/* * 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.shield.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Information about the volume of attacks during the time period, included in an AttackStatisticsDataItem. If * the accompanying AttackCount in the statistics object is zero, this setting might be empty. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AttackVolume implements Serializable, Cloneable, StructuredPojo { /** *

* A statistics object that uses bits per second as the unit. This is included for network level attacks. *

*/ private AttackVolumeStatistics bitsPerSecond; /** *

* A statistics object that uses packets per second as the unit. This is included for network level attacks. *

*/ private AttackVolumeStatistics packetsPerSecond; /** *

* A statistics object that uses requests per second as the unit. This is included for application level attacks, * and is only available for accounts that are subscribed to Shield Advanced. *

*/ private AttackVolumeStatistics requestsPerSecond; /** *

* A statistics object that uses bits per second as the unit. This is included for network level attacks. *

* * @param bitsPerSecond * A statistics object that uses bits per second as the unit. This is included for network level attacks. */ public void setBitsPerSecond(AttackVolumeStatistics bitsPerSecond) { this.bitsPerSecond = bitsPerSecond; } /** *

* A statistics object that uses bits per second as the unit. This is included for network level attacks. *

* * @return A statistics object that uses bits per second as the unit. This is included for network level attacks. */ public AttackVolumeStatistics getBitsPerSecond() { return this.bitsPerSecond; } /** *

* A statistics object that uses bits per second as the unit. This is included for network level attacks. *

* * @param bitsPerSecond * A statistics object that uses bits per second as the unit. This is included for network level attacks. * @return Returns a reference to this object so that method calls can be chained together. */ public AttackVolume withBitsPerSecond(AttackVolumeStatistics bitsPerSecond) { setBitsPerSecond(bitsPerSecond); return this; } /** *

* A statistics object that uses packets per second as the unit. This is included for network level attacks. *

* * @param packetsPerSecond * A statistics object that uses packets per second as the unit. This is included for network level attacks. */ public void setPacketsPerSecond(AttackVolumeStatistics packetsPerSecond) { this.packetsPerSecond = packetsPerSecond; } /** *

* A statistics object that uses packets per second as the unit. This is included for network level attacks. *

* * @return A statistics object that uses packets per second as the unit. This is included for network level attacks. */ public AttackVolumeStatistics getPacketsPerSecond() { return this.packetsPerSecond; } /** *

* A statistics object that uses packets per second as the unit. This is included for network level attacks. *

* * @param packetsPerSecond * A statistics object that uses packets per second as the unit. This is included for network level attacks. * @return Returns a reference to this object so that method calls can be chained together. */ public AttackVolume withPacketsPerSecond(AttackVolumeStatistics packetsPerSecond) { setPacketsPerSecond(packetsPerSecond); return this; } /** *

* A statistics object that uses requests per second as the unit. This is included for application level attacks, * and is only available for accounts that are subscribed to Shield Advanced. *

* * @param requestsPerSecond * A statistics object that uses requests per second as the unit. This is included for application level * attacks, and is only available for accounts that are subscribed to Shield Advanced. */ public void setRequestsPerSecond(AttackVolumeStatistics requestsPerSecond) { this.requestsPerSecond = requestsPerSecond; } /** *

* A statistics object that uses requests per second as the unit. This is included for application level attacks, * and is only available for accounts that are subscribed to Shield Advanced. *

* * @return A statistics object that uses requests per second as the unit. This is included for application level * attacks, and is only available for accounts that are subscribed to Shield Advanced. */ public AttackVolumeStatistics getRequestsPerSecond() { return this.requestsPerSecond; } /** *

* A statistics object that uses requests per second as the unit. This is included for application level attacks, * and is only available for accounts that are subscribed to Shield Advanced. *

* * @param requestsPerSecond * A statistics object that uses requests per second as the unit. This is included for application level * attacks, and is only available for accounts that are subscribed to Shield Advanced. * @return Returns a reference to this object so that method calls can be chained together. */ public AttackVolume withRequestsPerSecond(AttackVolumeStatistics requestsPerSecond) { setRequestsPerSecond(requestsPerSecond); 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 (getBitsPerSecond() != null) sb.append("BitsPerSecond: ").append(getBitsPerSecond()).append(","); if (getPacketsPerSecond() != null) sb.append("PacketsPerSecond: ").append(getPacketsPerSecond()).append(","); if (getRequestsPerSecond() != null) sb.append("RequestsPerSecond: ").append(getRequestsPerSecond()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttackVolume == false) return false; AttackVolume other = (AttackVolume) obj; if (other.getBitsPerSecond() == null ^ this.getBitsPerSecond() == null) return false; if (other.getBitsPerSecond() != null && other.getBitsPerSecond().equals(this.getBitsPerSecond()) == false) return false; if (other.getPacketsPerSecond() == null ^ this.getPacketsPerSecond() == null) return false; if (other.getPacketsPerSecond() != null && other.getPacketsPerSecond().equals(this.getPacketsPerSecond()) == false) return false; if (other.getRequestsPerSecond() == null ^ this.getRequestsPerSecond() == null) return false; if (other.getRequestsPerSecond() != null && other.getRequestsPerSecond().equals(this.getRequestsPerSecond()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBitsPerSecond() == null) ? 0 : getBitsPerSecond().hashCode()); hashCode = prime * hashCode + ((getPacketsPerSecond() == null) ? 0 : getPacketsPerSecond().hashCode()); hashCode = prime * hashCode + ((getRequestsPerSecond() == null) ? 0 : getRequestsPerSecond().hashCode()); return hashCode; } @Override public AttackVolume clone() { try { return (AttackVolume) 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.shield.model.transform.AttackVolumeMarshaller.getInstance().marshall(this, protocolMarshaller); } }