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

software.amazon.awssdk.services.rbin.model.CreateRuleResponse 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.rbin.model;

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.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateRuleResponse extends RbinResponse implements
        ToCopyableBuilder {
    private static final SdkField IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Identifier").getter(getter(CreateRuleResponse::identifier)).setter(setter(Builder::identifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Identifier").build()).build();

    private static final SdkField RETENTION_PERIOD_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("RetentionPeriod")
            .getter(getter(CreateRuleResponse::retentionPeriod)).setter(setter(Builder::retentionPeriod))
            .constructor(RetentionPeriod::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetentionPeriod").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Description").getter(getter(CreateRuleResponse::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Tags")
            .getter(getter(CreateRuleResponse::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField RESOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ResourceType").getter(getter(CreateRuleResponse::resourceTypeAsString))
            .setter(setter(Builder::resourceType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceType").build()).build();

    private static final SdkField> RESOURCE_TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ResourceTags")
            .getter(getter(CreateRuleResponse::resourceTags))
            .setter(setter(Builder::resourceTags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceTags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(ResourceTag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
            .getter(getter(CreateRuleResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();

    private static final SdkField LOCK_CONFIGURATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("LockConfiguration")
            .getter(getter(CreateRuleResponse::lockConfiguration)).setter(setter(Builder::lockConfiguration))
            .constructor(LockConfiguration::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LockConfiguration").build()).build();

    private static final SdkField LOCK_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("LockState").getter(getter(CreateRuleResponse::lockStateAsString)).setter(setter(Builder::lockState))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LockState").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IDENTIFIER_FIELD,
            RETENTION_PERIOD_FIELD, DESCRIPTION_FIELD, TAGS_FIELD, RESOURCE_TYPE_FIELD, RESOURCE_TAGS_FIELD, STATUS_FIELD,
            LOCK_CONFIGURATION_FIELD, LOCK_STATE_FIELD));

    private final String identifier;

    private final RetentionPeriod retentionPeriod;

    private final String description;

    private final List tags;

    private final String resourceType;

    private final List resourceTags;

    private final String status;

    private final LockConfiguration lockConfiguration;

    private final String lockState;

    private CreateRuleResponse(BuilderImpl builder) {
        super(builder);
        this.identifier = builder.identifier;
        this.retentionPeriod = builder.retentionPeriod;
        this.description = builder.description;
        this.tags = builder.tags;
        this.resourceType = builder.resourceType;
        this.resourceTags = builder.resourceTags;
        this.status = builder.status;
        this.lockConfiguration = builder.lockConfiguration;
        this.lockState = builder.lockState;
    }

    /**
     * 

* The unique ID of the retention rule. *

* * @return The unique ID of the retention rule. */ public final String identifier() { return identifier; } /** * Returns the value of the RetentionPeriod property for this object. * * @return The value of the RetentionPeriod property for this object. */ public final RetentionPeriod retentionPeriod() { return retentionPeriod; } /** *

* The retention rule description. *

* * @return The retention rule description. */ public final String description() { return description; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

* Information about the tags assigned to the retention 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 #hasTags} method. *

* * @return Information about the tags assigned to the retention rule. */ public final List tags() { return tags; } /** *

* The resource type retained by the retention rule. *

*

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

* * @return The resource type retained by the retention rule. * @see ResourceType */ public final ResourceType resourceType() { return ResourceType.fromValue(resourceType); } /** *

* The resource type retained by the retention rule. *

*

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

* * @return The resource type retained by the retention rule. * @see ResourceType */ public final String resourceTypeAsString() { return resourceType; } /** * For responses, this returns true if the service returned a value for the ResourceTags 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 hasResourceTags() { return resourceTags != null && !(resourceTags instanceof SdkAutoConstructList); } /** *

* Information about the resource tags used to identify resources that are retained by the retention 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 #hasResourceTags} method. *

* * @return Information about the resource tags used to identify resources that are retained by the retention rule. */ public final List resourceTags() { return resourceTags; } /** *

* The state of the retention rule. Only retention rules that are in the available state retain * resources. *

*

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

* * @return The state of the retention rule. Only retention rules that are in the available state retain * resources. * @see RuleStatus */ public final RuleStatus status() { return RuleStatus.fromValue(status); } /** *

* The state of the retention rule. Only retention rules that are in the available state retain * resources. *

*

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

* * @return The state of the retention rule. Only retention rules that are in the available state retain * resources. * @see RuleStatus */ public final String statusAsString() { return status; } /** *

* Information about the retention rule lock configuration. *

* * @return Information about the retention rule lock configuration. */ public final LockConfiguration lockConfiguration() { return lockConfiguration; } /** *

* The lock state for the retention rule. *

*
    *
  • *

    * locked - The retention rule is locked and can't be modified or deleted. *

    *
  • *
  • *

    * pending_unlock - The retention rule has been unlocked but it is still within the unlock delay * period. The retention rule can be modified or deleted only after the unlock delay period has expired. *

    *
  • *
  • *

    * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with the * required permissions. *

    *
  • *
  • *

    * null - The retention rule has never been locked. Once a retention rule has been locked, it can * transition between the locked and unlocked states only; it can never transition back to * null. *

    *
  • *
*

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

* * @return The lock state for the retention rule.

*
    *
  • *

    * locked - The retention rule is locked and can't be modified or deleted. *

    *
  • *
  • *

    * pending_unlock - The retention rule has been unlocked but it is still within the unlock * delay period. The retention rule can be modified or deleted only after the unlock delay period has * expired. *

    *
  • *
  • *

    * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with * the required permissions. *

    *
  • *
  • *

    * null - The retention rule has never been locked. Once a retention rule has been locked, it * can transition between the locked and unlocked states only; it can never * transition back to null. *

    *
  • * @see LockState */ public final LockState lockState() { return LockState.fromValue(lockState); } /** *

    * The lock state for the retention rule. *

    *
      *
    • *

      * locked - The retention rule is locked and can't be modified or deleted. *

      *
    • *
    • *

      * pending_unlock - The retention rule has been unlocked but it is still within the unlock delay * period. The retention rule can be modified or deleted only after the unlock delay period has expired. *

      *
    • *
    • *

      * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with the * required permissions. *

      *
    • *
    • *

      * null - The retention rule has never been locked. Once a retention rule has been locked, it can * transition between the locked and unlocked states only; it can never transition back to * null. *

      *
    • *
    *

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

    * * @return The lock state for the retention rule.

    *
      *
    • *

      * locked - The retention rule is locked and can't be modified or deleted. *

      *
    • *
    • *

      * pending_unlock - The retention rule has been unlocked but it is still within the unlock * delay period. The retention rule can be modified or deleted only after the unlock delay period has * expired. *

      *
    • *
    • *

      * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with * the required permissions. *

      *
    • *
    • *

      * null - The retention rule has never been locked. Once a retention rule has been locked, it * can transition between the locked and unlocked states only; it can never * transition back to null. *

      *
    • * @see LockState */ public final String lockStateAsString() { return lockState; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(identifier()); hashCode = 31 * hashCode + Objects.hashCode(retentionPeriod()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(resourceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasResourceTags() ? resourceTags() : null); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(lockConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(lockStateAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateRuleResponse)) { return false; } CreateRuleResponse other = (CreateRuleResponse) obj; return Objects.equals(identifier(), other.identifier()) && Objects.equals(retentionPeriod(), other.retentionPeriod()) && Objects.equals(description(), other.description()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(resourceTypeAsString(), other.resourceTypeAsString()) && hasResourceTags() == other.hasResourceTags() && Objects.equals(resourceTags(), other.resourceTags()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(lockConfiguration(), other.lockConfiguration()) && Objects.equals(lockStateAsString(), other.lockStateAsString()); } /** * 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("CreateRuleResponse").add("Identifier", identifier()).add("RetentionPeriod", retentionPeriod()) .add("Description", description()).add("Tags", hasTags() ? tags() : null) .add("ResourceType", resourceTypeAsString()).add("ResourceTags", hasResourceTags() ? resourceTags() : null) .add("Status", statusAsString()).add("LockConfiguration", lockConfiguration()) .add("LockState", lockStateAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Identifier": return Optional.ofNullable(clazz.cast(identifier())); case "RetentionPeriod": return Optional.ofNullable(clazz.cast(retentionPeriod())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "ResourceType": return Optional.ofNullable(clazz.cast(resourceTypeAsString())); case "ResourceTags": return Optional.ofNullable(clazz.cast(resourceTags())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "LockConfiguration": return Optional.ofNullable(clazz.cast(lockConfiguration())); case "LockState": return Optional.ofNullable(clazz.cast(lockStateAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateRuleResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RbinResponse.Builder, SdkPojo, CopyableBuilder { /** *

      * The unique ID of the retention rule. *

      * * @param identifier * The unique ID of the retention rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identifier(String identifier); /** * Sets the value of the RetentionPeriod property for this object. * * @param retentionPeriod * The new value for the RetentionPeriod property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retentionPeriod(RetentionPeriod retentionPeriod); /** * Sets the value of the RetentionPeriod property for this object. * * This is a convenience method that creates an instance of the {@link RetentionPeriod.Builder} avoiding the * need to create one manually via {@link RetentionPeriod#builder()}. * *

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

      * The retention rule description. *

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

      * Information about the tags assigned to the retention rule. *

      * * @param tags * Information about the tags assigned to the retention rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

      * Information about the tags assigned to the retention rule. *

      * * @param tags * Information about the tags assigned to the retention rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

      * Information about the tags assigned to the retention rule. *

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

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

      * The resource type retained by the retention rule. *

      * * @param resourceType * The resource type retained by the retention rule. * @see ResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ Builder resourceType(String resourceType); /** *

      * The resource type retained by the retention rule. *

      * * @param resourceType * The resource type retained by the retention rule. * @see ResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ Builder resourceType(ResourceType resourceType); /** *

      * Information about the resource tags used to identify resources that are retained by the retention rule. *

      * * @param resourceTags * Information about the resource tags used to identify resources that are retained by the retention * rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceTags(Collection resourceTags); /** *

      * Information about the resource tags used to identify resources that are retained by the retention rule. *

      * * @param resourceTags * Information about the resource tags used to identify resources that are retained by the retention * rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceTags(ResourceTag... resourceTags); /** *

      * Information about the resource tags used to identify resources that are retained by the retention rule. *

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

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

      * The state of the retention rule. Only retention rules that are in the available state retain * resources. *

      * * @param status * The state of the retention rule. Only retention rules that are in the available state * retain resources. * @see RuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RuleStatus */ Builder status(String status); /** *

      * The state of the retention rule. Only retention rules that are in the available state retain * resources. *

      * * @param status * The state of the retention rule. Only retention rules that are in the available state * retain resources. * @see RuleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RuleStatus */ Builder status(RuleStatus status); /** *

      * Information about the retention rule lock configuration. *

      * * @param lockConfiguration * Information about the retention rule lock configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lockConfiguration(LockConfiguration lockConfiguration); /** *

      * Information about the retention rule lock configuration. *

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

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

      * The lock state for the retention rule. *

      *
        *
      • *

        * locked - The retention rule is locked and can't be modified or deleted. *

        *
      • *
      • *

        * pending_unlock - The retention rule has been unlocked but it is still within the unlock delay * period. The retention rule can be modified or deleted only after the unlock delay period has expired. *

        *
      • *
      • *

        * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with the * required permissions. *

        *
      • *
      • *

        * null - The retention rule has never been locked. Once a retention rule has been locked, it can * transition between the locked and unlocked states only; it can never transition * back to null. *

        *
      • *
      * * @param lockState * The lock state for the retention rule.

      *
        *
      • *

        * locked - The retention rule is locked and can't be modified or deleted. *

        *
      • *
      • *

        * pending_unlock - The retention rule has been unlocked but it is still within the unlock * delay period. The retention rule can be modified or deleted only after the unlock delay period has * expired. *

        *
      • *
      • *

        * unlocked - The retention rule is unlocked and it can be modified or deleted by any user * with the required permissions. *

        *
      • *
      • *

        * null - The retention rule has never been locked. Once a retention rule has been locked, * it can transition between the locked and unlocked states only; it can never * transition back to null. *

        *
      • * @see LockState * @return Returns a reference to this object so that method calls can be chained together. * @see LockState */ Builder lockState(String lockState); /** *

        * The lock state for the retention rule. *

        *
          *
        • *

          * locked - The retention rule is locked and can't be modified or deleted. *

          *
        • *
        • *

          * pending_unlock - The retention rule has been unlocked but it is still within the unlock delay * period. The retention rule can be modified or deleted only after the unlock delay period has expired. *

          *
        • *
        • *

          * unlocked - The retention rule is unlocked and it can be modified or deleted by any user with the * required permissions. *

          *
        • *
        • *

          * null - The retention rule has never been locked. Once a retention rule has been locked, it can * transition between the locked and unlocked states only; it can never transition * back to null. *

          *
        • *
        * * @param lockState * The lock state for the retention rule.

        *
          *
        • *

          * locked - The retention rule is locked and can't be modified or deleted. *

          *
        • *
        • *

          * pending_unlock - The retention rule has been unlocked but it is still within the unlock * delay period. The retention rule can be modified or deleted only after the unlock delay period has * expired. *

          *
        • *
        • *

          * unlocked - The retention rule is unlocked and it can be modified or deleted by any user * with the required permissions. *

          *
        • *
        • *

          * null - The retention rule has never been locked. Once a retention rule has been locked, * it can transition between the locked and unlocked states only; it can never * transition back to null. *

          *
        • * @see LockState * @return Returns a reference to this object so that method calls can be chained together. * @see LockState */ Builder lockState(LockState lockState); } static final class BuilderImpl extends RbinResponse.BuilderImpl implements Builder { private String identifier; private RetentionPeriod retentionPeriod; private String description; private List tags = DefaultSdkAutoConstructList.getInstance(); private String resourceType; private List resourceTags = DefaultSdkAutoConstructList.getInstance(); private String status; private LockConfiguration lockConfiguration; private String lockState; private BuilderImpl() { } private BuilderImpl(CreateRuleResponse model) { super(model); identifier(model.identifier); retentionPeriod(model.retentionPeriod); description(model.description); tags(model.tags); resourceType(model.resourceType); resourceTags(model.resourceTags); status(model.status); lockConfiguration(model.lockConfiguration); lockState(model.lockState); } public final String getIdentifier() { return identifier; } public final void setIdentifier(String identifier) { this.identifier = identifier; } @Override public final Builder identifier(String identifier) { this.identifier = identifier; return this; } public final RetentionPeriod.Builder getRetentionPeriod() { return retentionPeriod != null ? retentionPeriod.toBuilder() : null; } public final void setRetentionPeriod(RetentionPeriod.BuilderImpl retentionPeriod) { this.retentionPeriod = retentionPeriod != null ? retentionPeriod.build() : null; } @Override public final Builder retentionPeriod(RetentionPeriod retentionPeriod) { this.retentionPeriod = retentionPeriod; 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 List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getResourceType() { return resourceType; } public final void setResourceType(String resourceType) { this.resourceType = resourceType; } @Override public final Builder resourceType(String resourceType) { this.resourceType = resourceType; return this; } @Override public final Builder resourceType(ResourceType resourceType) { this.resourceType(resourceType == null ? null : resourceType.toString()); return this; } public final List getResourceTags() { List result = ResourceTagsCopier.copyToBuilder(this.resourceTags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setResourceTags(Collection resourceTags) { this.resourceTags = ResourceTagsCopier.copyFromBuilder(resourceTags); } @Override public final Builder resourceTags(Collection resourceTags) { this.resourceTags = ResourceTagsCopier.copy(resourceTags); return this; } @Override @SafeVarargs public final Builder resourceTags(ResourceTag... resourceTags) { resourceTags(Arrays.asList(resourceTags)); return this; } @Override @SafeVarargs public final Builder resourceTags(Consumer... resourceTags) { resourceTags(Stream.of(resourceTags).map(c -> ResourceTag.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(RuleStatus status) { this.status(status == null ? null : status.toString()); return this; } public final LockConfiguration.Builder getLockConfiguration() { return lockConfiguration != null ? lockConfiguration.toBuilder() : null; } public final void setLockConfiguration(LockConfiguration.BuilderImpl lockConfiguration) { this.lockConfiguration = lockConfiguration != null ? lockConfiguration.build() : null; } @Override public final Builder lockConfiguration(LockConfiguration lockConfiguration) { this.lockConfiguration = lockConfiguration; return this; } public final String getLockState() { return lockState; } public final void setLockState(String lockState) { this.lockState = lockState; } @Override public final Builder lockState(String lockState) { this.lockState = lockState; return this; } @Override public final Builder lockState(LockState lockState) { this.lockState(lockState == null ? null : lockState.toString()); return this; } @Override public CreateRuleResponse build() { return new CreateRuleResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy