/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package dev.plexapi.sdk;

import dev.plexapi.sdk.hooks.SDKHooks;
import dev.plexapi.sdk.utils.HTTPClient;
import dev.plexapi.sdk.utils.Hook.SdkInitData;
import dev.plexapi.sdk.utils.Hooks;
import dev.plexapi.sdk.utils.RetryConfig;
import java.lang.Object;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

class SDKConfiguration {
    public SecuritySource securitySource;
    
    public Optional<SecuritySource> securitySource() {
        return Optional.ofNullable(securitySource);
    }
    public HTTPClient defaultClient;
    public String serverUrl;
    public int serverIdx = 0;
    List<Map<String, String>> serverDefaults = new ArrayList<>(){ {
        add(new HashMap<>(){ {
            put("protocol", "https");
            put("ip", "10.10.10.47");
            put("port", "32400");
        } });
    } };
    public String language = "java";
    public String openapiDocVersion = "0.0.3";
    public String sdkVersion = "0.3.2";
    public String genVersion = "2.415.8";
    public String userAgent = "speakeasy-sdk/java 0.3.2 2.415.8 0.0.3 dev.plexapi.sdk";

    private Hooks _hooks = createHooks();

    private static Hooks createHooks() {
        Hooks hooks = new Hooks();
        return hooks;
    }
    
    public Hooks hooks() {
        return _hooks;
    }

    public void setHooks(Hooks hooks) {
        this._hooks = hooks;
    }

    /** 
     * Initializes state (for example hooks).
     **/
    public void initialize() {
        SDKHooks.initialize(_hooks);
        // apply the sdk init hook immediately
        SdkInitData data = _hooks.sdkInit(new SdkInitData(serverUrl, defaultClient));
        this.serverUrl = data.baseUrl();
        this.defaultClient = data.client();
    }

    @SuppressWarnings("serial")
    public Map<String, Map<String, Map<String,Object>>> globals = new HashMap<>(){ {
        put("parameters", new HashMap<>());
    } };
    
    public Map<String, String> getServerVariableDefaults() {
        return serverDefaults.get(this.serverIdx);
    }
    public Optional<RetryConfig> retryConfig = Optional.empty();
}
