
software.amazon.awscdk.services.config.ManagedRuleProps Maven / Gradle / Ivy
package software.amazon.awscdk.services.config;
/**
* Construction properties for a ManagedRule.
*
* EXPERIMENTAL
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.9.0 (build 5c646d5)", date = "2020-07-31T23:31:37.939Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.config.$Module.class, fqn = "@aws-cdk/aws-config.ManagedRuleProps")
@software.amazon.jsii.Jsii.Proxy(ManagedRuleProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface ManagedRuleProps extends software.amazon.jsii.JsiiSerializable, software.amazon.awscdk.services.config.RuleProps {
/**
* The identifier of the AWS managed rule.
*
* EXPERIMENTAL
*
* @see https://docs.aws.amazon.com/config/latest/developerguide/managed-rules-by-aws-config.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.String getIdentifier();
/**
* @return a {@link Builder} of {@link ManagedRuleProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ManagedRuleProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String identifier;
private java.lang.String configRuleName;
private java.lang.String description;
private java.util.Map inputParameters;
private software.amazon.awscdk.services.config.MaximumExecutionFrequency maximumExecutionFrequency;
/**
* Sets the value of {@link ManagedRuleProps#getIdentifier}
* @param identifier The identifier of the AWS managed rule. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder identifier(java.lang.String identifier) {
this.identifier = identifier;
return this;
}
/**
* Sets the value of {@link ManagedRuleProps#getConfigRuleName}
* @param configRuleName A name for the AWS Config rule.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder configRuleName(java.lang.String configRuleName) {
this.configRuleName = configRuleName;
return this;
}
/**
* Sets the value of {@link ManagedRuleProps#getDescription}
* @param description A description about this AWS Config rule.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link ManagedRuleProps#getInputParameters}
* @param inputParameters Input parameter values that are passed to the AWS Config rule.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder inputParameters(java.util.Map inputParameters) {
this.inputParameters = inputParameters;
return this;
}
/**
* Sets the value of {@link ManagedRuleProps#getMaximumExecutionFrequency}
* @param maximumExecutionFrequency The maximum frequency at which the AWS Config rule runs evaluations.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maximumExecutionFrequency(software.amazon.awscdk.services.config.MaximumExecutionFrequency maximumExecutionFrequency) {
this.maximumExecutionFrequency = maximumExecutionFrequency;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ManagedRuleProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public ManagedRuleProps build() {
return new Jsii$Proxy(identifier, configRuleName, description, inputParameters, maximumExecutionFrequency);
}
}
/**
* An implementation for {@link ManagedRuleProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ManagedRuleProps {
private final java.lang.String identifier;
private final java.lang.String configRuleName;
private final java.lang.String description;
private final java.util.Map inputParameters;
private final software.amazon.awscdk.services.config.MaximumExecutionFrequency maximumExecutionFrequency;
/**
* 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.identifier = this.jsiiGet("identifier", java.lang.String.class);
this.configRuleName = this.jsiiGet("configRuleName", java.lang.String.class);
this.description = this.jsiiGet("description", java.lang.String.class);
this.inputParameters = this.jsiiGet("inputParameters", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)));
this.maximumExecutionFrequency = this.jsiiGet("maximumExecutionFrequency", software.amazon.awscdk.services.config.MaximumExecutionFrequency.class);
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
private Jsii$Proxy(final java.lang.String identifier, final java.lang.String configRuleName, final java.lang.String description, final java.util.Map inputParameters, final software.amazon.awscdk.services.config.MaximumExecutionFrequency maximumExecutionFrequency) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.identifier = java.util.Objects.requireNonNull(identifier, "identifier is required");
this.configRuleName = configRuleName;
this.description = description;
this.inputParameters = inputParameters;
this.maximumExecutionFrequency = maximumExecutionFrequency;
}
@Override
public java.lang.String getIdentifier() {
return this.identifier;
}
@Override
public java.lang.String getConfigRuleName() {
return this.configRuleName;
}
@Override
public java.lang.String getDescription() {
return this.description;
}
@Override
public java.util.Map getInputParameters() {
return this.inputParameters;
}
@Override
public software.amazon.awscdk.services.config.MaximumExecutionFrequency getMaximumExecutionFrequency() {
return this.maximumExecutionFrequency;
}
@Override
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("identifier", om.valueToTree(this.getIdentifier()));
if (this.getConfigRuleName() != null) {
data.set("configRuleName", om.valueToTree(this.getConfigRuleName()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getInputParameters() != null) {
data.set("inputParameters", om.valueToTree(this.getInputParameters()));
}
if (this.getMaximumExecutionFrequency() != null) {
data.set("maximumExecutionFrequency", om.valueToTree(this.getMaximumExecutionFrequency()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-config.ManagedRuleProps"));
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 boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ManagedRuleProps.Jsii$Proxy that = (ManagedRuleProps.Jsii$Proxy) o;
if (!identifier.equals(that.identifier)) return false;
if (this.configRuleName != null ? !this.configRuleName.equals(that.configRuleName) : that.configRuleName != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.inputParameters != null ? !this.inputParameters.equals(that.inputParameters) : that.inputParameters != null) return false;
return this.maximumExecutionFrequency != null ? this.maximumExecutionFrequency.equals(that.maximumExecutionFrequency) : that.maximumExecutionFrequency == null;
}
@Override
public int hashCode() {
int result = this.identifier.hashCode();
result = 31 * result + (this.configRuleName != null ? this.configRuleName.hashCode() : 0);
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.inputParameters != null ? this.inputParameters.hashCode() : 0);
result = 31 * result + (this.maximumExecutionFrequency != null ? this.maximumExecutionFrequency.hashCode() : 0);
return result;
}
}
}