Search in sources :

Example 1 with ApiKeyAuth

use of com.arm.mbed.cloud.sdk.internal.statistics.auth.ApiKeyAuth in project mbed-cloud-sdk-java by ARMmbed.

the class GsonCustomConverterFactory method setApiKey.

/**
 * Helper method to configure the first api key found
 * @param apiKey API key
 * @return ApiClient
 */
public ApiClient setApiKey(String apiKey) {
    for (Interceptor apiAuthorization : apiAuthorizations.values()) {
        if (apiAuthorization instanceof ApiKeyAuth) {
            ApiKeyAuth keyAuth = (ApiKeyAuth) apiAuthorization;
            keyAuth.setApiKey(apiKey);
            return this;
        }
    }
    return this;
}
Also used : ApiKeyAuth(com.arm.mbed.cloud.sdk.internal.statistics.auth.ApiKeyAuth) Interceptor(okhttp3.Interceptor)

Aggregations

ApiKeyAuth (com.arm.mbed.cloud.sdk.internal.statistics.auth.ApiKeyAuth)1 Interceptor (okhttp3.Interceptor)1