com.amazonaws.services.securityhub.model.AwsIamInstanceProfile Maven / Gradle / Ivy
/*
* Copyright 2016-2021 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an instance profile.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsIamInstanceProfile implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ARN of the instance profile.
*
*/
private String arn;
/**
*
* Indicates when the instance profile was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*/
private String createDate;
/**
*
* The identifier of the instance profile.
*
*/
private String instanceProfileId;
/**
*
* The name of the instance profile.
*
*/
private String instanceProfileName;
/**
*
* The path to the instance profile.
*
*/
private String path;
/**
*
* The roles associated with the instance profile.
*
*/
private java.util.List roles;
/**
*
* The ARN of the instance profile.
*
*
* @param arn
* The ARN of the instance profile.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The ARN of the instance profile.
*
*
* @return The ARN of the instance profile.
*/
public String getArn() {
return this.arn;
}
/**
*
* The ARN of the instance profile.
*
*
* @param arn
* The ARN of the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* Indicates when the instance profile was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @param createDate
* Indicates when the instance profile was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
*/
public void setCreateDate(String createDate) {
this.createDate = createDate;
}
/**
*
* Indicates when the instance profile was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @return Indicates when the instance profile was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
*/
public String getCreateDate() {
return this.createDate;
}
/**
*
* Indicates when the instance profile was created.
*
*
* Uses the date-time
format specified in RFC
* 3339 section 5.6, Internet Date/Time Format. The value cannot contain spaces. For example,
* 2020-03-22T13:22:13.933Z
.
*
*
* @param createDate
* Indicates when the instance profile was created.
*
* Uses the date-time
format specified in RFC 3339 section 5.6, Internet Date/Time
* Format. The value cannot contain spaces. For example, 2020-03-22T13:22:13.933Z
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withCreateDate(String createDate) {
setCreateDate(createDate);
return this;
}
/**
*
* The identifier of the instance profile.
*
*
* @param instanceProfileId
* The identifier of the instance profile.
*/
public void setInstanceProfileId(String instanceProfileId) {
this.instanceProfileId = instanceProfileId;
}
/**
*
* The identifier of the instance profile.
*
*
* @return The identifier of the instance profile.
*/
public String getInstanceProfileId() {
return this.instanceProfileId;
}
/**
*
* The identifier of the instance profile.
*
*
* @param instanceProfileId
* The identifier of the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withInstanceProfileId(String instanceProfileId) {
setInstanceProfileId(instanceProfileId);
return this;
}
/**
*
* The name of the instance profile.
*
*
* @param instanceProfileName
* The name of the instance profile.
*/
public void setInstanceProfileName(String instanceProfileName) {
this.instanceProfileName = instanceProfileName;
}
/**
*
* The name of the instance profile.
*
*
* @return The name of the instance profile.
*/
public String getInstanceProfileName() {
return this.instanceProfileName;
}
/**
*
* The name of the instance profile.
*
*
* @param instanceProfileName
* The name of the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withInstanceProfileName(String instanceProfileName) {
setInstanceProfileName(instanceProfileName);
return this;
}
/**
*
* The path to the instance profile.
*
*
* @param path
* The path to the instance profile.
*/
public void setPath(String path) {
this.path = path;
}
/**
*
* The path to the instance profile.
*
*
* @return The path to the instance profile.
*/
public String getPath() {
return this.path;
}
/**
*
* The path to the instance profile.
*
*
* @param path
* The path to the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withPath(String path) {
setPath(path);
return this;
}
/**
*
* The roles associated with the instance profile.
*
*
* @return The roles associated with the instance profile.
*/
public java.util.List getRoles() {
return roles;
}
/**
*
* The roles associated with the instance profile.
*
*
* @param roles
* The roles associated with the instance profile.
*/
public void setRoles(java.util.Collection roles) {
if (roles == null) {
this.roles = null;
return;
}
this.roles = new java.util.ArrayList(roles);
}
/**
*
* The roles associated with the instance profile.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRoles(java.util.Collection)} or {@link #withRoles(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param roles
* The roles associated with the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withRoles(AwsIamInstanceProfileRole... roles) {
if (this.roles == null) {
setRoles(new java.util.ArrayList(roles.length));
}
for (AwsIamInstanceProfileRole ele : roles) {
this.roles.add(ele);
}
return this;
}
/**
*
* The roles associated with the instance profile.
*
*
* @param roles
* The roles associated with the instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsIamInstanceProfile withRoles(java.util.Collection roles) {
setRoles(roles);
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 (getCreateDate() != null)
sb.append("CreateDate: ").append(getCreateDate()).append(",");
if (getInstanceProfileId() != null)
sb.append("InstanceProfileId: ").append(getInstanceProfileId()).append(",");
if (getInstanceProfileName() != null)
sb.append("InstanceProfileName: ").append(getInstanceProfileName()).append(",");
if (getPath() != null)
sb.append("Path: ").append(getPath()).append(",");
if (getRoles() != null)
sb.append("Roles: ").append(getRoles());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsIamInstanceProfile == false)
return false;
AwsIamInstanceProfile other = (AwsIamInstanceProfile) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getCreateDate() == null ^ this.getCreateDate() == null)
return false;
if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false)
return false;
if (other.getInstanceProfileId() == null ^ this.getInstanceProfileId() == null)
return false;
if (other.getInstanceProfileId() != null && other.getInstanceProfileId().equals(this.getInstanceProfileId()) == false)
return false;
if (other.getInstanceProfileName() == null ^ this.getInstanceProfileName() == null)
return false;
if (other.getInstanceProfileName() != null && other.getInstanceProfileName().equals(this.getInstanceProfileName()) == false)
return false;
if (other.getPath() == null ^ this.getPath() == null)
return false;
if (other.getPath() != null && other.getPath().equals(this.getPath()) == false)
return false;
if (other.getRoles() == null ^ this.getRoles() == null)
return false;
if (other.getRoles() != null && other.getRoles().equals(this.getRoles()) == 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 + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
hashCode = prime * hashCode + ((getInstanceProfileId() == null) ? 0 : getInstanceProfileId().hashCode());
hashCode = prime * hashCode + ((getInstanceProfileName() == null) ? 0 : getInstanceProfileName().hashCode());
hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode());
hashCode = prime * hashCode + ((getRoles() == null) ? 0 : getRoles().hashCode());
return hashCode;
}
@Override
public AwsIamInstanceProfile clone() {
try {
return (AwsIamInstanceProfile) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.securityhub.model.transform.AwsIamInstanceProfileMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}