software.amazon.awscdk.services.apprunner.alpha.ImageRepository Maven / Gradle / Ivy
Show all versions of apprunner-alpha Show documentation
package software.amazon.awscdk.services.apprunner.alpha;
/**
* (experimental) Describes a source image repository.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imagerepository.html
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.40.0 (build 9713b9d)", date = "2021-10-27T10:32:43.152Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.apprunner.alpha.$Module.class, fqn = "@aws-cdk/aws-apprunner-alpha.ImageRepository")
@software.amazon.jsii.Jsii.Proxy(ImageRepository.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface ImageRepository extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The identifier of the image.
*
* For ECR_PUBLIC
imageRepositoryType, the identifier domain should
* always be public.ecr.aws
. For ECR
, the pattern should be
* ([0-9]{12}.dkr.ecr.[a-z\-]+-[0-9]{1}.amazonaws.com\/.*)
.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imagerepository.html for more details.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getImageIdentifier();
/**
* (experimental) The type of the image repository.
*
* This reflects the repository provider and whether
* the repository is private or public.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType getImageRepositoryType();
/**
* (experimental) Configuration for running the identified image.
*
* Default: - no image configuration will be passed. The default `port` will be 8080.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-imageconfiguration.html#cfn-apprunner-service-imageconfiguration-port
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration getImageConfiguration() {
return null;
}
/**
* @return a {@link Builder} of {@link ImageRepository}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ImageRepository}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String imageIdentifier;
private software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType imageRepositoryType;
private software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration imageConfiguration;
/**
* Sets the value of {@link ImageRepository#getImageIdentifier}
* @param imageIdentifier The identifier of the image. This parameter is required.
* For ECR_PUBLIC
imageRepositoryType, the identifier domain should
* always be public.ecr.aws
. For ECR
, the pattern should be
* ([0-9]{12}.dkr.ecr.[a-z\-]+-[0-9]{1}.amazonaws.com\/.*)
.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imageIdentifier(java.lang.String imageIdentifier) {
this.imageIdentifier = imageIdentifier;
return this;
}
/**
* Sets the value of {@link ImageRepository#getImageRepositoryType}
* @param imageRepositoryType The type of the image repository. This parameter is required.
* This reflects the repository provider and whether
* the repository is private or public.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imageRepositoryType(software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType imageRepositoryType) {
this.imageRepositoryType = imageRepositoryType;
return this;
}
/**
* Sets the value of {@link ImageRepository#getImageConfiguration}
* @param imageConfiguration Configuration for running the identified image.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder imageConfiguration(software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration imageConfiguration) {
this.imageConfiguration = imageConfiguration;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ImageRepository}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public ImageRepository build() {
return new Jsii$Proxy(imageIdentifier, imageRepositoryType, imageConfiguration);
}
}
/**
* An implementation for {@link ImageRepository}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ImageRepository {
private final java.lang.String imageIdentifier;
private final software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType imageRepositoryType;
private final software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration imageConfiguration;
/**
* 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.imageIdentifier = software.amazon.jsii.Kernel.get(this, "imageIdentifier", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.imageRepositoryType = software.amazon.jsii.Kernel.get(this, "imageRepositoryType", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType.class));
this.imageConfiguration = software.amazon.jsii.Kernel.get(this, "imageConfiguration", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.String imageIdentifier, final software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType imageRepositoryType, final software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration imageConfiguration) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.imageIdentifier = java.util.Objects.requireNonNull(imageIdentifier, "imageIdentifier is required");
this.imageRepositoryType = java.util.Objects.requireNonNull(imageRepositoryType, "imageRepositoryType is required");
this.imageConfiguration = imageConfiguration;
}
@Override
public final java.lang.String getImageIdentifier() {
return this.imageIdentifier;
}
@Override
public final software.amazon.awscdk.services.apprunner.alpha.ImageRepositoryType getImageRepositoryType() {
return this.imageRepositoryType;
}
@Override
public final software.amazon.awscdk.services.apprunner.alpha.ImageConfiguration getImageConfiguration() {
return this.imageConfiguration;
}
@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("imageIdentifier", om.valueToTree(this.getImageIdentifier()));
data.set("imageRepositoryType", om.valueToTree(this.getImageRepositoryType()));
if (this.getImageConfiguration() != null) {
data.set("imageConfiguration", om.valueToTree(this.getImageConfiguration()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-apprunner-alpha.ImageRepository"));
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;
ImageRepository.Jsii$Proxy that = (ImageRepository.Jsii$Proxy) o;
if (!imageIdentifier.equals(that.imageIdentifier)) return false;
if (!imageRepositoryType.equals(that.imageRepositoryType)) return false;
return this.imageConfiguration != null ? this.imageConfiguration.equals(that.imageConfiguration) : that.imageConfiguration == null;
}
@Override
public final int hashCode() {
int result = this.imageIdentifier.hashCode();
result = 31 * result + (this.imageRepositoryType.hashCode());
result = 31 * result + (this.imageConfiguration != null ? this.imageConfiguration.hashCode() : 0);
return result;
}
}
}