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

software.amazon.awssdk.services.securityhub.model.AutomationRulesConfig Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.securityhub.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Defines the configuration of an automation rule. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AutomationRulesConfig implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField RULE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RuleArn").getter(getter(AutomationRulesConfig::ruleArn)).setter(setter(Builder::ruleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleArn").build()).build(); private static final SdkField RULE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RuleStatus").getter(getter(AutomationRulesConfig::ruleStatusAsString)) .setter(setter(Builder::ruleStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleStatus").build()).build(); private static final SdkField RULE_ORDER_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("RuleOrder").getter(getter(AutomationRulesConfig::ruleOrder)).setter(setter(Builder::ruleOrder)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleOrder").build()).build(); private static final SdkField RULE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RuleName").getter(getter(AutomationRulesConfig::ruleName)).setter(setter(Builder::ruleName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleName").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(AutomationRulesConfig::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField IS_TERMINAL_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("IsTerminal").getter(getter(AutomationRulesConfig::isTerminal)).setter(setter(Builder::isTerminal)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsTerminal").build()).build(); private static final SdkField CRITERIA_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Criteria") .getter(getter(AutomationRulesConfig::criteria)).setter(setter(Builder::criteria)) .constructor(AutomationRulesFindingFilters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Criteria").build()).build(); private static final SdkField> ACTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Actions") .getter(getter(AutomationRulesConfig::actions)) .setter(setter(Builder::actions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Actions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AutomationRulesAction::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("CreatedAt") .getter(getter(AutomationRulesConfig::createdAt)) .setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField UPDATED_AT_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("UpdatedAt") .getter(getter(AutomationRulesConfig::updatedAt)) .setter(setter(Builder::updatedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdatedAt").build(), TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build(); private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreatedBy").getter(getter(AutomationRulesConfig::createdBy)).setter(setter(Builder::createdBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RULE_ARN_FIELD, RULE_STATUS_FIELD, RULE_ORDER_FIELD, RULE_NAME_FIELD, DESCRIPTION_FIELD, IS_TERMINAL_FIELD, CRITERIA_FIELD, ACTIONS_FIELD, CREATED_AT_FIELD, UPDATED_AT_FIELD, CREATED_BY_FIELD)); private static final long serialVersionUID = 1L; private final String ruleArn; private final String ruleStatus; private final Integer ruleOrder; private final String ruleName; private final String description; private final Boolean isTerminal; private final AutomationRulesFindingFilters criteria; private final List actions; private final Instant createdAt; private final Instant updatedAt; private final String createdBy; private AutomationRulesConfig(BuilderImpl builder) { this.ruleArn = builder.ruleArn; this.ruleStatus = builder.ruleStatus; this.ruleOrder = builder.ruleOrder; this.ruleName = builder.ruleName; this.description = builder.description; this.isTerminal = builder.isTerminal; this.criteria = builder.criteria; this.actions = builder.actions; this.createdAt = builder.createdAt; this.updatedAt = builder.updatedAt; this.createdBy = builder.createdBy; } /** *

* The Amazon Resource Name (ARN) of a rule. *

