@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeDeploymentsResult == false) return false; DescribeDeploymentsResult other = (DescribeDeploymentsResult) obj; if (other.getDeployments() == null ^ this.getDeployments() == null) return false; if (other.getDeployments() != null && other.getDeployments().equals(this.getDeployments()) == false) return false; return true; }
/** * <p> * An array of <code>Deployment</code> objects that describe the deployments. * </p> * * @param deployments * An array of <code>Deployment</code> objects that describe the deployments. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeDeploymentsResult withDeployments(java.util.Collection<Deployment> deployments) { setDeployments(deployments); return this; }
public DescribeDeploymentsResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeDeploymentsResult describeDeploymentsResult = new DescribeDeploymentsResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeDeploymentsResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Deployments", targetDepth)) { context.nextToken(); describeDeploymentsResult.setDeployments(new ListUnmarshaller<Deployment>(DeploymentJsonUnmarshaller.getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeDeploymentsResult; }
public DescribeDeploymentsResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeDeploymentsResult describeDeploymentsResult = new DescribeDeploymentsResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeDeploymentsResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Deployments", targetDepth)) { context.nextToken(); describeDeploymentsResult.setDeployments(new ListUnmarshaller<Deployment>(DeploymentJsonUnmarshaller.getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeDeploymentsResult; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeployments() == null) ? 0 : getDeployments().hashCode()); return hashCode; }
/** * <p> * An array of <code>Deployment</code> objects that describe the deployments. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDeployments(java.util.Collection)} or {@link #withDeployments(java.util.Collection)} if you want to * override the existing values. * </p> * * @param deployments * An array of <code>Deployment</code> objects that describe the deployments. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeDeploymentsResult withDeployments(Deployment... deployments) { if (this.deployments == null) { setDeployments(new com.amazonaws.internal.SdkInternalList<Deployment>(deployments.length)); } for (Deployment ele : deployments) { this.deployments.add(ele); } 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 (getDeployments() != null) sb.append("Deployments: ").append(getDeployments()); sb.append("}"); return sb.toString(); }
/** * <p> * An array of <code>Deployment</code> objects that describe the deployments. * </p> * * @param deployments * An array of <code>Deployment</code> objects that describe the deployments. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeDeploymentsResult withDeployments(java.util.Collection<Deployment> deployments) { setDeployments(deployments); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeDeploymentsResult == false) return false; DescribeDeploymentsResult other = (DescribeDeploymentsResult) obj; if (other.getDeployments() == null ^ this.getDeployments() == null) return false; if (other.getDeployments() != null && other.getDeployments().equals(this.getDeployments()) == false) return false; return true; }
/** * <p> * An array of <code>Deployment</code> objects that describe the deployments. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setDeployments(java.util.Collection)} or {@link #withDeployments(java.util.Collection)} if you want to * override the existing values. * </p> * * @param deployments * An array of <code>Deployment</code> objects that describe the deployments. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeDeploymentsResult withDeployments(Deployment... deployments) { if (this.deployments == null) { setDeployments(new com.amazonaws.internal.SdkInternalList<Deployment>(deployments.length)); } for (Deployment ele : deployments) { this.deployments.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeployments() == null) ? 0 : getDeployments().hashCode()); return hashCode; }
/** * 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 (getDeployments() != null) sb.append("Deployments: ").append(getDeployments()); sb.append("}"); return sb.toString(); }
new DescribeDeploymentsRequest() .withDeploymentIds(deploymentIds)) .getDeployments(); for (Deployment deployment : deployments) { String status = deployment.getStatus();
public static boolean wasSuccessfulDeployment(AWSOpsWorksClient opsClient, String deploymentId) { while (true) { Deployment deployment = opsClient .describeDeployments( new DescribeDeploymentsRequest() .withDeploymentIds(deploymentId)) .getDeployments().get(0); if (deployment.getStatus().equalsIgnoreCase("successful")) { System.out.println("Deployment " + deploymentId + " was successful"); return true; } else if (deployment.getStatus().equalsIgnoreCase("failed")) { return false; } } }