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

software.amazon.awssdk.services.opensearch.model.ChangeProgressDetails Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Open Search module holds the client classes that are used for communicating with Open Search.

The 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.opensearch.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Container for information about a configuration change happening on a domain. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ChangeProgressDetails implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CHANGE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ChangeId").getter(getter(ChangeProgressDetails::changeId)).setter(setter(Builder::changeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeId").build()).build(); private static final SdkField MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Message") .getter(getter(ChangeProgressDetails::message)).setter(setter(Builder::message)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Message").build()).build(); private static final SdkField CONFIG_CHANGE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ConfigChangeStatus").getter(getter(ChangeProgressDetails::configChangeStatusAsString)) .setter(setter(Builder::configChangeStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigChangeStatus").build()) .build(); private static final SdkField INITIATED_BY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("InitiatedBy").getter(getter(ChangeProgressDetails::initiatedByAsString)) .setter(setter(Builder::initiatedBy)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InitiatedBy").build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(ChangeProgressDetails::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField LAST_UPDATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastUpdatedTime").getter(getter(ChangeProgressDetails::lastUpdatedTime)) .setter(setter(Builder::lastUpdatedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdatedTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CHANGE_ID_FIELD, MESSAGE_FIELD, CONFIG_CHANGE_STATUS_FIELD, INITIATED_BY_FIELD, START_TIME_FIELD, LAST_UPDATED_TIME_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String changeId; private final String message; private final String configChangeStatus; private final String initiatedBy; private final Instant startTime; private final Instant lastUpdatedTime; private ChangeProgressDetails(BuilderImpl builder) { this.changeId = builder.changeId; this.message = builder.message; this.configChangeStatus = builder.configChangeStatus; this.initiatedBy = builder.initiatedBy; this.startTime = builder.startTime; this.lastUpdatedTime = builder.lastUpdatedTime; } /** *

* The ID of the configuration change. *

* * @return The ID of the configuration change. */ public final String changeId() { return changeId; } /** *

* A message corresponding to the status of the configuration change. *

* * @return A message corresponding to the status of the configuration change. */ public final String message() { return message; } /** *

* The current status of the configuration change. *

*

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

* * @return The current status of the configuration change. * @see ConfigChangeStatus */ public final ConfigChangeStatus configChangeStatus() { return ConfigChangeStatus.fromValue(configChangeStatus); } /** *

* The current status of the configuration change. *

*

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

* * @return The current status of the configuration change. * @see ConfigChangeStatus */ public final String configChangeStatusAsString() { return configChangeStatus; } /** *

* The IAM principal who initiated the configuration change. *

*

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

* * @return The IAM principal who initiated the configuration change. * @see InitiatedBy */ public final InitiatedBy initiatedBy() { return InitiatedBy.fromValue(initiatedBy); } /** *

* The IAM principal who initiated the configuration change. *

*

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

* * @return The IAM principal who initiated the configuration change. * @see InitiatedBy */ public final String initiatedByAsString() { return initiatedBy; } /** *

* The time that the configuration change was initiated, in Universal Coordinated Time (UTC). *

* * @return The time that the configuration change was initiated, in Universal Coordinated Time (UTC). */ public final Instant startTime() { return startTime; } /** *

* The last time that the configuration change was updated. *

* * @return The last time that the configuration change was updated. */ public final Instant lastUpdatedTime() { return lastUpdatedTime; } @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(message()); hashCode = 31 * hashCode + Objects.hashCode(configChangeStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(initiatedByAsString()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedTime()); 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 ChangeProgressDetails)) { return false; } ChangeProgressDetails other = (ChangeProgressDetails) obj; return Objects.equals(changeId(), other.changeId()) && Objects.equals(message(), other.message()) && Objects.equals(configChangeStatusAsString(), other.configChangeStatusAsString()) && Objects.equals(initiatedByAsString(), other.initiatedByAsString()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(lastUpdatedTime(), other.lastUpdatedTime()); } /** * 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("ChangeProgressDetails").add("ChangeId", changeId()).add("Message", message()) .add("ConfigChangeStatus", configChangeStatusAsString()).add("InitiatedBy", initiatedByAsString()) .add("StartTime", startTime()).add("LastUpdatedTime", lastUpdatedTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ChangeId": return Optional.ofNullable(clazz.cast(changeId())); case "Message": return Optional.ofNullable(clazz.cast(message())); case "ConfigChangeStatus": return Optional.ofNullable(clazz.cast(configChangeStatusAsString())); case "InitiatedBy": return Optional.ofNullable(clazz.cast(initiatedByAsString())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "LastUpdatedTime": return Optional.ofNullable(clazz.cast(lastUpdatedTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("ChangeId", CHANGE_ID_FIELD); map.put("Message", MESSAGE_FIELD); map.put("ConfigChangeStatus", CONFIG_CHANGE_STATUS_FIELD); map.put("InitiatedBy", INITIATED_BY_FIELD); map.put("StartTime", START_TIME_FIELD); map.put("LastUpdatedTime", LAST_UPDATED_TIME_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((ChangeProgressDetails) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the configuration change. *

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

* A message corresponding to the status of the configuration change. *

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

* The current status of the configuration change. *

* * @param configChangeStatus * The current status of the configuration change. * @see ConfigChangeStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigChangeStatus */ Builder configChangeStatus(String configChangeStatus); /** *

* The current status of the configuration change. *

* * @param configChangeStatus * The current status of the configuration change. * @see ConfigChangeStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ConfigChangeStatus */ Builder configChangeStatus(ConfigChangeStatus configChangeStatus); /** *

* The IAM principal who initiated the configuration change. *

* * @param initiatedBy * The IAM principal who initiated the configuration change. * @see InitiatedBy * @return Returns a reference to this object so that method calls can be chained together. * @see InitiatedBy */ Builder initiatedBy(String initiatedBy); /** *

* The IAM principal who initiated the configuration change. *

* * @param initiatedBy * The IAM principal who initiated the configuration change. * @see InitiatedBy * @return Returns a reference to this object so that method calls can be chained together. * @see InitiatedBy */ Builder initiatedBy(InitiatedBy initiatedBy); /** *

* The time that the configuration change was initiated, in Universal Coordinated Time (UTC). *

* * @param startTime * The time that the configuration change was initiated, in Universal Coordinated Time (UTC). * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The last time that the configuration change was updated. *

* * @param lastUpdatedTime * The last time that the configuration change was updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedTime(Instant lastUpdatedTime); } static final class BuilderImpl implements Builder { private String changeId; private String message; private String configChangeStatus; private String initiatedBy; private Instant startTime; private Instant lastUpdatedTime; private BuilderImpl() { } private BuilderImpl(ChangeProgressDetails model) { changeId(model.changeId); message(model.message); configChangeStatus(model.configChangeStatus); initiatedBy(model.initiatedBy); startTime(model.startTime); lastUpdatedTime(model.lastUpdatedTime); } 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 String getMessage() { return message; } public final void setMessage(String message) { this.message = message; } @Override public final Builder message(String message) { this.message = message; return this; } public final String getConfigChangeStatus() { return configChangeStatus; } public final void setConfigChangeStatus(String configChangeStatus) { this.configChangeStatus = configChangeStatus; } @Override public final Builder configChangeStatus(String configChangeStatus) { this.configChangeStatus = configChangeStatus; return this; } @Override public final Builder configChangeStatus(ConfigChangeStatus configChangeStatus) { this.configChangeStatus(configChangeStatus == null ? null : configChangeStatus.toString()); return this; } public final String getInitiatedBy() { return initiatedBy; } public final void setInitiatedBy(String initiatedBy) { this.initiatedBy = initiatedBy; } @Override public final Builder initiatedBy(String initiatedBy) { this.initiatedBy = initiatedBy; return this; } @Override public final Builder initiatedBy(InitiatedBy initiatedBy) { this.initiatedBy(initiatedBy == null ? null : initiatedBy.toString()); 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 Instant getLastUpdatedTime() { return lastUpdatedTime; } public final void setLastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; } @Override public final Builder lastUpdatedTime(Instant lastUpdatedTime) { this.lastUpdatedTime = lastUpdatedTime; return this; } @Override public ChangeProgressDetails build() { return new ChangeProgressDetails(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy