/* * Copyright 2018-2023 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 com.amazonaws.services.opensearch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Auto-Tune settings when updating a domain. For more information, see Auto-Tune for Amazon * OpenSearch Service. *

*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AutoTuneOptions implements Serializable, Cloneable, StructuredPojo { /** *

* Whether Auto-Tune is enabled or disabled. *

*/ private String desiredState; /** *

* When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. Otherwise, * OpenSearch Service is unable to perform the rollback. *

*/ private String rollbackOnDisable; /** *

* DEPRECATED. Use off-peak window * instead. *

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. *

*/ private java.util.List maintenanceSchedules; /** *

* Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. *

*/ private Boolean useOffPeakWindow; /** *

* Whether Auto-Tune is enabled or disabled. *

* * @param desiredState * Whether Auto-Tune is enabled or disabled. * @see AutoTuneDesiredState */ public void setDesiredState(String desiredState) { this.desiredState = desiredState; } /** *

* Whether Auto-Tune is enabled or disabled. *

* * @return Whether Auto-Tune is enabled or disabled. * @see AutoTuneDesiredState */ public String getDesiredState() { return this.desiredState; } /** *

* Whether Auto-Tune is enabled or disabled. *

* * @param desiredState * Whether Auto-Tune is enabled or disabled. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoTuneDesiredState */ public AutoTuneOptions withDesiredState(String desiredState) { setDesiredState(desiredState); return this; } /** *

* Whether Auto-Tune is enabled or disabled. *

* * @param desiredState * Whether Auto-Tune is enabled or disabled. * @return Returns a reference to this object so that method calls can be chained together. * @see AutoTuneDesiredState */ public AutoTuneOptions withDesiredState(AutoTuneDesiredState desiredState) { this.desiredState = desiredState.toString(); return this; } /** *

* When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. Otherwise, * OpenSearch Service is unable to perform the rollback. *

* * @param rollbackOnDisable * When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. * Otherwise, OpenSearch Service is unable to perform the rollback. * @see RollbackOnDisable */ public void setRollbackOnDisable(String rollbackOnDisable) { this.rollbackOnDisable = rollbackOnDisable; } /** *

* When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. Otherwise, * OpenSearch Service is unable to perform the rollback. *

* * @return When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. * Otherwise, OpenSearch Service is unable to perform the rollback. * @see RollbackOnDisable */ public String getRollbackOnDisable() { return this.rollbackOnDisable; } /** *

* When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. Otherwise, * OpenSearch Service is unable to perform the rollback. *

* * @param rollbackOnDisable * When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. * Otherwise, OpenSearch Service is unable to perform the rollback. * @return Returns a reference to this object so that method calls can be chained together. * @see RollbackOnDisable */ public AutoTuneOptions withRollbackOnDisable(String rollbackOnDisable) { setRollbackOnDisable(rollbackOnDisable); return this; } /** *

* When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. Otherwise, * OpenSearch Service is unable to perform the rollback. *

* * @param rollbackOnDisable * When disabling Auto-Tune, specify NO_ROLLBACK to retain all prior Auto-Tune settings or * DEFAULT_ROLLBACK to revert to the OpenSearch Service defaults. If you specify * DEFAULT_ROLLBACK, you must include a MaintenanceSchedule in the request. * Otherwise, OpenSearch Service is unable to perform the rollback. * @return Returns a reference to this object so that method calls can be chained together. * @see RollbackOnDisable */ public AutoTuneOptions withRollbackOnDisable(RollbackOnDisable rollbackOnDisable) { this.rollbackOnDisable = rollbackOnDisable.toString(); return this; } /** *

* DEPRECATED. Use off-peak window * instead. *

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. *

* * @return DEPRECATED. Use off-peak * window instead.

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. */ public java.util.List getMaintenanceSchedules() { return maintenanceSchedules; } /** *

* DEPRECATED. Use off-peak window * instead. *

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. *

* * @param maintenanceSchedules * DEPRECATED. Use off-peak * window instead.

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. */ public void setMaintenanceSchedules(java.util.Collection maintenanceSchedules) { if (maintenanceSchedules == null) { this.maintenanceSchedules = null; return; } this.maintenanceSchedules = new java.util.ArrayList(maintenanceSchedules); } /** *

* DEPRECATED. Use off-peak window * instead. *

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setMaintenanceSchedules(java.util.Collection)} or {@link #withMaintenanceSchedules(java.util.Collection)} * if you want to override the existing values. *

* * @param maintenanceSchedules * DEPRECATED. Use off-peak * window instead.

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoTuneOptions withMaintenanceSchedules(AutoTuneMaintenanceSchedule... maintenanceSchedules) { if (this.maintenanceSchedules == null) { setMaintenanceSchedules(new java.util.ArrayList(maintenanceSchedules.length)); } for (AutoTuneMaintenanceSchedule ele : maintenanceSchedules) { this.maintenanceSchedules.add(ele); } return this; } /** *

* DEPRECATED. Use off-peak window * instead. *

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. *

* * @param maintenanceSchedules * DEPRECATED. Use off-peak * window instead.

*

* A list of maintenance schedules during which Auto-Tune can deploy changes. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoTuneOptions withMaintenanceSchedules(java.util.Collection maintenanceSchedules) { setMaintenanceSchedules(maintenanceSchedules); return this; } /** *

* Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. *

* * @param useOffPeakWindow * Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. */ public void setUseOffPeakWindow(Boolean useOffPeakWindow) { this.useOffPeakWindow = useOffPeakWindow; } /** *

* Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. *

* * @return Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. */ public Boolean getUseOffPeakWindow() { return this.useOffPeakWindow; } /** *

* Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. *

* * @param useOffPeakWindow * Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. * @return Returns a reference to this object so that method calls can be chained together. */ public AutoTuneOptions withUseOffPeakWindow(Boolean useOffPeakWindow) { setUseOffPeakWindow(useOffPeakWindow); return this; } /** *

* Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. *

* * @return Whether to use the domain's off-peak * window to deploy configuration changes on the domain rather than a maintenance schedule. */ public Boolean isUseOffPeakWindow() { return this.useOffPeakWindow; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDesiredState() != null) sb.append("DesiredState: ").append(getDesiredState()).append(","); if (getRollbackOnDisable() != null) sb.append("RollbackOnDisable: ").append(getRollbackOnDisable()).append(","); if (getMaintenanceSchedules() != null) sb.append("MaintenanceSchedules: ").append(getMaintenanceSchedules()).append(","); if (getUseOffPeakWindow() != null) sb.append("UseOffPeakWindow: ").append(getUseOffPeakWindow()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AutoTuneOptions == false) return false; AutoTuneOptions other = (AutoTuneOptions) obj; if (other.getDesiredState() == null ^ this.getDesiredState() == null) return false; if (other.getDesiredState() != null && other.getDesiredState().equals(this.getDesiredState()) == false) return false; if (other.getRollbackOnDisable() == null ^ this.getRollbackOnDisable() == null) return false; if (other.getRollbackOnDisable() != null && other.getRollbackOnDisable().equals(this.getRollbackOnDisable()) == false) return false; if (other.getMaintenanceSchedules() == null ^ this.getMaintenanceSchedules() == null) return false; if (other.getMaintenanceSchedules() != null && other.getMaintenanceSchedules().equals(this.getMaintenanceSchedules()) == false) return false; if (other.getUseOffPeakWindow() == null ^ this.getUseOffPeakWindow() == null) return false; if (other.getUseOffPeakWindow() != null && other.getUseOffPeakWindow().equals(this.getUseOffPeakWindow()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDesiredState() == null) ? 0 : getDesiredState().hashCode()); hashCode = prime * hashCode + ((getRollbackOnDisable() == null) ? 0 : getRollbackOnDisable().hashCode()); hashCode = prime * hashCode + ((getMaintenanceSchedules() == null) ? 0 : getMaintenanceSchedules().hashCode()); hashCode = prime * hashCode + ((getUseOffPeakWindow() == null) ? 0 : getUseOffPeakWindow().hashCode()); return hashCode; } @Override public AutoTuneOptions clone() { try { return (AutoTuneOptions) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.opensearch.model.transform.AutoTuneOptionsMarshaller.getInstance().marshall(this, protocolMarshaller); } }