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

software.amazon.awssdk.services.elasticache.model.DeleteUserGroupResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon ElastiCache module holds the client classes that are used for communicating with Amazon ElastiCache Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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.elasticache.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 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 DeleteUserGroupResponse extends ElastiCacheResponse implements
        ToCopyableBuilder {
    private static final SdkField USER_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("UserGroupId").getter(getter(DeleteUserGroupResponse::userGroupId)).setter(setter(Builder::userGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserGroupId").build()).build();

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

    private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
            .getter(getter(DeleteUserGroupResponse::engine)).setter(setter(Builder::engine))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();

    private static final SdkField> USER_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("UserIds")
            .getter(getter(DeleteUserGroupResponse::userIds))
            .setter(setter(Builder::userIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserIds").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField MINIMUM_ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("MinimumEngineVersion").getter(getter(DeleteUserGroupResponse::minimumEngineVersion))
            .setter(setter(Builder::minimumEngineVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MinimumEngineVersion").build())
            .build();

    private static final SdkField PENDING_CHANGES_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("PendingChanges")
            .getter(getter(DeleteUserGroupResponse::pendingChanges)).setter(setter(Builder::pendingChanges))
            .constructor(UserGroupPendingChanges::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PendingChanges").build()).build();

    private static final SdkField> REPLICATION_GROUPS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ReplicationGroups")
            .getter(getter(DeleteUserGroupResponse::replicationGroups))
            .setter(setter(Builder::replicationGroups))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationGroups").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> SERVERLESS_CACHES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("ServerlessCaches")
            .getter(getter(DeleteUserGroupResponse::serverlessCaches))
            .setter(setter(Builder::serverlessCaches))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerlessCaches").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("ARN")
            .getter(getter(DeleteUserGroupResponse::arn)).setter(setter(Builder::arn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ARN").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(USER_GROUP_ID_FIELD,
            STATUS_FIELD, ENGINE_FIELD, USER_IDS_FIELD, MINIMUM_ENGINE_VERSION_FIELD, PENDING_CHANGES_FIELD,
            REPLICATION_GROUPS_FIELD, SERVERLESS_CACHES_FIELD, ARN_FIELD));

    private final String userGroupId;

    private final String status;

    private final String engine;

    private final List userIds;

    private final String minimumEngineVersion;

    private final UserGroupPendingChanges pendingChanges;

    private final List replicationGroups;

    private final List serverlessCaches;

    private final String arn;

    private DeleteUserGroupResponse(BuilderImpl builder) {
        super(builder);
        this.userGroupId = builder.userGroupId;
        this.status = builder.status;
        this.engine = builder.engine;
        this.userIds = builder.userIds;
        this.minimumEngineVersion = builder.minimumEngineVersion;
        this.pendingChanges = builder.pendingChanges;
        this.replicationGroups = builder.replicationGroups;
        this.serverlessCaches = builder.serverlessCaches;
        this.arn = builder.arn;
    }

    /**
     * 

* The ID of the user group. *

* * @return The ID of the user group. */ public final String userGroupId() { return userGroupId; } /** *

* Indicates user group status. Can be "creating", "active", "modifying", "deleting". *

* * @return Indicates user group status. Can be "creating", "active", "modifying", "deleting". */ public final String status() { return status; } /** *

* The current supported value is Redis. *

* * @return The current supported value is Redis. */ public final String engine() { return engine; } /** * For responses, this returns true if the service returned a value for the UserIds 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 hasUserIds() { return userIds != null && !(userIds instanceof SdkAutoConstructList); } /** *

* The list of user IDs that belong to the user group. *

*

* 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 #hasUserIds} method. *

* * @return The list of user IDs that belong to the user group. */ public final List userIds() { return userIds; } /** *

* The minimum engine version required, which is Redis 6.0 *

* * @return The minimum engine version required, which is Redis 6.0 */ public final String minimumEngineVersion() { return minimumEngineVersion; } /** *

* A list of updates being applied to the user group. *

* * @return A list of updates being applied to the user group. */ public final UserGroupPendingChanges pendingChanges() { return pendingChanges; } /** * For responses, this returns true if the service returned a value for the ReplicationGroups 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 hasReplicationGroups() { return replicationGroups != null && !(replicationGroups instanceof SdkAutoConstructList); } /** *

* A list of replication groups that the user group can access. *

*

* 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 #hasReplicationGroups} method. *

* * @return A list of replication groups that the user group can access. */ public final List replicationGroups() { return replicationGroups; } /** * For responses, this returns true if the service returned a value for the ServerlessCaches 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 hasServerlessCaches() { return serverlessCaches != null && !(serverlessCaches instanceof SdkAutoConstructList); } /** *

* Indicates which serverless caches the specified user group is associated with. Available for Redis only. *

*

* 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 #hasServerlessCaches} method. *

* * @return Indicates which serverless caches the specified user group is associated with. Available for Redis only. */ public final List serverlessCaches() { return serverlessCaches; } /** *

* The Amazon Resource Name (ARN) of the user group. *

* * @return The Amazon Resource Name (ARN) of the user group. */ public final String arn() { return arn; } @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(userGroupId()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(engine()); hashCode = 31 * hashCode + Objects.hashCode(hasUserIds() ? userIds() : null); hashCode = 31 * hashCode + Objects.hashCode(minimumEngineVersion()); hashCode = 31 * hashCode + Objects.hashCode(pendingChanges()); hashCode = 31 * hashCode + Objects.hashCode(hasReplicationGroups() ? replicationGroups() : null); hashCode = 31 * hashCode + Objects.hashCode(hasServerlessCaches() ? serverlessCaches() : null); hashCode = 31 * hashCode + Objects.hashCode(arn()); 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 DeleteUserGroupResponse)) { return false; } DeleteUserGroupResponse other = (DeleteUserGroupResponse) obj; return Objects.equals(userGroupId(), other.userGroupId()) && Objects.equals(status(), other.status()) && Objects.equals(engine(), other.engine()) && hasUserIds() == other.hasUserIds() && Objects.equals(userIds(), other.userIds()) && Objects.equals(minimumEngineVersion(), other.minimumEngineVersion()) && Objects.equals(pendingChanges(), other.pendingChanges()) && hasReplicationGroups() == other.hasReplicationGroups() && Objects.equals(replicationGroups(), other.replicationGroups()) && hasServerlessCaches() == other.hasServerlessCaches() && Objects.equals(serverlessCaches(), other.serverlessCaches()) && Objects.equals(arn(), other.arn()); } /** * 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("DeleteUserGroupResponse").add("UserGroupId", userGroupId()).add("Status", status()) .add("Engine", engine()).add("UserIds", hasUserIds() ? userIds() : null) .add("MinimumEngineVersion", minimumEngineVersion()).add("PendingChanges", pendingChanges()) .add("ReplicationGroups", hasReplicationGroups() ? replicationGroups() : null) .add("ServerlessCaches", hasServerlessCaches() ? serverlessCaches() : null).add("ARN", arn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "UserGroupId": return Optional.ofNullable(clazz.cast(userGroupId())); case "Status": return Optional.ofNullable(clazz.cast(status())); case "Engine": return Optional.ofNullable(clazz.cast(engine())); case "UserIds": return Optional.ofNullable(clazz.cast(userIds())); case "MinimumEngineVersion": return Optional.ofNullable(clazz.cast(minimumEngineVersion())); case "PendingChanges": return Optional.ofNullable(clazz.cast(pendingChanges())); case "ReplicationGroups": return Optional.ofNullable(clazz.cast(replicationGroups())); case "ServerlessCaches": return Optional.ofNullable(clazz.cast(serverlessCaches())); case "ARN": return Optional.ofNullable(clazz.cast(arn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DeleteUserGroupResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElastiCacheResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The ID of the user group. *

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

* Indicates user group status. Can be "creating", "active", "modifying", "deleting". *

* * @param status * Indicates user group status. Can be "creating", "active", "modifying", "deleting". * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

* The current supported value is Redis. *

* * @param engine * The current supported value is Redis. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

* The list of user IDs that belong to the user group. *

* * @param userIds * The list of user IDs that belong to the user group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userIds(Collection userIds); /** *

* The list of user IDs that belong to the user group. *

* * @param userIds * The list of user IDs that belong to the user group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userIds(String... userIds); /** *

* The minimum engine version required, which is Redis 6.0 *

* * @param minimumEngineVersion * The minimum engine version required, which is Redis 6.0 * @return Returns a reference to this object so that method calls can be chained together. */ Builder minimumEngineVersion(String minimumEngineVersion); /** *

* A list of updates being applied to the user group. *

* * @param pendingChanges * A list of updates being applied to the user group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pendingChanges(UserGroupPendingChanges pendingChanges); /** *

* A list of updates being applied to the user group. *

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

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

* A list of replication groups that the user group can access. *

* * @param replicationGroups * A list of replication groups that the user group can access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationGroups(Collection replicationGroups); /** *

* A list of replication groups that the user group can access. *

* * @param replicationGroups * A list of replication groups that the user group can access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationGroups(String... replicationGroups); /** *

* Indicates which serverless caches the specified user group is associated with. Available for Redis only. *

* * @param serverlessCaches * Indicates which serverless caches the specified user group is associated with. Available for Redis * only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverlessCaches(Collection serverlessCaches); /** *

* Indicates which serverless caches the specified user group is associated with. Available for Redis only. *

* * @param serverlessCaches * Indicates which serverless caches the specified user group is associated with. Available for Redis * only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverlessCaches(String... serverlessCaches); /** *

* The Amazon Resource Name (ARN) of the user group. *

* * @param arn * The Amazon Resource Name (ARN) of the user group. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); } static final class BuilderImpl extends ElastiCacheResponse.BuilderImpl implements Builder { private String userGroupId; private String status; private String engine; private List userIds = DefaultSdkAutoConstructList.getInstance(); private String minimumEngineVersion; private UserGroupPendingChanges pendingChanges; private List replicationGroups = DefaultSdkAutoConstructList.getInstance(); private List serverlessCaches = DefaultSdkAutoConstructList.getInstance(); private String arn; private BuilderImpl() { } private BuilderImpl(DeleteUserGroupResponse model) { super(model); userGroupId(model.userGroupId); status(model.status); engine(model.engine); userIds(model.userIds); minimumEngineVersion(model.minimumEngineVersion); pendingChanges(model.pendingChanges); replicationGroups(model.replicationGroups); serverlessCaches(model.serverlessCaches); arn(model.arn); } public final String getUserGroupId() { return userGroupId; } public final void setUserGroupId(String userGroupId) { this.userGroupId = userGroupId; } @Override public final Builder userGroupId(String userGroupId) { this.userGroupId = userGroupId; 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; } public final String getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override public final Builder engine(String engine) { this.engine = engine; return this; } public final Collection getUserIds() { if (userIds instanceof SdkAutoConstructList) { return null; } return userIds; } public final void setUserIds(Collection userIds) { this.userIds = UserIdListCopier.copy(userIds); } @Override public final Builder userIds(Collection userIds) { this.userIds = UserIdListCopier.copy(userIds); return this; } @Override @SafeVarargs public final Builder userIds(String... userIds) { userIds(Arrays.asList(userIds)); return this; } public final String getMinimumEngineVersion() { return minimumEngineVersion; } public final void setMinimumEngineVersion(String minimumEngineVersion) { this.minimumEngineVersion = minimumEngineVersion; } @Override public final Builder minimumEngineVersion(String minimumEngineVersion) { this.minimumEngineVersion = minimumEngineVersion; return this; } public final UserGroupPendingChanges.Builder getPendingChanges() { return pendingChanges != null ? pendingChanges.toBuilder() : null; } public final void setPendingChanges(UserGroupPendingChanges.BuilderImpl pendingChanges) { this.pendingChanges = pendingChanges != null ? pendingChanges.build() : null; } @Override public final Builder pendingChanges(UserGroupPendingChanges pendingChanges) { this.pendingChanges = pendingChanges; return this; } public final Collection getReplicationGroups() { if (replicationGroups instanceof SdkAutoConstructList) { return null; } return replicationGroups; } public final void setReplicationGroups(Collection replicationGroups) { this.replicationGroups = UGReplicationGroupIdListCopier.copy(replicationGroups); } @Override public final Builder replicationGroups(Collection replicationGroups) { this.replicationGroups = UGReplicationGroupIdListCopier.copy(replicationGroups); return this; } @Override @SafeVarargs public final Builder replicationGroups(String... replicationGroups) { replicationGroups(Arrays.asList(replicationGroups)); return this; } public final Collection getServerlessCaches() { if (serverlessCaches instanceof SdkAutoConstructList) { return null; } return serverlessCaches; } public final void setServerlessCaches(Collection serverlessCaches) { this.serverlessCaches = UGServerlessCacheIdListCopier.copy(serverlessCaches); } @Override public final Builder serverlessCaches(Collection serverlessCaches) { this.serverlessCaches = UGServerlessCacheIdListCopier.copy(serverlessCaches); return this; } @Override @SafeVarargs public final Builder serverlessCaches(String... serverlessCaches) { serverlessCaches(Arrays.asList(serverlessCaches)); return this; } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } @Override public DeleteUserGroupResponse build() { return new DeleteUserGroupResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy