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

* The API request rate limits. *

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

* The API target request burst rate limit. This allows more requests through for a period of time than the target * rate limit. *

*/ private Integer burstLimit; /** *

* The API target request rate limit. *

*/ private Double rateLimit; /** *

* The API target request burst rate limit. This allows more requests through for a period of time than the target * rate limit. *

* * @param burstLimit * The API target request burst rate limit. This allows more requests through for a period of time than the * target rate limit. */ public void setBurstLimit(Integer burstLimit) { this.burstLimit = burstLimit; } /** *

* The API target request burst rate limit. This allows more requests through for a period of time than the target * rate limit. *

* * @return The API target request burst rate limit. This allows more requests through for a period of time than the * target rate limit. */ public Integer getBurstLimit() { return this.burstLimit; } /** *

* The API target request burst rate limit. This allows more requests through for a period of time than the target * rate limit. *

* * @param burstLimit * The API target request burst rate limit. This allows more requests through for a period of time than the * target rate limit. * @return Returns a reference to this object so that method calls can be chained together. */ public ThrottleSettings withBurstLimit(Integer burstLimit) { setBurstLimit(burstLimit); return this; } /** *

* The API target request rate limit. *

* * @param rateLimit * The API target request rate limit. */ public void setRateLimit(Double rateLimit) { this.rateLimit = rateLimit; } /** *

* The API target request rate limit. *

* * @return The API target request rate limit. */ public Double getRateLimit() { return this.rateLimit; } /** *

* The API target request rate limit. *

* * @param rateLimit * The API target request rate limit. * @return Returns a reference to this object so that method calls can be chained together. */ public ThrottleSettings withRateLimit(Double rateLimit) { setRateLimit(rateLimit); 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 (getBurstLimit() != null) sb.append("BurstLimit: ").append(getBurstLimit()).append(","); if (getRateLimit() != null) sb.append("RateLimit: ").append(getRateLimit()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ThrottleSettings == false) return false; ThrottleSettings other = (ThrottleSettings) obj; if (other.getBurstLimit() == null ^ this.getBurstLimit() == null) return false; if (other.getBurstLimit() != null && other.getBurstLimit().equals(this.getBurstLimit()) == false) return false; if (other.getRateLimit() == null ^ this.getRateLimit() == null) return false; if (other.getRateLimit() != null && other.getRateLimit().equals(this.getRateLimit()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBurstLimit() == null) ? 0 : getBurstLimit().hashCode()); hashCode = prime * hashCode + ((getRateLimit() == null) ? 0 : getRateLimit().hashCode()); return hashCode; } @Override public ThrottleSettings clone() { try { return (ThrottleSettings) 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.apigateway.model.transform.ThrottleSettingsMarshaller.getInstance().marshall(this, protocolMarshaller); } }