/* * 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; /** *
* Information that identifies the noncompliant resource. *
*/ public class ResourceIdentifier implements Serializable { /** ** The ID of the certificate attached to the resource. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*/
private String deviceCertificateId;
/**
*
* The ID of the CA certificate used to authorize the certificate. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*/
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. *
*
* Constraints:
* Length: 12 - 12
* Pattern: [0-9]+
*/
private String account;
/**
*
* The ARN of the IAM role that has overly permissive actions. *
*
* Constraints:
* Length: 20 - 2048
*/
private String iamRoleArn;
/**
*
* The ARN of the role alias that has overly permissive actions. *
*
* Constraints:
* Length: 1 - 2048
*/
private String roleAliasArn;
/**
*
* The issuer certificate identifier. *
*/ private IssuerCertificateIdentifier issuerCertificateIdentifier; /** ** The ARN of the identified device certificate. *
*/ private String deviceCertificateArn; /** ** The ID of the certificate attached to the resource. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @return
* The ID of the certificate attached to the resource. *
*/ public String getDeviceCertificateId() { return deviceCertificateId; } /** ** The ID of the certificate attached to the resource. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @param deviceCertificateId
* The ID of the certificate attached to the resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withDeviceCertificateId(String deviceCertificateId) { this.deviceCertificateId = deviceCertificateId; return this; } /** ** The ID of the CA certificate used to authorize the certificate. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @return
* The ID of the CA certificate used to authorize the certificate. *
*/ public String getCaCertificateId() { return caCertificateId; } /** ** The ID of the CA certificate used to authorize the certificate. *
*
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 64 - 64
* Pattern: (0x)?[a-fA-F0-9]+
*
* @param caCertificateId
* The ID of the CA certificate used to authorize the * certificate. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withCaCertificateId(String caCertificateId) { this.caCertificateId = caCertificateId; return this; } /** ** The ID of the Amazon Cognito identity pool. *
* * @return* The ID of the Amazon Cognito identity pool. *
*/ public String getCognitoIdentityPoolId() { return cognitoIdentityPoolId; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param cognitoIdentityPoolId
* The ID of the Amazon Cognito identity pool. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withCognitoIdentityPoolId(String cognitoIdentityPoolId) { this.cognitoIdentityPoolId = cognitoIdentityPoolId; return this; } /** ** The client ID. *
* * @return* The client ID. *
*/ public String getClientId() { return clientId; } /** ** The client ID. *
* * @param clientId* The client ID. *
*/ public void setClientId(String clientId) { this.clientId = clientId; } /** ** The client ID. *
** Returns a reference to this object so that method calls can be chained * together. * * @param clientId
* The client ID. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withClientId(String clientId) { this.clientId = clientId; return this; } /** ** The version of the policy associated with the resource. *
* * @return* The version of the policy associated with the resource. *
*/ public PolicyVersionIdentifier getPolicyVersionIdentifier() { return policyVersionIdentifier; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyVersionIdentifier
* The version of the policy associated with the resource. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withPolicyVersionIdentifier( PolicyVersionIdentifier policyVersionIdentifier) { this.policyVersionIdentifier = policyVersionIdentifier; return this; } /** ** The account with which the resource is associated. *
*
* Constraints:
* Length: 12 - 12
* Pattern: [0-9]+
*
* @return
* The account with which the resource is associated. *
*/ public String getAccount() { return account; } /** ** The account with which the resource is associated. *
*
* Constraints:
* Length: 12 - 12
* Pattern: [0-9]+
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 12 - 12
* Pattern: [0-9]+
*
* @param account
* The account with which the resource is associated. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withAccount(String account) { this.account = account; return this; } /** ** The ARN of the IAM role that has overly permissive actions. *
*
* Constraints:
* Length: 20 - 2048
*
* @return
* The ARN of the IAM role that has overly permissive actions. *
*/ public String getIamRoleArn() { return iamRoleArn; } /** ** The ARN of the IAM role that has overly permissive actions. *
*
* Constraints:
* Length: 20 - 2048
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
*
* @param iamRoleArn
* The ARN of the IAM role that has overly permissive actions. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withIamRoleArn(String iamRoleArn) { this.iamRoleArn = iamRoleArn; return this; } /** ** The ARN of the role alias that has overly permissive actions. *
*
* Constraints:
* Length: 1 - 2048
*
* @return
* The ARN of the role alias that has overly permissive actions. *
*/ public String getRoleAliasArn() { return roleAliasArn; } /** ** The ARN of the role alias that has overly permissive actions. *
*
* Constraints:
* Length: 1 - 2048
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 2048
*
* @param roleAliasArn
* The ARN of the role alias that has overly permissive actions. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withRoleAliasArn(String roleAliasArn) { this.roleAliasArn = roleAliasArn; return this; } /** ** The issuer certificate identifier. *
* * @return* The issuer certificate identifier. *
*/ public IssuerCertificateIdentifier getIssuerCertificateIdentifier() { return issuerCertificateIdentifier; } /** ** The issuer certificate identifier. *
* * @param issuerCertificateIdentifier* The issuer certificate identifier. *
*/ public void setIssuerCertificateIdentifier( IssuerCertificateIdentifier issuerCertificateIdentifier) { this.issuerCertificateIdentifier = issuerCertificateIdentifier; } /** ** The issuer certificate identifier. *
** Returns a reference to this object so that method calls can be chained * together. * * @param issuerCertificateIdentifier
* The issuer certificate identifier. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withIssuerCertificateIdentifier( IssuerCertificateIdentifier issuerCertificateIdentifier) { this.issuerCertificateIdentifier = issuerCertificateIdentifier; return this; } /** ** The ARN of the identified device certificate. *
* * @return* The ARN of the identified device certificate. *
*/ public String getDeviceCertificateArn() { return deviceCertificateArn; } /** ** The ARN of the identified device certificate. *
* * @param deviceCertificateArn* The ARN of the identified device certificate. *
*/ public void setDeviceCertificateArn(String deviceCertificateArn) { this.deviceCertificateArn = deviceCertificateArn; } /** ** The ARN of the identified device certificate. *
** Returns a reference to this object so that method calls can be chained * together. * * @param deviceCertificateArn
* The ARN of the identified device certificate. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ResourceIdentifier withDeviceCertificateArn(String deviceCertificateArn) { this.deviceCertificateArn = deviceCertificateArn; 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 (getDeviceCertificateId() != null) sb.append("deviceCertificateId: " + getDeviceCertificateId() + ","); if (getCaCertificateId() != null) sb.append("caCertificateId: " + getCaCertificateId() + ","); if (getCognitoIdentityPoolId() != null) sb.append("cognitoIdentityPoolId: " + getCognitoIdentityPoolId() + ","); if (getClientId() != null) sb.append("clientId: " + getClientId() + ","); if (getPolicyVersionIdentifier() != null) sb.append("policyVersionIdentifier: " + getPolicyVersionIdentifier() + ","); if (getAccount() != null) sb.append("account: " + getAccount() + ","); if (getIamRoleArn() != null) sb.append("iamRoleArn: " + getIamRoleArn() + ","); if (getRoleAliasArn() != null) sb.append("roleAliasArn: " + getRoleAliasArn() + ","); if (getIssuerCertificateIdentifier() != null) sb.append("issuerCertificateIdentifier: " + getIssuerCertificateIdentifier() + ","); if (getDeviceCertificateArn() != null) sb.append("deviceCertificateArn: " + getDeviceCertificateArn()); sb.append("}"); return sb.toString(); } @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()); hashCode = prime * hashCode + ((getIssuerCertificateIdentifier() == null) ? 0 : getIssuerCertificateIdentifier().hashCode()); hashCode = prime * hashCode + ((getDeviceCertificateArn() == null) ? 0 : getDeviceCertificateArn().hashCode()); return hashCode; } @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; if (other.getIssuerCertificateIdentifier() == null ^ this.getIssuerCertificateIdentifier() == null) return false; if (other.getIssuerCertificateIdentifier() != null && other.getIssuerCertificateIdentifier().equals( this.getIssuerCertificateIdentifier()) == false) return false; if (other.getDeviceCertificateArn() == null ^ this.getDeviceCertificateArn() == null) return false; if (other.getDeviceCertificateArn() != null && other.getDeviceCertificateArn().equals(this.getDeviceCertificateArn()) == false) return false; return true; } }