com.amazonaws.services.panorama.model.DescribePackageResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-panorama Show documentation
/*
* Copyright 2019-2024 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.panorama.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribePackageResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The package's ARN.
*
*/
private String arn;
/**
*
* When the package was created.
*
*/
private java.util.Date createdTime;
/**
*
* The package's ID.
*
*/
private String packageId;
/**
*
* The package's name.
*
*/
private String packageName;
/**
*
* ARNs of accounts that have read access to the package.
*
*/
private java.util.List readAccessPrincipalArns;
/**
*
* The package's storage location.
*
*/
private StorageLocation storageLocation;
/**
*
* The package's tags.
*
*/
private java.util.Map tags;
/**
*
* ARNs of accounts that have write access to the package.
*
*/
private java.util.List writeAccessPrincipalArns;
/**
*
* The package's ARN.
*
*
* @param arn
* The package's ARN.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The package's ARN.
*
*
* @return The package's ARN.
*/
public String getArn() {
return this.arn;
}
/**
*
* The package's ARN.
*
*
* @param arn
* The package's ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* When the package was created.
*
*
* @param createdTime
* When the package was created.
*/
public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime;
}
/**
*
* When the package was created.
*
*
* @return When the package was created.
*/
public java.util.Date getCreatedTime() {
return this.createdTime;
}
/**
*
* When the package was created.
*
*
* @param createdTime
* When the package was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withCreatedTime(java.util.Date createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The package's ID.
*
*
* @param packageId
* The package's ID.
*/
public void setPackageId(String packageId) {
this.packageId = packageId;
}
/**
*
* The package's ID.
*
*
* @return The package's ID.
*/
public String getPackageId() {
return this.packageId;
}
/**
*
* The package's ID.
*
*
* @param packageId
* The package's ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withPackageId(String packageId) {
setPackageId(packageId);
return this;
}
/**
*
* The package's name.
*
*
* @param packageName
* The package's name.
*/
public void setPackageName(String packageName) {
this.packageName = packageName;
}
/**
*
* The package's name.
*
*
* @return The package's name.
*/
public String getPackageName() {
return this.packageName;
}
/**
*
* The package's name.
*
*
* @param packageName
* The package's name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withPackageName(String packageName) {
setPackageName(packageName);
return this;
}
/**
*
* ARNs of accounts that have read access to the package.
*
*
* @return ARNs of accounts that have read access to the package.
*/
public java.util.List getReadAccessPrincipalArns() {
return readAccessPrincipalArns;
}
/**
*
* ARNs of accounts that have read access to the package.
*
*
* @param readAccessPrincipalArns
* ARNs of accounts that have read access to the package.
*/
public void setReadAccessPrincipalArns(java.util.Collection readAccessPrincipalArns) {
if (readAccessPrincipalArns == null) {
this.readAccessPrincipalArns = null;
return;
}
this.readAccessPrincipalArns = new java.util.ArrayList(readAccessPrincipalArns);
}
/**
*
* ARNs of accounts that have read access to the package.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setReadAccessPrincipalArns(java.util.Collection)} or
* {@link #withReadAccessPrincipalArns(java.util.Collection)} if you want to override the existing values.
*
*
* @param readAccessPrincipalArns
* ARNs of accounts that have read access to the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withReadAccessPrincipalArns(String... readAccessPrincipalArns) {
if (this.readAccessPrincipalArns == null) {
setReadAccessPrincipalArns(new java.util.ArrayList(readAccessPrincipalArns.length));
}
for (String ele : readAccessPrincipalArns) {
this.readAccessPrincipalArns.add(ele);
}
return this;
}
/**
*
* ARNs of accounts that have read access to the package.
*
*
* @param readAccessPrincipalArns
* ARNs of accounts that have read access to the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withReadAccessPrincipalArns(java.util.Collection readAccessPrincipalArns) {
setReadAccessPrincipalArns(readAccessPrincipalArns);
return this;
}
/**
*
* The package's storage location.
*
*
* @param storageLocation
* The package's storage location.
*/
public void setStorageLocation(StorageLocation storageLocation) {
this.storageLocation = storageLocation;
}
/**
*
* The package's storage location.
*
*
* @return The package's storage location.
*/
public StorageLocation getStorageLocation() {
return this.storageLocation;
}
/**
*
* The package's storage location.
*
*
* @param storageLocation
* The package's storage location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withStorageLocation(StorageLocation storageLocation) {
setStorageLocation(storageLocation);
return this;
}
/**
*
* The package's tags.
*
*
* @return The package's tags.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* The package's tags.
*
*
* @param tags
* The package's tags.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* The package's tags.
*
*
* @param tags
* The package's tags.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see DescribePackageResult#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult 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 DescribePackageResult clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* ARNs of accounts that have write access to the package.
*
*
* @return ARNs of accounts that have write access to the package.
*/
public java.util.List getWriteAccessPrincipalArns() {
return writeAccessPrincipalArns;
}
/**
*
* ARNs of accounts that have write access to the package.
*
*
* @param writeAccessPrincipalArns
* ARNs of accounts that have write access to the package.
*/
public void setWriteAccessPrincipalArns(java.util.Collection writeAccessPrincipalArns) {
if (writeAccessPrincipalArns == null) {
this.writeAccessPrincipalArns = null;
return;
}
this.writeAccessPrincipalArns = new java.util.ArrayList(writeAccessPrincipalArns);
}
/**
*
* ARNs of accounts that have write access to the package.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setWriteAccessPrincipalArns(java.util.Collection)} or
* {@link #withWriteAccessPrincipalArns(java.util.Collection)} if you want to override the existing values.
*
*
* @param writeAccessPrincipalArns
* ARNs of accounts that have write access to the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withWriteAccessPrincipalArns(String... writeAccessPrincipalArns) {
if (this.writeAccessPrincipalArns == null) {
setWriteAccessPrincipalArns(new java.util.ArrayList(writeAccessPrincipalArns.length));
}
for (String ele : writeAccessPrincipalArns) {
this.writeAccessPrincipalArns.add(ele);
}
return this;
}
/**
*
* ARNs of accounts that have write access to the package.
*
*
* @param writeAccessPrincipalArns
* ARNs of accounts that have write access to the package.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DescribePackageResult withWriteAccessPrincipalArns(java.util.Collection writeAccessPrincipalArns) {
setWriteAccessPrincipalArns(writeAccessPrincipalArns);
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
if (getPackageId() != null)
sb.append("PackageId: ").append(getPackageId()).append(",");
if (getPackageName() != null)
sb.append("PackageName: ").append(getPackageName()).append(",");
if (getReadAccessPrincipalArns() != null)
sb.append("ReadAccessPrincipalArns: ").append(getReadAccessPrincipalArns()).append(",");
if (getStorageLocation() != null)
sb.append("StorageLocation: ").append(getStorageLocation()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getWriteAccessPrincipalArns() != null)
sb.append("WriteAccessPrincipalArns: ").append(getWriteAccessPrincipalArns());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DescribePackageResult == false)
return false;
DescribePackageResult other = (DescribePackageResult) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
if (other.getPackageId() == null ^ this.getPackageId() == null)
return false;
if (other.getPackageId() != null && other.getPackageId().equals(this.getPackageId()) == 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.getReadAccessPrincipalArns() == null ^ this.getReadAccessPrincipalArns() == null)
return false;
if (other.getReadAccessPrincipalArns() != null && other.getReadAccessPrincipalArns().equals(this.getReadAccessPrincipalArns()) == false)
return false;
if (other.getStorageLocation() == null ^ this.getStorageLocation() == null)
return false;
if (other.getStorageLocation() != null && other.getStorageLocation().equals(this.getStorageLocation()) == 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.getWriteAccessPrincipalArns() == null ^ this.getWriteAccessPrincipalArns() == null)
return false;
if (other.getWriteAccessPrincipalArns() != null && other.getWriteAccessPrincipalArns().equals(this.getWriteAccessPrincipalArns()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
hashCode = prime * hashCode + ((getPackageId() == null) ? 0 : getPackageId().hashCode());
hashCode = prime * hashCode + ((getPackageName() == null) ? 0 : getPackageName().hashCode());
hashCode = prime * hashCode + ((getReadAccessPrincipalArns() == null) ? 0 : getReadAccessPrincipalArns().hashCode());
hashCode = prime * hashCode + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getWriteAccessPrincipalArns() == null) ? 0 : getWriteAccessPrincipalArns().hashCode());
return hashCode;
}
@Override
public DescribePackageResult clone() {
try {
return (DescribePackageResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}