com.amazonaws.services.opensearchserverless.model.EffectiveLifecyclePolicyDetail Maven / Gradle / Ivy
Show all versions of aws-java-sdk-opensearchserverless Show documentation
/*
* Copyright 2019-2024 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.opensearchserverless.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Error information for an OpenSearch Serverless request.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EffectiveLifecyclePolicyDetail implements Serializable, Cloneable, StructuredPojo {
/**
*
* The minimum number of index retention days set. That is an optional param that will return as true
* if the minimum number of days or hours is not set to a index resource.
*
*/
private Boolean noMinRetentionPeriod;
/**
*
* The name of the lifecycle policy.
*
*/
private String policyName;
/**
*
* The name of the OpenSearch Serverless index resource.
*
*/
private String resource;
/**
*
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
*
*/
private String resourceType;
/**
*
* The minimum number of index retention in days or hours. This is an optional parameter that will return only if
* it’s set.
*
*/
private String retentionPeriod;
/**
*
* The type of lifecycle policy.
*
*/
private String type;
/**
*
* The minimum number of index retention days set. That is an optional param that will return as true
* if the minimum number of days or hours is not set to a index resource.
*
*
* @param noMinRetentionPeriod
* The minimum number of index retention days set. That is an optional param that will return as
* true
if the minimum number of days or hours is not set to a index resource.
*/
public void setNoMinRetentionPeriod(Boolean noMinRetentionPeriod) {
this.noMinRetentionPeriod = noMinRetentionPeriod;
}
/**
*
* The minimum number of index retention days set. That is an optional param that will return as true
* if the minimum number of days or hours is not set to a index resource.
*
*
* @return The minimum number of index retention days set. That is an optional param that will return as
* true
if the minimum number of days or hours is not set to a index resource.
*/
public Boolean getNoMinRetentionPeriod() {
return this.noMinRetentionPeriod;
}
/**
*
* The minimum number of index retention days set. That is an optional param that will return as true
* if the minimum number of days or hours is not set to a index resource.
*
*
* @param noMinRetentionPeriod
* The minimum number of index retention days set. That is an optional param that will return as
* true
if the minimum number of days or hours is not set to a index resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EffectiveLifecyclePolicyDetail withNoMinRetentionPeriod(Boolean noMinRetentionPeriod) {
setNoMinRetentionPeriod(noMinRetentionPeriod);
return this;
}
/**
*
* The minimum number of index retention days set. That is an optional param that will return as true
* if the minimum number of days or hours is not set to a index resource.
*
*
* @return The minimum number of index retention days set. That is an optional param that will return as
* true
if the minimum number of days or hours is not set to a index resource.
*/
public Boolean isNoMinRetentionPeriod() {
return this.noMinRetentionPeriod;
}
/**
*
* The name of the lifecycle policy.
*
*
* @param policyName
* The name of the lifecycle policy.
*/
public void setPolicyName(String policyName) {
this.policyName = policyName;
}
/**
*
* The name of the lifecycle policy.
*
*
* @return The name of the lifecycle policy.
*/
public String getPolicyName() {
return this.policyName;
}
/**
*
* The name of the lifecycle policy.
*
*
* @param policyName
* The name of the lifecycle policy.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EffectiveLifecyclePolicyDetail withPolicyName(String policyName) {
setPolicyName(policyName);
return this;
}
/**
*
* The name of the OpenSearch Serverless index resource.
*
*
* @param resource
* The name of the OpenSearch Serverless index resource.
*/
public void setResource(String resource) {
this.resource = resource;
}
/**
*
* The name of the OpenSearch Serverless index resource.
*
*
* @return The name of the OpenSearch Serverless index resource.
*/
public String getResource() {
return this.resource;
}
/**
*
* The name of the OpenSearch Serverless index resource.
*
*
* @param resource
* The name of the OpenSearch Serverless index resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EffectiveLifecyclePolicyDetail withResource(String resource) {
setResource(resource);
return this;
}
/**
*
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
*
*
* @param resourceType
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
* @see ResourceType
*/
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
/**
*
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
*
*
* @return The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
* @see ResourceType
*/
public String getResourceType() {
return this.resourceType;
}
/**
*
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
*
*
* @param resourceType
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public EffectiveLifecyclePolicyDetail withResourceType(String resourceType) {
setResourceType(resourceType);
return this;
}
/**
*
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
*
*
* @param resourceType
* The type of OpenSearch Serverless resource. Currently, the only supported resource is index
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceType
*/
public EffectiveLifecyclePolicyDetail withResourceType(ResourceType resourceType) {
this.resourceType = resourceType.toString();
return this;
}
/**
*
* The minimum number of index retention in days or hours. This is an optional parameter that will return only if
* it’s set.
*
*
* @param retentionPeriod
* The minimum number of index retention in days or hours. This is an optional parameter that will return
* only if it’s set.
*/
public void setRetentionPeriod(String retentionPeriod) {
this.retentionPeriod = retentionPeriod;
}
/**
*
* The minimum number of index retention in days or hours. This is an optional parameter that will return only if
* it’s set.
*
*
* @return The minimum number of index retention in days or hours. This is an optional parameter that will return
* only if it’s set.
*/
public String getRetentionPeriod() {
return this.retentionPeriod;
}
/**
*
* The minimum number of index retention in days or hours. This is an optional parameter that will return only if
* it’s set.
*
*
* @param retentionPeriod
* The minimum number of index retention in days or hours. This is an optional parameter that will return
* only if it’s set.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EffectiveLifecyclePolicyDetail withRetentionPeriod(String retentionPeriod) {
setRetentionPeriod(retentionPeriod);
return this;
}
/**
*
* The type of lifecycle policy.
*
*
* @param type
* The type of lifecycle policy.
* @see LifecyclePolicyType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of lifecycle policy.
*
*
* @return The type of lifecycle policy.
* @see LifecyclePolicyType
*/
public String getType() {
return this.type;
}
/**
*
* The type of lifecycle policy.
*
*
* @param type
* The type of lifecycle policy.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LifecyclePolicyType
*/
public EffectiveLifecyclePolicyDetail withType(String type) {
setType(type);
return this;
}
/**
*
* The type of lifecycle policy.
*
*
* @param type
* The type of lifecycle policy.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LifecyclePolicyType
*/
public EffectiveLifecyclePolicyDetail withType(LifecyclePolicyType type) {
this.type = type.toString();
return this;
}
/**
* 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 (getNoMinRetentionPeriod() != null)
sb.append("NoMinRetentionPeriod: ").append(getNoMinRetentionPeriod()).append(",");
if (getPolicyName() != null)
sb.append("PolicyName: ").append(getPolicyName()).append(",");
if (getResource() != null)
sb.append("Resource: ").append(getResource()).append(",");
if (getResourceType() != null)
sb.append("ResourceType: ").append(getResourceType()).append(",");
if (getRetentionPeriod() != null)
sb.append("RetentionPeriod: ").append(getRetentionPeriod()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EffectiveLifecyclePolicyDetail == false)
return false;
EffectiveLifecyclePolicyDetail other = (EffectiveLifecyclePolicyDetail) obj;
if (other.getNoMinRetentionPeriod() == null ^ this.getNoMinRetentionPeriod() == null)
return false;
if (other.getNoMinRetentionPeriod() != null && other.getNoMinRetentionPeriod().equals(this.getNoMinRetentionPeriod()) == false)
return false;
if (other.getPolicyName() == null ^ this.getPolicyName() == null)
return false;
if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false)
return false;
if (other.getResource() == null ^ this.getResource() == null)
return false;
if (other.getResource() != null && other.getResource().equals(this.getResource()) == false)
return false;
if (other.getResourceType() == null ^ this.getResourceType() == null)
return false;
if (other.getResourceType() != null && other.getResourceType().equals(this.getResourceType()) == false)
return false;
if (other.getRetentionPeriod() == null ^ this.getRetentionPeriod() == null)
return false;
if (other.getRetentionPeriod() != null && other.getRetentionPeriod().equals(this.getRetentionPeriod()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNoMinRetentionPeriod() == null) ? 0 : getNoMinRetentionPeriod().hashCode());
hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode());
hashCode = prime * hashCode + ((getResource() == null) ? 0 : getResource().hashCode());
hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode());
hashCode = prime * hashCode + ((getRetentionPeriod() == null) ? 0 : getRetentionPeriod().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
return hashCode;
}
@Override
public EffectiveLifecyclePolicyDetail clone() {
try {
return (EffectiveLifecyclePolicyDetail) 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.opensearchserverless.model.transform.EffectiveLifecyclePolicyDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}