/* * 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.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes a database snapshot. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class RelationalDatabaseSnapshot implements Serializable, Cloneable, StructuredPojo { /** ** The name of the database snapshot. *
*/ private String name; /** ** The Amazon Resource Name (ARN) of the database snapshot. *
*/ private String arn; /** ** The support code for the database snapshot. Include this code in your email to support when you have questions * about a database snapshot in Lightsail. This code enables our support team to look up your Lightsail information * more easily. *
*/ private String supportCode; /** ** The timestamp when the database snapshot was created. *
*/ private java.util.Date createdAt; /** ** The Region name and Availability Zone where the database snapshot is located. *
*/ private ResourceLocation location; /** ** The Lightsail resource type. *
*/ private String resourceType; /** ** The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer * Guide. *
*/ private java.util.List
* The software of the database snapshot (for example, MySQL
)
*
* The database engine version for the database snapshot (for example, 5.7.23
).
*
* The size of the disk in GB (for example, 32
) for the database snapshot.
*
* The state of the database snapshot. *
*/ private String state; /** ** The name of the source database from which the database snapshot was created. *
*/ private String fromRelationalDatabaseName; /** ** The Amazon Resource Name (ARN) of the database from which the database snapshot was created. *
*/ private String fromRelationalDatabaseArn; /** ** The bundle ID of the database from which the database snapshot was created. *
*/ private String fromRelationalDatabaseBundleId; /** ** The blueprint ID of the database from which the database snapshot was created. A blueprint describes the major * engine version of a database. *
*/ private String fromRelationalDatabaseBlueprintId; /** ** The name of the database snapshot. *
* * @param name * The name of the database snapshot. */ public void setName(String name) { this.name = name; } /** ** The name of the database snapshot. *
* * @return The name of the database snapshot. */ public String getName() { return this.name; } /** ** The name of the database snapshot. *
* * @param name * The name of the database snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withName(String name) { setName(name); return this; } /** ** The Amazon Resource Name (ARN) of the database snapshot. *
* * @param arn * The Amazon Resource Name (ARN) of the database snapshot. */ public void setArn(String arn) { this.arn = arn; } /** ** The Amazon Resource Name (ARN) of the database snapshot. *
* * @return The Amazon Resource Name (ARN) of the database snapshot. */ public String getArn() { return this.arn; } /** ** The Amazon Resource Name (ARN) of the database snapshot. *
* * @param arn * The Amazon Resource Name (ARN) of the database snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withArn(String arn) { setArn(arn); return this; } /** ** The support code for the database snapshot. Include this code in your email to support when you have questions * about a database snapshot in Lightsail. This code enables our support team to look up your Lightsail information * more easily. *
* * @param supportCode * The support code for the database snapshot. Include this code in your email to support when you have * questions about a database snapshot in Lightsail. This code enables our support team to look up your * Lightsail information more easily. */ public void setSupportCode(String supportCode) { this.supportCode = supportCode; } /** ** The support code for the database snapshot. Include this code in your email to support when you have questions * about a database snapshot in Lightsail. This code enables our support team to look up your Lightsail information * more easily. *
* * @return The support code for the database snapshot. Include this code in your email to support when you have * questions about a database snapshot in Lightsail. This code enables our support team to look up your * Lightsail information more easily. */ public String getSupportCode() { return this.supportCode; } /** ** The support code for the database snapshot. Include this code in your email to support when you have questions * about a database snapshot in Lightsail. This code enables our support team to look up your Lightsail information * more easily. *
* * @param supportCode * The support code for the database snapshot. Include this code in your email to support when you have * questions about a database snapshot in Lightsail. This code enables our support team to look up your * Lightsail information more easily. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withSupportCode(String supportCode) { setSupportCode(supportCode); return this; } /** ** The timestamp when the database snapshot was created. *
* * @param createdAt * The timestamp when the database snapshot was created. */ public void setCreatedAt(java.util.Date createdAt) { this.createdAt = createdAt; } /** ** The timestamp when the database snapshot was created. *
* * @return The timestamp when the database snapshot was created. */ public java.util.Date getCreatedAt() { return this.createdAt; } /** ** The timestamp when the database snapshot was created. *
* * @param createdAt * The timestamp when the database snapshot was created. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withCreatedAt(java.util.Date createdAt) { setCreatedAt(createdAt); return this; } /** ** The Region name and Availability Zone where the database snapshot is located. *
* * @param location * The Region name and Availability Zone where the database snapshot is located. */ public void setLocation(ResourceLocation location) { this.location = location; } /** ** The Region name and Availability Zone where the database snapshot is located. *
* * @return The Region name and Availability Zone where the database snapshot is located. */ public ResourceLocation getLocation() { return this.location; } /** ** The Region name and Availability Zone where the database snapshot is located. *
* * @param location * The Region name and Availability Zone where the database snapshot is located. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withLocation(ResourceLocation location) { setLocation(location); return this; } /** ** The Lightsail resource type. *
* * @param resourceType * The Lightsail resource type. * @see ResourceType */ public void setResourceType(String resourceType) { this.resourceType = resourceType; } /** ** The Lightsail resource type. *
* * @return The Lightsail resource type. * @see ResourceType */ public String getResourceType() { return this.resourceType; } /** ** The Lightsail resource type. *
* * @param resourceType * The Lightsail resource type. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public RelationalDatabaseSnapshot withResourceType(String resourceType) { setResourceType(resourceType); return this; } /** ** The Lightsail resource type. *
* * @param resourceType * The Lightsail resource type. * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ public RelationalDatabaseSnapshot withResourceType(ResourceType resourceType) { this.resourceType = resourceType.toString(); return this; } /** ** The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer * Guide. *
* * @return The tag keys and optional values for the resource. For more information about tags in Lightsail, see the * Amazon Lightsail * Developer Guide. */ public java.util.List* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer * Guide. *
* * @param tags * The tag keys and optional values for the resource. For more information about tags in Lightsail, see the * Amazon Lightsail * Developer Guide. */ public void setTags(java.util.Collection* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer * Guide. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * The tag keys and optional values for the resource. For more information about tags in Lightsail, see the * Amazon Lightsail * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer * Guide. *
* * @param tags * The tag keys and optional values for the resource. For more information about tags in Lightsail, see the * Amazon Lightsail * Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withTags(java.util.Collection
* The software of the database snapshot (for example, MySQL
)
*
MySQL
)
*/
public void setEngine(String engine) {
this.engine = engine;
}
/**
*
* The software of the database snapshot (for example, MySQL
)
*
MySQL
)
*/
public String getEngine() {
return this.engine;
}
/**
*
* The software of the database snapshot (for example, MySQL
)
*
MySQL
)
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RelationalDatabaseSnapshot withEngine(String engine) {
setEngine(engine);
return this;
}
/**
*
* The database engine version for the database snapshot (for example, 5.7.23
).
*
5.7.23
).
*/
public void setEngineVersion(String engineVersion) {
this.engineVersion = engineVersion;
}
/**
*
* The database engine version for the database snapshot (for example, 5.7.23
).
*
5.7.23
).
*/
public String getEngineVersion() {
return this.engineVersion;
}
/**
*
* The database engine version for the database snapshot (for example, 5.7.23
).
*
5.7.23
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RelationalDatabaseSnapshot withEngineVersion(String engineVersion) {
setEngineVersion(engineVersion);
return this;
}
/**
*
* The size of the disk in GB (for example, 32
) for the database snapshot.
*
32
) for the database snapshot.
*/
public void setSizeInGb(Integer sizeInGb) {
this.sizeInGb = sizeInGb;
}
/**
*
* The size of the disk in GB (for example, 32
) for the database snapshot.
*
32
) for the database snapshot.
*/
public Integer getSizeInGb() {
return this.sizeInGb;
}
/**
*
* The size of the disk in GB (for example, 32
) for the database snapshot.
*
32
) for the database snapshot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RelationalDatabaseSnapshot withSizeInGb(Integer sizeInGb) {
setSizeInGb(sizeInGb);
return this;
}
/**
* * The state of the database snapshot. *
* * @param state * The state of the database snapshot. */ public void setState(String state) { this.state = state; } /** ** The state of the database snapshot. *
* * @return The state of the database snapshot. */ public String getState() { return this.state; } /** ** The state of the database snapshot. *
* * @param state * The state of the database snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withState(String state) { setState(state); return this; } /** ** The name of the source database from which the database snapshot was created. *
* * @param fromRelationalDatabaseName * The name of the source database from which the database snapshot was created. */ public void setFromRelationalDatabaseName(String fromRelationalDatabaseName) { this.fromRelationalDatabaseName = fromRelationalDatabaseName; } /** ** The name of the source database from which the database snapshot was created. *
* * @return The name of the source database from which the database snapshot was created. */ public String getFromRelationalDatabaseName() { return this.fromRelationalDatabaseName; } /** ** The name of the source database from which the database snapshot was created. *
* * @param fromRelationalDatabaseName * The name of the source database from which the database snapshot was created. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withFromRelationalDatabaseName(String fromRelationalDatabaseName) { setFromRelationalDatabaseName(fromRelationalDatabaseName); return this; } /** ** The Amazon Resource Name (ARN) of the database from which the database snapshot was created. *
* * @param fromRelationalDatabaseArn * The Amazon Resource Name (ARN) of the database from which the database snapshot was created. */ public void setFromRelationalDatabaseArn(String fromRelationalDatabaseArn) { this.fromRelationalDatabaseArn = fromRelationalDatabaseArn; } /** ** The Amazon Resource Name (ARN) of the database from which the database snapshot was created. *
* * @return The Amazon Resource Name (ARN) of the database from which the database snapshot was created. */ public String getFromRelationalDatabaseArn() { return this.fromRelationalDatabaseArn; } /** ** The Amazon Resource Name (ARN) of the database from which the database snapshot was created. *
* * @param fromRelationalDatabaseArn * The Amazon Resource Name (ARN) of the database from which the database snapshot was created. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withFromRelationalDatabaseArn(String fromRelationalDatabaseArn) { setFromRelationalDatabaseArn(fromRelationalDatabaseArn); return this; } /** ** The bundle ID of the database from which the database snapshot was created. *
* * @param fromRelationalDatabaseBundleId * The bundle ID of the database from which the database snapshot was created. */ public void setFromRelationalDatabaseBundleId(String fromRelationalDatabaseBundleId) { this.fromRelationalDatabaseBundleId = fromRelationalDatabaseBundleId; } /** ** The bundle ID of the database from which the database snapshot was created. *
* * @return The bundle ID of the database from which the database snapshot was created. */ public String getFromRelationalDatabaseBundleId() { return this.fromRelationalDatabaseBundleId; } /** ** The bundle ID of the database from which the database snapshot was created. *
* * @param fromRelationalDatabaseBundleId * The bundle ID of the database from which the database snapshot was created. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withFromRelationalDatabaseBundleId(String fromRelationalDatabaseBundleId) { setFromRelationalDatabaseBundleId(fromRelationalDatabaseBundleId); return this; } /** ** The blueprint ID of the database from which the database snapshot was created. A blueprint describes the major * engine version of a database. *
* * @param fromRelationalDatabaseBlueprintId * The blueprint ID of the database from which the database snapshot was created. A blueprint describes the * major engine version of a database. */ public void setFromRelationalDatabaseBlueprintId(String fromRelationalDatabaseBlueprintId) { this.fromRelationalDatabaseBlueprintId = fromRelationalDatabaseBlueprintId; } /** ** The blueprint ID of the database from which the database snapshot was created. A blueprint describes the major * engine version of a database. *
* * @return The blueprint ID of the database from which the database snapshot was created. A blueprint describes the * major engine version of a database. */ public String getFromRelationalDatabaseBlueprintId() { return this.fromRelationalDatabaseBlueprintId; } /** ** The blueprint ID of the database from which the database snapshot was created. A blueprint describes the major * engine version of a database. *
* * @param fromRelationalDatabaseBlueprintId * The blueprint ID of the database from which the database snapshot was created. A blueprint describes the * major engine version of a database. * @return Returns a reference to this object so that method calls can be chained together. */ public RelationalDatabaseSnapshot withFromRelationalDatabaseBlueprintId(String fromRelationalDatabaseBlueprintId) { setFromRelationalDatabaseBlueprintId(fromRelationalDatabaseBlueprintId); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getSupportCode() != null) sb.append("SupportCode: ").append(getSupportCode()).append(","); if (getCreatedAt() != null) sb.append("CreatedAt: ").append(getCreatedAt()).append(","); if (getLocation() != null) sb.append("Location: ").append(getLocation()).append(","); if (getResourceType() != null) sb.append("ResourceType: ").append(getResourceType()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getEngine() != null) sb.append("Engine: ").append(getEngine()).append(","); if (getEngineVersion() != null) sb.append("EngineVersion: ").append(getEngineVersion()).append(","); if (getSizeInGb() != null) sb.append("SizeInGb: ").append(getSizeInGb()).append(","); if (getState() != null) sb.append("State: ").append(getState()).append(","); if (getFromRelationalDatabaseName() != null) sb.append("FromRelationalDatabaseName: ").append(getFromRelationalDatabaseName()).append(","); if (getFromRelationalDatabaseArn() != null) sb.append("FromRelationalDatabaseArn: ").append(getFromRelationalDatabaseArn()).append(","); if (getFromRelationalDatabaseBundleId() != null) sb.append("FromRelationalDatabaseBundleId: ").append(getFromRelationalDatabaseBundleId()).append(","); if (getFromRelationalDatabaseBlueprintId() != null) sb.append("FromRelationalDatabaseBlueprintId: ").append(getFromRelationalDatabaseBlueprintId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RelationalDatabaseSnapshot == false) return false; RelationalDatabaseSnapshot other = (RelationalDatabaseSnapshot) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getSupportCode() == null ^ this.getSupportCode() == null) return false; if (other.getSupportCode() != null && other.getSupportCode().equals(this.getSupportCode()) == false) return false; if (other.getCreatedAt() == null ^ this.getCreatedAt() == null) return false; if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false) return false; if (other.getLocation() == null ^ this.getLocation() == null) return false; if (other.getLocation() != null && other.getLocation().equals(this.getLocation()) == 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.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getEngine() == null ^ this.getEngine() == null) return false; if (other.getEngine() != null && other.getEngine().equals(this.getEngine()) == false) return false; if (other.getEngineVersion() == null ^ this.getEngineVersion() == null) return false; if (other.getEngineVersion() != null && other.getEngineVersion().equals(this.getEngineVersion()) == false) return false; if (other.getSizeInGb() == null ^ this.getSizeInGb() == null) return false; if (other.getSizeInGb() != null && other.getSizeInGb().equals(this.getSizeInGb()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false; if (other.getFromRelationalDatabaseName() == null ^ this.getFromRelationalDatabaseName() == null) return false; if (other.getFromRelationalDatabaseName() != null && other.getFromRelationalDatabaseName().equals(this.getFromRelationalDatabaseName()) == false) return false; if (other.getFromRelationalDatabaseArn() == null ^ this.getFromRelationalDatabaseArn() == null) return false; if (other.getFromRelationalDatabaseArn() != null && other.getFromRelationalDatabaseArn().equals(this.getFromRelationalDatabaseArn()) == false) return false; if (other.getFromRelationalDatabaseBundleId() == null ^ this.getFromRelationalDatabaseBundleId() == null) return false; if (other.getFromRelationalDatabaseBundleId() != null && other.getFromRelationalDatabaseBundleId().equals(this.getFromRelationalDatabaseBundleId()) == false) return false; if (other.getFromRelationalDatabaseBlueprintId() == null ^ this.getFromRelationalDatabaseBlueprintId() == null) return false; if (other.getFromRelationalDatabaseBlueprintId() != null && other.getFromRelationalDatabaseBlueprintId().equals(this.getFromRelationalDatabaseBlueprintId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getSupportCode() == null) ? 0 : getSupportCode().hashCode()); hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); hashCode = prime * hashCode + ((getLocation() == null) ? 0 : getLocation().hashCode()); hashCode = prime * hashCode + ((getResourceType() == null) ? 0 : getResourceType().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode()); hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode()); hashCode = prime * hashCode + ((getSizeInGb() == null) ? 0 : getSizeInGb().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getFromRelationalDatabaseName() == null) ? 0 : getFromRelationalDatabaseName().hashCode()); hashCode = prime * hashCode + ((getFromRelationalDatabaseArn() == null) ? 0 : getFromRelationalDatabaseArn().hashCode()); hashCode = prime * hashCode + ((getFromRelationalDatabaseBundleId() == null) ? 0 : getFromRelationalDatabaseBundleId().hashCode()); hashCode = prime * hashCode + ((getFromRelationalDatabaseBlueprintId() == null) ? 0 : getFromRelationalDatabaseBlueprintId().hashCode()); return hashCode; } @Override public RelationalDatabaseSnapshot clone() { try { return (RelationalDatabaseSnapshot) 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.lightsail.model.transform.RelationalDatabaseSnapshotMarshaller.getInstance().marshall(this, protocolMarshaller); } }