// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package atproto

// schema: com.atproto.label.queryLabels

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

// LabelQueryLabels_Output is the output of a com.atproto.label.queryLabels call.
type LabelQueryLabels_Output struct {
	Cursor *string            `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
	Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"`
}

// LabelQueryLabels calls the XRPC method "com.atproto.label.queryLabels".
//
// sources: Optional list of label sources (DIDs) to filter on.
// uriPatterns: List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI.
func LabelQueryLabels(ctx context.Context, c util.LexClient, cursor string, limit int64, sources []string, uriPatterns []string) (*LabelQueryLabels_Output, error) {
	var out LabelQueryLabels_Output

	params := map[string]interface{}{}
	if cursor != "" {
		params["cursor"] = cursor
	}
	if limit != 0 {
		params["limit"] = limit
	}
	if len(sources) != 0 {
		params["sources"] = sources
	}
	params["uriPatterns"] = uriPatterns
	if err := c.LexDo(ctx, util.Query, "", "com.atproto.label.queryLabels", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
