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

software.amazon.awssdk.services.neptune.model.PendingMaintenanceAction Maven / Gradle / Ivy

Go to download

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

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

/**
 * 

* Provides information about a pending maintenance action for a resource. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PendingMaintenanceAction implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACTION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Action") .getter(getter(PendingMaintenanceAction::action)).setter(setter(Builder::action)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Action").build()).build(); private static final SdkField AUTO_APPLIED_AFTER_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("AutoAppliedAfterDate").getter(getter(PendingMaintenanceAction::autoAppliedAfterDate)) .setter(setter(Builder::autoAppliedAfterDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoAppliedAfterDate").build()) .build(); private static final SdkField FORCED_APPLY_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("ForcedApplyDate").getter(getter(PendingMaintenanceAction::forcedApplyDate)) .setter(setter(Builder::forcedApplyDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ForcedApplyDate").build()).build(); private static final SdkField OPT_IN_STATUS_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("OptInStatus").getter(getter(PendingMaintenanceAction::optInStatus)).setter(setter(Builder::optInStatus)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OptInStatus").build()).build(); private static final SdkField CURRENT_APPLY_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("CurrentApplyDate").getter(getter(PendingMaintenanceAction::currentApplyDate)) .setter(setter(Builder::currentApplyDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentApplyDate").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(PendingMaintenanceAction::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_FIELD, AUTO_APPLIED_AFTER_DATE_FIELD, FORCED_APPLY_DATE_FIELD, OPT_IN_STATUS_FIELD, CURRENT_APPLY_DATE_FIELD, DESCRIPTION_FIELD)); private static final Map> SDK_NAME_TO_FIELD = Collections .unmodifiableMap(new HashMap>() { { put("Action", ACTION_FIELD); put("AutoAppliedAfterDate", AUTO_APPLIED_AFTER_DATE_FIELD); put("ForcedApplyDate", FORCED_APPLY_DATE_FIELD); put("OptInStatus", OPT_IN_STATUS_FIELD); put("CurrentApplyDate", CURRENT_APPLY_DATE_FIELD); put("Description", DESCRIPTION_FIELD); } }); private static final long serialVersionUID = 1L; private final String action; private final Instant autoAppliedAfterDate; private final Instant forcedApplyDate; private final String optInStatus; private final Instant currentApplyDate; private final String description; private PendingMaintenanceAction(BuilderImpl builder) { this.action = builder.action; this.autoAppliedAfterDate = builder.autoAppliedAfterDate; this.forcedApplyDate = builder.forcedApplyDate; this.optInStatus = builder.optInStatus; this.currentApplyDate = builder.currentApplyDate; this.description = builder.description; } /** *

* The type of pending maintenance action that is available for the resource. *

* * @return The type of pending maintenance action that is available for the resource. */ public final String action() { return action; } /** *

* The date of the maintenance window when the action is applied. The maintenance action is applied to the resource * during its first maintenance window after this date. If this date is specified, any next-maintenance * opt-in requests are ignored. *

* * @return The date of the maintenance window when the action is applied. The maintenance action is applied to the * resource during its first maintenance window after this date. If this date is specified, any * next-maintenance opt-in requests are ignored. */ public final Instant autoAppliedAfterDate() { return autoAppliedAfterDate; } /** *

* The date when the maintenance action is automatically applied. The maintenance action is applied to the resource * on this date regardless of the maintenance window for the resource. If this date is specified, any * immediate opt-in requests are ignored. *

* * @return The date when the maintenance action is automatically applied. The maintenance action is applied to the * resource on this date regardless of the maintenance window for the resource. If this date is specified, * any immediate opt-in requests are ignored. */ public final Instant forcedApplyDate() { return forcedApplyDate; } /** *

* Indicates the type of opt-in request that has been received for the resource. *

* * @return Indicates the type of opt-in request that has been received for the resource. */ public final String optInStatus() { return optInStatus; } /** *

* The effective date when the pending maintenance action is applied to the resource. This date takes into account * opt-in requests received from the ApplyPendingMaintenanceAction API, the AutoAppliedAfterDate * , and the ForcedApplyDate. This value is blank if an opt-in request has not been received and * nothing has been specified as AutoAppliedAfterDate or ForcedApplyDate. *

* * @return The effective date when the pending maintenance action is applied to the resource. This date takes into * account opt-in requests received from the ApplyPendingMaintenanceAction API, the * AutoAppliedAfterDate, and the ForcedApplyDate. This value is blank if an opt-in * request has not been received and nothing has been specified as AutoAppliedAfterDate or * ForcedApplyDate. */ public final Instant currentApplyDate() { return currentApplyDate; } /** *

* A description providing more detail about the maintenance action. *

* * @return A description providing more detail about the maintenance action. */ public final String description() { return description; } @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(action()); hashCode = 31 * hashCode + Objects.hashCode(autoAppliedAfterDate()); hashCode = 31 * hashCode + Objects.hashCode(forcedApplyDate()); hashCode = 31 * hashCode + Objects.hashCode(optInStatus()); hashCode = 31 * hashCode + Objects.hashCode(currentApplyDate()); hashCode = 31 * hashCode + Objects.hashCode(description()); 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 PendingMaintenanceAction)) { return false; } PendingMaintenanceAction other = (PendingMaintenanceAction) obj; return Objects.equals(action(), other.action()) && Objects.equals(autoAppliedAfterDate(), other.autoAppliedAfterDate()) && Objects.equals(forcedApplyDate(), other.forcedApplyDate()) && Objects.equals(optInStatus(), other.optInStatus()) && Objects.equals(currentApplyDate(), other.currentApplyDate()) && Objects.equals(description(), other.description()); } /** * 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("PendingMaintenanceAction").add("Action", action()) .add("AutoAppliedAfterDate", autoAppliedAfterDate()).add("ForcedApplyDate", forcedApplyDate()) .add("OptInStatus", optInStatus()).add("CurrentApplyDate", currentApplyDate()).add("Description", description()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Action": return Optional.ofNullable(clazz.cast(action())); case "AutoAppliedAfterDate": return Optional.ofNullable(clazz.cast(autoAppliedAfterDate())); case "ForcedApplyDate": return Optional.ofNullable(clazz.cast(forcedApplyDate())); case "OptInStatus": return Optional.ofNullable(clazz.cast(optInStatus())); case "CurrentApplyDate": return Optional.ofNullable(clazz.cast(currentApplyDate())); case "Description": return Optional.ofNullable(clazz.cast(description())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Function getter(Function g) { return obj -> g.apply((PendingMaintenanceAction) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The type of pending maintenance action that is available for the resource. *

* * @param action * The type of pending maintenance action that is available for the resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder action(String action); /** *

* The date of the maintenance window when the action is applied. The maintenance action is applied to the * resource during its first maintenance window after this date. If this date is specified, any * next-maintenance opt-in requests are ignored. *

* * @param autoAppliedAfterDate * The date of the maintenance window when the action is applied. The maintenance action is applied to * the resource during its first maintenance window after this date. If this date is specified, any * next-maintenance opt-in requests are ignored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoAppliedAfterDate(Instant autoAppliedAfterDate); /** *

* The date when the maintenance action is automatically applied. The maintenance action is applied to the * resource on this date regardless of the maintenance window for the resource. If this date is specified, any * immediate opt-in requests are ignored. *

* * @param forcedApplyDate * The date when the maintenance action is automatically applied. The maintenance action is applied to * the resource on this date regardless of the maintenance window for the resource. If this date is * specified, any immediate opt-in requests are ignored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder forcedApplyDate(Instant forcedApplyDate); /** *

* Indicates the type of opt-in request that has been received for the resource. *

* * @param optInStatus * Indicates the type of opt-in request that has been received for the resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder optInStatus(String optInStatus); /** *

* The effective date when the pending maintenance action is applied to the resource. This date takes into * account opt-in requests received from the ApplyPendingMaintenanceAction API, the * AutoAppliedAfterDate, and the ForcedApplyDate. This value is blank if an opt-in * request has not been received and nothing has been specified as AutoAppliedAfterDate or * ForcedApplyDate. *

* * @param currentApplyDate * The effective date when the pending maintenance action is applied to the resource. This date takes * into account opt-in requests received from the ApplyPendingMaintenanceAction API, the * AutoAppliedAfterDate, and the ForcedApplyDate. This value is blank if an * opt-in request has not been received and nothing has been specified as * AutoAppliedAfterDate or ForcedApplyDate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder currentApplyDate(Instant currentApplyDate); /** *

* A description providing more detail about the maintenance action. *

* * @param description * A description providing more detail about the maintenance action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); } static final class BuilderImpl implements Builder { private String action; private Instant autoAppliedAfterDate; private Instant forcedApplyDate; private String optInStatus; private Instant currentApplyDate; private String description; private BuilderImpl() { } private BuilderImpl(PendingMaintenanceAction model) { action(model.action); autoAppliedAfterDate(model.autoAppliedAfterDate); forcedApplyDate(model.forcedApplyDate); optInStatus(model.optInStatus); currentApplyDate(model.currentApplyDate); description(model.description); } public final String getAction() { return action; } public final void setAction(String action) { this.action = action; } @Override public final Builder action(String action) { this.action = action; return this; } public final Instant getAutoAppliedAfterDate() { return autoAppliedAfterDate; } public final void setAutoAppliedAfterDate(Instant autoAppliedAfterDate) { this.autoAppliedAfterDate = autoAppliedAfterDate; } @Override public final Builder autoAppliedAfterDate(Instant autoAppliedAfterDate) { this.autoAppliedAfterDate = autoAppliedAfterDate; return this; } public final Instant getForcedApplyDate() { return forcedApplyDate; } public final void setForcedApplyDate(Instant forcedApplyDate) { this.forcedApplyDate = forcedApplyDate; } @Override public final Builder forcedApplyDate(Instant forcedApplyDate) { this.forcedApplyDate = forcedApplyDate; return this; } public final String getOptInStatus() { return optInStatus; } public final void setOptInStatus(String optInStatus) { this.optInStatus = optInStatus; } @Override public final Builder optInStatus(String optInStatus) { this.optInStatus = optInStatus; return this; } public final Instant getCurrentApplyDate() { return currentApplyDate; } public final void setCurrentApplyDate(Instant currentApplyDate) { this.currentApplyDate = currentApplyDate; } @Override public final Builder currentApplyDate(Instant currentApplyDate) { this.currentApplyDate = currentApplyDate; 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; } @Override public PendingMaintenanceAction build() { return new PendingMaintenanceAction(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy