All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.assemblyai.api.core.RequestOptions Maven / Gradle / Ivy

The newest version!
package com.assemblyai.api.core;

import java.util.HashMap;
import java.util.Map;

public final class RequestOptions {
    private final String apiKey;

    private RequestOptions(String apiKey) {
        this.apiKey = apiKey;
    }

    public Map getHeaders() {
        Map headers = new HashMap<>();
        if (this.apiKey != null) {
            headers.put("Authorization", this.apiKey);
        }
        return headers;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static final class Builder {
        private String apiKey = null;

        public Builder apiKey(String apiKey) {
            this.apiKey = apiKey;
            return this;
        }

        public RequestOptions build() {
            return new RequestOptions(apiKey);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy