Class RiotGamesApiConfig.Builder
Inheritance
Inherited Members
Namespace: Camille.RiotGames
Assembly: Camille.RiotGames.dll
Syntax
public class Builder
Constructors
| Improve this Doc View SourceBuilder(String)
Declaration
public Builder(string apiKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | apiKey |
Fields
| Improve this Doc View SourceApiKey
Riot Games API key.
Declaration
public string ApiKey
Field Value
Type | Description |
---|---|
System.String |
ApiRouteConfig
How the API call should include the region/route.
Declaration
public RouteConfig ApiRouteConfig
Field Value
Type | Description |
---|---|
RouteConfig |
Examples
Default value:
RouteConfig.InUrl
|
Improve this Doc
View Source
ApiUrl
URL to call for the Riot Games API. Include {0} for the region/route, if you want it in the URL - Not necessary if apiCallRouteConfig is RouteConfig.InUrlAsRouteQueryParameter.
Declaration
public string ApiUrl
Field Value
Type | Description |
---|---|
System.String |
Examples
Default value:
"https://{0}.api.riotgames.com"
|
Improve this Doc
View Source
BackoffStrategy
A backoff strategy for 429s with missing Retry-After headers. Returns seconds.
Declaration
public BackoffStrategy BackoffStrategy
Field Value
Type | Description |
---|---|
BackoffStrategy |
Examples
Default value:
(retries, num429s, num5xxs) => 0.5 + Math.Pow(2, num5xxs + num429s)
|
Improve this Doc
View Source
ConcurrentInstanceFactor
Multiplier for using concurrent instances. For example, use 0.25 for 4 concurrent instances equally spread.
Declaration
public float ConcurrentInstanceFactor
Field Value
Type | Description |
---|---|
System.Single |
Examples
Default value:
1f
|
Improve this Doc
View Source
MaxConcurrentRequests
Maximum number of concurrent requests allowed.
Declaration
public int MaxConcurrentRequests
Field Value
Type | Description |
---|---|
System.Int32 |
Examples
Default value:
1000
|
Improve this Doc
View Source
OverheadFactor
Overhead factor to reduce the chance 429s due to network noise.
Declaration
public float OverheadFactor
Field Value
Type | Description |
---|---|
System.Single |
Examples
Default value:
0.95f
|
Improve this Doc
View Source
Retries
Number of times to retry a failed request (zero for no retries).
Declaration
public int Retries
Field Value
Type | Description |
---|---|
System.Int32 |
Examples
Default value:
5
|
Improve this Doc
View Source
RouteKey
The query or header name to use for the region/route. Only used if RouteConfig is set to InHeader or InQueryParam.
Declaration
public string RouteKey
Field Value
Type | Description |
---|---|
System.String |
Examples
Default value:
"Riot-Region"
|
Improve this Doc
View Source
TokenBucketFactory
Factory for creating token buckets.
Declaration
public TokenBucketFactory TokenBucketFactory
Field Value
Type | Description |
---|---|
TokenBucketFactory |
Examples
Default value:
(timespan, totalLimit, concurrentInstanceFactor, overheadFactor) => new MingweiSamuel.TokenBucket.CircularTokenBucket(timespan, totalLimit, 20, 0.5f, concurrentInstanceFactor * overheadFactor)
Methods
| Improve this Doc View SourceBuild()
Declaration
public RiotGamesApiConfig Build()
Returns
Type | Description |
---|---|
RiotGamesApiConfig |