
io.github.cdklabs.projen.release.PyPiPublishOptions Maven / Gradle / Ivy
package io.github.cdklabs.projen.release;
/**
* (experimental) Options for PyPI release.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.50.0 (build d1830a4)", date = "2022-01-03T02:39:48.734Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.release.PyPiPublishOptions")
@software.amazon.jsii.Jsii.Proxy(PyPiPublishOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface PyPiPublishOptions extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.projen.release.CommonPublishOptions {
/**
* (experimental) The GitHub secret which contains PyPI password.
*
* Default: "TWINE_PASSWORD"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getTwinePasswordSecret() {
return null;
}
/**
* (experimental) The registry url to use when releasing packages.
*
* Default: - twine default
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getTwineRegistryUrl() {
return null;
}
/**
* (experimental) The GitHub secret which contains PyPI user name.
*
* Default: "TWINE_USERNAME"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getTwineUsernameSecret() {
return null;
}
/**
* @return a {@link Builder} of {@link PyPiPublishOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link PyPiPublishOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String twinePasswordSecret;
java.lang.String twineRegistryUrl;
java.lang.String twineUsernameSecret;
java.util.List prePublishSteps;
io.github.cdklabs.projen.github.workflows.Tools publishTools;
/**
* Sets the value of {@link PyPiPublishOptions#getTwinePasswordSecret}
* @param twinePasswordSecret The GitHub secret which contains PyPI password.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder twinePasswordSecret(java.lang.String twinePasswordSecret) {
this.twinePasswordSecret = twinePasswordSecret;
return this;
}
/**
* Sets the value of {@link PyPiPublishOptions#getTwineRegistryUrl}
* @param twineRegistryUrl The registry url to use when releasing packages.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder twineRegistryUrl(java.lang.String twineRegistryUrl) {
this.twineRegistryUrl = twineRegistryUrl;
return this;
}
/**
* Sets the value of {@link PyPiPublishOptions#getTwineUsernameSecret}
* @param twineUsernameSecret The GitHub secret which contains PyPI user name.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder twineUsernameSecret(java.lang.String twineUsernameSecret) {
this.twineUsernameSecret = twineUsernameSecret;
return this;
}
/**
* Sets the value of {@link PyPiPublishOptions#getPrePublishSteps}
* @param prePublishSteps Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if neede.
* These steps are executed after dist/
has been populated with the build
* output.
*
* Note that when using this in publishToGitHubReleases
this will override steps added via addGitHubPrePublishingSteps
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder prePublishSteps(java.util.List extends io.github.cdklabs.projen.github.workflows.JobStep> prePublishSteps) {
this.prePublishSteps = (java.util.List)prePublishSteps;
return this;
}
/**
* Sets the value of {@link PyPiPublishOptions#getPublishTools}
* @param publishTools Additional tools to install in the publishing job.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder publishTools(io.github.cdklabs.projen.github.workflows.Tools publishTools) {
this.publishTools = publishTools;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link PyPiPublishOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public PyPiPublishOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link PyPiPublishOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PyPiPublishOptions {
private final java.lang.String twinePasswordSecret;
private final java.lang.String twineRegistryUrl;
private final java.lang.String twineUsernameSecret;
private final java.util.List prePublishSteps;
private final io.github.cdklabs.projen.github.workflows.Tools publishTools;
/**
* 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.twinePasswordSecret = software.amazon.jsii.Kernel.get(this, "twinePasswordSecret", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.twineRegistryUrl = software.amazon.jsii.Kernel.get(this, "twineRegistryUrl", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.twineUsernameSecret = software.amazon.jsii.Kernel.get(this, "twineUsernameSecret", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.prePublishSteps = software.amazon.jsii.Kernel.get(this, "prePublishSteps", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.github.workflows.JobStep.class)));
this.publishTools = software.amazon.jsii.Kernel.get(this, "publishTools", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.github.workflows.Tools.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.twinePasswordSecret = builder.twinePasswordSecret;
this.twineRegistryUrl = builder.twineRegistryUrl;
this.twineUsernameSecret = builder.twineUsernameSecret;
this.prePublishSteps = (java.util.List)builder.prePublishSteps;
this.publishTools = builder.publishTools;
}
@Override
public final java.lang.String getTwinePasswordSecret() {
return this.twinePasswordSecret;
}
@Override
public final java.lang.String getTwineRegistryUrl() {
return this.twineRegistryUrl;
}
@Override
public final java.lang.String getTwineUsernameSecret() {
return this.twineUsernameSecret;
}
@Override
public final java.util.List getPrePublishSteps() {
return this.prePublishSteps;
}
@Override
public final io.github.cdklabs.projen.github.workflows.Tools getPublishTools() {
return this.publishTools;
}
@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();
if (this.getTwinePasswordSecret() != null) {
data.set("twinePasswordSecret", om.valueToTree(this.getTwinePasswordSecret()));
}
if (this.getTwineRegistryUrl() != null) {
data.set("twineRegistryUrl", om.valueToTree(this.getTwineRegistryUrl()));
}
if (this.getTwineUsernameSecret() != null) {
data.set("twineUsernameSecret", om.valueToTree(this.getTwineUsernameSecret()));
}
if (this.getPrePublishSteps() != null) {
data.set("prePublishSteps", om.valueToTree(this.getPrePublishSteps()));
}
if (this.getPublishTools() != null) {
data.set("publishTools", om.valueToTree(this.getPublishTools()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.release.PyPiPublishOptions"));
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;
PyPiPublishOptions.Jsii$Proxy that = (PyPiPublishOptions.Jsii$Proxy) o;
if (this.twinePasswordSecret != null ? !this.twinePasswordSecret.equals(that.twinePasswordSecret) : that.twinePasswordSecret != null) return false;
if (this.twineRegistryUrl != null ? !this.twineRegistryUrl.equals(that.twineRegistryUrl) : that.twineRegistryUrl != null) return false;
if (this.twineUsernameSecret != null ? !this.twineUsernameSecret.equals(that.twineUsernameSecret) : that.twineUsernameSecret != null) return false;
if (this.prePublishSteps != null ? !this.prePublishSteps.equals(that.prePublishSteps) : that.prePublishSteps != null) return false;
return this.publishTools != null ? this.publishTools.equals(that.publishTools) : that.publishTools == null;
}
@Override
public final int hashCode() {
int result = this.twinePasswordSecret != null ? this.twinePasswordSecret.hashCode() : 0;
result = 31 * result + (this.twineRegistryUrl != null ? this.twineRegistryUrl.hashCode() : 0);
result = 31 * result + (this.twineUsernameSecret != null ? this.twineUsernameSecret.hashCode() : 0);
result = 31 * result + (this.prePublishSteps != null ? this.prePublishSteps.hashCode() : 0);
result = 31 * result + (this.publishTools != null ? this.publishTools.hashCode() : 0);
return result;
}
}
}