software.aws.awsprototypingsdk.openapigateway.SmithyBuildOptions Maven / Gradle / Ivy
Show all versions of open-api-gateway Show documentation
package software.aws.awsprototypingsdk.openapigateway;
/**
* (experimental) Options for the smithy build files.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:38:04.771Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.openapigateway.$Module.class, fqn = "@aws-prototyping-sdk/open-api-gateway.SmithyBuildOptions")
@software.amazon.jsii.Jsii.Proxy(SmithyBuildOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface SmithyBuildOptions extends software.amazon.jsii.JsiiSerializable, software.aws.awsprototypingsdk.openapigateway.SmithyCommon {
/**
* (experimental) If a plugin can't be found, Smithy will by default fail the build.
*
* This setting can be set to true to allow the build to progress
* even if a plugin can't be found on the classpath.
*
* Default: - no ignoreMissingPlugins set in the smithy-build.json file
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getIgnoreMissingPlugins() {
return null;
}
/**
* (experimental) Maven configuration for the Smithy build project, used to specify dependencies and repositories in the build.gradle and smithy-build.json files.
*
* Default: the default configuration required for Smithy to OpenAPI conversion
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration getMaven() {
return null;
}
/**
* (experimental) Map of projections name to projection configurations https://awslabs.github.io/smithy/2.0/guides/building-models/build-config.html#projections.
*
* Default: - no projections
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getProjections() {
return null;
}
/**
* @return a {@link Builder} of {@link SmithyBuildOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SmithyBuildOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean ignoreMissingPlugins;
software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration maven;
java.util.Map projections;
java.util.List imports;
java.util.Map> plugins;
/**
* Sets the value of {@link SmithyBuildOptions#getIgnoreMissingPlugins}
* @param ignoreMissingPlugins If a plugin can't be found, Smithy will by default fail the build.
* This setting can be set to true to allow the build to progress
* even if a plugin can't be found on the classpath.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder ignoreMissingPlugins(java.lang.Boolean ignoreMissingPlugins) {
this.ignoreMissingPlugins = ignoreMissingPlugins;
return this;
}
/**
* Sets the value of {@link SmithyBuildOptions#getMaven}
* @param maven Maven configuration for the Smithy build project, used to specify dependencies and repositories in the build.gradle and smithy-build.json files.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maven(software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration maven) {
this.maven = maven;
return this;
}
/**
* Sets the value of {@link SmithyBuildOptions#getProjections}
* @param projections Map of projections name to projection configurations https://awslabs.github.io/smithy/2.0/guides/building-models/build-config.html#projections.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder projections(java.util.Map projections) {
this.projections = (java.util.Map)projections;
return this;
}
/**
* Sets the value of {@link SmithyBuildOptions#getImports}
* @param imports List of imports.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imports(java.util.List imports) {
this.imports = imports;
return this;
}
/**
* Sets the value of {@link SmithyBuildOptions#getPlugins}
* @param plugins Plugins keyed by plugin id.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder plugins(java.util.Map> plugins) {
this.plugins = (java.util.Map>)plugins;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SmithyBuildOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public SmithyBuildOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SmithyBuildOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SmithyBuildOptions {
private final java.lang.Boolean ignoreMissingPlugins;
private final software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration maven;
private final java.util.Map projections;
private final java.util.List imports;
private final java.util.Map> plugins;
/**
* 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.ignoreMissingPlugins = software.amazon.jsii.Kernel.get(this, "ignoreMissingPlugins", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.maven = software.amazon.jsii.Kernel.get(this, "maven", software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration.class));
this.projections = software.amazon.jsii.Kernel.get(this, "projections", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.SmithyProjection.class)));
this.imports = software.amazon.jsii.Kernel.get(this, "imports", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.plugins = software.amazon.jsii.Kernel.get(this, "plugins", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.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.ignoreMissingPlugins = builder.ignoreMissingPlugins;
this.maven = builder.maven;
this.projections = (java.util.Map)builder.projections;
this.imports = builder.imports;
this.plugins = (java.util.Map>)builder.plugins;
}
@Override
public final java.lang.Boolean getIgnoreMissingPlugins() {
return this.ignoreMissingPlugins;
}
@Override
public final software.aws.awsprototypingsdk.openapigateway.SmithyMavenConfiguration getMaven() {
return this.maven;
}
@Override
public final java.util.Map getProjections() {
return this.projections;
}
@Override
public final java.util.List getImports() {
return this.imports;
}
@Override
public final java.util.Map> getPlugins() {
return this.plugins;
}
@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.getIgnoreMissingPlugins() != null) {
data.set("ignoreMissingPlugins", om.valueToTree(this.getIgnoreMissingPlugins()));
}
if (this.getMaven() != null) {
data.set("maven", om.valueToTree(this.getMaven()));
}
if (this.getProjections() != null) {
data.set("projections", om.valueToTree(this.getProjections()));
}
if (this.getImports() != null) {
data.set("imports", om.valueToTree(this.getImports()));
}
if (this.getPlugins() != null) {
data.set("plugins", om.valueToTree(this.getPlugins()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-prototyping-sdk/open-api-gateway.SmithyBuildOptions"));
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;
SmithyBuildOptions.Jsii$Proxy that = (SmithyBuildOptions.Jsii$Proxy) o;
if (this.ignoreMissingPlugins != null ? !this.ignoreMissingPlugins.equals(that.ignoreMissingPlugins) : that.ignoreMissingPlugins != null) return false;
if (this.maven != null ? !this.maven.equals(that.maven) : that.maven != null) return false;
if (this.projections != null ? !this.projections.equals(that.projections) : that.projections != null) return false;
if (this.imports != null ? !this.imports.equals(that.imports) : that.imports != null) return false;
return this.plugins != null ? this.plugins.equals(that.plugins) : that.plugins == null;
}
@Override
public final int hashCode() {
int result = this.ignoreMissingPlugins != null ? this.ignoreMissingPlugins.hashCode() : 0;
result = 31 * result + (this.maven != null ? this.maven.hashCode() : 0);
result = 31 * result + (this.projections != null ? this.projections.hashCode() : 0);
result = 31 * result + (this.imports != null ? this.imports.hashCode() : 0);
result = 31 * result + (this.plugins != null ? this.plugins.hashCode() : 0);
return result;
}
}
}