io.github.cdklabs.projen.github.UploadGitPatchOptions Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen.github;
/**
* (experimental) Options for uploadGitPatch
.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:55.208Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.github.UploadGitPatchOptions")
@software.amazon.jsii.Jsii.Proxy(UploadGitPatchOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface UploadGitPatchOptions extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The name of the output to emit.
*
* It will be set to true
if there was a diff.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getOutputName();
/**
* (experimental) The step ID which produces the output which indicates if a patch was created.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getStepId();
/**
* (experimental) Fail if a mutation was found and print this error message.
*
* Default: - do not fail upon mutation
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getMutationError() {
return null;
}
/**
* (experimental) The name of the artifact the patch is stored as.
*
* Default: ".repo.patch"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getPatchFile() {
return null;
}
/**
* (experimental) The name of the step.
*
* Default: "Find mutations"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getStepName() {
return null;
}
/**
* @return a {@link Builder} of {@link UploadGitPatchOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link UploadGitPatchOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String outputName;
java.lang.String stepId;
java.lang.String mutationError;
java.lang.String patchFile;
java.lang.String stepName;
/**
* Sets the value of {@link UploadGitPatchOptions#getOutputName}
* @param outputName The name of the output to emit. This parameter is required.
* It will be set to true
if there was a diff.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder outputName(java.lang.String outputName) {
this.outputName = outputName;
return this;
}
/**
* Sets the value of {@link UploadGitPatchOptions#getStepId}
* @param stepId The step ID which produces the output which indicates if a patch was created. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder stepId(java.lang.String stepId) {
this.stepId = stepId;
return this;
}
/**
* Sets the value of {@link UploadGitPatchOptions#getMutationError}
* @param mutationError Fail if a mutation was found and print this error message.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder mutationError(java.lang.String mutationError) {
this.mutationError = mutationError;
return this;
}
/**
* Sets the value of {@link UploadGitPatchOptions#getPatchFile}
* @param patchFile The name of the artifact the patch is stored as.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder patchFile(java.lang.String patchFile) {
this.patchFile = patchFile;
return this;
}
/**
* Sets the value of {@link UploadGitPatchOptions#getStepName}
* @param stepName The name of the step.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder stepName(java.lang.String stepName) {
this.stepName = stepName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link UploadGitPatchOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public UploadGitPatchOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link UploadGitPatchOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements UploadGitPatchOptions {
private final java.lang.String outputName;
private final java.lang.String stepId;
private final java.lang.String mutationError;
private final java.lang.String patchFile;
private final java.lang.String stepName;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.outputName = software.amazon.jsii.Kernel.get(this, "outputName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.stepId = software.amazon.jsii.Kernel.get(this, "stepId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.mutationError = software.amazon.jsii.Kernel.get(this, "mutationError", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.patchFile = software.amazon.jsii.Kernel.get(this, "patchFile", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.stepName = software.amazon.jsii.Kernel.get(this, "stepName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.outputName = java.util.Objects.requireNonNull(builder.outputName, "outputName is required");
this.stepId = java.util.Objects.requireNonNull(builder.stepId, "stepId is required");
this.mutationError = builder.mutationError;
this.patchFile = builder.patchFile;
this.stepName = builder.stepName;
}
@Override
public final java.lang.String getOutputName() {
return this.outputName;
}
@Override
public final java.lang.String getStepId() {
return this.stepId;
}
@Override
public final java.lang.String getMutationError() {
return this.mutationError;
}
@Override
public final java.lang.String getPatchFile() {
return this.patchFile;
}
@Override
public final java.lang.String getStepName() {
return this.stepName;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("outputName", om.valueToTree(this.getOutputName()));
data.set("stepId", om.valueToTree(this.getStepId()));
if (this.getMutationError() != null) {
data.set("mutationError", om.valueToTree(this.getMutationError()));
}
if (this.getPatchFile() != null) {
data.set("patchFile", om.valueToTree(this.getPatchFile()));
}
if (this.getStepName() != null) {
data.set("stepName", om.valueToTree(this.getStepName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.github.UploadGitPatchOptions"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UploadGitPatchOptions.Jsii$Proxy that = (UploadGitPatchOptions.Jsii$Proxy) o;
if (!outputName.equals(that.outputName)) return false;
if (!stepId.equals(that.stepId)) return false;
if (this.mutationError != null ? !this.mutationError.equals(that.mutationError) : that.mutationError != null) return false;
if (this.patchFile != null ? !this.patchFile.equals(that.patchFile) : that.patchFile != null) return false;
return this.stepName != null ? this.stepName.equals(that.stepName) : that.stepName == null;
}
@Override
public final int hashCode() {
int result = this.outputName.hashCode();
result = 31 * result + (this.stepId.hashCode());
result = 31 * result + (this.mutationError != null ? this.mutationError.hashCode() : 0);
result = 31 * result + (this.patchFile != null ? this.patchFile.hashCode() : 0);
result = 31 * result + (this.stepName != null ? this.stepName.hashCode() : 0);
return result;
}
}
}