// Code generated by Fern. DO NOT EDIT.

package trace

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 a specific trace
func (c *Client) Get(
    ctx context.Context,
    request *api.TraceGetRequest,
    opts ...option.RequestOption,
) (*api.TraceWithFullDetails, error){
    response, err := c.WithRawResponse.Get(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete a specific trace
func (c *Client) Delete(
    ctx context.Context,
    request *api.TraceDeleteRequest,
    opts ...option.RequestOption,
) (*api.DeleteTraceResponse, error){
    response, err := c.WithRawResponse.Delete(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get list of traces
func (c *Client) List(
    ctx context.Context,
    request *api.TraceListRequest,
    opts ...option.RequestOption,
) (*api.Traces, error){
    response, err := c.WithRawResponse.List(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete multiple traces
func (c *Client) Deletemultiple(
    ctx context.Context,
    request *api.TraceDeleteMultipleRequest,
    opts ...option.RequestOption,
) (*api.DeleteTraceResponse, error){
    response, err := c.WithRawResponse.Deletemultiple(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

