com.pepperize.cdk.organizations.PolicyProps Maven / Gradle / Ivy
Show all versions of cdk-organizations Show documentation
package com.pepperize.cdk.organizations;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.98.0 (build 00b106d)", date = "2024-05-17T01:18:02.671Z")
@software.amazon.jsii.Jsii(module = com.pepperize.cdk.organizations.$Module.class, fqn = "@pepperize/cdk-organizations.PolicyProps")
@software.amazon.jsii.Jsii.Proxy(PolicyProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface PolicyProps extends software.amazon.jsii.JsiiSerializable {
/**
* The policy text content to add to the new policy.
*
* The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getContent();
/**
* The friendly name to assign to the policy.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getPolicyName();
/**
* The type of policy to create.
*
* You can specify one of the following values:
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull com.pepperize.cdk.organizations.PolicyType getPolicyType();
/**
* An optional description to assign to the policy.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return null;
}
/**
* @return a {@link Builder} of {@link PolicyProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link PolicyProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String content;
java.lang.String policyName;
com.pepperize.cdk.organizations.PolicyType policyType;
java.lang.String description;
/**
* Sets the value of {@link PolicyProps#getContent}
* @param content The policy text content to add to the new policy. This parameter is required.
* The text that you supply must adhere to the rules of the policy type you specify in the Type parameter.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder content(java.lang.String content) {
this.content = content;
return this;
}
/**
* Sets the value of {@link PolicyProps#getPolicyName}
* @param policyName The friendly name to assign to the policy. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder policyName(java.lang.String policyName) {
this.policyName = policyName;
return this;
}
/**
* Sets the value of {@link PolicyProps#getPolicyType}
* @param policyType The type of policy to create. This parameter is required.
* You can specify one of the following values:
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder policyType(com.pepperize.cdk.organizations.PolicyType policyType) {
this.policyType = policyType;
return this;
}
/**
* Sets the value of {@link PolicyProps#getDescription}
* @param description An optional description to assign to the policy.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link PolicyProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public PolicyProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link PolicyProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements PolicyProps {
private final java.lang.String content;
private final java.lang.String policyName;
private final com.pepperize.cdk.organizations.PolicyType policyType;
private final java.lang.String description;
/**
* 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.content = software.amazon.jsii.Kernel.get(this, "content", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.policyName = software.amazon.jsii.Kernel.get(this, "policyName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.policyType = software.amazon.jsii.Kernel.get(this, "policyType", software.amazon.jsii.NativeType.forClass(com.pepperize.cdk.organizations.PolicyType.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.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.content = java.util.Objects.requireNonNull(builder.content, "content is required");
this.policyName = java.util.Objects.requireNonNull(builder.policyName, "policyName is required");
this.policyType = java.util.Objects.requireNonNull(builder.policyType, "policyType is required");
this.description = builder.description;
}
@Override
public final java.lang.String getContent() {
return this.content;
}
@Override
public final java.lang.String getPolicyName() {
return this.policyName;
}
@Override
public final com.pepperize.cdk.organizations.PolicyType getPolicyType() {
return this.policyType;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@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("content", om.valueToTree(this.getContent()));
data.set("policyName", om.valueToTree(this.getPolicyName()));
data.set("policyType", om.valueToTree(this.getPolicyType()));
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@pepperize/cdk-organizations.PolicyProps"));
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;
PolicyProps.Jsii$Proxy that = (PolicyProps.Jsii$Proxy) o;
if (!content.equals(that.content)) return false;
if (!policyName.equals(that.policyName)) return false;
if (!policyType.equals(that.policyType)) return false;
return this.description != null ? this.description.equals(that.description) : that.description == null;
}
@Override
public final int hashCode() {
int result = this.content.hashCode();
result = 31 * result + (this.policyName.hashCode());
result = 31 * result + (this.policyType.hashCode());
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
return result;
}
}
}