Package app.kntrl.client.openapi.model
Class RateLimiterCfg
- java.lang.Object
-
- app.kntrl.client.openapi.model.RateLimiterCfg
-
@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class RateLimiterCfg extends java.lang.ObjectRate limiter configuration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRateLimiterCfg.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static java.util.HashSet<java.lang.String>openapiFieldsstatic java.util.HashSet<java.lang.String>openapiRequiredFieldsstatic java.lang.StringSERIALIZED_NAME_ALIGN_LOADstatic java.lang.StringSERIALIZED_NAME_IPstatic java.lang.StringSERIALIZED_NAME_PARENTstatic java.lang.StringSERIALIZED_NAME_PERIODstatic java.lang.StringSERIALIZED_NAME_QUOTAstatic java.lang.StringSERIALIZED_NAME_USER_ID
-
Constructor Summary
Constructors Constructor Description RateLimiterCfg()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RateLimiterCfgalignLoad(java.lang.Boolean alignLoad)booleanequals(java.lang.Object o)static RateLimiterCfgfromJson(java.lang.String jsonString)Create an instance of RateLimiterCfg given an JSON stringjava.util.Map<java.lang.String,java.lang.Object>getAdditionalProperties()Return the additional (undeclared) property.java.lang.ObjectgetAdditionalProperty(java.lang.String key)Return the additional (undeclared) property with the specified name.java.lang.BooleangetAlignLoad()Insert delays between requests if there are too many simultaneous requests.java.lang.BooleangetIp()Create different rate limiters for different ips.java.lang.StringgetParent()Allows to combine rate limiters.java.lang.StringgetPeriod()Quota restoring periodjava.lang.DoublegetQuota()Total quota available for time period.java.lang.BooleangetUserId()Create different rate limiters for different users.inthashCode()RateLimiterCfgip(java.lang.Boolean ip)RateLimiterCfgparent(java.lang.String parent)RateLimiterCfgperiod(java.lang.String period)RateLimiterCfgputAdditionalProperty(java.lang.String key, java.lang.Object value)Set the additional (undeclared) property with the specified name and value.RateLimiterCfgquota(java.lang.Double quota)voidsetAlignLoad(java.lang.Boolean alignLoad)voidsetIp(java.lang.Boolean ip)voidsetParent(java.lang.String parent)voidsetPeriod(java.lang.String period)voidsetQuota(java.lang.Double quota)voidsetUserId(java.lang.Boolean userId)java.lang.StringtoJson()Convert an instance of RateLimiterCfg to an JSON stringjava.lang.StringtoString()RateLimiterCfguserId(java.lang.Boolean userId)static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)Validates the JSON Object and throws an exception if issues found
-
-
-
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
-
-
Method Detail
-
userId
public RateLimiterCfg userId(java.lang.Boolean userId)
-
getUserId
@Nullable public java.lang.Boolean getUserId()
Create different rate limiters for different users.- Returns:
- userId
-
setUserId
public void setUserId(java.lang.Boolean userId)
-
ip
public RateLimiterCfg ip(java.lang.Boolean ip)
-
getIp
@Nullable public java.lang.Boolean getIp()
Create different rate limiters for different ips.- Returns:
- ip
-
setIp
public void setIp(java.lang.Boolean ip)
-
quota
public RateLimiterCfg quota(java.lang.Double quota)
-
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)
-
period
public RateLimiterCfg period(java.lang.String period)
-
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)
-
parent
public RateLimiterCfg parent(java.lang.String parent)
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws java.io.IOExceptionValidates 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
-
-