
com.amazonaws.services.iot.model.ResourceIdentifier Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information that identifies the noncompliant resource.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceIdentifier implements Serializable, Cloneable, StructuredPojo {
/**
*
* The ID of the certificate attached to the resource.
*
*/
private String deviceCertificateId;
/**
*
* The ID of the CA certificate used to authorize the certificate.
*
*/
private String caCertificateId;
/**
*
* The ID of the Amazon Cognito identity pool.
*
*/
private String cognitoIdentityPoolId;
/**
*
* The client ID.
*
*/
private String clientId;
/**
*
* The version of the policy associated with the resource.
*
*/
private PolicyVersionIdentifier policyVersionIdentifier;
/**
*
* The account with which the resource is associated.
*
*/
private String account;
/**
*
* The ARN of the IAM role that has overly permissive actions.
*
*/
private String iamRoleArn;
/**
*
* The ARN of the role alias that has overly permissive actions.
*
*/
private String roleAliasArn;
/**
*
* The ID of the certificate attached to the resource.
*
*
* @param deviceCertificateId
* The ID of the certificate attached to the resource.
*/
public void setDeviceCertificateId(String deviceCertificateId) {
this.deviceCertificateId = deviceCertificateId;
}
/**
*
* The ID of the certificate attached to the resource.
*
*
* @return The ID of the certificate attached to the resource.
*/
public String getDeviceCertificateId() {
return this.deviceCertificateId;
}
/**
*
* The ID of the certificate attached to the resource.
*
*
* @param deviceCertificateId
* The ID of the certificate attached to the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withDeviceCertificateId(String deviceCertificateId) {
setDeviceCertificateId(deviceCertificateId);
return this;
}
/**
*
* The ID of the CA certificate used to authorize the certificate.
*
*
* @param caCertificateId
* The ID of the CA certificate used to authorize the certificate.
*/
public void setCaCertificateId(String caCertificateId) {
this.caCertificateId = caCertificateId;
}
/**
*
* The ID of the CA certificate used to authorize the certificate.
*
*
* @return The ID of the CA certificate used to authorize the certificate.
*/
public String getCaCertificateId() {
return this.caCertificateId;
}
/**
*
* The ID of the CA certificate used to authorize the certificate.
*
*
* @param caCertificateId
* The ID of the CA certificate used to authorize the certificate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withCaCertificateId(String caCertificateId) {
setCaCertificateId(caCertificateId);
return this;
}
/**
*
* The ID of the Amazon Cognito identity pool.
*
*
* @param cognitoIdentityPoolId
* The ID of the Amazon Cognito identity pool.
*/
public void setCognitoIdentityPoolId(String cognitoIdentityPoolId) {
this.cognitoIdentityPoolId = cognitoIdentityPoolId;
}
/**
*
* The ID of the Amazon Cognito identity pool.
*
*
* @return The ID of the Amazon Cognito identity pool.
*/
public String getCognitoIdentityPoolId() {
return this.cognitoIdentityPoolId;
}
/**
*
* The ID of the Amazon Cognito identity pool.
*
*
* @param cognitoIdentityPoolId
* The ID of the Amazon Cognito identity pool.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withCognitoIdentityPoolId(String cognitoIdentityPoolId) {
setCognitoIdentityPoolId(cognitoIdentityPoolId);
return this;
}
/**
*
* The client ID.
*
*
* @param clientId
* The client ID.
*/
public void setClientId(String clientId) {
this.clientId = clientId;
}
/**
*
* The client ID.
*
*
* @return The client ID.
*/
public String getClientId() {
return this.clientId;
}
/**
*
* The client ID.
*
*
* @param clientId
* The client ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withClientId(String clientId) {
setClientId(clientId);
return this;
}
/**
*
* The version of the policy associated with the resource.
*
*
* @param policyVersionIdentifier
* The version of the policy associated with the resource.
*/
public void setPolicyVersionIdentifier(PolicyVersionIdentifier policyVersionIdentifier) {
this.policyVersionIdentifier = policyVersionIdentifier;
}
/**
*
* The version of the policy associated with the resource.
*
*
* @return The version of the policy associated with the resource.
*/
public PolicyVersionIdentifier getPolicyVersionIdentifier() {
return this.policyVersionIdentifier;
}
/**
*
* The version of the policy associated with the resource.
*
*
* @param policyVersionIdentifier
* The version of the policy associated with the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withPolicyVersionIdentifier(PolicyVersionIdentifier policyVersionIdentifier) {
setPolicyVersionIdentifier(policyVersionIdentifier);
return this;
}
/**
*
* The account with which the resource is associated.
*
*
* @param account
* The account with which the resource is associated.
*/
public void setAccount(String account) {
this.account = account;
}
/**
*
* The account with which the resource is associated.
*
*
* @return The account with which the resource is associated.
*/
public String getAccount() {
return this.account;
}
/**
*
* The account with which the resource is associated.
*
*
* @param account
* The account with which the resource is associated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withAccount(String account) {
setAccount(account);
return this;
}
/**
*
* The ARN of the IAM role that has overly permissive actions.
*
*
* @param iamRoleArn
* The ARN of the IAM role that has overly permissive actions.
*/
public void setIamRoleArn(String iamRoleArn) {
this.iamRoleArn = iamRoleArn;
}
/**
*
* The ARN of the IAM role that has overly permissive actions.
*
*
* @return The ARN of the IAM role that has overly permissive actions.
*/
public String getIamRoleArn() {
return this.iamRoleArn;
}
/**
*
* The ARN of the IAM role that has overly permissive actions.
*
*
* @param iamRoleArn
* The ARN of the IAM role that has overly permissive actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withIamRoleArn(String iamRoleArn) {
setIamRoleArn(iamRoleArn);
return this;
}
/**
*
* The ARN of the role alias that has overly permissive actions.
*
*
* @param roleAliasArn
* The ARN of the role alias that has overly permissive actions.
*/
public void setRoleAliasArn(String roleAliasArn) {
this.roleAliasArn = roleAliasArn;
}
/**
*
* The ARN of the role alias that has overly permissive actions.
*
*
* @return The ARN of the role alias that has overly permissive actions.
*/
public String getRoleAliasArn() {
return this.roleAliasArn;
}
/**
*
* The ARN of the role alias that has overly permissive actions.
*
*
* @param roleAliasArn
* The ARN of the role alias that has overly permissive actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceIdentifier withRoleAliasArn(String roleAliasArn) {
setRoleAliasArn(roleAliasArn);
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 (getDeviceCertificateId() != null)
sb.append("DeviceCertificateId: ").append(getDeviceCertificateId()).append(",");
if (getCaCertificateId() != null)
sb.append("CaCertificateId: ").append(getCaCertificateId()).append(",");
if (getCognitoIdentityPoolId() != null)
sb.append("CognitoIdentityPoolId: ").append(getCognitoIdentityPoolId()).append(",");
if (getClientId() != null)
sb.append("ClientId: ").append(getClientId()).append(",");
if (getPolicyVersionIdentifier() != null)
sb.append("PolicyVersionIdentifier: ").append(getPolicyVersionIdentifier()).append(",");
if (getAccount() != null)
sb.append("Account: ").append(getAccount()).append(",");
if (getIamRoleArn() != null)
sb.append("IamRoleArn: ").append(getIamRoleArn()).append(",");
if (getRoleAliasArn() != null)
sb.append("RoleAliasArn: ").append(getRoleAliasArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceIdentifier == false)
return false;
ResourceIdentifier other = (ResourceIdentifier) obj;
if (other.getDeviceCertificateId() == null ^ this.getDeviceCertificateId() == null)
return false;
if (other.getDeviceCertificateId() != null && other.getDeviceCertificateId().equals(this.getDeviceCertificateId()) == false)
return false;
if (other.getCaCertificateId() == null ^ this.getCaCertificateId() == null)
return false;
if (other.getCaCertificateId() != null && other.getCaCertificateId().equals(this.getCaCertificateId()) == false)
return false;
if (other.getCognitoIdentityPoolId() == null ^ this.getCognitoIdentityPoolId() == null)
return false;
if (other.getCognitoIdentityPoolId() != null && other.getCognitoIdentityPoolId().equals(this.getCognitoIdentityPoolId()) == false)
return false;
if (other.getClientId() == null ^ this.getClientId() == null)
return false;
if (other.getClientId() != null && other.getClientId().equals(this.getClientId()) == false)
return false;
if (other.getPolicyVersionIdentifier() == null ^ this.getPolicyVersionIdentifier() == null)
return false;
if (other.getPolicyVersionIdentifier() != null && other.getPolicyVersionIdentifier().equals(this.getPolicyVersionIdentifier()) == false)
return false;
if (other.getAccount() == null ^ this.getAccount() == null)
return false;
if (other.getAccount() != null && other.getAccount().equals(this.getAccount()) == false)
return false;
if (other.getIamRoleArn() == null ^ this.getIamRoleArn() == null)
return false;
if (other.getIamRoleArn() != null && other.getIamRoleArn().equals(this.getIamRoleArn()) == false)
return false;
if (other.getRoleAliasArn() == null ^ this.getRoleAliasArn() == null)
return false;
if (other.getRoleAliasArn() != null && other.getRoleAliasArn().equals(this.getRoleAliasArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDeviceCertificateId() == null) ? 0 : getDeviceCertificateId().hashCode());
hashCode = prime * hashCode + ((getCaCertificateId() == null) ? 0 : getCaCertificateId().hashCode());
hashCode = prime * hashCode + ((getCognitoIdentityPoolId() == null) ? 0 : getCognitoIdentityPoolId().hashCode());
hashCode = prime * hashCode + ((getClientId() == null) ? 0 : getClientId().hashCode());
hashCode = prime * hashCode + ((getPolicyVersionIdentifier() == null) ? 0 : getPolicyVersionIdentifier().hashCode());
hashCode = prime * hashCode + ((getAccount() == null) ? 0 : getAccount().hashCode());
hashCode = prime * hashCode + ((getIamRoleArn() == null) ? 0 : getIamRoleArn().hashCode());
hashCode = prime * hashCode + ((getRoleAliasArn() == null) ? 0 : getRoleAliasArn().hashCode());
return hashCode;
}
@Override
public ResourceIdentifier clone() {
try {
return (ResourceIdentifier) 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.iot.model.transform.ResourceIdentifierMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}