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

software.amazon.awssdk.services.elasticsearch.model.ChangeProgressStatusDetails Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Elasticsearch Service module holds the client classes that are used for communicating with Amazon Elasticsearch 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.elasticsearch.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.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;

/**
 * 

* The progress details of a specific domain configuration change. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ChangeProgressStatusDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CHANGE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ChangeId").getter(getter(ChangeProgressStatusDetails::changeId)).setter(setter(Builder::changeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeId").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(ChangeProgressStatusDetails::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ChangeProgressStatusDetails::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField> PENDING_PROPERTIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("PendingProperties") .getter(getter(ChangeProgressStatusDetails::pendingProperties)) .setter(setter(Builder::pendingProperties)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PendingProperties").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> COMPLETED_PROPERTIES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("CompletedProperties") .getter(getter(ChangeProgressStatusDetails::completedProperties)) .setter(setter(Builder::completedProperties)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletedProperties").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 TOTAL_NUMBER_OF_STAGES_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("TotalNumberOfStages").getter(getter(ChangeProgressStatusDetails::totalNumberOfStages)) .setter(setter(Builder::totalNumberOfStages)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TotalNumberOfStages").build()) .build(); private static final SdkField> CHANGE_PROGRESS_STAGES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ChangeProgressStages") .getter(getter(ChangeProgressStatusDetails::changeProgressStages)) .setter(setter(Builder::changeProgressStages)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeProgressStages").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ChangeProgressStage::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CHANGE_ID_FIELD, START_TIME_FIELD, STATUS_FIELD, PENDING_PROPERTIES_FIELD, COMPLETED_PROPERTIES_FIELD, TOTAL_NUMBER_OF_STAGES_FIELD, CHANGE_PROGRESS_STAGES_FIELD)); private static final long serialVersionUID = 1L; private final String changeId; private final Instant startTime; private final String status; private final List pendingProperties; private final List completedProperties; private final Integer totalNumberOfStages; private final List changeProgressStages; private ChangeProgressStatusDetails(BuilderImpl builder) { this.changeId = builder.changeId; this.startTime = builder.startTime; this.status = builder.status; this.pendingProperties = builder.pendingProperties; this.completedProperties = builder.completedProperties; this.totalNumberOfStages = builder.totalNumberOfStages; this.changeProgressStages = builder.changeProgressStages; } /** *

* The unique change identifier associated with a specific domain configuration change. *

* * @return The unique change identifier associated with a specific domain configuration change. */ public final String changeId() { return changeId; } /** *

* The time at which the configuration change is made on the domain. *

* * @return The time at which the configuration change is made on the domain. */ public final Instant startTime() { return startTime; } /** *

* The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED *

*

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

* * @return The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED * @see OverallChangeStatus */ public final OverallChangeStatus status() { return OverallChangeStatus.fromValue(status); } /** *

* The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED *

*

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

* * @return The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED * @see OverallChangeStatus */ public final String statusAsString() { return status; } /** * For responses, this returns true if the service returned a value for the PendingProperties 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 hasPendingProperties() { return pendingProperties != null && !(pendingProperties instanceof SdkAutoConstructList); } /** *

* The list of properties involved in the domain configuration change that are still in pending. *

*

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

* * @return The list of properties involved in the domain configuration change that are still in pending. */ public final List pendingProperties() { return pendingProperties; } /** * For responses, this returns true if the service returned a value for the CompletedProperties 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 hasCompletedProperties() { return completedProperties != null && !(completedProperties instanceof SdkAutoConstructList); } /** *

* The list of properties involved in the domain configuration change that are completed. *

*

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

* * @return The list of properties involved in the domain configuration change that are completed. */ public final List completedProperties() { return completedProperties; } /** *

* The total number of stages required for the configuration change. *

* * @return The total number of stages required for the configuration change. */ public final Integer totalNumberOfStages() { return totalNumberOfStages; } /** * For responses, this returns true if the service returned a value for the ChangeProgressStages 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 hasChangeProgressStages() { return changeProgressStages != null && !(changeProgressStages instanceof SdkAutoConstructList); } /** *

* The specific stages that the domain is going through to perform the configuration change. *

*

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

* * @return The specific stages that the domain is going through to perform the configuration change. */ public final List changeProgressStages() { return changeProgressStages; } @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(changeId()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasPendingProperties() ? pendingProperties() : null); hashCode = 31 * hashCode + Objects.hashCode(hasCompletedProperties() ? completedProperties() : null); hashCode = 31 * hashCode + Objects.hashCode(totalNumberOfStages()); hashCode = 31 * hashCode + Objects.hashCode(hasChangeProgressStages() ? changeProgressStages() : null); 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 ChangeProgressStatusDetails)) { return false; } ChangeProgressStatusDetails other = (ChangeProgressStatusDetails) obj; return Objects.equals(changeId(), other.changeId()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(statusAsString(), other.statusAsString()) && hasPendingProperties() == other.hasPendingProperties() && Objects.equals(pendingProperties(), other.pendingProperties()) && hasCompletedProperties() == other.hasCompletedProperties() && Objects.equals(completedProperties(), other.completedProperties()) && Objects.equals(totalNumberOfStages(), other.totalNumberOfStages()) && hasChangeProgressStages() == other.hasChangeProgressStages() && Objects.equals(changeProgressStages(), other.changeProgressStages()); } /** * 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("ChangeProgressStatusDetails").add("ChangeId", changeId()).add("StartTime", startTime()) .add("Status", statusAsString()).add("PendingProperties", hasPendingProperties() ? pendingProperties() : null) .add("CompletedProperties", hasCompletedProperties() ? completedProperties() : null) .add("TotalNumberOfStages", totalNumberOfStages()) .add("ChangeProgressStages", hasChangeProgressStages() ? changeProgressStages() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ChangeId": return Optional.ofNullable(clazz.cast(changeId())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "PendingProperties": return Optional.ofNullable(clazz.cast(pendingProperties())); case "CompletedProperties": return Optional.ofNullable(clazz.cast(completedProperties())); case "TotalNumberOfStages": return Optional.ofNullable(clazz.cast(totalNumberOfStages())); case "ChangeProgressStages": return Optional.ofNullable(clazz.cast(changeProgressStages())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ChangeProgressStatusDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The unique change identifier associated with a specific domain configuration change. *

* * @param changeId * The unique change identifier associated with a specific domain configuration change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder changeId(String changeId); /** *

* The time at which the configuration change is made on the domain. *

* * @param startTime * The time at which the configuration change is made on the domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED *

* * @param status * The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED * @see OverallChangeStatus * @return Returns a reference to this object so that method calls can be chained together. * @see OverallChangeStatus */ Builder status(String status); /** *

* The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED *

* * @param status * The overall status of the domain configuration change. This field can take the following values: * PENDING, PROCESSING, COMPLETED and FAILED * @see OverallChangeStatus * @return Returns a reference to this object so that method calls can be chained together. * @see OverallChangeStatus */ Builder status(OverallChangeStatus status); /** *

* The list of properties involved in the domain configuration change that are still in pending. *

* * @param pendingProperties * The list of properties involved in the domain configuration change that are still in pending. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pendingProperties(Collection pendingProperties); /** *

* The list of properties involved in the domain configuration change that are still in pending. *

* * @param pendingProperties * The list of properties involved in the domain configuration change that are still in pending. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pendingProperties(String... pendingProperties); /** *

* The list of properties involved in the domain configuration change that are completed. *

* * @param completedProperties * The list of properties involved in the domain configuration change that are completed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder completedProperties(Collection completedProperties); /** *

* The list of properties involved in the domain configuration change that are completed. *

* * @param completedProperties * The list of properties involved in the domain configuration change that are completed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder completedProperties(String... completedProperties); /** *

* The total number of stages required for the configuration change. *

* * @param totalNumberOfStages * The total number of stages required for the configuration change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder totalNumberOfStages(Integer totalNumberOfStages); /** *

* The specific stages that the domain is going through to perform the configuration change. *

* * @param changeProgressStages * The specific stages that the domain is going through to perform the configuration change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder changeProgressStages(Collection changeProgressStages); /** *

* The specific stages that the domain is going through to perform the configuration change. *

* * @param changeProgressStages * The specific stages that the domain is going through to perform the configuration change. * @return Returns a reference to this object so that method calls can be chained together. */ Builder changeProgressStages(ChangeProgressStage... changeProgressStages); /** *

* The specific stages that the domain is going through to perform the configuration change. *

* This is a convenience method that creates an instance of the {@link List.Builder} * avoiding the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately * and its result is passed to {@link #changeProgressStages(List)}. * * @param changeProgressStages * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #changeProgressStages(List) */ Builder changeProgressStages(Consumer... changeProgressStages); } static final class BuilderImpl implements Builder { private String changeId; private Instant startTime; private String status; private List pendingProperties = DefaultSdkAutoConstructList.getInstance(); private List completedProperties = DefaultSdkAutoConstructList.getInstance(); private Integer totalNumberOfStages; private List changeProgressStages = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(ChangeProgressStatusDetails model) { changeId(model.changeId); startTime(model.startTime); status(model.status); pendingProperties(model.pendingProperties); completedProperties(model.completedProperties); totalNumberOfStages(model.totalNumberOfStages); changeProgressStages(model.changeProgressStages); } public final String getChangeId() { return changeId; } public final void setChangeId(String changeId) { this.changeId = changeId; } @Override public final Builder changeId(String changeId) { this.changeId = changeId; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; 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(OverallChangeStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Collection getPendingProperties() { if (pendingProperties instanceof SdkAutoConstructList) { return null; } return pendingProperties; } public final void setPendingProperties(Collection pendingProperties) { this.pendingProperties = StringListCopier.copy(pendingProperties); } @Override public final Builder pendingProperties(Collection pendingProperties) { this.pendingProperties = StringListCopier.copy(pendingProperties); return this; } @Override @SafeVarargs public final Builder pendingProperties(String... pendingProperties) { pendingProperties(Arrays.asList(pendingProperties)); return this; } public final Collection getCompletedProperties() { if (completedProperties instanceof SdkAutoConstructList) { return null; } return completedProperties; } public final void setCompletedProperties(Collection completedProperties) { this.completedProperties = StringListCopier.copy(completedProperties); } @Override public final Builder completedProperties(Collection completedProperties) { this.completedProperties = StringListCopier.copy(completedProperties); return this; } @Override @SafeVarargs public final Builder completedProperties(String... completedProperties) { completedProperties(Arrays.asList(completedProperties)); return this; } public final Integer getTotalNumberOfStages() { return totalNumberOfStages; } public final void setTotalNumberOfStages(Integer totalNumberOfStages) { this.totalNumberOfStages = totalNumberOfStages; } @Override public final Builder totalNumberOfStages(Integer totalNumberOfStages) { this.totalNumberOfStages = totalNumberOfStages; return this; } public final List getChangeProgressStages() { List result = ChangeProgressStageListCopier.copyToBuilder(this.changeProgressStages); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setChangeProgressStages(Collection changeProgressStages) { this.changeProgressStages = ChangeProgressStageListCopier.copyFromBuilder(changeProgressStages); } @Override public final Builder changeProgressStages(Collection changeProgressStages) { this.changeProgressStages = ChangeProgressStageListCopier.copy(changeProgressStages); return this; } @Override @SafeVarargs public final Builder changeProgressStages(ChangeProgressStage... changeProgressStages) { changeProgressStages(Arrays.asList(changeProgressStages)); return this; } @Override @SafeVarargs public final Builder changeProgressStages(Consumer... changeProgressStages) { changeProgressStages(Stream.of(changeProgressStages).map(c -> ChangeProgressStage.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } @Override public ChangeProgressStatusDetails build() { return new ChangeProgressStatusDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy