Package com.slack.api.methods
Interface MethodsCustomRateLimitResolver
-
- All Known Implementing Classes:
MethodsCustomRateLimitResolver.Default
public interface MethodsCustomRateLimitResolver
Custom rate limit resolver.When you need to adjust the rate limits for some reason, you can implement this interface and pass it to MethodsConfig#setCustomRateLimitResolver() method. With that, you can override the allowed requests per minute for selected methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MethodsCustomRateLimitResolver.Default
-
Field Summary
Fields Modifier and Type Field Description static MethodsCustomRateLimitResolver
DEFAULT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<Integer>
getCustomAllowedRequestsForChatPostMessagePerMinute(String teamId, String channel)
Return a present value only when you want to override the allowed requests per minute.Optional<Integer>
getCustomAllowedRequestsPerMinute(String teamId, String methodName)
Return a present value only when you want to override the allowed requests per minute.
-
-
-
Field Detail
-
DEFAULT
static final MethodsCustomRateLimitResolver DEFAULT
-
-
Method Detail
-
getCustomAllowedRequestsPerMinute
Optional<Integer> getCustomAllowedRequestsPerMinute(String teamId, String methodName)
Return a present value only when you want to override the allowed requests per minute. Otherwise, returning Optional.empty() will result in falling back to the built-in calculation.- Parameters:
teamId
- the workspace IDmethodName
- the method name such as "auth.test"- Returns:
- the number of allowed requests per minute
-
getCustomAllowedRequestsForChatPostMessagePerMinute
Optional<Integer> getCustomAllowedRequestsForChatPostMessagePerMinute(String teamId, String channel)
Return a present value only when you want to override the allowed requests per minute. Otherwise, returning Optional.empty() will result in falling back to the built-in calculation.- Parameters:
teamId
- the workspace IDchannel
- either a channel ID or channel name- Returns:
- the number of allowed requests per minute
-
-