
software.amazon.awscdk.services.codepipeline.actions.GitHubSourceActionProps Maven / Gradle / Ivy
package software.amazon.awscdk.services.codepipeline.actions;
/**
* Construction properties of the {@link GitHubSourceAction GitHub source action}.
*/
@javax.annotation.Generated(value = "jsii-pacmak/0.10.3 (build 6bbf743)", date = "2019-05-02T10:15:47.475Z")
public interface GitHubSourceActionProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.codepipeline.CommonActionProps {
/**
* A GitHub OAuth token to use for authentication.
*
* It is recommended to use a Secrets Manager `SecretString` to obtain the token:
*
* const oauth = new secretsmanager.SecretString(this, 'GitHubOAuthToken', { secretId: 'my-github-token' });
* new GitHubSource(this, 'GitHubAction', { oauthToken: oauth.value, ... });
*/
software.amazon.awscdk.SecretValue getOauthToken();
software.amazon.awscdk.services.codepipeline.Artifact getOutput();
/**
* The GitHub account/user that owns the repo.
*/
java.lang.String getOwner();
/**
* The name of the repo, without the username.
*/
java.lang.String getRepo();
/**
* The branch to use.
*
* Default: "master"
*/
java.lang.String getBranch();
/**
* How AWS CodePipeline should be triggered.
*
* With the default value "WebHook", a webhook is created in GitHub that triggers the action
* With "Poll", CodePipeline periodically checks the source for changes
* With "None", the action is not triggered through changes in the source
*
* Default: GitHubTrigger.WebHook
*/
software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger getTrigger();
/**
* @return a {@link Builder} of {@link GitHubSourceActionProps}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GitHubSourceActionProps}
*/
final class Builder {
private software.amazon.awscdk.SecretValue _oauthToken;
private software.amazon.awscdk.services.codepipeline.Artifact _output;
private java.lang.String _owner;
private java.lang.String _repo;
@javax.annotation.Nullable
private java.lang.String _branch;
@javax.annotation.Nullable
private software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger _trigger;
private java.lang.String _actionName;
@javax.annotation.Nullable
private java.lang.Number _runOrder;
/**
* Sets the value of OauthToken
* @param value A GitHub OAuth token to use for authentication.
* @return {@code this}
*/
public Builder withOauthToken(final software.amazon.awscdk.SecretValue value) {
this._oauthToken = java.util.Objects.requireNonNull(value, "oauthToken is required");
return this;
}
/**
* Sets the value of Output
* @param value the value to be set
* @return {@code this}
*/
public Builder withOutput(final software.amazon.awscdk.services.codepipeline.Artifact value) {
this._output = java.util.Objects.requireNonNull(value, "output is required");
return this;
}
/**
* Sets the value of Owner
* @param value The GitHub account/user that owns the repo.
* @return {@code this}
*/
public Builder withOwner(final java.lang.String value) {
this._owner = java.util.Objects.requireNonNull(value, "owner is required");
return this;
}
/**
* Sets the value of Repo
* @param value The name of the repo, without the username.
* @return {@code this}
*/
public Builder withRepo(final java.lang.String value) {
this._repo = java.util.Objects.requireNonNull(value, "repo is required");
return this;
}
/**
* Sets the value of Branch
* @param value The branch to use.
* @return {@code this}
*/
public Builder withBranch(@javax.annotation.Nullable final java.lang.String value) {
this._branch = value;
return this;
}
/**
* Sets the value of Trigger
* @param value How AWS CodePipeline should be triggered.
* @return {@code this}
*/
public Builder withTrigger(@javax.annotation.Nullable final software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger value) {
this._trigger = value;
return this;
}
/**
* Sets the value of ActionName
* @param value The physical, human-readable name of the Action. Not that Action names must be unique within a single Stage.
* @return {@code this}
*/
public Builder withActionName(final java.lang.String value) {
this._actionName = java.util.Objects.requireNonNull(value, "actionName is required");
return this;
}
/**
* Sets the value of RunOrder
* @param value The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute.
* @return {@code this}
*/
public Builder withRunOrder(@javax.annotation.Nullable final java.lang.Number value) {
this._runOrder = value;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GitHubSourceActionProps}
* @throws NullPointerException if any required attribute was not provided
*/
public GitHubSourceActionProps build() {
return new GitHubSourceActionProps() {
private final software.amazon.awscdk.SecretValue $oauthToken = java.util.Objects.requireNonNull(_oauthToken, "oauthToken is required");
private final software.amazon.awscdk.services.codepipeline.Artifact $output = java.util.Objects.requireNonNull(_output, "output is required");
private final java.lang.String $owner = java.util.Objects.requireNonNull(_owner, "owner is required");
private final java.lang.String $repo = java.util.Objects.requireNonNull(_repo, "repo is required");
@javax.annotation.Nullable
private final java.lang.String $branch = _branch;
@javax.annotation.Nullable
private final software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger $trigger = _trigger;
private final java.lang.String $actionName = java.util.Objects.requireNonNull(_actionName, "actionName is required");
@javax.annotation.Nullable
private final java.lang.Number $runOrder = _runOrder;
@Override
public software.amazon.awscdk.SecretValue getOauthToken() {
return this.$oauthToken;
}
@Override
public software.amazon.awscdk.services.codepipeline.Artifact getOutput() {
return this.$output;
}
@Override
public java.lang.String getOwner() {
return this.$owner;
}
@Override
public java.lang.String getRepo() {
return this.$repo;
}
@Override
public java.lang.String getBranch() {
return this.$branch;
}
@Override
public software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger getTrigger() {
return this.$trigger;
}
@Override
public java.lang.String getActionName() {
return this.$actionName;
}
@Override
public java.lang.Number getRunOrder() {
return this.$runOrder;
}
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("oauthToken", om.valueToTree(this.getOauthToken()));
obj.set("output", om.valueToTree(this.getOutput()));
obj.set("owner", om.valueToTree(this.getOwner()));
obj.set("repo", om.valueToTree(this.getRepo()));
obj.set("branch", om.valueToTree(this.getBranch()));
obj.set("trigger", om.valueToTree(this.getTrigger()));
obj.set("actionName", om.valueToTree(this.getActionName()));
obj.set("runOrder", om.valueToTree(this.getRunOrder()));
return obj;
}
};
}
}
/**
* A proxy class which represents a concrete javascript instance of this type.
*/
final static class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements software.amazon.awscdk.services.codepipeline.actions.GitHubSourceActionProps {
protected Jsii$Proxy(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
super(mode);
}
/**
* A GitHub OAuth token to use for authentication.
*
* It is recommended to use a Secrets Manager `SecretString` to obtain the token:
*
* const oauth = new secretsmanager.SecretString(this, 'GitHubOAuthToken', { secretId: 'my-github-token' });
* new GitHubSource(this, 'GitHubAction', { oauthToken: oauth.value, ... });
*/
@Override
public software.amazon.awscdk.SecretValue getOauthToken() {
return this.jsiiGet("oauthToken", software.amazon.awscdk.SecretValue.class);
}
@Override
public software.amazon.awscdk.services.codepipeline.Artifact getOutput() {
return this.jsiiGet("output", software.amazon.awscdk.services.codepipeline.Artifact.class);
}
/**
* The GitHub account/user that owns the repo.
*/
@Override
public java.lang.String getOwner() {
return this.jsiiGet("owner", java.lang.String.class);
}
/**
* The name of the repo, without the username.
*/
@Override
public java.lang.String getRepo() {
return this.jsiiGet("repo", java.lang.String.class);
}
/**
* The branch to use.
*
* Default: "master"
*/
@Override
@javax.annotation.Nullable
public java.lang.String getBranch() {
return this.jsiiGet("branch", java.lang.String.class);
}
/**
* How AWS CodePipeline should be triggered.
*
* With the default value "WebHook", a webhook is created in GitHub that triggers the action
* With "Poll", CodePipeline periodically checks the source for changes
* With "None", the action is not triggered through changes in the source
*
* Default: GitHubTrigger.WebHook
*/
@Override
@javax.annotation.Nullable
public software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger getTrigger() {
return this.jsiiGet("trigger", software.amazon.awscdk.services.codepipeline.actions.GitHubTrigger.class);
}
/**
* The physical, human-readable name of the Action. Not that Action names must be unique within a single Stage.
*/
@Override
public java.lang.String getActionName() {
return this.jsiiGet("actionName", java.lang.String.class);
}
/**
* The runOrder property for this Action. RunOrder determines the relative order in which multiple Actions in the same Stage execute.
*
* Default: 1
*
* @see https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html
*/
@Override
@javax.annotation.Nullable
public java.lang.Number getRunOrder() {
return this.jsiiGet("runOrder", java.lang.Number.class);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy