/** * Constructs a new DeleteDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods * to initialize any additional object members. * * @param dBInstanceIdentifier * The DB instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must match the name of an existing DB instance. * </p> * </li> */ public DeleteDBInstanceRequest(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getSkipFinalSnapshot() == null) ? 0 : getSkipFinalSnapshot().hashCode()); hashCode = prime * hashCode + ((getFinalDBSnapshotIdentifier() == null) ? 0 : getFinalDBSnapshotIdentifier().hashCode()); hashCode = prime * hashCode + ((getDeleteAutomatedBackups() == null) ? 0 : getDeleteAutomatedBackups().hashCode()); return hashCode; }
/** * <p> * A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This * parameter isn't case-sensitive. This parameter defaults to <code>true</code>. * </p> * * @param deleteAutomatedBackups * A value that indicates whether to remove automated backups immediately after the DB instance is deleted. * This parameter isn't case-sensitive. This parameter defaults to <code>true</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteDBInstanceRequest withDeleteAutomatedBackups(Boolean deleteAutomatedBackups) { setDeleteAutomatedBackups(deleteAutomatedBackups); return this; }
@TaskAction public void deleteDBInstance() { // to enable conventionMappings feature String dbInstanceIdentifier = getDbInstanceIdentifier(); if (dbInstanceIdentifier == null) { throw new GradleException("dbInstanceIdentifier is required"); } AmazonRDSPluginExtension ext = getProject().getExtensions().getByType(AmazonRDSPluginExtension.class); AmazonRDS rds = ext.getClient(); try { DeleteDBInstanceRequest request = new DeleteDBInstanceRequest() .withDBInstanceIdentifier(dbInstanceIdentifier) .withSkipFinalSnapshot(isSkipFinalSnapshot()) .withFinalDBSnapshotIdentifier(getFinalDBSnapshotIdentifier()); dbInstance = rds.deleteDBInstance(request); getLogger().info("Delete RDS instance requested: {}", dbInstance.getDBInstanceIdentifier()); } catch (DBInstanceNotFoundException e) { getLogger().warn(e.getMessage()); } } }
public void deleteDBInstance(String dbInstanceIdentifier) { DeleteDBInstanceRequest request = new DeleteDBInstanceRequest(); request.setDBInstanceIdentifier(dbInstanceIdentifier); rdsClient.deleteDBInstance(request); }
public void delete(String dbInstanceIdentifier) { DBInstance dbInstance = client.deleteDBInstance( new DeleteDBInstanceRequest(dbInstanceIdentifier).withSkipFinalSnapshot(true) ); System.out.println(dbInstance); } }
setFinalDBSnapshotIdentifier(finalDBSnapshotIdentifier); return this;
setFinalDBSnapshotIdentifier(finalDBSnapshotIdentifier); return this;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteDBInstanceRequest == false) return false; DeleteDBInstanceRequest other = (DeleteDBInstanceRequest) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getSkipFinalSnapshot() == null ^ this.getSkipFinalSnapshot() == null) return false; if (other.getSkipFinalSnapshot() != null && other.getSkipFinalSnapshot().equals(this.getSkipFinalSnapshot()) == false) return false; if (other.getFinalDBSnapshotIdentifier() == null ^ this.getFinalDBSnapshotIdentifier() == null) return false; if (other.getFinalDBSnapshotIdentifier() != null && other.getFinalDBSnapshotIdentifier().equals(this.getFinalDBSnapshotIdentifier()) == false) return false; if (other.getDeleteAutomatedBackups() == null ^ this.getDeleteAutomatedBackups() == null) return false; if (other.getDeleteAutomatedBackups() != null && other.getDeleteAutomatedBackups().equals(this.getDeleteAutomatedBackups()) == false) return false; return true; }
setDBInstanceIdentifier(dBInstanceIdentifier); return this;
/** * <p> * A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This * parameter isn't case-sensitive. This parameter defaults to <code>true</code>. * </p> * * @param deleteAutomatedBackups * A value that indicates whether to remove automated backups immediately after the DB instance is deleted. * This parameter isn't case-sensitive. This parameter defaults to <code>true</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteDBInstanceRequest withDeleteAutomatedBackups(Boolean deleteAutomatedBackups) { setDeleteAutomatedBackups(deleteAutomatedBackups); 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 (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getSkipFinalSnapshot() != null) sb.append("SkipFinalSnapshot: ").append(getSkipFinalSnapshot()).append(","); if (getFinalDBSnapshotIdentifier() != null) sb.append("FinalDBSnapshotIdentifier: ").append(getFinalDBSnapshotIdentifier()).append(","); if (getDeleteAutomatedBackups() != null) sb.append("DeleteAutomatedBackups: ").append(getDeleteAutomatedBackups()); sb.append("}"); return sb.toString(); }
/** * Constructs a new DeleteDBInstanceRequest object. Callers should use the setter or fluent setter (with...) methods * to initialize any additional object members. * * @param dBInstanceIdentifier * The DB instance identifier for the DB instance to be deleted. This parameter isn't case-sensitive.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must match the name of an existing DB instance. * </p> * </li> */ public DeleteDBInstanceRequest(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); }
public Request<DeleteDBInstanceRequest> marshall(DeleteDBInstanceRequest deleteDBInstanceRequest) { if (deleteDBInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeleteDBInstanceRequest> request = new DefaultRequest<DeleteDBInstanceRequest>(deleteDBInstanceRequest, "AmazonRDS"); request.addParameter("Action", "DeleteDBInstance"); request.addParameter("Version", "2014-10-31"); request.setHttpMethod(HttpMethodName.POST); if (deleteDBInstanceRequest.getDBInstanceIdentifier() != null) { request.addParameter("DBInstanceIdentifier", StringUtils.fromString(deleteDBInstanceRequest.getDBInstanceIdentifier())); } if (deleteDBInstanceRequest.getSkipFinalSnapshot() != null) { request.addParameter("SkipFinalSnapshot", StringUtils.fromBoolean(deleteDBInstanceRequest.getSkipFinalSnapshot())); } if (deleteDBInstanceRequest.getFinalDBSnapshotIdentifier() != null) { request.addParameter("FinalDBSnapshotIdentifier", StringUtils.fromString(deleteDBInstanceRequest.getFinalDBSnapshotIdentifier())); } if (deleteDBInstanceRequest.getDeleteAutomatedBackups() != null) { request.addParameter("DeleteAutomatedBackups", StringUtils.fromBoolean(deleteDBInstanceRequest.getDeleteAutomatedBackups())); } return request; }
setDBInstanceIdentifier(dBInstanceIdentifier); return this;
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getSkipFinalSnapshot() == null) ? 0 : getSkipFinalSnapshot().hashCode()); hashCode = prime * hashCode + ((getFinalDBSnapshotIdentifier() == null) ? 0 : getFinalDBSnapshotIdentifier().hashCode()); hashCode = prime * hashCode + ((getDeleteAutomatedBackups() == null) ? 0 : getDeleteAutomatedBackups().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteDBInstanceRequest == false) return false; DeleteDBInstanceRequest other = (DeleteDBInstanceRequest) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getSkipFinalSnapshot() == null ^ this.getSkipFinalSnapshot() == null) return false; if (other.getSkipFinalSnapshot() != null && other.getSkipFinalSnapshot().equals(this.getSkipFinalSnapshot()) == false) return false; if (other.getFinalDBSnapshotIdentifier() == null ^ this.getFinalDBSnapshotIdentifier() == null) return false; if (other.getFinalDBSnapshotIdentifier() != null && other.getFinalDBSnapshotIdentifier().equals(this.getFinalDBSnapshotIdentifier()) == false) return false; if (other.getDeleteAutomatedBackups() == null ^ this.getDeleteAutomatedBackups() == null) return false; if (other.getDeleteAutomatedBackups() != null && other.getDeleteAutomatedBackups().equals(this.getDeleteAutomatedBackups()) == false) return false; return true; }
/** * 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 (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getSkipFinalSnapshot() != null) sb.append("SkipFinalSnapshot: ").append(getSkipFinalSnapshot()).append(","); if (getFinalDBSnapshotIdentifier() != null) sb.append("FinalDBSnapshotIdentifier: ").append(getFinalDBSnapshotIdentifier()).append(","); if (getDeleteAutomatedBackups() != null) sb.append("DeleteAutomatedBackups: ").append(getDeleteAutomatedBackups()); sb.append("}"); return sb.toString(); }
public Request<DeleteDBInstanceRequest> marshall(DeleteDBInstanceRequest deleteDBInstanceRequest) { if (deleteDBInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DeleteDBInstanceRequest> request = new DefaultRequest<DeleteDBInstanceRequest>(deleteDBInstanceRequest, "AmazonRDS"); request.addParameter("Action", "DeleteDBInstance"); request.addParameter("Version", "2014-10-31"); request.setHttpMethod(HttpMethodName.POST); if (deleteDBInstanceRequest.getDBInstanceIdentifier() != null) { request.addParameter("DBInstanceIdentifier", StringUtils.fromString(deleteDBInstanceRequest.getDBInstanceIdentifier())); } if (deleteDBInstanceRequest.getSkipFinalSnapshot() != null) { request.addParameter("SkipFinalSnapshot", StringUtils.fromBoolean(deleteDBInstanceRequest.getSkipFinalSnapshot())); } if (deleteDBInstanceRequest.getFinalDBSnapshotIdentifier() != null) { request.addParameter("FinalDBSnapshotIdentifier", StringUtils.fromString(deleteDBInstanceRequest.getFinalDBSnapshotIdentifier())); } if (deleteDBInstanceRequest.getDeleteAutomatedBackups() != null) { request.addParameter("DeleteAutomatedBackups", StringUtils.fromBoolean(deleteDBInstanceRequest.getDeleteAutomatedBackups())); } return request; }