org.projen.release.PyPiPublishOptions Maven / Gradle / Ivy
Show all versions of projen Show documentation
package org.projen.release;
/**
* (experimental) Options for PyPI release.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.34.0 (build 9b72778)", date = "2021-09-05T18:03:12.112Z")
@software.amazon.jsii.Jsii(module = org.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 {
/**
* (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 {
private java.lang.String twinePasswordSecret;
private java.lang.String twineRegistryUrl;
private java.lang.String twineUsernameSecret;
/**
* 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;
}
/**
* 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(twinePasswordSecret, twineRegistryUrl, twineUsernameSecret);
}
}
/**
* 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;
/**
* 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));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.String twinePasswordSecret, final java.lang.String twineRegistryUrl, final java.lang.String twineUsernameSecret) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.twinePasswordSecret = twinePasswordSecret;
this.twineRegistryUrl = twineRegistryUrl;
this.twineUsernameSecret = twineUsernameSecret;
}
@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
@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()));
}
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;
return this.twineUsernameSecret != null ? this.twineUsernameSecret.equals(that.twineUsernameSecret) : that.twineUsernameSecret == 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);
return result;
}
}
}