software.aws.awsprototypingsdk.openapigateway.CommonApiProjectOptions Maven / Gradle / Ivy
Show all versions of open-api-gateway Show documentation
package software.aws.awsprototypingsdk.openapigateway;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:38:04.570Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.openapigateway.$Module.class, fqn = "@aws-prototyping-sdk/open-api-gateway.CommonApiProjectOptions")
@software.amazon.jsii.Jsii.Proxy(CommonApiProjectOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface CommonApiProjectOptions extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The list of languages for which clients will be generated.
*
* A typescript client will always be generated.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.util.List getClientLanguages();
/**
* (experimental) The directory in which the api generated code will reside, relative to the project srcdir.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getApiSrcDir() {
return null;
}
/**
* (experimental) Formats to generate documentation in.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getDocumentationFormats() {
return null;
}
/**
* (experimental) Force to generate code and docs even if there were no changes in spec.
*
* Default: "false"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getForceGenerateCodeAndDocs() {
return null;
}
/**
* (experimental) The directory in which generated client code will be generated, relative to the outdir of this project.
*
* Default: "generated"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getGeneratedCodeDir() {
return null;
}
/**
* (experimental) Options for the generated java client (if specified in clientLanguages).
*
* These override the default inferred options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.java.JavaProjectOptions getJavaClientOptions() {
return null;
}
/**
* (experimental) The name of the output parsed OpenAPI specification file.
*
* Must end with .json.
*
* Default: ".parsed-spec.json"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getParsedSpecFileName() {
return null;
}
/**
* (experimental) Options for the generated python client (if specified in clientLanguages).
*
* These override the default inferred options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.python.PythonProjectOptions getPythonClientOptions() {
return null;
}
/**
* (experimental) Options for the generated typescript client.
*
* These override the default inferred options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.typescript.TypeScriptProjectOptions getTypescriptClientOptions() {
return null;
}
/**
* @return a {@link Builder} of {@link CommonApiProjectOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CommonApiProjectOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List clientLanguages;
java.lang.String apiSrcDir;
java.util.List documentationFormats;
java.lang.Boolean forceGenerateCodeAndDocs;
java.lang.String generatedCodeDir;
io.github.cdklabs.projen.java.JavaProjectOptions javaClientOptions;
java.lang.String parsedSpecFileName;
io.github.cdklabs.projen.python.PythonProjectOptions pythonClientOptions;
io.github.cdklabs.projen.typescript.TypeScriptProjectOptions typescriptClientOptions;
/**
* Sets the value of {@link CommonApiProjectOptions#getClientLanguages}
* @param clientLanguages The list of languages for which clients will be generated. This parameter is required.
* A typescript client will always be generated.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder clientLanguages(java.util.List extends software.aws.awsprototypingsdk.openapigateway.ClientLanguage> clientLanguages) {
this.clientLanguages = (java.util.List)clientLanguages;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getApiSrcDir}
* @param apiSrcDir The directory in which the api generated code will reside, relative to the project srcdir.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder apiSrcDir(java.lang.String apiSrcDir) {
this.apiSrcDir = apiSrcDir;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getDocumentationFormats}
* @param documentationFormats Formats to generate documentation in.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder documentationFormats(java.util.List extends software.aws.awsprototypingsdk.openapigateway.DocumentationFormat> documentationFormats) {
this.documentationFormats = (java.util.List)documentationFormats;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getForceGenerateCodeAndDocs}
* @param forceGenerateCodeAndDocs Force to generate code and docs even if there were no changes in spec.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder forceGenerateCodeAndDocs(java.lang.Boolean forceGenerateCodeAndDocs) {
this.forceGenerateCodeAndDocs = forceGenerateCodeAndDocs;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getGeneratedCodeDir}
* @param generatedCodeDir The directory in which generated client code will be generated, relative to the outdir of this project.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder generatedCodeDir(java.lang.String generatedCodeDir) {
this.generatedCodeDir = generatedCodeDir;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getJavaClientOptions}
* @param javaClientOptions Options for the generated java client (if specified in clientLanguages).
* These override the default inferred options.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder javaClientOptions(io.github.cdklabs.projen.java.JavaProjectOptions javaClientOptions) {
this.javaClientOptions = javaClientOptions;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getParsedSpecFileName}
* @param parsedSpecFileName The name of the output parsed OpenAPI specification file.
* Must end with .json.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder parsedSpecFileName(java.lang.String parsedSpecFileName) {
this.parsedSpecFileName = parsedSpecFileName;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getPythonClientOptions}
* @param pythonClientOptions Options for the generated python client (if specified in clientLanguages).
* These override the default inferred options.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder pythonClientOptions(io.github.cdklabs.projen.python.PythonProjectOptions pythonClientOptions) {
this.pythonClientOptions = pythonClientOptions;
return this;
}
/**
* Sets the value of {@link CommonApiProjectOptions#getTypescriptClientOptions}
* @param typescriptClientOptions Options for the generated typescript client.
* These override the default inferred options.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder typescriptClientOptions(io.github.cdklabs.projen.typescript.TypeScriptProjectOptions typescriptClientOptions) {
this.typescriptClientOptions = typescriptClientOptions;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CommonApiProjectOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public CommonApiProjectOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CommonApiProjectOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CommonApiProjectOptions {
private final java.util.List clientLanguages;
private final java.lang.String apiSrcDir;
private final java.util.List documentationFormats;
private final java.lang.Boolean forceGenerateCodeAndDocs;
private final java.lang.String generatedCodeDir;
private final io.github.cdklabs.projen.java.JavaProjectOptions javaClientOptions;
private final java.lang.String parsedSpecFileName;
private final io.github.cdklabs.projen.python.PythonProjectOptions pythonClientOptions;
private final io.github.cdklabs.projen.typescript.TypeScriptProjectOptions typescriptClientOptions;
/**
* 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.clientLanguages = software.amazon.jsii.Kernel.get(this, "clientLanguages", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.ClientLanguage.class)));
this.apiSrcDir = software.amazon.jsii.Kernel.get(this, "apiSrcDir", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.documentationFormats = software.amazon.jsii.Kernel.get(this, "documentationFormats", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.DocumentationFormat.class)));
this.forceGenerateCodeAndDocs = software.amazon.jsii.Kernel.get(this, "forceGenerateCodeAndDocs", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.generatedCodeDir = software.amazon.jsii.Kernel.get(this, "generatedCodeDir", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.javaClientOptions = software.amazon.jsii.Kernel.get(this, "javaClientOptions", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.java.JavaProjectOptions.class));
this.parsedSpecFileName = software.amazon.jsii.Kernel.get(this, "parsedSpecFileName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.pythonClientOptions = software.amazon.jsii.Kernel.get(this, "pythonClientOptions", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.python.PythonProjectOptions.class));
this.typescriptClientOptions = software.amazon.jsii.Kernel.get(this, "typescriptClientOptions", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.typescript.TypeScriptProjectOptions.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.clientLanguages = (java.util.List)java.util.Objects.requireNonNull(builder.clientLanguages, "clientLanguages is required");
this.apiSrcDir = builder.apiSrcDir;
this.documentationFormats = (java.util.List)builder.documentationFormats;
this.forceGenerateCodeAndDocs = builder.forceGenerateCodeAndDocs;
this.generatedCodeDir = builder.generatedCodeDir;
this.javaClientOptions = builder.javaClientOptions;
this.parsedSpecFileName = builder.parsedSpecFileName;
this.pythonClientOptions = builder.pythonClientOptions;
this.typescriptClientOptions = builder.typescriptClientOptions;
}
@Override
public final java.util.List getClientLanguages() {
return this.clientLanguages;
}
@Override
public final java.lang.String getApiSrcDir() {
return this.apiSrcDir;
}
@Override
public final java.util.List getDocumentationFormats() {
return this.documentationFormats;
}
@Override
public final java.lang.Boolean getForceGenerateCodeAndDocs() {
return this.forceGenerateCodeAndDocs;
}
@Override
public final java.lang.String getGeneratedCodeDir() {
return this.generatedCodeDir;
}
@Override
public final io.github.cdklabs.projen.java.JavaProjectOptions getJavaClientOptions() {
return this.javaClientOptions;
}
@Override
public final java.lang.String getParsedSpecFileName() {
return this.parsedSpecFileName;
}
@Override
public final io.github.cdklabs.projen.python.PythonProjectOptions getPythonClientOptions() {
return this.pythonClientOptions;
}
@Override
public final io.github.cdklabs.projen.typescript.TypeScriptProjectOptions getTypescriptClientOptions() {
return this.typescriptClientOptions;
}
@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("clientLanguages", om.valueToTree(this.getClientLanguages()));
if (this.getApiSrcDir() != null) {
data.set("apiSrcDir", om.valueToTree(this.getApiSrcDir()));
}
if (this.getDocumentationFormats() != null) {
data.set("documentationFormats", om.valueToTree(this.getDocumentationFormats()));
}
if (this.getForceGenerateCodeAndDocs() != null) {
data.set("forceGenerateCodeAndDocs", om.valueToTree(this.getForceGenerateCodeAndDocs()));
}
if (this.getGeneratedCodeDir() != null) {
data.set("generatedCodeDir", om.valueToTree(this.getGeneratedCodeDir()));
}
if (this.getJavaClientOptions() != null) {
data.set("javaClientOptions", om.valueToTree(this.getJavaClientOptions()));
}
if (this.getParsedSpecFileName() != null) {
data.set("parsedSpecFileName", om.valueToTree(this.getParsedSpecFileName()));
}
if (this.getPythonClientOptions() != null) {
data.set("pythonClientOptions", om.valueToTree(this.getPythonClientOptions()));
}
if (this.getTypescriptClientOptions() != null) {
data.set("typescriptClientOptions", om.valueToTree(this.getTypescriptClientOptions()));
}
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.CommonApiProjectOptions"));
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;
CommonApiProjectOptions.Jsii$Proxy that = (CommonApiProjectOptions.Jsii$Proxy) o;
if (!clientLanguages.equals(that.clientLanguages)) return false;
if (this.apiSrcDir != null ? !this.apiSrcDir.equals(that.apiSrcDir) : that.apiSrcDir != null) return false;
if (this.documentationFormats != null ? !this.documentationFormats.equals(that.documentationFormats) : that.documentationFormats != null) return false;
if (this.forceGenerateCodeAndDocs != null ? !this.forceGenerateCodeAndDocs.equals(that.forceGenerateCodeAndDocs) : that.forceGenerateCodeAndDocs != null) return false;
if (this.generatedCodeDir != null ? !this.generatedCodeDir.equals(that.generatedCodeDir) : that.generatedCodeDir != null) return false;
if (this.javaClientOptions != null ? !this.javaClientOptions.equals(that.javaClientOptions) : that.javaClientOptions != null) return false;
if (this.parsedSpecFileName != null ? !this.parsedSpecFileName.equals(that.parsedSpecFileName) : that.parsedSpecFileName != null) return false;
if (this.pythonClientOptions != null ? !this.pythonClientOptions.equals(that.pythonClientOptions) : that.pythonClientOptions != null) return false;
return this.typescriptClientOptions != null ? this.typescriptClientOptions.equals(that.typescriptClientOptions) : that.typescriptClientOptions == null;
}
@Override
public final int hashCode() {
int result = this.clientLanguages.hashCode();
result = 31 * result + (this.apiSrcDir != null ? this.apiSrcDir.hashCode() : 0);
result = 31 * result + (this.documentationFormats != null ? this.documentationFormats.hashCode() : 0);
result = 31 * result + (this.forceGenerateCodeAndDocs != null ? this.forceGenerateCodeAndDocs.hashCode() : 0);
result = 31 * result + (this.generatedCodeDir != null ? this.generatedCodeDir.hashCode() : 0);
result = 31 * result + (this.javaClientOptions != null ? this.javaClientOptions.hashCode() : 0);
result = 31 * result + (this.parsedSpecFileName != null ? this.parsedSpecFileName.hashCode() : 0);
result = 31 * result + (this.pythonClientOptions != null ? this.pythonClientOptions.hashCode() : 0);
result = 31 * result + (this.typescriptClientOptions != null ? this.typescriptClientOptions.hashCode() : 0);
return result;
}
}
}