Usage
The Dart API client has three separate functions,
one for each operation.
Report incorrect code
Copy
var response = await client.WaitForApiKeyAsync(
"api-key-add-operation-test-csharp",
Enum.Parse<ApiKeyOperation>("Add")
);
Report incorrect code
Copy
var response = await client.WaitForApiKeyAsync(
"api-key-update-operation-test-csharp",
Enum.Parse<ApiKeyOperation>("Update"),
new ApiKey
{
Description = "my updated api key",
Acl = new List<Acl>
{
Enum.Parse<Acl>("Search"),
Enum.Parse<Acl>("AddObject"),
Enum.Parse<Acl>("DeleteObject"),
},
Indexes = new List<string> { "Movies", "Books" },
Referers = new List<string> { "*google.com", "*algolia.com" },
Validity = 305,
MaxQueriesPerIPPerHour = 95,
MaxHitsPerQuery = 20,
}
);
Report incorrect code
Copy
var response = await client.WaitForApiKeyAsync(
"api-key-delete-operation-test-csharp",
Enum.Parse<ApiKeyOperation>("Delete")
);
Parameters
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
API key to wait for.
Operation type to wait for.
One of:
ApiKeyOperation.Add,
ApiKeyOperation.Update,
or ApiKeyOperation.Delete.API key object.
Required for
Update operations.
For details about the API key properties, see Update API key.Maximum number of retries for checking the status.
Returns a timeout based on the current number of iterations.
Additional request options.
Parameter that can be used as a signal to cancel the request.
API key to wait for.
API key object with expected properties.
Required for the
waitKeyUpdate method.
For details about the API key properties,
see Update API key.Hide child attributes
Hide child attributes
Maximum number of retries for checking the status.
Timeout in milliseconds after which an exception is thrown.
Initial delay after which to check for the status for the first time.
Maximum delay between status checks.
Additional request options.
API key to wait for.
Operation type to wait for.
One of:
search.API_KEY_OPERATION_ADD,
search.API_KEY_OPERATION_UPDATE,
or search.API_KEY_OPERATION_DELETE.Functional options to provide extra arguments.
Show available functions
Show available functions
Signature:
func(apiKey ApiKey) waitForApiKeyOptionAPI key object.
Required for update operations.
For details about the API key properties, see Update API key.Signature:
func(maxRetries int) iterableOptionSets the maximum number of retries for this method.Signature:
func(count int) time.DurationReturns a timeout based on the current number of iterations.Signature:
func(key string, value string) requestOptionSets extra header parameters for this request.
To learn more, see request options.Signature:
func(key string, value string) requestOptionSets extra query parameters for this request.
To learn more, see request options.API key to wait for.
Operation type to wait for.
One of:
ApiKeyOperation.ADD,
ApiKeyOperation.UPDATE,
or ApiKeyOperation.DELETE.API key object.
Required for
UPDATE operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
(int retries) -> Math.min(retries * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.
API key to wait for.
Operation type to wait for.
One of:
add, update, or delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
(retryCount: number) -> Math.min(retryCount * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.
API key to wait for.
Operation type to wait for.
Can be
ApiKeyOperation.Add,
ApiKeyOperation.Update,
or ApiKeyOperation.Delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Time after which the status is checked for the first time.
This time is doubled after every check until it reaches the value set by
maxDelay.Maximum time to wait between status checks.
Additional request options.
API key to wait for.
Operation type to wait for.
One of:
add, update, or delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Number of milliseconds between status checks.
Additional request options.
API key to wait for.
Operation type to wait for.
One of:
add, update, or delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
min(retry_count*0.2, 5)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.
API key to wait for.
Operation type to wait for.
One of:
add, update, or delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
[retry_count * 200, 5000].minReturns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.
API key to wait for.
Operation type to wait for.
One of:
ApiKeyOperation.Add,
ApiKeyOperation.Update,
or ApiKeyOperation.Delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
(retries: Long) => Math.min(retries * 200, 5000)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.
API key to wait for.
Operation type to wait for.
One of:
ApiKeyOperation.add,
ApiKeyOperation.update, or ApiKeyOperation.delete.API key object.
Required for
update operations.
For details about the API key properties,
see Update API key.Maximum number of retries for checking the status.
Default:
(retryCount) -> min(TimeInterval(retryCount) * 0.2, 5)Returns the time between status checks based on the current number of iterations.
By default, the initial delay is 200 milliseconds.
With every iteration, the delay increases by 200 milliseconds,
until a maximum of 5 seconds is reached.Additional request options.