// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.resourcemanager.dataprotection.models.AdHocBackupRuleOptions;
import com.azure.resourcemanager.dataprotection.models.AdhocBackupTriggerOption;
import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest;

/** Samples for BackupInstances AdhocBackup. */
public final class BackupInstancesAdhocBackupSamples {
    /*
     * x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/BackupInstanceOperations/TriggerBackup.json
     */
    /**
     * Sample code: Trigger Adhoc Backup.
     *
     * @param manager Entry point to DataProtectionManager.
     */
    public static void triggerAdhocBackup(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
        manager
            .backupInstances()
            .adhocBackup(
                "000pikumar",
                "PratikPrivatePreviewVault1",
                "testInstance1",
                new TriggerBackupRequest()
                    .withBackupRuleOptions(
                        new AdHocBackupRuleOptions()
                            .withRuleName("BackupWeekly")
                            .withTriggerOption(new AdhocBackupTriggerOption().withRetentionTagOverride("yearly"))),
                com.azure.core.util.Context.NONE);
    }
}
