@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode()); hashCode = prime * hashCode + ((getRateKey() == null) ? 0 : getRateKey().hashCode()); hashCode = prime * hashCode + ((getRateLimit() == null) ? 0 : getRateLimit().hashCode()); hashCode = prime * hashCode + ((getChangeToken() == null) ? 0 : getChangeToken().hashCode()); return hashCode; }
/** * <p> * The <code>ChangeToken</code> that you used to submit the <code>CreateRateBasedRule</code> request. You can also * use this value to query the status of the request. For more information, see <a>GetChangeTokenStatus</a>. * </p> * * @param changeToken * The <code>ChangeToken</code> that you used to submit the <code>CreateRateBasedRule</code> request. You can * also use this value to query the status of the request. For more information, see * <a>GetChangeTokenStatus</a>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateRateBasedRuleRequest withChangeToken(String changeToken) { setChangeToken(changeToken); return this; }
/** * <p> * A friendly name or description for the metrics for this <code>RateBasedRule</code>. The name can contain only * alphanumeric characters (A-Z, a-z, 0-9); the name can't contain whitespace. You can't change the name of the * metric after you create the <code>RateBasedRule</code>. * </p> * * @param metricName * A friendly name or description for the metrics for this <code>RateBasedRule</code>. The name can contain * only alphanumeric characters (A-Z, a-z, 0-9); the name can't contain whitespace. You can't change the name * of the metric after you create the <code>RateBasedRule</code>. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateRateBasedRuleRequest withMetricName(String metricName) { setMetricName(metricName); return this; }
/** * <p> * A friendly name or description of the <a>RateBasedRule</a>. You can't change the name of a * <code>RateBasedRule</code> after you create it. * </p> * * @param name * A friendly name or description of the <a>RateBasedRule</a>. You can't change the name of a * <code>RateBasedRule</code> after you create it. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateRateBasedRuleRequest withName(String name) { setName(name); return this; }
/** * <p> * The maximum number of requests, which have an identical value in the field that is specified by * <code>RateKey</code>, allowed in a five-minute period. If the number of requests exceeds the * <code>RateLimit</code> and the other predicates specified in the rule are also met, AWS WAF triggers the action * that is specified for this rule. * </p> * * @param rateLimit * The maximum number of requests, which have an identical value in the field that is specified by * <code>RateKey</code>, allowed in a five-minute period. If the number of requests exceeds the * <code>RateLimit</code> and the other predicates specified in the rule are also met, AWS WAF triggers the * action that is specified for this rule. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateRateBasedRuleRequest withRateLimit(Long rateLimit) { setRateLimit(rateLimit); return this; }
/** * <p> * The field that AWS WAF uses to determine if requests are likely arriving from a single source and thus subject to * rate monitoring. The only valid value for <code>RateKey</code> is <code>IP</code>. <code>IP</code> indicates that * requests that arrive from the same IP address are subject to the <code>RateLimit</code> that is specified in the * <code>RateBasedRule</code>. * </p> * * @param rateKey * The field that AWS WAF uses to determine if requests are likely arriving from a single source and thus * subject to rate monitoring. The only valid value for <code>RateKey</code> is <code>IP</code>. * <code>IP</code> indicates that requests that arrive from the same IP address are subject to the * <code>RateLimit</code> that is specified in the <code>RateBasedRule</code>. * @return Returns a reference to this object so that method calls can be chained together. * @see RateKey */ public CreateRateBasedRuleRequest withRateKey(String rateKey) { setRateKey(rateKey); return this; }
return false; CreateRateBasedRuleRequest other = (CreateRateBasedRuleRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getMetricName() == null ^ this.getMetricName() == null) return false; if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false) return false; if (other.getRateKey() == null ^ this.getRateKey() == null) return false; if (other.getRateKey() != null && other.getRateKey().equals(this.getRateKey()) == false) return false; if (other.getRateLimit() == null ^ this.getRateLimit() == null) return false; if (other.getRateLimit() != null && other.getRateLimit().equals(this.getRateLimit()) == false) return false; if (other.getChangeToken() == null ^ this.getChangeToken() == null) return false; if (other.getChangeToken() != null && other.getChangeToken().equals(this.getChangeToken()) == false) return false; return true;
/** * 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getMetricName() != null) sb.append("MetricName: ").append(getMetricName()).append(","); if (getRateKey() != null) sb.append("RateKey: ").append(getRateKey()).append(","); if (getRateLimit() != null) sb.append("RateLimit: ").append(getRateLimit()).append(","); if (getChangeToken() != null) sb.append("ChangeToken: ").append(getChangeToken()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(CreateRateBasedRuleRequest createRateBasedRuleRequest, ProtocolMarshaller protocolMarshaller) { if (createRateBasedRuleRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createRateBasedRuleRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getMetricName(), METRICNAME_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getRateKey(), RATEKEY_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getRateLimit(), RATELIMIT_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getChangeToken(), CHANGETOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Marshall the given parameter object. */ public void marshall(CreateRateBasedRuleRequest createRateBasedRuleRequest, ProtocolMarshaller protocolMarshaller) { if (createRateBasedRuleRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createRateBasedRuleRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getMetricName(), METRICNAME_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getRateKey(), RATEKEY_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getRateLimit(), RATELIMIT_BINDING); protocolMarshaller.marshall(createRateBasedRuleRequest.getChangeToken(), CHANGETOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }