// Code generated by Fern. DO NOT EDIT.

package media

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

// Patch a media record
func (c *Client) Patch(
    ctx context.Context,
    request *api.PatchMediaBody,
    opts ...option.RequestOption,
) error{
    _, err := c.WithRawResponse.Patch(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return err
    }
    return nil
}

// Get a presigned upload URL for a media record
func (c *Client) Getuploadurl(
    ctx context.Context,
    request *api.GetMediaUploadURLRequest,
    opts ...option.RequestOption,
) (*api.GetMediaUploadURLResponse, error){
    response, err := c.WithRawResponse.Getuploadurl(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

