io.github.cdklabs.generative_ai_cdk_constructs.HuggingFaceSageMakerEndpointProps Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of generative-ai-cdk-constructs Show documentation
Show all versions of generative-ai-cdk-constructs Show documentation
AWS Generative AI CDK Constructs is a library for well-architected generative AI patterns.
package io.github.cdklabs.generative_ai_cdk_constructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-23T22:27:31.857Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.generative_ai_cdk_constructs.$Module.class, fqn = "@cdklabs/generative-ai-cdk-constructs.HuggingFaceSageMakerEndpointProps")
@software.amazon.jsii.Jsii.Proxy(HuggingFaceSageMakerEndpointProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface HuggingFaceSageMakerEndpointProps extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage getContainer();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType getInstanceType();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getModelId();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getEndpointName() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getEnvironment() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getInstanceCount() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.Role getRole() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getStartupHealthCheckTimeoutInSeconds() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty getVpcConfig() {
return null;
}
/**
* @return a {@link Builder} of {@link HuggingFaceSageMakerEndpointProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link HuggingFaceSageMakerEndpointProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage container;
io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType instanceType;
java.lang.String modelId;
java.lang.String endpointName;
java.util.Map environment;
java.lang.Number instanceCount;
software.amazon.awscdk.services.iam.Role role;
java.lang.Number startupHealthCheckTimeoutInSeconds;
software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty vpcConfig;
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getContainer}
* @param container the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder container(io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage container) {
this.container = container;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getInstanceType}
* @param instanceType the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder instanceType(io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType instanceType) {
this.instanceType = instanceType;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getModelId}
* @param modelId the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder modelId(java.lang.String modelId) {
this.modelId = modelId;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getEndpointName}
* @param endpointName the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder endpointName(java.lang.String endpointName) {
this.endpointName = endpointName;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getEnvironment}
* @param environment the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder environment(java.util.Map environment) {
this.environment = environment;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getInstanceCount}
* @param instanceCount the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder instanceCount(java.lang.Number instanceCount) {
this.instanceCount = instanceCount;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getRole}
* @param role the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder role(software.amazon.awscdk.services.iam.Role role) {
this.role = role;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getStartupHealthCheckTimeoutInSeconds}
* @param startupHealthCheckTimeoutInSeconds the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder startupHealthCheckTimeoutInSeconds(java.lang.Number startupHealthCheckTimeoutInSeconds) {
this.startupHealthCheckTimeoutInSeconds = startupHealthCheckTimeoutInSeconds;
return this;
}
/**
* Sets the value of {@link HuggingFaceSageMakerEndpointProps#getVpcConfig}
* @param vpcConfig the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder vpcConfig(software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty vpcConfig) {
this.vpcConfig = vpcConfig;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link HuggingFaceSageMakerEndpointProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public HuggingFaceSageMakerEndpointProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link HuggingFaceSageMakerEndpointProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements HuggingFaceSageMakerEndpointProps {
private final io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage container;
private final io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType instanceType;
private final java.lang.String modelId;
private final java.lang.String endpointName;
private final java.util.Map environment;
private final java.lang.Number instanceCount;
private final software.amazon.awscdk.services.iam.Role role;
private final java.lang.Number startupHealthCheckTimeoutInSeconds;
private final software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty vpcConfig;
/**
* 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.container = software.amazon.jsii.Kernel.get(this, "container", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage.class));
this.instanceType = software.amazon.jsii.Kernel.get(this, "instanceType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType.class));
this.modelId = software.amazon.jsii.Kernel.get(this, "modelId", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.endpointName = software.amazon.jsii.Kernel.get(this, "endpointName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.environment = software.amazon.jsii.Kernel.get(this, "environment", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.instanceCount = software.amazon.jsii.Kernel.get(this, "instanceCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.role = software.amazon.jsii.Kernel.get(this, "role", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.Role.class));
this.startupHealthCheckTimeoutInSeconds = software.amazon.jsii.Kernel.get(this, "startupHealthCheckTimeoutInSeconds", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.vpcConfig = software.amazon.jsii.Kernel.get(this, "vpcConfig", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty.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.container = java.util.Objects.requireNonNull(builder.container, "container is required");
this.instanceType = java.util.Objects.requireNonNull(builder.instanceType, "instanceType is required");
this.modelId = java.util.Objects.requireNonNull(builder.modelId, "modelId is required");
this.endpointName = builder.endpointName;
this.environment = builder.environment;
this.instanceCount = builder.instanceCount;
this.role = builder.role;
this.startupHealthCheckTimeoutInSeconds = builder.startupHealthCheckTimeoutInSeconds;
this.vpcConfig = builder.vpcConfig;
}
@Override
public final io.github.cdklabs.generative_ai_cdk_constructs.ContainerImage getContainer() {
return this.container;
}
@Override
public final io.github.cdklabs.generative_ai_cdk_constructs.SageMakerInstanceType getInstanceType() {
return this.instanceType;
}
@Override
public final java.lang.String getModelId() {
return this.modelId;
}
@Override
public final java.lang.String getEndpointName() {
return this.endpointName;
}
@Override
public final java.util.Map getEnvironment() {
return this.environment;
}
@Override
public final java.lang.Number getInstanceCount() {
return this.instanceCount;
}
@Override
public final software.amazon.awscdk.services.iam.Role getRole() {
return this.role;
}
@Override
public final java.lang.Number getStartupHealthCheckTimeoutInSeconds() {
return this.startupHealthCheckTimeoutInSeconds;
}
@Override
public final software.amazon.awscdk.services.sagemaker.CfnModel.VpcConfigProperty getVpcConfig() {
return this.vpcConfig;
}
@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("container", om.valueToTree(this.getContainer()));
data.set("instanceType", om.valueToTree(this.getInstanceType()));
data.set("modelId", om.valueToTree(this.getModelId()));
if (this.getEndpointName() != null) {
data.set("endpointName", om.valueToTree(this.getEndpointName()));
}
if (this.getEnvironment() != null) {
data.set("environment", om.valueToTree(this.getEnvironment()));
}
if (this.getInstanceCount() != null) {
data.set("instanceCount", om.valueToTree(this.getInstanceCount()));
}
if (this.getRole() != null) {
data.set("role", om.valueToTree(this.getRole()));
}
if (this.getStartupHealthCheckTimeoutInSeconds() != null) {
data.set("startupHealthCheckTimeoutInSeconds", om.valueToTree(this.getStartupHealthCheckTimeoutInSeconds()));
}
if (this.getVpcConfig() != null) {
data.set("vpcConfig", om.valueToTree(this.getVpcConfig()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@cdklabs/generative-ai-cdk-constructs.HuggingFaceSageMakerEndpointProps"));
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;
HuggingFaceSageMakerEndpointProps.Jsii$Proxy that = (HuggingFaceSageMakerEndpointProps.Jsii$Proxy) o;
if (!container.equals(that.container)) return false;
if (!instanceType.equals(that.instanceType)) return false;
if (!modelId.equals(that.modelId)) return false;
if (this.endpointName != null ? !this.endpointName.equals(that.endpointName) : that.endpointName != null) return false;
if (this.environment != null ? !this.environment.equals(that.environment) : that.environment != null) return false;
if (this.instanceCount != null ? !this.instanceCount.equals(that.instanceCount) : that.instanceCount != null) return false;
if (this.role != null ? !this.role.equals(that.role) : that.role != null) return false;
if (this.startupHealthCheckTimeoutInSeconds != null ? !this.startupHealthCheckTimeoutInSeconds.equals(that.startupHealthCheckTimeoutInSeconds) : that.startupHealthCheckTimeoutInSeconds != null) return false;
return this.vpcConfig != null ? this.vpcConfig.equals(that.vpcConfig) : that.vpcConfig == null;
}
@Override
public final int hashCode() {
int result = this.container.hashCode();
result = 31 * result + (this.instanceType.hashCode());
result = 31 * result + (this.modelId.hashCode());
result = 31 * result + (this.endpointName != null ? this.endpointName.hashCode() : 0);
result = 31 * result + (this.environment != null ? this.environment.hashCode() : 0);
result = 31 * result + (this.instanceCount != null ? this.instanceCount.hashCode() : 0);
result = 31 * result + (this.role != null ? this.role.hashCode() : 0);
result = 31 * result + (this.startupHealthCheckTimeoutInSeconds != null ? this.startupHealthCheckTimeoutInSeconds.hashCode() : 0);
result = 31 * result + (this.vpcConfig != null ? this.vpcConfig.hashCode() : 0);
return result;
}
}
}