/* * 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.greengrassv2.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetDeploymentResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The ARN of the target * IoT thing or thing group. *

*/ private String targetArn; /** *

* The revision number of the deployment. *

*/ private String revisionId; /** *

* The ID of the deployment. *

*/ private String deploymentId; /** *

* The name of the deployment. *

*/ private String deploymentName; /** *

* The status of the deployment. *

*/ private String deploymentStatus; /** *

* The ID of the IoT job that applies the deployment to target devices. *

*/ private String iotJobId; /** *

* The ARN of the IoT job * that applies the deployment to target devices. *

*/ private String iotJobArn; /** *

* The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value * is the version and configuration to deploy for that component. *

*/ private java.util.Map components; /** *

* The deployment policies for the deployment. These policies define how the deployment updates components and * handles failure. *

*/ private DeploymentPolicies deploymentPolicies; /** *

* The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and * stop configurations for the deployment configuration. *

*/ private DeploymentIoTJobConfiguration iotJobConfiguration; /** *

* The time at which the deployment was created, expressed in ISO 8601 format. *

*/ private java.util.Date creationTimestamp; /** *

* Whether or not the deployment is the latest revision for its target. *

*/ private Boolean isLatestForTarget; /** *

* The parent deployment's target ARN within a subdeployment. *

*/ private String parentTargetArn; /** *

* A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the * IoT Greengrass V2 Developer Guide. *

*/ private java.util.Map tags; /** *

* The ARN of the target * IoT thing or thing group. *

* * @param targetArn * The ARN of the * target IoT thing or thing group. */ public void setTargetArn(String targetArn) { this.targetArn = targetArn; } /** *

* The ARN of the target * IoT thing or thing group. *

* * @return The ARN of the * target IoT thing or thing group. */ public String getTargetArn() { return this.targetArn; } /** *

* The ARN of the target * IoT thing or thing group. *

* * @param targetArn * The ARN of the * target IoT thing or thing group. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withTargetArn(String targetArn) { setTargetArn(targetArn); return this; } /** *

* The revision number of the deployment. *

* * @param revisionId * The revision number of the deployment. */ public void setRevisionId(String revisionId) { this.revisionId = revisionId; } /** *

* The revision number of the deployment. *

* * @return The revision number of the deployment. */ public String getRevisionId() { return this.revisionId; } /** *

* The revision number of the deployment. *

* * @param revisionId * The revision number of the deployment. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withRevisionId(String revisionId) { setRevisionId(revisionId); return this; } /** *

* The ID of the deployment. *

* * @param deploymentId * The ID of the deployment. */ public void setDeploymentId(String deploymentId) { this.deploymentId = deploymentId; } /** *

* The ID of the deployment. *

* * @return The ID of the deployment. */ public String getDeploymentId() { return this.deploymentId; } /** *

* The ID of the deployment. *

* * @param deploymentId * The ID of the deployment. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withDeploymentId(String deploymentId) { setDeploymentId(deploymentId); return this; } /** *

* The name of the deployment. *

* * @param deploymentName * The name of the deployment. */ public void setDeploymentName(String deploymentName) { this.deploymentName = deploymentName; } /** *

* The name of the deployment. *

* * @return The name of the deployment. */ public String getDeploymentName() { return this.deploymentName; } /** *

* The name of the deployment. *

* * @param deploymentName * The name of the deployment. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withDeploymentName(String deploymentName) { setDeploymentName(deploymentName); return this; } /** *

* The status of the deployment. *

* * @param deploymentStatus * The status of the deployment. * @see DeploymentStatus */ public void setDeploymentStatus(String deploymentStatus) { this.deploymentStatus = deploymentStatus; } /** *

* The status of the deployment. *

* * @return The status of the deployment. * @see DeploymentStatus */ public String getDeploymentStatus() { return this.deploymentStatus; } /** *

* The status of the deployment. *

* * @param deploymentStatus * The status of the deployment. * @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentStatus */ public GetDeploymentResult withDeploymentStatus(String deploymentStatus) { setDeploymentStatus(deploymentStatus); return this; } /** *

* The status of the deployment. *

* * @param deploymentStatus * The status of the deployment. * @return Returns a reference to this object so that method calls can be chained together. * @see DeploymentStatus */ public GetDeploymentResult withDeploymentStatus(DeploymentStatus deploymentStatus) { this.deploymentStatus = deploymentStatus.toString(); return this; } /** *

* The ID of the IoT job that applies the deployment to target devices. *

* * @param iotJobId * The ID of the IoT job that applies the deployment to target devices. */ public void setIotJobId(String iotJobId) { this.iotJobId = iotJobId; } /** *

* The ID of the IoT job that applies the deployment to target devices. *

* * @return The ID of the IoT job that applies the deployment to target devices. */ public String getIotJobId() { return this.iotJobId; } /** *

* The ID of the IoT job that applies the deployment to target devices. *

* * @param iotJobId * The ID of the IoT job that applies the deployment to target devices. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withIotJobId(String iotJobId) { setIotJobId(iotJobId); return this; } /** *

* The ARN of the IoT job * that applies the deployment to target devices. *

* * @param iotJobArn * The ARN of the * IoT job that applies the deployment to target devices. */ public void setIotJobArn(String iotJobArn) { this.iotJobArn = iotJobArn; } /** *

* The ARN of the IoT job * that applies the deployment to target devices. *

* * @return The ARN of the * IoT job that applies the deployment to target devices. */ public String getIotJobArn() { return this.iotJobArn; } /** *

* The ARN of the IoT job * that applies the deployment to target devices. *

* * @param iotJobArn * The ARN of the * IoT job that applies the deployment to target devices. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withIotJobArn(String iotJobArn) { setIotJobArn(iotJobArn); return this; } /** *

* The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value * is the version and configuration to deploy for that component. *

* * @return The components to deploy. This is a dictionary, where each key is the name of a component, and each key's * value is the version and configuration to deploy for that component. */ public java.util.Map getComponents() { return components; } /** *

* The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value * is the version and configuration to deploy for that component. *

* * @param components * The components to deploy. This is a dictionary, where each key is the name of a component, and each key's * value is the version and configuration to deploy for that component. */ public void setComponents(java.util.Map components) { this.components = components; } /** *

* The components to deploy. This is a dictionary, where each key is the name of a component, and each key's value * is the version and configuration to deploy for that component. *

* * @param components * The components to deploy. This is a dictionary, where each key is the name of a component, and each key's * value is the version and configuration to deploy for that component. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withComponents(java.util.Map components) { setComponents(components); return this; } /** * Add a single Components entry * * @see GetDeploymentResult#withComponents * @returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult addComponentsEntry(String key, ComponentDeploymentSpecification value) { if (null == this.components) { this.components = new java.util.HashMap(); } if (this.components.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.components.put(key, value); return this; } /** * Removes all the entries added into Components. * * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult clearComponentsEntries() { this.components = null; return this; } /** *

* The deployment policies for the deployment. These policies define how the deployment updates components and * handles failure. *

* * @param deploymentPolicies * The deployment policies for the deployment. These policies define how the deployment updates components * and handles failure. */ public void setDeploymentPolicies(DeploymentPolicies deploymentPolicies) { this.deploymentPolicies = deploymentPolicies; } /** *

* The deployment policies for the deployment. These policies define how the deployment updates components and * handles failure. *

* * @return The deployment policies for the deployment. These policies define how the deployment updates components * and handles failure. */ public DeploymentPolicies getDeploymentPolicies() { return this.deploymentPolicies; } /** *

* The deployment policies for the deployment. These policies define how the deployment updates components and * handles failure. *

* * @param deploymentPolicies * The deployment policies for the deployment. These policies define how the deployment updates components * and handles failure. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withDeploymentPolicies(DeploymentPolicies deploymentPolicies) { setDeploymentPolicies(deploymentPolicies); return this; } /** *

* The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and * stop configurations for the deployment configuration. *

* * @param iotJobConfiguration * The job configuration for the deployment configuration. The job configuration specifies the rollout, * timeout, and stop configurations for the deployment configuration. */ public void setIotJobConfiguration(DeploymentIoTJobConfiguration iotJobConfiguration) { this.iotJobConfiguration = iotJobConfiguration; } /** *

* The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and * stop configurations for the deployment configuration. *

* * @return The job configuration for the deployment configuration. The job configuration specifies the rollout, * timeout, and stop configurations for the deployment configuration. */ public DeploymentIoTJobConfiguration getIotJobConfiguration() { return this.iotJobConfiguration; } /** *

* The job configuration for the deployment configuration. The job configuration specifies the rollout, timeout, and * stop configurations for the deployment configuration. *

* * @param iotJobConfiguration * The job configuration for the deployment configuration. The job configuration specifies the rollout, * timeout, and stop configurations for the deployment configuration. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withIotJobConfiguration(DeploymentIoTJobConfiguration iotJobConfiguration) { setIotJobConfiguration(iotJobConfiguration); return this; } /** *

* The time at which the deployment was created, expressed in ISO 8601 format. *

* * @param creationTimestamp * The time at which the deployment was created, expressed in ISO 8601 format. */ public void setCreationTimestamp(java.util.Date creationTimestamp) { this.creationTimestamp = creationTimestamp; } /** *

* The time at which the deployment was created, expressed in ISO 8601 format. *

* * @return The time at which the deployment was created, expressed in ISO 8601 format. */ public java.util.Date getCreationTimestamp() { return this.creationTimestamp; } /** *

* The time at which the deployment was created, expressed in ISO 8601 format. *

* * @param creationTimestamp * The time at which the deployment was created, expressed in ISO 8601 format. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withCreationTimestamp(java.util.Date creationTimestamp) { setCreationTimestamp(creationTimestamp); return this; } /** *

* Whether or not the deployment is the latest revision for its target. *

* * @param isLatestForTarget * Whether or not the deployment is the latest revision for its target. */ public void setIsLatestForTarget(Boolean isLatestForTarget) { this.isLatestForTarget = isLatestForTarget; } /** *

* Whether or not the deployment is the latest revision for its target. *

* * @return Whether or not the deployment is the latest revision for its target. */ public Boolean getIsLatestForTarget() { return this.isLatestForTarget; } /** *

* Whether or not the deployment is the latest revision for its target. *

* * @param isLatestForTarget * Whether or not the deployment is the latest revision for its target. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withIsLatestForTarget(Boolean isLatestForTarget) { setIsLatestForTarget(isLatestForTarget); return this; } /** *

* Whether or not the deployment is the latest revision for its target. *

* * @return Whether or not the deployment is the latest revision for its target. */ public Boolean isLatestForTarget() { return this.isLatestForTarget; } /** *

* The parent deployment's target ARN within a subdeployment. *

* * @param parentTargetArn * The parent deployment's target ARN within a * subdeployment. */ public void setParentTargetArn(String parentTargetArn) { this.parentTargetArn = parentTargetArn; } /** *

* The parent deployment's target ARN within a subdeployment. *

* * @return The parent deployment's target ARN within a * subdeployment. */ public String getParentTargetArn() { return this.parentTargetArn; } /** *

* The parent deployment's target ARN within a subdeployment. *

* * @param parentTargetArn * The parent deployment's target ARN within a * subdeployment. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withParentTargetArn(String parentTargetArn) { setParentTargetArn(parentTargetArn); return this; } /** *

* A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the * IoT Greengrass V2 Developer Guide. *

* * @return A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources * in the IoT Greengrass V2 Developer Guide. */ public java.util.Map getTags() { return tags; } /** *

* A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the * IoT Greengrass V2 Developer Guide. *

* * @param tags * A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources * in the IoT Greengrass V2 Developer Guide. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the * IoT Greengrass V2 Developer Guide. *

* * @param tags * A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources * in the IoT Greengrass V2 Developer Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see GetDeploymentResult#withTags * @returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public GetDeploymentResult clearTagsEntries() { this.tags = null; 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 (getTargetArn() != null) sb.append("TargetArn: ").append(getTargetArn()).append(","); if (getRevisionId() != null) sb.append("RevisionId: ").append(getRevisionId()).append(","); if (getDeploymentId() != null) sb.append("DeploymentId: ").append(getDeploymentId()).append(","); if (getDeploymentName() != null) sb.append("DeploymentName: ").append(getDeploymentName()).append(","); if (getDeploymentStatus() != null) sb.append("DeploymentStatus: ").append(getDeploymentStatus()).append(","); if (getIotJobId() != null) sb.append("IotJobId: ").append(getIotJobId()).append(","); if (getIotJobArn() != null) sb.append("IotJobArn: ").append(getIotJobArn()).append(","); if (getComponents() != null) sb.append("Components: ").append(getComponents()).append(","); if (getDeploymentPolicies() != null) sb.append("DeploymentPolicies: ").append(getDeploymentPolicies()).append(","); if (getIotJobConfiguration() != null) sb.append("IotJobConfiguration: ").append(getIotJobConfiguration()).append(","); if (getCreationTimestamp() != null) sb.append("CreationTimestamp: ").append(getCreationTimestamp()).append(","); if (getIsLatestForTarget() != null) sb.append("IsLatestForTarget: ").append(getIsLatestForTarget()).append(","); if (getParentTargetArn() != null) sb.append("ParentTargetArn: ").append(getParentTargetArn()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetDeploymentResult == false) return false; GetDeploymentResult other = (GetDeploymentResult) obj; if (other.getTargetArn() == null ^ this.getTargetArn() == null) return false; if (other.getTargetArn() != null && other.getTargetArn().equals(this.getTargetArn()) == false) return false; if (other.getRevisionId() == null ^ this.getRevisionId() == null) return false; if (other.getRevisionId() != null && other.getRevisionId().equals(this.getRevisionId()) == false) return false; if (other.getDeploymentId() == null ^ this.getDeploymentId() == null) return false; if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == false) return false; if (other.getDeploymentName() == null ^ this.getDeploymentName() == null) return false; if (other.getDeploymentName() != null && other.getDeploymentName().equals(this.getDeploymentName()) == false) return false; if (other.getDeploymentStatus() == null ^ this.getDeploymentStatus() == null) return false; if (other.getDeploymentStatus() != null && other.getDeploymentStatus().equals(this.getDeploymentStatus()) == false) return false; if (other.getIotJobId() == null ^ this.getIotJobId() == null) return false; if (other.getIotJobId() != null && other.getIotJobId().equals(this.getIotJobId()) == false) return false; if (other.getIotJobArn() == null ^ this.getIotJobArn() == null) return false; if (other.getIotJobArn() != null && other.getIotJobArn().equals(this.getIotJobArn()) == false) return false; if (other.getComponents() == null ^ this.getComponents() == null) return false; if (other.getComponents() != null && other.getComponents().equals(this.getComponents()) == false) return false; if (other.getDeploymentPolicies() == null ^ this.getDeploymentPolicies() == null) return false; if (other.getDeploymentPolicies() != null && other.getDeploymentPolicies().equals(this.getDeploymentPolicies()) == false) return false; if (other.getIotJobConfiguration() == null ^ this.getIotJobConfiguration() == null) return false; if (other.getIotJobConfiguration() != null && other.getIotJobConfiguration().equals(this.getIotJobConfiguration()) == false) return false; if (other.getCreationTimestamp() == null ^ this.getCreationTimestamp() == null) return false; if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false) return false; if (other.getIsLatestForTarget() == null ^ this.getIsLatestForTarget() == null) return false; if (other.getIsLatestForTarget() != null && other.getIsLatestForTarget().equals(this.getIsLatestForTarget()) == false) return false; if (other.getParentTargetArn() == null ^ this.getParentTargetArn() == null) return false; if (other.getParentTargetArn() != null && other.getParentTargetArn().equals(this.getParentTargetArn()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTargetArn() == null) ? 0 : getTargetArn().hashCode()); hashCode = prime * hashCode + ((getRevisionId() == null) ? 0 : getRevisionId().hashCode()); hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode()); hashCode = prime * hashCode + ((getDeploymentName() == null) ? 0 : getDeploymentName().hashCode()); hashCode = prime * hashCode + ((getDeploymentStatus() == null) ? 0 : getDeploymentStatus().hashCode()); hashCode = prime * hashCode + ((getIotJobId() == null) ? 0 : getIotJobId().hashCode()); hashCode = prime * hashCode + ((getIotJobArn() == null) ? 0 : getIotJobArn().hashCode()); hashCode = prime * hashCode + ((getComponents() == null) ? 0 : getComponents().hashCode()); hashCode = prime * hashCode + ((getDeploymentPolicies() == null) ? 0 : getDeploymentPolicies().hashCode()); hashCode = prime * hashCode + ((getIotJobConfiguration() == null) ? 0 : getIotJobConfiguration().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); hashCode = prime * hashCode + ((getIsLatestForTarget() == null) ? 0 : getIsLatestForTarget().hashCode()); hashCode = prime * hashCode + ((getParentTargetArn() == null) ? 0 : getParentTargetArn().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public GetDeploymentResult clone() { try { return (GetDeploymentResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }