software.aws.awsprototypingsdk.openapigateway.OpenApiIntegration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of open-api-gateway Show documentation
Show all versions of open-api-gateway Show documentation
@aws-prototyping-sdk/open-api-gateway
package software.aws.awsprototypingsdk.openapigateway;
/**
* (experimental) Defines an integration for an individual API operation.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.82.0 (build 2d2ddd7)", date = "2023-08-15T05:38:04.727Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.openapigateway.$Module.class, fqn = "@aws-prototyping-sdk/open-api-gateway.OpenApiIntegration")
@software.amazon.jsii.Jsii.Proxy(OpenApiIntegration.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface OpenApiIntegration extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The lambda function to service the api operation.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.aws.awsprototypingsdk.openapigateway.Integration getIntegration();
/**
* (experimental) The authorizer to use for this api operation (overrides the default).
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.aws.awsprototypingsdk.openapigateway.Authorizer getAuthorizer() {
return null;
}
/**
* @return a {@link Builder} of {@link OpenApiIntegration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link OpenApiIntegration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.aws.awsprototypingsdk.openapigateway.Integration integration;
software.aws.awsprototypingsdk.openapigateway.Authorizer authorizer;
/**
* Sets the value of {@link OpenApiIntegration#getIntegration}
* @param integration The lambda function to service the api operation. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder integration(software.aws.awsprototypingsdk.openapigateway.Integration integration) {
this.integration = integration;
return this;
}
/**
* Sets the value of {@link OpenApiIntegration#getAuthorizer}
* @param authorizer The authorizer to use for this api operation (overrides the default).
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder authorizer(software.aws.awsprototypingsdk.openapigateway.Authorizer authorizer) {
this.authorizer = authorizer;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link OpenApiIntegration}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public OpenApiIntegration build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link OpenApiIntegration}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements OpenApiIntegration {
private final software.aws.awsprototypingsdk.openapigateway.Integration integration;
private final software.aws.awsprototypingsdk.openapigateway.Authorizer authorizer;
/**
* 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.integration = software.amazon.jsii.Kernel.get(this, "integration", software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.Integration.class));
this.authorizer = software.amazon.jsii.Kernel.get(this, "authorizer", software.amazon.jsii.NativeType.forClass(software.aws.awsprototypingsdk.openapigateway.Authorizer.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.integration = java.util.Objects.requireNonNull(builder.integration, "integration is required");
this.authorizer = builder.authorizer;
}
@Override
public final software.aws.awsprototypingsdk.openapigateway.Integration getIntegration() {
return this.integration;
}
@Override
public final software.aws.awsprototypingsdk.openapigateway.Authorizer getAuthorizer() {
return this.authorizer;
}
@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("integration", om.valueToTree(this.getIntegration()));
if (this.getAuthorizer() != null) {
data.set("authorizer", om.valueToTree(this.getAuthorizer()));
}
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.OpenApiIntegration"));
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;
OpenApiIntegration.Jsii$Proxy that = (OpenApiIntegration.Jsii$Proxy) o;
if (!integration.equals(that.integration)) return false;
return this.authorizer != null ? this.authorizer.equals(that.authorizer) : that.authorizer == null;
}
@Override
public final int hashCode() {
int result = this.integration.hashCode();
result = 31 * result + (this.authorizer != null ? this.authorizer.hashCode() : 0);
return result;
}
}
}