* * @return The Amazon Resource Name (ARN) of a rule. */ public final String ruleArn() { return ruleArn; } /** *

* Whether the rule is active after it is created. If this parameter is equal to ENABLED, Security Hub * starts applying the rule to findings and finding updates after the rule is created. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #ruleStatus} will * return {@link RuleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ruleStatusAsString}. *

* * @return Whether the rule is active after it is created. If this parameter is equal to ENABLED, * Security Hub starts applying the rule to findings and finding updates after the rule is created. * @see RuleStatus */ public final RuleStatus ruleStatus() { return RuleStatus.fromValue(ruleStatus); } /** *

* Whether the rule is active after it is created. If this parameter is equal to ENABLED, Security Hub * starts applying the rule to findings and finding updates after the rule is created. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #ruleStatus} will * return {@link RuleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #ruleStatusAsString}. *

* * @return Whether the rule is active after it is created. If this parameter is equal to ENABLED, * Security Hub starts applying the rule to findings and finding updates after the rule is created. * @see RuleStatus */ public final String ruleStatusAsString() { return ruleStatus; } /** *

* An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. * Security Hub applies rules with lower values for this parameter first. *

* * @return An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to * findings. Security Hub applies rules with lower values for this parameter first. */ public final Integer ruleOrder() { return ruleOrder; } /** *

* The name of the rule. *

* * @return The name of the rule. */ public final String ruleName() { return ruleName; } /** *

* A description of the rule. *

* * @return A description of the rule. */ public final String description() { return description; } /** *

* Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. This * is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule * is terminal, Security Hub applies the rule action to a finding that matches the rule criteria and doesn't * evaluate other rules for the finding. By default, a rule isn't terminal. *

* * @return Specifies whether a rule is the last to be applied with respect to a finding that matches the rule * criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has * different actions. If a rule is terminal, Security Hub applies the rule action to a finding that matches * the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal. */ public final Boolean isTerminal() { return isTerminal; } /** *

* A set of Amazon Web * Services Security Finding Format finding field attributes and corresponding expected values that Security Hub * uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this parameter, * Security Hub applies the rule action to the finding. *

* * @return A set of Amazon * Web Services Security Finding Format finding field attributes and corresponding expected values that * Security Hub uses to filter findings. If a rule is enabled and a finding matches the conditions specified * in this parameter, Security Hub applies the rule action to the finding. */ public final AutomationRulesFindingFilters criteria() { return criteria; } /** * For responses, this returns true if the service returned a value for the Actions property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasActions() { return actions != null && !(actions instanceof SdkAutoConstructList); } /** *

* One or more actions to update finding fields if a finding matches the defined criteria of the rule. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasActions} method. *

* * @return One or more actions to update finding fields if a finding matches the defined criteria of the rule. */ public final List actions() { return actions; } /** *

* A timestamp that indicates when the rule was created. *

*

* Uses the date-time format specified in RFC * 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example, * 2020-03-22T13:22:13.933Z. *

* * @return A timestamp that indicates when the rule was created.

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time * Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. */ public final Instant createdAt() { return createdAt; } /** *

* A timestamp that indicates when the rule was most recently updated. *

*

* Uses the date-time format specified in RFC * 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example, * 2020-03-22T13:22:13.933Z. *

* * @return A timestamp that indicates when the rule was most recently updated.

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time * Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. */ public final Instant updatedAt() { return updatedAt; } /** *

* The principal that created a rule. *

* * @return The principal that created a rule. */ public final String createdBy() { return createdBy; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(ruleArn()); hashCode = 31 * hashCode + Objects.hashCode(ruleStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(ruleOrder()); hashCode = 31 * hashCode + Objects.hashCode(ruleName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(isTerminal()); hashCode = 31 * hashCode + Objects.hashCode(criteria()); hashCode = 31 * hashCode + Objects.hashCode(hasActions() ? actions() : null); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(updatedAt()); hashCode = 31 * hashCode + Objects.hashCode(createdBy()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof AutomationRulesConfig)) { return false; } AutomationRulesConfig other = (AutomationRulesConfig) obj; return Objects.equals(ruleArn(), other.ruleArn()) && Objects.equals(ruleStatusAsString(), other.ruleStatusAsString()) && Objects.equals(ruleOrder(), other.ruleOrder()) && Objects.equals(ruleName(), other.ruleName()) && Objects.equals(description(), other.description()) && Objects.equals(isTerminal(), other.isTerminal()) && Objects.equals(criteria(), other.criteria()) && hasActions() == other.hasActions() && Objects.equals(actions(), other.actions()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(updatedAt(), other.updatedAt()) && Objects.equals(createdBy(), other.createdBy()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("AutomationRulesConfig").add("RuleArn", ruleArn()).add("RuleStatus", ruleStatusAsString()) .add("RuleOrder", ruleOrder()).add("RuleName", ruleName()).add("Description", description()) .add("IsTerminal", isTerminal()).add("Criteria", criteria()).add("Actions", hasActions() ? actions() : null) .add("CreatedAt", createdAt()).add("UpdatedAt", updatedAt()).add("CreatedBy", createdBy()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "RuleArn": return Optional.ofNullable(clazz.cast(ruleArn())); case "RuleStatus": return Optional.ofNullable(clazz.cast(ruleStatusAsString())); case "RuleOrder": return Optional.ofNullable(clazz.cast(ruleOrder())); case "RuleName": return Optional.ofNullable(clazz.cast(ruleName())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "IsTerminal": return Optional.ofNullable(clazz.cast(isTerminal())); case "Criteria": return Optional.ofNullable(clazz.cast(criteria())); case "Actions": return Optional.ofNullable(clazz.cast(actions())); case "CreatedAt": return Optional.ofNullable(clazz.cast(createdAt())); case "UpdatedAt": return Optional.ofNullable(clazz.cast(updatedAt())); case "CreatedBy": return Optional.ofNullable(clazz.cast(createdBy())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AutomationRulesConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of a rule. *

* * @param ruleArn * The Amazon Resource Name (ARN) of a rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ruleArn(String ruleArn); /** *

* Whether the rule is active after it is created. If this parameter is equal to ENABLED, Security * Hub starts applying the rule to findings and finding updates after the rule is created. *

* * @param ruleStatus * Whether the rule is active after it is created. If this parameter is equal to ENABLED, * Security Hub starts applying the rule to findings and finding updates after the rule is created. * @see RuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RuleStatus */ Builder ruleStatus(String ruleStatus); /** *

* Whether the rule is active after it is created. If this parameter is equal to ENABLED, Security * Hub starts applying the rule to findings and finding updates after the rule is created. *

* * @param ruleStatus * Whether the rule is active after it is created. If this parameter is equal to ENABLED, * Security Hub starts applying the rule to findings and finding updates after the rule is created. * @see RuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RuleStatus */ Builder ruleStatus(RuleStatus ruleStatus); /** *

* An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings. * Security Hub applies rules with lower values for this parameter first. *

* * @param ruleOrder * An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to * findings. Security Hub applies rules with lower values for this parameter first. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ruleOrder(Integer ruleOrder); /** *

* The name of the rule. *

* * @param ruleName * The name of the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ruleName(String ruleName); /** *

* A description of the rule. *

* * @param description * A description of the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria. * This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. * If a rule is terminal, Security Hub applies the rule action to a finding that matches the rule criteria and * doesn't evaluate other rules for the finding. By default, a rule isn't terminal. *

* * @param isTerminal * Specifies whether a rule is the last to be applied with respect to a finding that matches the rule * criteria. This is useful when a finding matches the criteria for multiple rules, and each rule has * different actions. If a rule is terminal, Security Hub applies the rule action to a finding that * matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't * terminal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isTerminal(Boolean isTerminal); /** *

* A set of Amazon Web * Services Security Finding Format finding field attributes and corresponding expected values that Security * Hub uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this * parameter, Security Hub applies the rule action to the finding. *

* * @param criteria * A set of Amazon Web Services Security Finding Format finding field attributes and corresponding expected * values that Security Hub uses to filter findings. If a rule is enabled and a finding matches the * conditions specified in this parameter, Security Hub applies the rule action to the finding. * @return Returns a reference to this object so that method calls can be chained together. */ Builder criteria(AutomationRulesFindingFilters criteria); /** *

* A set of Amazon Web * Services Security Finding Format finding field attributes and corresponding expected values that Security * Hub uses to filter findings. If a rule is enabled and a finding matches the conditions specified in this * parameter, Security Hub applies the rule action to the finding. *

* This is a convenience method that creates an instance of the {@link AutomationRulesFindingFilters.Builder} * avoiding the need to create one manually via {@link AutomationRulesFindingFilters#builder()}. * *

* When the {@link Consumer} completes, {@link AutomationRulesFindingFilters.Builder#build()} is called * immediately and its result is passed to {@link #criteria(AutomationRulesFindingFilters)}. * * @param criteria * a consumer that will call methods on {@link AutomationRulesFindingFilters.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #criteria(AutomationRulesFindingFilters) */ default Builder criteria(Consumer criteria) { return criteria(AutomationRulesFindingFilters.builder().applyMutation(criteria).build()); } /** *

* One or more actions to update finding fields if a finding matches the defined criteria of the rule. *

* * @param actions * One or more actions to update finding fields if a finding matches the defined criteria of the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(Collection actions); /** *

* One or more actions to update finding fields if a finding matches the defined criteria of the rule. *

* * @param actions * One or more actions to update finding fields if a finding matches the defined criteria of the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(AutomationRulesAction... actions); /** *

* One or more actions to update finding fields if a finding matches the defined criteria of the rule. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.securityhub.model.AutomationRulesAction.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.securityhub.model.AutomationRulesAction#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.securityhub.model.AutomationRulesAction.Builder#build()} is called * immediately and its result is passed to {@link #actions(List)}. * * @param actions * a consumer that will call methods on * {@link software.amazon.awssdk.services.securityhub.model.AutomationRulesAction.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #actions(java.util.Collection) */ Builder actions(Consumer... actions); /** *

* A timestamp that indicates when the rule was created. *

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format. * The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. *

* * @param createdAt * A timestamp that indicates when the rule was created.

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time * Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* A timestamp that indicates when the rule was most recently updated. *

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time Format. * The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. *

* * @param updatedAt * A timestamp that indicates when the rule was most recently updated.

*

* Uses the date-time format specified in RFC 3339 section 5.6, Internet Date/Time * Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updatedAt(Instant updatedAt); /** *

* The principal that created a rule. *

* * @param createdBy * The principal that created a rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdBy(String createdBy); } static final class BuilderImpl implements Builder { private String ruleArn; private String ruleStatus; private Integer ruleOrder; private String ruleName; private String description; private Boolean isTerminal; private AutomationRulesFindingFilters criteria; private List actions = DefaultSdkAutoConstructList.getInstance(); private Instant createdAt; private Instant updatedAt; private String createdBy; private BuilderImpl() { } private BuilderImpl(AutomationRulesConfig model) { ruleArn(model.ruleArn); ruleStatus(model.ruleStatus); ruleOrder(model.ruleOrder); ruleName(model.ruleName); description(model.description); isTerminal(model.isTerminal); criteria(model.criteria); actions(model.actions); createdAt(model.createdAt); updatedAt(model.updatedAt); createdBy(model.createdBy); } public final String getRuleArn() { return ruleArn; } public final void setRuleArn(String ruleArn) { this.ruleArn = ruleArn; } @Override public final Builder ruleArn(String ruleArn) { this.ruleArn = ruleArn; return this; } public final String getRuleStatus() { return ruleStatus; } public final void setRuleStatus(String ruleStatus) { this.ruleStatus = ruleStatus; } @Override public final Builder ruleStatus(String ruleStatus) { this.ruleStatus = ruleStatus; return this; } @Override public final Builder ruleStatus(RuleStatus ruleStatus) { this.ruleStatus(ruleStatus == null ? null : ruleStatus.toString()); return this; } public final Integer getRuleOrder() { return ruleOrder; } public final void setRuleOrder(Integer ruleOrder) { this.ruleOrder = ruleOrder; } @Override public final Builder ruleOrder(Integer ruleOrder) { this.ruleOrder = ruleOrder; return this; } public final String getRuleName() { return ruleName; } public final void setRuleName(String ruleName) { this.ruleName = ruleName; } @Override public final Builder ruleName(String ruleName) { this.ruleName = ruleName; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Boolean getIsTerminal() { return isTerminal; } public final void setIsTerminal(Boolean isTerminal) { this.isTerminal = isTerminal; } @Override public final Builder isTerminal(Boolean isTerminal) { this.isTerminal = isTerminal; return this; } public final AutomationRulesFindingFilters.Builder getCriteria() { return criteria != null ? criteria.toBuilder() : null; } public final void setCriteria(AutomationRulesFindingFilters.BuilderImpl criteria) { this.criteria = criteria != null ? criteria.build() : null; } @Override public final Builder criteria(AutomationRulesFindingFilters criteria) { this.criteria = criteria; return this; } public final List getActions() { List result = ActionListCopier.copyToBuilder(this.actions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setActions(Collection actions) { this.actions = ActionListCopier.copyFromBuilder(actions); } @Override public final Builder actions(Collection actions) { this.actions = ActionListCopier.copy(actions); return this; } @Override @SafeVarargs public final Builder actions(AutomationRulesAction... actions) { actions(Arrays.asList(actions)); return this; } @Override @SafeVarargs public final Builder actions(Consumer... actions) { actions(Stream.of(actions).map(c -> AutomationRulesAction.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getUpdatedAt() { return updatedAt; } public final void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; } @Override public final Builder updatedAt(Instant updatedAt) { this.updatedAt = updatedAt; return this; } public final String getCreatedBy() { return createdBy; } public final void setCreatedBy(String createdBy) { this.createdBy = createdBy; } @Override public final Builder createdBy(String createdBy) { this.createdBy = createdBy; return this; } @Override public AutomationRulesConfig build() { return new AutomationRulesConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy