/* * Copyright 2018-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.accessanalyzer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Access control configuration structures for your resource. You specify the configuration as a type-value pair. You * can specify only one type of access control configuration. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Configuration implements Serializable, Cloneable, StructuredPojo { /** ** The access control configuration is for an Amazon EBS volume snapshot. *
*/ private EbsSnapshotConfiguration ebsSnapshot; /** ** The access control configuration is for an Amazon ECR repository. *
*/ private EcrRepositoryConfiguration ecrRepository; /** ** The access control configuration is for an IAM role. *
*/ private IamRoleConfiguration iamRole; /** ** The access control configuration is for an Amazon EFS file system. *
*/ private EfsFileSystemConfiguration efsFileSystem; /** ** The access control configuration is for a KMS key. *
*/ private KmsKeyConfiguration kmsKey; /** ** The access control configuration is for an Amazon RDS DB cluster snapshot. *
*/ private RdsDbClusterSnapshotConfiguration rdsDbClusterSnapshot; /** ** The access control configuration is for an Amazon RDS DB snapshot. *
*/ private RdsDbSnapshotConfiguration rdsDbSnapshot; /** ** The access control configuration is for a Secrets Manager secret. *
*/ private SecretsManagerSecretConfiguration secretsManagerSecret; /** ** The access control configuration is for an Amazon S3 Bucket. *
*/ private S3BucketConfiguration s3Bucket; /** ** The access control configuration is for an Amazon SNS topic *
*/ private SnsTopicConfiguration snsTopic; /** ** The access control configuration is for an Amazon SQS queue. *
*/ private SqsQueueConfiguration sqsQueue; /** ** The access control configuration is for an Amazon EBS volume snapshot. *
* * @param ebsSnapshot * The access control configuration is for an Amazon EBS volume snapshot. */ public void setEbsSnapshot(EbsSnapshotConfiguration ebsSnapshot) { this.ebsSnapshot = ebsSnapshot; } /** ** The access control configuration is for an Amazon EBS volume snapshot. *
* * @return The access control configuration is for an Amazon EBS volume snapshot. */ public EbsSnapshotConfiguration getEbsSnapshot() { return this.ebsSnapshot; } /** ** The access control configuration is for an Amazon EBS volume snapshot. *
* * @param ebsSnapshot * The access control configuration is for an Amazon EBS volume snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withEbsSnapshot(EbsSnapshotConfiguration ebsSnapshot) { setEbsSnapshot(ebsSnapshot); return this; } /** ** The access control configuration is for an Amazon ECR repository. *
* * @param ecrRepository * The access control configuration is for an Amazon ECR repository. */ public void setEcrRepository(EcrRepositoryConfiguration ecrRepository) { this.ecrRepository = ecrRepository; } /** ** The access control configuration is for an Amazon ECR repository. *
* * @return The access control configuration is for an Amazon ECR repository. */ public EcrRepositoryConfiguration getEcrRepository() { return this.ecrRepository; } /** ** The access control configuration is for an Amazon ECR repository. *
* * @param ecrRepository * The access control configuration is for an Amazon ECR repository. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withEcrRepository(EcrRepositoryConfiguration ecrRepository) { setEcrRepository(ecrRepository); return this; } /** ** The access control configuration is for an IAM role. *
* * @param iamRole * The access control configuration is for an IAM role. */ public void setIamRole(IamRoleConfiguration iamRole) { this.iamRole = iamRole; } /** ** The access control configuration is for an IAM role. *
* * @return The access control configuration is for an IAM role. */ public IamRoleConfiguration getIamRole() { return this.iamRole; } /** ** The access control configuration is for an IAM role. *
* * @param iamRole * The access control configuration is for an IAM role. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withIamRole(IamRoleConfiguration iamRole) { setIamRole(iamRole); return this; } /** ** The access control configuration is for an Amazon EFS file system. *
* * @param efsFileSystem * The access control configuration is for an Amazon EFS file system. */ public void setEfsFileSystem(EfsFileSystemConfiguration efsFileSystem) { this.efsFileSystem = efsFileSystem; } /** ** The access control configuration is for an Amazon EFS file system. *
* * @return The access control configuration is for an Amazon EFS file system. */ public EfsFileSystemConfiguration getEfsFileSystem() { return this.efsFileSystem; } /** ** The access control configuration is for an Amazon EFS file system. *
* * @param efsFileSystem * The access control configuration is for an Amazon EFS file system. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withEfsFileSystem(EfsFileSystemConfiguration efsFileSystem) { setEfsFileSystem(efsFileSystem); return this; } /** ** The access control configuration is for a KMS key. *
* * @param kmsKey * The access control configuration is for a KMS key. */ public void setKmsKey(KmsKeyConfiguration kmsKey) { this.kmsKey = kmsKey; } /** ** The access control configuration is for a KMS key. *
* * @return The access control configuration is for a KMS key. */ public KmsKeyConfiguration getKmsKey() { return this.kmsKey; } /** ** The access control configuration is for a KMS key. *
* * @param kmsKey * The access control configuration is for a KMS key. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withKmsKey(KmsKeyConfiguration kmsKey) { setKmsKey(kmsKey); return this; } /** ** The access control configuration is for an Amazon RDS DB cluster snapshot. *
* * @param rdsDbClusterSnapshot * The access control configuration is for an Amazon RDS DB cluster snapshot. */ public void setRdsDbClusterSnapshot(RdsDbClusterSnapshotConfiguration rdsDbClusterSnapshot) { this.rdsDbClusterSnapshot = rdsDbClusterSnapshot; } /** ** The access control configuration is for an Amazon RDS DB cluster snapshot. *
* * @return The access control configuration is for an Amazon RDS DB cluster snapshot. */ public RdsDbClusterSnapshotConfiguration getRdsDbClusterSnapshot() { return this.rdsDbClusterSnapshot; } /** ** The access control configuration is for an Amazon RDS DB cluster snapshot. *
* * @param rdsDbClusterSnapshot * The access control configuration is for an Amazon RDS DB cluster snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withRdsDbClusterSnapshot(RdsDbClusterSnapshotConfiguration rdsDbClusterSnapshot) { setRdsDbClusterSnapshot(rdsDbClusterSnapshot); return this; } /** ** The access control configuration is for an Amazon RDS DB snapshot. *
* * @param rdsDbSnapshot * The access control configuration is for an Amazon RDS DB snapshot. */ public void setRdsDbSnapshot(RdsDbSnapshotConfiguration rdsDbSnapshot) { this.rdsDbSnapshot = rdsDbSnapshot; } /** ** The access control configuration is for an Amazon RDS DB snapshot. *
* * @return The access control configuration is for an Amazon RDS DB snapshot. */ public RdsDbSnapshotConfiguration getRdsDbSnapshot() { return this.rdsDbSnapshot; } /** ** The access control configuration is for an Amazon RDS DB snapshot. *
* * @param rdsDbSnapshot * The access control configuration is for an Amazon RDS DB snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withRdsDbSnapshot(RdsDbSnapshotConfiguration rdsDbSnapshot) { setRdsDbSnapshot(rdsDbSnapshot); return this; } /** ** The access control configuration is for a Secrets Manager secret. *
* * @param secretsManagerSecret * The access control configuration is for a Secrets Manager secret. */ public void setSecretsManagerSecret(SecretsManagerSecretConfiguration secretsManagerSecret) { this.secretsManagerSecret = secretsManagerSecret; } /** ** The access control configuration is for a Secrets Manager secret. *
* * @return The access control configuration is for a Secrets Manager secret. */ public SecretsManagerSecretConfiguration getSecretsManagerSecret() { return this.secretsManagerSecret; } /** ** The access control configuration is for a Secrets Manager secret. *
* * @param secretsManagerSecret * The access control configuration is for a Secrets Manager secret. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withSecretsManagerSecret(SecretsManagerSecretConfiguration secretsManagerSecret) { setSecretsManagerSecret(secretsManagerSecret); return this; } /** ** The access control configuration is for an Amazon S3 Bucket. *
* * @param s3Bucket * The access control configuration is for an Amazon S3 Bucket. */ public void setS3Bucket(S3BucketConfiguration s3Bucket) { this.s3Bucket = s3Bucket; } /** ** The access control configuration is for an Amazon S3 Bucket. *
* * @return The access control configuration is for an Amazon S3 Bucket. */ public S3BucketConfiguration getS3Bucket() { return this.s3Bucket; } /** ** The access control configuration is for an Amazon S3 Bucket. *
* * @param s3Bucket * The access control configuration is for an Amazon S3 Bucket. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withS3Bucket(S3BucketConfiguration s3Bucket) { setS3Bucket(s3Bucket); return this; } /** ** The access control configuration is for an Amazon SNS topic *
* * @param snsTopic * The access control configuration is for an Amazon SNS topic */ public void setSnsTopic(SnsTopicConfiguration snsTopic) { this.snsTopic = snsTopic; } /** ** The access control configuration is for an Amazon SNS topic *
* * @return The access control configuration is for an Amazon SNS topic */ public SnsTopicConfiguration getSnsTopic() { return this.snsTopic; } /** ** The access control configuration is for an Amazon SNS topic *
* * @param snsTopic * The access control configuration is for an Amazon SNS topic * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withSnsTopic(SnsTopicConfiguration snsTopic) { setSnsTopic(snsTopic); return this; } /** ** The access control configuration is for an Amazon SQS queue. *
* * @param sqsQueue * The access control configuration is for an Amazon SQS queue. */ public void setSqsQueue(SqsQueueConfiguration sqsQueue) { this.sqsQueue = sqsQueue; } /** ** The access control configuration is for an Amazon SQS queue. *
* * @return The access control configuration is for an Amazon SQS queue. */ public SqsQueueConfiguration getSqsQueue() { return this.sqsQueue; } /** ** The access control configuration is for an Amazon SQS queue. *
* * @param sqsQueue * The access control configuration is for an Amazon SQS queue. * @return Returns a reference to this object so that method calls can be chained together. */ public Configuration withSqsQueue(SqsQueueConfiguration sqsQueue) { setSqsQueue(sqsQueue); 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 (getEbsSnapshot() != null) sb.append("EbsSnapshot: ").append(getEbsSnapshot()).append(","); if (getEcrRepository() != null) sb.append("EcrRepository: ").append(getEcrRepository()).append(","); if (getIamRole() != null) sb.append("IamRole: ").append(getIamRole()).append(","); if (getEfsFileSystem() != null) sb.append("EfsFileSystem: ").append(getEfsFileSystem()).append(","); if (getKmsKey() != null) sb.append("KmsKey: ").append(getKmsKey()).append(","); if (getRdsDbClusterSnapshot() != null) sb.append("RdsDbClusterSnapshot: ").append(getRdsDbClusterSnapshot()).append(","); if (getRdsDbSnapshot() != null) sb.append("RdsDbSnapshot: ").append(getRdsDbSnapshot()).append(","); if (getSecretsManagerSecret() != null) sb.append("SecretsManagerSecret: ").append(getSecretsManagerSecret()).append(","); if (getS3Bucket() != null) sb.append("S3Bucket: ").append(getS3Bucket()).append(","); if (getSnsTopic() != null) sb.append("SnsTopic: ").append(getSnsTopic()).append(","); if (getSqsQueue() != null) sb.append("SqsQueue: ").append(getSqsQueue()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Configuration == false) return false; Configuration other = (Configuration) obj; if (other.getEbsSnapshot() == null ^ this.getEbsSnapshot() == null) return false; if (other.getEbsSnapshot() != null && other.getEbsSnapshot().equals(this.getEbsSnapshot()) == false) return false; if (other.getEcrRepository() == null ^ this.getEcrRepository() == null) return false; if (other.getEcrRepository() != null && other.getEcrRepository().equals(this.getEcrRepository()) == false) return false; if (other.getIamRole() == null ^ this.getIamRole() == null) return false; if (other.getIamRole() != null && other.getIamRole().equals(this.getIamRole()) == false) return false; if (other.getEfsFileSystem() == null ^ this.getEfsFileSystem() == null) return false; if (other.getEfsFileSystem() != null && other.getEfsFileSystem().equals(this.getEfsFileSystem()) == false) return false; if (other.getKmsKey() == null ^ this.getKmsKey() == null) return false; if (other.getKmsKey() != null && other.getKmsKey().equals(this.getKmsKey()) == false) return false; if (other.getRdsDbClusterSnapshot() == null ^ this.getRdsDbClusterSnapshot() == null) return false; if (other.getRdsDbClusterSnapshot() != null && other.getRdsDbClusterSnapshot().equals(this.getRdsDbClusterSnapshot()) == false) return false; if (other.getRdsDbSnapshot() == null ^ this.getRdsDbSnapshot() == null) return false; if (other.getRdsDbSnapshot() != null && other.getRdsDbSnapshot().equals(this.getRdsDbSnapshot()) == false) return false; if (other.getSecretsManagerSecret() == null ^ this.getSecretsManagerSecret() == null) return false; if (other.getSecretsManagerSecret() != null && other.getSecretsManagerSecret().equals(this.getSecretsManagerSecret()) == false) return false; if (other.getS3Bucket() == null ^ this.getS3Bucket() == null) return false; if (other.getS3Bucket() != null && other.getS3Bucket().equals(this.getS3Bucket()) == false) return false; if (other.getSnsTopic() == null ^ this.getSnsTopic() == null) return false; if (other.getSnsTopic() != null && other.getSnsTopic().equals(this.getSnsTopic()) == false) return false; if (other.getSqsQueue() == null ^ this.getSqsQueue() == null) return false; if (other.getSqsQueue() != null && other.getSqsQueue().equals(this.getSqsQueue()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEbsSnapshot() == null) ? 0 : getEbsSnapshot().hashCode()); hashCode = prime * hashCode + ((getEcrRepository() == null) ? 0 : getEcrRepository().hashCode()); hashCode = prime * hashCode + ((getIamRole() == null) ? 0 : getIamRole().hashCode()); hashCode = prime * hashCode + ((getEfsFileSystem() == null) ? 0 : getEfsFileSystem().hashCode()); hashCode = prime * hashCode + ((getKmsKey() == null) ? 0 : getKmsKey().hashCode()); hashCode = prime * hashCode + ((getRdsDbClusterSnapshot() == null) ? 0 : getRdsDbClusterSnapshot().hashCode()); hashCode = prime * hashCode + ((getRdsDbSnapshot() == null) ? 0 : getRdsDbSnapshot().hashCode()); hashCode = prime * hashCode + ((getSecretsManagerSecret() == null) ? 0 : getSecretsManagerSecret().hashCode()); hashCode = prime * hashCode + ((getS3Bucket() == null) ? 0 : getS3Bucket().hashCode()); hashCode = prime * hashCode + ((getSnsTopic() == null) ? 0 : getSnsTopic().hashCode()); hashCode = prime * hashCode + ((getSqsQueue() == null) ? 0 : getSqsQueue().hashCode()); return hashCode; } @Override public Configuration clone() { try { return (Configuration) 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.accessanalyzer.model.transform.ConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }