"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Runbook = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Runbook resource in Oracle Cloud Infrastructure Fleet Apps Management service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/fleet-management/latest/Runbook
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/fleet_apps_management
 *
 * Creates a runbook.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testRunbook = new oci.fleetappsmanagement.Runbook("test_runbook", {
 *     compartmentId: compartmentId,
 *     displayName: runbookDisplayName,
 *     operation: runbookOperation,
 *     runbookVersion: {
 *         executionWorkflowDetails: {
 *             workflows: [{
 *                 groupName: testGroup.name,
 *                 steps: [{
 *                     type: runbookRunbookVersionExecutionWorkflowDetailsWorkflowStepsType,
 *                     groupName: testGroup.name,
 *                     stepName: runbookRunbookVersionExecutionWorkflowDetailsWorkflowStepsStepName,
 *                     steps: runbookRunbookVersionExecutionWorkflowDetailsWorkflowStepsSteps,
 *                 }],
 *                 type: runbookRunbookVersionExecutionWorkflowDetailsWorkflowType,
 *             }],
 *         },
 *         groups: [{
 *             name: runbookRunbookVersionGroupsName,
 *             type: runbookRunbookVersionGroupsType,
 *             properties: {
 *                 actionOnFailure: runbookRunbookVersionGroupsPropertiesActionOnFailure,
 *                 notificationPreferences: {
 *                     shouldNotifyOnPause: runbookRunbookVersionGroupsPropertiesNotificationPreferencesShouldNotifyOnPause === "true",
 *                     shouldNotifyOnTaskFailure: runbookRunbookVersionGroupsPropertiesNotificationPreferencesShouldNotifyOnTaskFailure === "true",
 *                     shouldNotifyOnTaskSuccess: runbookRunbookVersionGroupsPropertiesNotificationPreferencesShouldNotifyOnTaskSuccess === "true",
 *                 },
 *                 pauseDetails: {
 *                     kind: runbookRunbookVersionGroupsPropertiesPauseDetailsKind,
 *                     durationInMinutes: Number(runbookRunbookVersionGroupsPropertiesPauseDetailsDurationInMinutes),
 *                 },
 *                 preCondition: runbookRunbookVersionGroupsPropertiesPreCondition,
 *                 runOn: {
 *                     kind: runbookRunbookVersionGroupsPropertiesRunOnKind,
 *                     condition: runbookRunbookVersionGroupsPropertiesRunOnCondition,
 *                     host: runbookRunbookVersionGroupsPropertiesRunOnHost,
 *                     previousTaskInstanceDetails: [{
 *                         outputVariableDetails: {
 *                             outputVariableName: runbookRunbookVersionGroupsPropertiesRunOnPreviousTaskInstanceDetailsOutputVariableDetailsOutputVariableName,
 *                             stepName: runbookRunbookVersionGroupsPropertiesRunOnPreviousTaskInstanceDetailsOutputVariableDetailsStepName,
 *                         },
 *                         resourceId: testResource.id,
 *                         resourceType: runbookRunbookVersionGroupsPropertiesRunOnPreviousTaskInstanceDetailsResourceType,
 *                     }],
 *                 },
 *             },
 *         }],
 *         tasks: [{
 *             stepName: runbookRunbookVersionTasksStepName,
 *             taskRecordDetails: {
 *                 scope: runbookRunbookVersionTasksTaskRecordDetailsScope,
 *                 description: runbookRunbookVersionTasksTaskRecordDetailsDescription,
 *                 executionDetails: {
 *                     executionType: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsExecutionType,
 *                     catalogId: testCatalog.id,
 *                     command: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsCommand,
 *                     configFile: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsConfigFile,
 *                     content: {
 *                         sourceType: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsContentSourceType,
 *                         bucket: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsContentBucket,
 *                         catalogId: testCatalog.id,
 *                         checksum: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsContentChecksum,
 *                         namespace: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsContentNamespace,
 *                         object: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsContentObject,
 *                     },
 *                     credentials: [{
 *                         displayName: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsCredentialsDisplayName,
 *                         id: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsCredentialsId,
 *                     }],
 *                     endpoint: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsEndpoint,
 *                     isExecutableContent: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsIsExecutableContent === "true",
 *                     isLocked: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsIsLocked === "true",
 *                     isReadOutputVariableEnabled: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsIsReadOutputVariableEnabled === "true",
 *                     systemVariables: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsSystemVariables,
 *                     targetCompartmentId: testCompartment.id,
 *                     variables: {
 *                         inputVariables: [{
 *                             description: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsVariablesInputVariablesDescription,
 *                             name: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsVariablesInputVariablesName,
 *                             type: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsVariablesInputVariablesType,
 *                         }],
 *                         outputVariables: runbookRunbookVersionTasksTaskRecordDetailsExecutionDetailsVariablesOutputVariables,
 *                     },
 *                 },
 *                 isApplySubjectTask: runbookRunbookVersionTasksTaskRecordDetailsIsApplySubjectTask === "true",
 *                 isCopyToLibraryEnabled: runbookRunbookVersionTasksTaskRecordDetailsIsCopyToLibraryEnabled === "true",
 *                 isDiscoveryOutputTask: runbookRunbookVersionTasksTaskRecordDetailsIsDiscoveryOutputTask === "true",
 *                 name: runbookRunbookVersionTasksTaskRecordDetailsName,
 *                 osType: runbookRunbookVersionTasksTaskRecordDetailsOsType,
 *                 platform: runbookRunbookVersionTasksTaskRecordDetailsPlatform,
 *                 properties: {
 *                     numRetries: Number(runbookRunbookVersionTasksTaskRecordDetailsPropertiesNumRetries),
 *                     timeoutInSeconds: Number(runbookRunbookVersionTasksTaskRecordDetailsPropertiesTimeoutInSeconds),
 *                 },
 *                 taskRecordId: testTaskRecord.id,
 *             },
 *             outputVariableMappings: [{
 *                 name: runbookRunbookVersionTasksOutputVariableMappingsName,
 *                 outputVariableDetails: {
 *                     outputVariableName: runbookRunbookVersionTasksOutputVariableMappingsOutputVariableDetailsOutputVariableName,
 *                     stepName: runbookRunbookVersionTasksOutputVariableMappingsOutputVariableDetailsStepName,
 *                 },
 *             }],
 *             stepProperties: {
 *                 actionOnFailure: runbookRunbookVersionTasksStepPropertiesActionOnFailure,
 *                 notificationPreferences: {
 *                     shouldNotifyOnPause: runbookRunbookVersionTasksStepPropertiesNotificationPreferencesShouldNotifyOnPause === "true",
 *                     shouldNotifyOnTaskFailure: runbookRunbookVersionTasksStepPropertiesNotificationPreferencesShouldNotifyOnTaskFailure === "true",
 *                     shouldNotifyOnTaskSuccess: runbookRunbookVersionTasksStepPropertiesNotificationPreferencesShouldNotifyOnTaskSuccess === "true",
 *                 },
 *                 pauseDetails: {
 *                     kind: runbookRunbookVersionTasksStepPropertiesPauseDetailsKind,
 *                     durationInMinutes: Number(runbookRunbookVersionTasksStepPropertiesPauseDetailsDurationInMinutes),
 *                 },
 *                 preCondition: runbookRunbookVersionTasksStepPropertiesPreCondition,
 *                 runOn: {
 *                     kind: runbookRunbookVersionTasksStepPropertiesRunOnKind,
 *                     condition: runbookRunbookVersionTasksStepPropertiesRunOnCondition,
 *                     host: runbookRunbookVersionTasksStepPropertiesRunOnHost,
 *                     previousTaskInstanceDetails: [{
 *                         outputVariableDetails: {
 *                             outputVariableName: runbookRunbookVersionTasksStepPropertiesRunOnPreviousTaskInstanceDetailsOutputVariableDetailsOutputVariableName,
 *                             stepName: runbookRunbookVersionTasksStepPropertiesRunOnPreviousTaskInstanceDetailsOutputVariableDetailsStepName,
 *                         },
 *                         resourceId: testResource.id,
 *                         resourceType: runbookRunbookVersionTasksStepPropertiesRunOnPreviousTaskInstanceDetailsResourceType,
 *                     }],
 *                 },
 *             },
 *         }],
 *         isLatest: runbookRunbookVersionIsLatest === "true",
 *         rollbackWorkflowDetails: {
 *             scope: runbookRunbookVersionRollbackWorkflowDetailsScope,
 *             workflows: [{
 *                 groupName: testGroup.name,
 *                 steps: [{
 *                     type: runbookRunbookVersionRollbackWorkflowDetailsWorkflowStepsType,
 *                     groupName: testGroup.name,
 *                     stepName: runbookRunbookVersionRollbackWorkflowDetailsWorkflowStepsStepName,
 *                     steps: runbookRunbookVersionRollbackWorkflowDetailsWorkflowStepsSteps,
 *                 }],
 *                 type: runbookRunbookVersionRollbackWorkflowDetailsWorkflowType,
 *             }],
 *         },
 *         version: runbookRunbookVersionVersion,
 *     },
 *     definedTags: {
 *         "foo-namespace.bar-key": "value",
 *     },
 *     description: runbookDescription,
 *     estimatedTime: runbookEstimatedTime,
 *     freeformTags: {
 *         "bar-key": "value",
 *     },
 *     isDefault: runbookIsDefault === "true",
 *     isSudoAccessNeeded: runbookIsSudoAccessNeeded === "true",
 *     osType: runbookOsType,
 *     platform: runbookPlatform,
 * });
 * ```
 *
 * ## Import
 *
 * Runbooks can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:FleetAppsManagement/runbook:Runbook test_runbook "id"
 * ```
 */
class Runbook extends pulumi.CustomResource {
    /**
     * Get an existing Runbook resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new Runbook(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:FleetAppsManagement/runbook:Runbook';
    /**
     * Returns true if the given object is an instance of Runbook.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Runbook.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["description"] = state?.description;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["estimatedTime"] = state?.estimatedTime;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["hasDraftVersion"] = state?.hasDraftVersion;
            resourceInputs["isDefault"] = state?.isDefault;
            resourceInputs["isSudoAccessNeeded"] = state?.isSudoAccessNeeded;
            resourceInputs["latestVersion"] = state?.latestVersion;
            resourceInputs["lifecycleDetails"] = state?.lifecycleDetails;
            resourceInputs["operation"] = state?.operation;
            resourceInputs["osType"] = state?.osType;
            resourceInputs["platform"] = state?.platform;
            resourceInputs["resourceRegion"] = state?.resourceRegion;
            resourceInputs["runbookVersion"] = state?.runbookVersion;
            resourceInputs["state"] = state?.state;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
            resourceInputs["type"] = state?.type;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.operation === undefined && !opts.urn) {
                throw new Error("Missing required property 'operation'");
            }
            if (args?.runbookVersion === undefined && !opts.urn) {
                throw new Error("Missing required property 'runbookVersion'");
            }
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["description"] = args?.description;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["estimatedTime"] = args?.estimatedTime;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["isDefault"] = args?.isDefault;
            resourceInputs["isSudoAccessNeeded"] = args?.isSudoAccessNeeded;
            resourceInputs["operation"] = args?.operation;
            resourceInputs["osType"] = args?.osType;
            resourceInputs["platform"] = args?.platform;
            resourceInputs["runbookVersion"] = args?.runbookVersion;
            resourceInputs["hasDraftVersion"] = undefined /*out*/;
            resourceInputs["latestVersion"] = undefined /*out*/;
            resourceInputs["lifecycleDetails"] = undefined /*out*/;
            resourceInputs["resourceRegion"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
            resourceInputs["type"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Runbook.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Runbook = Runbook;
//# sourceMappingURL=runbook.js.map