// Code generated by Fern. DO NOT EDIT.

package blobstorageintegrations

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 all blob storage integrations for the organization (requires organization-scoped API key)
func (c *Client) Getblobstorageintegrations(
    ctx context.Context,
    opts ...option.RequestOption,
) (*api.BlobStorageIntegrationsResponse, error){
    response, err := c.WithRawResponse.Getblobstorageintegrations(
        ctx,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create or update a blob storage integration for a specific project (requires organization-scoped API key). The configuration is validated by performing a test upload to the bucket.
func (c *Client) Upsertblobstorageintegration(
    ctx context.Context,
    request *api.CreateBlobStorageIntegrationRequest,
    opts ...option.RequestOption,
) (*api.BlobStorageIntegrationResponse, error){
    response, err := c.WithRawResponse.Upsertblobstorageintegration(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete a blob storage integration by ID (requires organization-scoped API key)
func (c *Client) Deleteblobstorageintegration(
    ctx context.Context,
    request *api.BlobStorageIntegrationsDeleteBlobStorageIntegrationRequest,
    opts ...option.RequestOption,
) (*api.BlobStorageIntegrationDeletionResponse, error){
    response, err := c.WithRawResponse.Deleteblobstorageintegration(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

