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

io.github.cdklabs.cdk.verified.permissions.Policy Maven / Gradle / Ivy

The newest version!
package io.github.cdklabs.cdk.verified.permissions;

/**
 */
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-11T10:47:53.518Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdk.verified.permissions.$Module.class, fqn = "@cdklabs/cdk-verified-permissions.Policy")
public class Policy extends software.amazon.awscdk.Resource implements io.github.cdklabs.cdk.verified.permissions.IPolicy {

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

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

    /**
     * @param scope This parameter is required.
     * @param id This parameter is required.
     * @param props This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
    public Policy(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.PolicyProps props) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        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"), java.util.Objects.requireNonNull(props, "props is required") });
    }

    /**
     * (experimental) Create a policy based on a file containing a cedar policy.
     * 

* Best practice would be * for the file name to end in .cedar but this is not required. Policy is parsed for valid * syntax but not validated against schema. In order to validate against schema, use * PolicyStore.addPoliciesFromPath() *

* @param scope The parent creating construct (usually this). This parameter is required. * @param id The construct id. This parameter is required. * @param props A StaticPolicyFromFileProps object. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.Policy fromFile(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.StaticPolicyFromFileProps props) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.cdk.verified.permissions.Policy.class, "fromFile", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.verified.permissions.Policy.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") }); } /** * (experimental) Import a Policy construct from attributes. *

* @param scope The parent creating construct (usually this). This parameter is required. * @param id The construct id. This parameter is required. * @param attrs A PolicyAttributes object. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.IPolicy fromPolicyAttributes(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.PolicyAttributes attrs) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.cdk.verified.permissions.Policy.class, "fromPolicyAttributes", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.verified.permissions.IPolicy.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") }); } /** * (experimental) Import a policy into the CDK using its id. *

* @param scope The parent creating construct (usually this). This parameter is required. * @param id The construct id. This parameter is required. * @param policyId The policy id. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.IPolicy fromPolicyId(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull java.lang.String policyId) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(io.github.cdklabs.cdk.verified.permissions.Policy.class, "fromPolicyId", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.verified.permissions.IPolicy.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(policyId, "policyId is required") }); } /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.PolicyDefinitionProperty getDefinition() { return software.amazon.jsii.Kernel.get(this, "definition", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.verified.permissions.PolicyDefinitionProperty.class)); } /** * (experimental) The unique ID of the new or updated policy. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getPolicyId() { return software.amazon.jsii.Kernel.get(this, "policyId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getPolicyStoreId() { return software.amazon.jsii.Kernel.get(this, "policyStoreId", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * (experimental) The type of the policy. *

* This is one of the following values: Static or TemplateLinked. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull io.github.cdklabs.cdk.verified.permissions.PolicyType getPolicyType() { return software.amazon.jsii.Kernel.get(this, "policyType", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdk.verified.permissions.PolicyType.class)); } /** * (experimental) A fluent builder for {@link io.github.cdklabs.cdk.verified.permissions.Policy}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { /** * @return a new instance of {@link Builder}. * @param scope This parameter is required. * @param id This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static Builder create(final software.constructs.Construct scope, final java.lang.String id) { return new Builder(scope, id); } private final software.constructs.Construct scope; private final java.lang.String id; private final io.github.cdklabs.cdk.verified.permissions.PolicyProps.Builder props; private Builder(final software.constructs.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; this.props = new io.github.cdklabs.cdk.verified.permissions.PolicyProps.Builder(); } /** * (experimental) Specifies the policy type and content to use for the new or updated policy. *

* The definition structure must include either a Static or a TemplateLinked element. *

* @return {@code this} * @param definition Specifies the policy type and content to use for the new or updated policy. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder definition(final io.github.cdklabs.cdk.verified.permissions.PolicyDefinitionProperty definition) { this.props.definition(definition); return this; } /** * (experimental) The policy store that contains the policy. *

* @return {@code this} * @param policyStore The policy store that contains the policy. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder policyStore(final io.github.cdklabs.cdk.verified.permissions.IPolicyStore policyStore) { this.props.policyStore(policyStore); return this; } /** * @return a newly built instance of {@link io.github.cdklabs.cdk.verified.permissions.Policy}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public io.github.cdklabs.cdk.verified.permissions.Policy build() { return new io.github.cdklabs.cdk.verified.permissions.Policy( this.scope, this.id, this.props.build() ); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy