import * as cb from "../../../aws-codebuild";
import * as cp from "../../../aws-codepipeline";
import { Construct } from 'constructs';
import { ArtifactMap } from './artifact-map';
import { CodeBuildOptions, CodePipeline } from './codepipeline';
/**
 * (experimental) Options for the `CodePipelineActionFactory.produce()` method.
 *
 * @experimental
 */
export interface ProduceActionOptions {
    /**
     * (experimental) Scope in which to create constructs.
     *
     * @experimental
     */
    readonly scope: Construct;
    /**
     * (experimental) Name the action should get.
     *
     * @experimental
     */
    readonly actionName: string;
    /**
     * (experimental) RunOrder the action should get.
     *
     * @experimental
     */
    readonly runOrder: number;
    /**
     * (experimental) Helper object to translate FileSets to CodePipeline Artifacts.
     *
     * @experimental
     */
    readonly artifacts: ArtifactMap;
    /**
     * (experimental) An input artifact that CodeBuild projects that don't actually need an input artifact can use.
     *
     * CodeBuild Projects MUST have an input artifact in order to be added to the Pipeline. If
     * the Project doesn't actually care about its input (it can be anything), it can use the
     * Artifact passed here.
     *
     * @default - A fallback artifact does not exist
     * @experimental
     */
    readonly fallbackArtifact?: cp.Artifact;
    /**
     * (experimental) The pipeline the action is being generated for.
     *
     * @experimental
     */
    readonly pipeline: CodePipeline;
    /**
     * (experimental) If this action factory creates a CodeBuild step, default options to inherit.
     *
     * @default - No CodeBuild project defaults
     * @experimental
     */
    readonly codeBuildDefaults?: CodeBuildOptions;
    /**
     * (experimental) Whether or not this action is inserted before self mutation.
     *
     * If it is, the action should take care to reflect some part of
     * its own definition in the pipeline action definition, to
     * trigger a restart after self-mutation (if necessary).
     *
     * @default false
     * @experimental
     */
    readonly beforeSelfMutation?: boolean;
}
/**
 * (experimental) Factory for explicit CodePipeline Actions.
 *
 * If you have specific types of Actions you want to add to a
 * CodePipeline, write a subclass of `Step` that implements this
 * interface, and add the action or actions you want in the `produce` method.
 *
 * There needs to be a level of indirection here, because some aspects of the
 * Action creation need to be controlled by the workflow engine (name and
 * runOrder). All the rest of the properties are controlled by the factory.
 *
 * @experimental
 */
export interface ICodePipelineActionFactory {
    /**
     * (experimental) Create the desired Action and add it to the pipeline.
     *
     * @experimental
     */
    produceAction(stage: cp.IStage, options: ProduceActionOptions): CodePipelineActionFactoryResult;
}
/**
 * (experimental) The result of adding actions to the pipeline.
 *
 * @experimental
 */
export interface CodePipelineActionFactoryResult {
    /**
     * (experimental) How many RunOrders were consumed.
     *
     * @experimental
     */
    readonly runOrdersConsumed: number;
    /**
     * (experimental) If a CodeBuild project got created, the project.
     *
     * @default - This factory did not create a CodeBuild project
     * @experimental
     */
    readonly project?: cb.IProject;
}
