// Code generated by Fern. DO NOT EDIT.

package projects

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


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 Project associated with API key (requires project-scoped API key). You can use GET /api/public/organizations/projects to get all projects with an organization-scoped key.
func (c *Client) Get(
    ctx context.Context,
    opts ...option.RequestOption,
) (*api.Projects, error){
    response, err := c.WithRawResponse.Get(
        ctx,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create a new project (requires organization-scoped API key)
func (c *Client) Create(
    ctx context.Context,
    request *api.ProjectsCreateRequest,
    opts ...option.RequestOption,
) (*api.Project, error){
    response, err := c.WithRawResponse.Create(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Update a project by ID (requires organization-scoped API key).
func (c *Client) Update(
    ctx context.Context,
    request *api.ProjectsUpdateRequest,
    opts ...option.RequestOption,
) (*api.Project, error){
    response, err := c.WithRawResponse.Update(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete a project by ID (requires organization-scoped API key). Project deletion is processed asynchronously.
func (c *Client) Delete(
    ctx context.Context,
    request *api.ProjectsDeleteRequest,
    opts ...option.RequestOption,
) (*api.ProjectDeletionResponse, error){
    response, err := c.WithRawResponse.Delete(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get all API keys for a project (requires organization-scoped API key)
func (c *Client) Getapikeys(
    ctx context.Context,
    request *api.ProjectsGetAPIKeysRequest,
    opts ...option.RequestOption,
) (*api.APIKeyList, error){
    response, err := c.WithRawResponse.Getapikeys(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create a new API key for a project (requires organization-scoped API key)
func (c *Client) Createapikey(
    ctx context.Context,
    request *api.ProjectsCreateAPIKeyRequest,
    opts ...option.RequestOption,
) (*api.APIKeyResponse, error){
    response, err := c.WithRawResponse.Createapikey(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete an API key for a project (requires organization-scoped API key)
func (c *Client) Deleteapikey(
    ctx context.Context,
    request *api.ProjectsDeleteAPIKeyRequest,
    opts ...option.RequestOption,
) (*api.APIKeyDeletionResponse, error){
    response, err := c.WithRawResponse.Deleteapikey(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

