/* * Copyright 2010-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.iot.model; import java.io.Serializable; public class CreatePackageVersionResult implements Serializable { /** *

* The Amazon Resource Name (ARN) for the package. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
*/ private String packageVersionArn; /** *

* The name of the associated package. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9-_.]+
*/ private String packageName; /** *

* The name of the new package version. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9-_.]+
*/ private String versionName; /** *

* The package version description. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: [^\p{C}]+
*/ private String description; /** *

* Metadata that were added to the package version that can be used to * define a package version’s configuration. *

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

* The status of the package version. For more information, see Package version lifecycle. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED */ private String status; /** *

* Error reason for a package version failure during creation or update. *

*/ private String errorReason; /** *

* The Amazon Resource Name (ARN) for the package. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @return

* The Amazon Resource Name (ARN) for the package. *

*/ public String getPackageVersionArn() { return packageVersionArn; } /** *

* The Amazon Resource Name (ARN) for the package. *

*

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @param packageVersionArn

* The Amazon Resource Name (ARN) for the package. *

*/ public void setPackageVersionArn(String packageVersionArn) { this.packageVersionArn = packageVersionArn; } /** *

* The Amazon Resource Name (ARN) for the package. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 1600
* Pattern: ^arn:[!-~]+$
* * @param packageVersionArn

* The Amazon Resource Name (ARN) for the package. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withPackageVersionArn(String packageVersionArn) { this.packageVersionArn = packageVersionArn; return this; } /** *

* The name of the associated package. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9-_.]+
* * @return

* The name of the associated package. *

*/ public String getPackageName() { return packageName; } /** *

* The name of the associated package. *

*

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9-_.]+
* * @param packageName

* The name of the associated package. *

*/ public void setPackageName(String packageName) { this.packageName = packageName; } /** *

* The name of the associated package. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9-_.]+
* * @param packageName

* The name of the associated package. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withPackageName(String packageName) { this.packageName = packageName; return this; } /** *

* The name of the new package version. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9-_.]+
* * @return

* The name of the new package version. *

*/ public String getVersionName() { return versionName; } /** *

* The name of the new package version. *

*

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9-_.]+
* * @param versionName

* The name of the new package version. *

*/ public void setVersionName(String versionName) { this.versionName = versionName; } /** *

* The name of the new package version. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 1 - 64
* Pattern: [a-zA-Z0-9-_.]+
* * @param versionName

* The name of the new package version. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withVersionName(String versionName) { this.versionName = versionName; return this; } /** *

* The package version description. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: [^\p{C}]+
* * @return

* The package version description. *

*/ public String getDescription() { return description; } /** *

* The package version description. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: [^\p{C}]+
* * @param description

* The package version description. *

*/ public void setDescription(String description) { this.description = description; } /** *

* The package version description. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 0 - 1024
* Pattern: [^\p{C}]+
* * @param description

* The package version description. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withDescription(String description) { this.description = description; return this; } /** *

* Metadata that were added to the package version that can be used to * define a package version’s configuration. *

* * @return

* Metadata that were added to the package version that can be used * to define a package version’s configuration. *

*/ public java.util.Map getAttributes() { return attributes; } /** *

* Metadata that were added to the package version that can be used to * define a package version’s configuration. *

* * @param attributes

* Metadata that were added to the package version that can be * used to define a package version’s configuration. *

*/ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* Metadata that were added to the package version that can be used to * define a package version’s configuration. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param attributes

* Metadata that were added to the package version that can be * used to define a package version’s configuration. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withAttributes(java.util.Map attributes) { this.attributes = attributes; return this; } /** *

* Metadata that were added to the package version that can be used to * define a package version’s configuration. *

*

* The method adds a new key-value pair into attributes parameter, and * returns a reference to this object so that method calls can be chained * together. * * @param key The key of the entry to be added into attributes. * @param value The corresponding value of the entry to be added into * attributes. * @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult addattributesEntry(String key, String value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into attributes. *

* Returns a reference to this object so that method calls can be chained * together. */ public CreatePackageVersionResult clearattributesEntries() { this.attributes = null; return this; } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED * * @return

* The status of the package version. For more information, see Package version lifecycle. *

* @see PackageVersionStatus */ public String getStatus() { return status; } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED * * @param status

* The status of the package version. For more information, see * Package version lifecycle. *

* @see PackageVersionStatus */ public void setStatus(String status) { this.status = status; } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED * * @param status

* The status of the package version. For more information, see * Package version lifecycle. *

* @return A reference to this updated object so that method calls can be * chained together. * @see PackageVersionStatus */ public CreatePackageVersionResult withStatus(String status) { this.status = status; return this; } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED * * @param status

* The status of the package version. For more information, see * Package version lifecycle. *

* @see PackageVersionStatus */ public void setStatus(PackageVersionStatus status) { this.status = status.toString(); } /** *

* The status of the package version. For more information, see Package version lifecycle. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: DRAFT, PUBLISHED, DEPRECATED * * @param status

* The status of the package version. For more information, see * Package version lifecycle. *

* @return A reference to this updated object so that method calls can be * chained together. * @see PackageVersionStatus */ public CreatePackageVersionResult withStatus(PackageVersionStatus status) { this.status = status.toString(); return this; } /** *

* Error reason for a package version failure during creation or update. *

* * @return

* Error reason for a package version failure during creation or * update. *

*/ public String getErrorReason() { return errorReason; } /** *

* Error reason for a package version failure during creation or update. *

* * @param errorReason

* Error reason for a package version failure during creation or * update. *

*/ public void setErrorReason(String errorReason) { this.errorReason = errorReason; } /** *

* Error reason for a package version failure during creation or update. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param errorReason

* Error reason for a package version failure during creation or * update. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreatePackageVersionResult withErrorReason(String errorReason) { this.errorReason = errorReason; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getPackageVersionArn() != null) sb.append("packageVersionArn: " + getPackageVersionArn() + ","); if (getPackageName() != null) sb.append("packageName: " + getPackageName() + ","); if (getVersionName() != null) sb.append("versionName: " + getVersionName() + ","); if (getDescription() != null) sb.append("description: " + getDescription() + ","); if (getAttributes() != null) sb.append("attributes: " + getAttributes() + ","); if (getStatus() != null) sb.append("status: " + getStatus() + ","); if (getErrorReason() != null) sb.append("errorReason: " + getErrorReason()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPackageVersionArn() == null) ? 0 : getPackageVersionArn().hashCode()); hashCode = prime * hashCode + ((getPackageName() == null) ? 0 : getPackageName().hashCode()); hashCode = prime * hashCode + ((getVersionName() == null) ? 0 : getVersionName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getErrorReason() == null) ? 0 : getErrorReason().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreatePackageVersionResult == false) return false; CreatePackageVersionResult other = (CreatePackageVersionResult) obj; if (other.getPackageVersionArn() == null ^ this.getPackageVersionArn() == null) return false; if (other.getPackageVersionArn() != null && other.getPackageVersionArn().equals(this.getPackageVersionArn()) == false) return false; if (other.getPackageName() == null ^ this.getPackageName() == null) return false; if (other.getPackageName() != null && other.getPackageName().equals(this.getPackageName()) == false) return false; if (other.getVersionName() == null ^ this.getVersionName() == null) return false; if (other.getVersionName() != null && other.getVersionName().equals(this.getVersionName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getErrorReason() == null ^ this.getErrorReason() == null) return false; if (other.getErrorReason() != null && other.getErrorReason().equals(this.getErrorReason()) == false) return false; return true; } }