package host

import (
	"context"
	"encoding/json"
)

func (c Core) GetBaseConfig(ctx context.Context, in *ConfigBaseInput) (*ConfigBaseOutput, error) {
	marshal, err := json.Marshal(in)
	if err != nil {
		return nil, err
	}
	result, err := c.Plugin.CallHost("getBaseConfig", marshal)

	if err != nil {
		return nil, err
	}

	out := ConfigBaseOutput{}
	if err = json.Unmarshal(result, &out); err != nil {
		return nil, err
	}
	return &out, nil
}
