Class RateLimiterCfg


  • @Generated("org.openapitools.codegen.languages.JavaClientCodegen")
    public class RateLimiterCfg
    extends java.lang.Object
    Rate limiter configuration
    • Field Detail

      • SERIALIZED_NAME_USER_ID

        public static final java.lang.String SERIALIZED_NAME_USER_ID
        See Also:
        Constant Field Values
      • SERIALIZED_NAME_IP

        public static final java.lang.String SERIALIZED_NAME_IP
        See Also:
        Constant Field Values
      • SERIALIZED_NAME_QUOTA

        public static final java.lang.String SERIALIZED_NAME_QUOTA
        See Also:
        Constant Field Values
      • SERIALIZED_NAME_PERIOD

        public static final java.lang.String SERIALIZED_NAME_PERIOD
        See Also:
        Constant Field Values
      • SERIALIZED_NAME_ALIGN_LOAD

        public static final java.lang.String SERIALIZED_NAME_ALIGN_LOAD
        See Also:
        Constant Field Values
      • SERIALIZED_NAME_PARENT

        public static final java.lang.String SERIALIZED_NAME_PARENT
        See Also:
        Constant Field Values
      • openapiFields

        public static java.util.HashSet<java.lang.String> openapiFields
      • openapiRequiredFields

        public static java.util.HashSet<java.lang.String> openapiRequiredFields
    • Constructor Detail

      • RateLimiterCfg

        public RateLimiterCfg()
    • Method Detail

      • getUserId

        @Nullable
        public java.lang.Boolean getUserId()
        Create different rate limiters for different users.
        Returns:
        userId
      • setUserId

        public void setUserId​(java.lang.Boolean userId)
      • getIp

        @Nullable
        public java.lang.Boolean getIp()
        Create different rate limiters for different ips.
        Returns:
        ip
      • setIp

        public void setIp​(java.lang.Boolean ip)
      • getQuota

        @Nullable
        public java.lang.Double getQuota()
        Total quota available for time period. Quota means \"weight\" of a request. So quota 1.0 and period 1s allows 10 request with weight 0.1 per seconds or 5 request with weight 0.2 per second.
        Returns:
        quota
      • setQuota

        public void setQuota​(java.lang.Double quota)
      • getPeriod

        @Nullable
        public java.lang.String getPeriod()
        Quota restoring period
        Returns:
        period
      • setPeriod

        public void setPeriod​(java.lang.String period)
      • alignLoad

        public RateLimiterCfg alignLoad​(java.lang.Boolean alignLoad)
      • getAlignLoad

        @Nullable
        public java.lang.Boolean getAlignLoad()
        Insert delays between requests if there are too many simultaneous requests.
        Returns:
        alignLoad
      • setAlignLoad

        public void setAlignLoad​(java.lang.Boolean alignLoad)
      • getParent

        @Nullable
        public java.lang.String getParent()
        Allows to combine rate limiters. Let's say rt1 allows 10 reqs per seconds, and rt2 allows 20 reqs per minute. If the rt1 has the rt2 as a parent, that means that rt1 allows 10 reqs per seconds but not more than 20 per minute.
        Returns:
        parent
      • setParent

        public void setParent​(java.lang.String parent)
      • putAdditionalProperty

        public RateLimiterCfg putAdditionalProperty​(java.lang.String key,
                                                    java.lang.Object value)
        Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
      • getAdditionalProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getAdditionalProperties()
        Return the additional (undeclared) property.
      • getAdditionalProperty

        public java.lang.Object getAdditionalProperty​(java.lang.String key)
        Return the additional (undeclared) property with the specified name.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj)
                                       throws java.io.IOException
        Validates the JSON Object and throws an exception if issues found
        Parameters:
        jsonObj - JSON Object
        Throws:
        java.io.IOException - if the JSON Object is invalid with respect to RateLimiterCfg
      • fromJson

        public static RateLimiterCfg fromJson​(java.lang.String jsonString)
                                       throws java.io.IOException
        Create an instance of RateLimiterCfg given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of RateLimiterCfg
        Throws:
        java.io.IOException - if the JSON string is invalid with respect to RateLimiterCfg
      • toJson

        public java.lang.String toJson()
        Convert an instance of RateLimiterCfg to an JSON string
        Returns:
        JSON string