Home Reference Source Test
public class | source

Attribute

Resolves an attribute that has been defined as part of the UserParameters. An attribute can either be a static, hardcoded value or can be a reference to a key, found inside a file present in an input artifact.

Constructor Summary

Public Constructor
public

constructor(mapping: String,Object, artifacts: Array[Artifact])

Member Summary

Public Members
public

artifacts: Array[Artifact]

An object containing Artifact instances, with the keys denoting the logical name of the artifact inside CodePipeline.

public

mapping: String,Object

Either a hardcoded value (a string) or an object denoting a remote reference.

public get

type: String: *

Determine if the type of mapping that has been provided for the attribute value is either a static value, or needs to be resolved using a remote input artifact.

Method Summary

Public Methods
public

async value(): String

Resolves the value for the attribute, either returning the static attribute value, or the resolved value from inside a remote artifact.

Private Methods
private

async fetch(artifactName: String, filename: String, key: String): String

Public Constructors

public constructor(mapping: String,Object, artifacts: Array[Artifact]) source

Params:

NameTypeAttributeDescription
mapping String,Object

a mapping object, either a hardcoded value or a reference to a key, found inside a file present in an input artifact.

artifacts Array[Artifact]

an array of artifacts that any remote attribute value could be found inside.

Public Members

public artifacts: Array[Artifact] source

An object containing Artifact instances, with the keys denoting the logical name of the artifact inside CodePipeline.

public mapping: String,Object source

Either a hardcoded value (a string) or an object denoting a remote reference.

public get type: String: * source

Determine if the type of mapping that has been provided for the attribute value is either a static value, or needs to be resolved using a remote input artifact.

Return:

String

the type of attribute mapping provided

Public Methods

public async value(): String source

Resolves the value for the attribute, either returning the static attribute value, or the resolved value from inside a remote artifact.

Return:

String

the attribute's value

Private Methods

private async fetch(artifactName: String, filename: String, key: String): String source

Params:

NameTypeAttributeDescription
artifactName String

the name of the artifact the file resides in.

filename String

The name of the JSON file inside the artifact

key String

The property key inside the JSON file

Return:

String

the value of the key inside the JSON file, inside the artifact.