package awscodepipeline

import (
	_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
	_jsii_ "github.com/aws/jsii-runtime-go/runtime"

	"github.com/aws/aws-cdk-go/awscdk/v2/awss3"
)

// An output artifact of an action.
//
// Artifacts can be used as input by some actions.
//
// Example:
//   var pipeline pipeline
//
//
//   sourceOutput := codepipeline.NewArtifact()
//   sourceAction := codepipeline_actions.NewCodeStarConnectionsSourceAction(&CodeStarConnectionsSourceActionProps{
//   	ActionName: jsii.String("CodeStarConnectionsSourceAction"),
//   	Output: sourceOutput,
//   	ConnectionArn: jsii.String("your-connection-arn"),
//   	Owner: jsii.String("your-owner"),
//   	Repo: jsii.String("your-repo"),
//   })
//
//   scanOutput := codepipeline.NewArtifact()
//   scanAction := codepipeline_actions.NewInspectorSourceCodeScanAction(&InspectorSourceCodeScanActionProps{
//   	ActionName: jsii.String("InspectorSourceCodeScanAction"),
//   	Input: sourceOutput,
//   	Output: scanOutput,
//   })
//
//   pipeline.AddStage(&StageOptions{
//   	StageName: jsii.String("Source"),
//   	Actions: []iAction{
//   		sourceAction,
//   	},
//   })
//   pipeline.AddStage(&StageOptions{
//   	StageName: jsii.String("Scan"),
//   	Actions: []*iAction{
//   		scanAction,
//   	},
//   })
//
type Artifact interface {
	// The file paths that you want to export as the output artifact for the action.
	//
	// This property can only be used in artifacts for `CommandsAction`.
	ArtifactFiles() *[]*string
	ArtifactName() *string
	// The artifact attribute for the name of the S3 bucket where the artifact is stored.
	BucketName() *string
	// The artifact attribute for The name of the .zip file that contains the artifact that is generated by AWS CodePipeline, such as 1ABCyZZ.zip.
	ObjectKey() *string
	// Returns the location of the .zip file in S3 that this Artifact represents. Used by Lambda's `CfnParametersCode` when being deployed in a CodePipeline.
	S3Location() *awss3.Location
	// The artifact attribute of the Amazon Simple Storage Service (Amazon S3) URL of the artifact, such as https://s3-us-west-2.amazonaws.com/artifactstorebucket-yivczw8jma0c/test/TemplateSo/1ABCyZZ.zip.
	Url() *string
	// Returns an ArtifactPath for a file within this artifact.
	//
	// CfnOutput is in the form "<artifact-name>::<file-name>".
	AtPath(fileName *string) ArtifactPath
	// Retrieve the metadata stored in this artifact under the given key.
	//
	// If there is no metadata stored under the given key,
	// null will be returned.
	GetMetadata(key *string) interface{}
	// Returns a token for a value inside a JSON file within this artifact.
	GetParam(jsonFile *string, keyName *string) *string
	// Add arbitrary extra payload to the artifact under a given key.
	//
	// This can be used by CodePipeline actions to communicate data between themselves.
	// If metadata was already present under the given key,
	// it will be overwritten with the new value.
	SetMetadata(key *string, value interface{})
	ToString() *string
}

// The jsii proxy struct for Artifact
type jsiiProxy_Artifact struct {
	_ byte // padding
}

func (j *jsiiProxy_Artifact) ArtifactFiles() *[]*string {
	var returns *[]*string
	_jsii_.Get(
		j,
		"artifactFiles",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_Artifact) ArtifactName() *string {
	var returns *string
	_jsii_.Get(
		j,
		"artifactName",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_Artifact) BucketName() *string {
	var returns *string
	_jsii_.Get(
		j,
		"bucketName",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_Artifact) ObjectKey() *string {
	var returns *string
	_jsii_.Get(
		j,
		"objectKey",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_Artifact) S3Location() *awss3.Location {
	var returns *awss3.Location
	_jsii_.Get(
		j,
		"s3Location",
		&returns,
	)
	return returns
}

func (j *jsiiProxy_Artifact) Url() *string {
	var returns *string
	_jsii_.Get(
		j,
		"url",
		&returns,
	)
	return returns
}


// An output artifact of an action.
//
// Artifacts can be used as input by some actions.
func NewArtifact(artifactName *string, artifactFiles *[]*string) Artifact {
	_init_.Initialize()

	j := jsiiProxy_Artifact{}

	_jsii_.Create(
		"aws-cdk-lib.aws_codepipeline.Artifact",
		[]interface{}{artifactName, artifactFiles},
		&j,
	)

	return &j
}

// An output artifact of an action.
//
// Artifacts can be used as input by some actions.
func NewArtifact_Override(a Artifact, artifactName *string, artifactFiles *[]*string) {
	_init_.Initialize()

	_jsii_.Create(
		"aws-cdk-lib.aws_codepipeline.Artifact",
		[]interface{}{artifactName, artifactFiles},
		a,
	)
}

// A static factory method used to create instances of the Artifact class.
//
// Mainly meant to be used from `decdk`.
func Artifact_Artifact(name *string, files *[]*string) Artifact {
	_init_.Initialize()

	if err := validateArtifact_ArtifactParameters(name); err != nil {
		panic(err)
	}
	var returns Artifact

	_jsii_.StaticInvoke(
		"aws-cdk-lib.aws_codepipeline.Artifact",
		"artifact",
		[]interface{}{name, files},
		&returns,
	)

	return returns
}

func (a *jsiiProxy_Artifact) AtPath(fileName *string) ArtifactPath {
	if err := a.validateAtPathParameters(fileName); err != nil {
		panic(err)
	}
	var returns ArtifactPath

	_jsii_.Invoke(
		a,
		"atPath",
		[]interface{}{fileName},
		&returns,
	)

	return returns
}

func (a *jsiiProxy_Artifact) GetMetadata(key *string) interface{} {
	if err := a.validateGetMetadataParameters(key); err != nil {
		panic(err)
	}
	var returns interface{}

	_jsii_.Invoke(
		a,
		"getMetadata",
		[]interface{}{key},
		&returns,
	)

	return returns
}

func (a *jsiiProxy_Artifact) GetParam(jsonFile *string, keyName *string) *string {
	if err := a.validateGetParamParameters(jsonFile, keyName); err != nil {
		panic(err)
	}
	var returns *string

	_jsii_.Invoke(
		a,
		"getParam",
		[]interface{}{jsonFile, keyName},
		&returns,
	)

	return returns
}

func (a *jsiiProxy_Artifact) SetMetadata(key *string, value interface{}) {
	if err := a.validateSetMetadataParameters(key, value); err != nil {
		panic(err)
	}
	_jsii_.InvokeVoid(
		a,
		"setMetadata",
		[]interface{}{key, value},
	)
}

func (a *jsiiProxy_Artifact) ToString() *string {
	var returns *string

	_jsii_.Invoke(
		a,
		"toString",
		nil, // no parameters
		&returns,
	)

	return returns
}

