// Code generated by Fern. DO NOT EDIT.

package scoreconfigs

import (
    core "pentagi/pkg/observability/langfuse/api/core"
    internal "pentagi/pkg/observability/langfuse/api/internal"
    context "context"
    api "pentagi/pkg/observability/langfuse/api"
    option "pentagi/pkg/observability/langfuse/api/option"
)


type Client struct {
    WithRawResponse *RawClient

    options *core.RequestOptions
    baseURL string
    caller *internal.Caller
}

func NewClient(options *core.RequestOptions) *Client {
    return &Client{
        WithRawResponse: NewRawClient(options),
        options: options,
        baseURL: options.BaseURL,
        caller: internal.NewCaller(
            &internal.CallerParams{
                Client: options.HTTPClient,
                MaxAttempts: options.MaxAttempts,
            },
        ),
    }
}

// Get all score configs
func (c *Client) Get(
    ctx context.Context,
    request *api.ScoreConfigsGetRequest,
    opts ...option.RequestOption,
) (*api.ScoreConfigs, error){
    response, err := c.WithRawResponse.Get(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create a score configuration (config). Score configs are used to define the structure of scores
func (c *Client) Create(
    ctx context.Context,
    request *api.CreateScoreConfigRequest,
    opts ...option.RequestOption,
) (*api.ScoreConfig, error){
    response, err := c.WithRawResponse.Create(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get a score config
func (c *Client) GetByID(
    ctx context.Context,
    request *api.ScoreConfigsGetByIDRequest,
    opts ...option.RequestOption,
) (*api.ScoreConfig, error){
    response, err := c.WithRawResponse.GetByID(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Update a score config
func (c *Client) Update(
    ctx context.Context,
    request *api.UpdateScoreConfigRequest,
    opts ...option.RequestOption,
) (*api.ScoreConfig, error){
    response, err := c.WithRawResponse.Update(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

