// Code generated by Fern. DO NOT EDIT.

package organizations

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 memberships for the organization associated with the API key (requires organization-scoped API key)
func (c *Client) Getorganizationmemberships(
    ctx context.Context,
    opts ...option.RequestOption,
) (*api.MembershipsResponse, error){
    response, err := c.WithRawResponse.Getorganizationmemberships(
        ctx,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Create or update a membership for the organization associated with the API key (requires organization-scoped API key)
func (c *Client) Updateorganizationmembership(
    ctx context.Context,
    request *api.MembershipRequest,
    opts ...option.RequestOption,
) (*api.MembershipResponse, error){
    response, err := c.WithRawResponse.Updateorganizationmembership(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete a membership from the organization associated with the API key (requires organization-scoped API key)
func (c *Client) Deleteorganizationmembership(
    ctx context.Context,
    request *api.DeleteMembershipRequest,
    opts ...option.RequestOption,
) (*api.MembershipDeletionResponse, error){
    response, err := c.WithRawResponse.Deleteorganizationmembership(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

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

// Create or update a membership for a specific project (requires organization-scoped API key). The user must already be a member of the organization.
func (c *Client) Updateprojectmembership(
    ctx context.Context,
    request *api.OrganizationsUpdateProjectMembershipRequest,
    opts ...option.RequestOption,
) (*api.MembershipResponse, error){
    response, err := c.WithRawResponse.Updateprojectmembership(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Delete a membership from a specific project (requires organization-scoped API key). The user must be a member of the organization.
func (c *Client) Deleteprojectmembership(
    ctx context.Context,
    request *api.OrganizationsDeleteProjectMembershipRequest,
    opts ...option.RequestOption,
) (*api.MembershipDeletionResponse, error){
    response, err := c.WithRawResponse.Deleteprojectmembership(
        ctx,
        request,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get all projects for the organization associated with the API key (requires organization-scoped API key)
func (c *Client) Getorganizationprojects(
    ctx context.Context,
    opts ...option.RequestOption,
) (*api.OrganizationProjectsResponse, error){
    response, err := c.WithRawResponse.Getorganizationprojects(
        ctx,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

// Get all API keys for the organization associated with the API key (requires organization-scoped API key)
func (c *Client) Getorganizationapikeys(
    ctx context.Context,
    opts ...option.RequestOption,
) (*api.OrganizationAPIKeysResponse, error){
    response, err := c.WithRawResponse.Getorganizationapikeys(
        ctx,
        opts...,
    )
    if err != nil {
        return nil, err
    }
    return response.Body, nil
}

