/* * 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; import com.amazonaws.AmazonWebServiceRequest; /** *

* Configures or reconfigures the Device Defender audit settings for this * account. Settings include how audit notifications are sent and which audit * checks are enabled or disabled. *

*

* Requires permission to access the UpdateAccountAuditConfiguration action. *

*/ public class UpdateAccountAuditConfigurationRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The Amazon Resource Name (ARN) of the role that grants permission to IoT * to access information about your devices, policies, certificates, and * other items as required when performing an audit. *

*

* Constraints:
* Length: 20 - 2048
*/ private String roleArn; /** *

* Information about the targets to which audit notifications are sent. *

*/ private java.util.Map auditNotificationTargetConfigurations; /** *

* Specifies which audit checks are enabled and disabled for this account. * Use DescribeAccountAuditConfiguration to see the list of all * checks, including those that are currently enabled. *

*

* Some data collection might start immediately when certain checks are * enabled. When a check is disabled, any data collected so far in relation * to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. You must * first delete the check from the scheduled audit or delete the scheduled * audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration, this * parameter is required and must specify at least one enabled check. *

*/ private java.util.Map auditCheckConfigurations; /** *

* The Amazon Resource Name (ARN) of the role that grants permission to IoT * to access information about your devices, policies, certificates, and * other items as required when performing an audit. *

*

* Constraints:
* Length: 20 - 2048
* * @return

* The Amazon Resource Name (ARN) of the role that grants permission * to IoT to access information about your devices, policies, * certificates, and other items as required when performing an * audit. *

*/ public String getRoleArn() { return roleArn; } /** *

* The Amazon Resource Name (ARN) of the role that grants permission to IoT * to access information about your devices, policies, certificates, and * other items as required when performing an audit. *

*

* Constraints:
* Length: 20 - 2048
* * @param roleArn

* The Amazon Resource Name (ARN) of the role that grants * permission to IoT to access information about your devices, * policies, certificates, and other items as required when * performing an audit. *

*/ public void setRoleArn(String roleArn) { this.roleArn = roleArn; } /** *

* The Amazon Resource Name (ARN) of the role that grants permission to IoT * to access information about your devices, policies, certificates, and * other items as required when performing an audit. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Length: 20 - 2048
* * @param roleArn

* The Amazon Resource Name (ARN) of the role that grants * permission to IoT to access information about your devices, * policies, certificates, and other items as required when * performing an audit. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAccountAuditConfigurationRequest withRoleArn(String roleArn) { this.roleArn = roleArn; return this; } /** *

* Information about the targets to which audit notifications are sent. *

* * @return

* Information about the targets to which audit notifications are * sent. *

*/ public java.util.Map getAuditNotificationTargetConfigurations() { return auditNotificationTargetConfigurations; } /** *

* Information about the targets to which audit notifications are sent. *

* * @param auditNotificationTargetConfigurations

* Information about the targets to which audit notifications are * sent. *

*/ public void setAuditNotificationTargetConfigurations( java.util.Map auditNotificationTargetConfigurations) { this.auditNotificationTargetConfigurations = auditNotificationTargetConfigurations; } /** *

* Information about the targets to which audit notifications are sent. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param auditNotificationTargetConfigurations

* Information about the targets to which audit notifications are * sent. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAccountAuditConfigurationRequest withAuditNotificationTargetConfigurations( java.util.Map auditNotificationTargetConfigurations) { this.auditNotificationTargetConfigurations = auditNotificationTargetConfigurations; return this; } /** *

* Information about the targets to which audit notifications are sent. *

*

* The method adds a new key-value pair into * auditNotificationTargetConfigurations parameter, and returns a reference * to this object so that method calls can be chained together. * * @param key The key of the entry to be added into * auditNotificationTargetConfigurations. * @param value The corresponding value of the entry to be added into * auditNotificationTargetConfigurations. * @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAccountAuditConfigurationRequest addauditNotificationTargetConfigurationsEntry( String key, AuditNotificationTarget value) { if (null == this.auditNotificationTargetConfigurations) { this.auditNotificationTargetConfigurations = new java.util.HashMap(); } if (this.auditNotificationTargetConfigurations.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.auditNotificationTargetConfigurations.put(key, value); return this; } /** * Removes all the entries added into auditNotificationTargetConfigurations. *

* Returns a reference to this object so that method calls can be chained * together. */ public UpdateAccountAuditConfigurationRequest clearauditNotificationTargetConfigurationsEntries() { this.auditNotificationTargetConfigurations = null; return this; } /** *

* Specifies which audit checks are enabled and disabled for this account. * Use DescribeAccountAuditConfiguration to see the list of all * checks, including those that are currently enabled. *

*

* Some data collection might start immediately when certain checks are * enabled. When a check is disabled, any data collected so far in relation * to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. You must * first delete the check from the scheduled audit or delete the scheduled * audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration, this * parameter is required and must specify at least one enabled check. *

* * @return

* Specifies which audit checks are enabled and disabled for this * account. Use DescribeAccountAuditConfiguration to * see the list of all checks, including those that are currently * enabled. *

*

* Some data collection might start immediately when certain checks * are enabled. When a check is disabled, any data collected so far * in relation to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. * You must first delete the check from the scheduled audit or * delete the scheduled audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration * , this parameter is required and must specify at least one * enabled check. *

*/ public java.util.Map getAuditCheckConfigurations() { return auditCheckConfigurations; } /** *

* Specifies which audit checks are enabled and disabled for this account. * Use DescribeAccountAuditConfiguration to see the list of all * checks, including those that are currently enabled. *

*

* Some data collection might start immediately when certain checks are * enabled. When a check is disabled, any data collected so far in relation * to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. You must * first delete the check from the scheduled audit or delete the scheduled * audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration, this * parameter is required and must specify at least one enabled check. *

* * @param auditCheckConfigurations

* Specifies which audit checks are enabled and disabled for this * account. Use DescribeAccountAuditConfiguration to * see the list of all checks, including those that are currently * enabled. *

*

* Some data collection might start immediately when certain * checks are enabled. When a check is disabled, any data * collected so far in relation to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled * audit. You must first delete the check from the scheduled * audit or delete the scheduled audit itself. *

*

* On the first call to * UpdateAccountAuditConfiguration, this parameter * is required and must specify at least one enabled check. *

*/ public void setAuditCheckConfigurations( java.util.Map auditCheckConfigurations) { this.auditCheckConfigurations = auditCheckConfigurations; } /** *

* Specifies which audit checks are enabled and disabled for this account. * Use DescribeAccountAuditConfiguration to see the list of all * checks, including those that are currently enabled. *

*

* Some data collection might start immediately when certain checks are * enabled. When a check is disabled, any data collected so far in relation * to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. You must * first delete the check from the scheduled audit or delete the scheduled * audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration, this * parameter is required and must specify at least one enabled check. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param auditCheckConfigurations

* Specifies which audit checks are enabled and disabled for this * account. Use DescribeAccountAuditConfiguration to * see the list of all checks, including those that are currently * enabled. *

*

* Some data collection might start immediately when certain * checks are enabled. When a check is disabled, any data * collected so far in relation to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled * audit. You must first delete the check from the scheduled * audit or delete the scheduled audit itself. *

*

* On the first call to * UpdateAccountAuditConfiguration, this parameter * is required and must specify at least one enabled check. *

* @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAccountAuditConfigurationRequest withAuditCheckConfigurations( java.util.Map auditCheckConfigurations) { this.auditCheckConfigurations = auditCheckConfigurations; return this; } /** *

* Specifies which audit checks are enabled and disabled for this account. * Use DescribeAccountAuditConfiguration to see the list of all * checks, including those that are currently enabled. *

*

* Some data collection might start immediately when certain checks are * enabled. When a check is disabled, any data collected so far in relation * to the check is deleted. *

*

* You cannot disable a check if it's used by any scheduled audit. You must * first delete the check from the scheduled audit or delete the scheduled * audit itself. *

*

* On the first call to UpdateAccountAuditConfiguration, this * parameter is required and must specify at least one enabled check. *

*

* The method adds a new key-value pair into auditCheckConfigurations * parameter, and returns a reference to this object so that method calls * can be chained together. * * @param key The key of the entry to be added into * auditCheckConfigurations. * @param value The corresponding value of the entry to be added into * auditCheckConfigurations. * @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAccountAuditConfigurationRequest addauditCheckConfigurationsEntry(String key, AuditCheckConfiguration value) { if (null == this.auditCheckConfigurations) { this.auditCheckConfigurations = new java.util.HashMap(); } if (this.auditCheckConfigurations.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.auditCheckConfigurations.put(key, value); return this; } /** * Removes all the entries added into auditCheckConfigurations. *

* Returns a reference to this object so that method calls can be chained * together. */ public UpdateAccountAuditConfigurationRequest clearauditCheckConfigurationsEntries() { this.auditCheckConfigurations = null; 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 (getRoleArn() != null) sb.append("roleArn: " + getRoleArn() + ","); if (getAuditNotificationTargetConfigurations() != null) sb.append("auditNotificationTargetConfigurations: " + getAuditNotificationTargetConfigurations() + ","); if (getAuditCheckConfigurations() != null) sb.append("auditCheckConfigurations: " + getAuditCheckConfigurations()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRoleArn() == null) ? 0 : getRoleArn().hashCode()); hashCode = prime * hashCode + ((getAuditNotificationTargetConfigurations() == null) ? 0 : getAuditNotificationTargetConfigurations().hashCode()); hashCode = prime * hashCode + ((getAuditCheckConfigurations() == null) ? 0 : getAuditCheckConfigurations() .hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateAccountAuditConfigurationRequest == false) return false; UpdateAccountAuditConfigurationRequest other = (UpdateAccountAuditConfigurationRequest) obj; if (other.getRoleArn() == null ^ this.getRoleArn() == null) return false; if (other.getRoleArn() != null && other.getRoleArn().equals(this.getRoleArn()) == false) return false; if (other.getAuditNotificationTargetConfigurations() == null ^ this.getAuditNotificationTargetConfigurations() == null) return false; if (other.getAuditNotificationTargetConfigurations() != null && other.getAuditNotificationTargetConfigurations().equals( this.getAuditNotificationTargetConfigurations()) == false) return false; if (other.getAuditCheckConfigurations() == null ^ this.getAuditCheckConfigurations() == null) return false; if (other.getAuditCheckConfigurations() != null && other.getAuditCheckConfigurations().equals(this.getAuditCheckConfigurations()) == false) return false; return true; } }