All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.ecr.Repository Maven / Gradle / Ivy

package software.amazon.awscdk.services.ecr;

/**
 * Define an ECR repository.
 */
@javax.annotation.Generated(value = "jsii-pacmak/0.17.1 (build f4a0dbe)", date = "2019-10-02T18:23:41.944Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ecr.$Module.class, fqn = "@aws-cdk/aws-ecr.Repository")
public class Repository extends software.amazon.awscdk.services.ecr.RepositoryBase {

    protected Repository(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected Repository(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param props
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public Repository(final software.amazon.awscdk.core.Construct scope, final java.lang.String id, final software.amazon.awscdk.services.ecr.RepositoryProps props) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        this.setObjRef(software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), props }));
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public Repository(final software.amazon.awscdk.core.Construct scope, final java.lang.String id) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        this.setObjRef(software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required") }));
    }

    /**
     * Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
     * 
     * @param repositoryName This parameter is required.
     * @param scope This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static java.lang.String arnForLocalRepository(final java.lang.String repositoryName, final software.amazon.awscdk.core.IConstruct scope) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.ecr.Repository.class, "arnForLocalRepository", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(repositoryName, "repositoryName is required"), java.util.Objects.requireNonNull(scope, "scope is required") });
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param repositoryArn This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static software.amazon.awscdk.services.ecr.IRepository fromRepositoryArn(final software.amazon.awscdk.core.Construct scope, final java.lang.String id, final java.lang.String repositoryArn) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.ecr.Repository.class, "fromRepositoryArn", software.amazon.awscdk.services.ecr.IRepository.class, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(repositoryArn, "repositoryArn is required") });
    }

    /**
     * Import a repository.
     * 
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param attrs This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static software.amazon.awscdk.services.ecr.IRepository fromRepositoryAttributes(final software.amazon.awscdk.core.Construct scope, final java.lang.String id, final software.amazon.awscdk.services.ecr.RepositoryAttributes attrs) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.ecr.Repository.class, "fromRepositoryAttributes", software.amazon.awscdk.services.ecr.IRepository.class, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(attrs, "attrs is required") });
    }

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param repositoryName This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static software.amazon.awscdk.services.ecr.IRepository fromRepositoryName(final software.amazon.awscdk.core.Construct scope, final java.lang.String id, final java.lang.String repositoryName) {
        return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.ecr.Repository.class, "fromRepositoryName", software.amazon.awscdk.services.ecr.IRepository.class, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(repositoryName, "repositoryName is required") });
    }

    /**
     * Add a life cycle rule to the repository.
     * 
     * Life cycle rules automatically expire images from the repository that match
     * certain conditions.
     * 
     * @param rule This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public void addLifecycleRule(final software.amazon.awscdk.services.ecr.LifecycleRule rule) {
        this.jsiiCall("addLifecycleRule", Void.class, new Object[] { java.util.Objects.requireNonNull(rule, "rule is required") });
    }

    /**
     * Add a policy statement to the repository's resource policy.
     * 
     * @param statement This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    @Override
    public void addToResourcePolicy(final software.amazon.awscdk.services.iam.PolicyStatement statement) {
        this.jsiiCall("addToResourcePolicy", Void.class, new Object[] { java.util.Objects.requireNonNull(statement, "statement is required") });
    }

    /**
     * The ARN of the repository.
     */
    @Override
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public java.lang.String getRepositoryArn() {
        return this.jsiiGet("repositoryArn", java.lang.String.class);
    }

    /**
     * The name of the repository.
     */
    @Override
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public java.lang.String getRepositoryName() {
        return this.jsiiGet("repositoryName", java.lang.String.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy