// Package aily code generated by oapi sdk gen
/*
 * MIT License
 *
 * Copyright (c) 2022 Lark Technologies Pte. Ltd.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package larkaily

import (
	"io"

	"bytes"

	"fmt"

	"context"
	"errors"

	"github.com/larksuite/oapi-sdk-go/v3/core"
)

const (
	AilyMessageContentTypeContentTypeMDX       = "MDX"       // MDX
	AilyMessageContentTypeContentTypeText      = "TEXT"      // TEXT
	AilyMessageContentTypeContentTypeClip      = "CLIP"      // GUI 卡片
	AilyMessageContentTypeContentTypeSmartCard = "SmartCard" // SmartCard
	AilyMessageContentTypeContentTypeJSON      = "JSON"      // JSON
)

const (
	ConnectTypeImport = "import" // 导入模式
	ConnectTypeDirect = "direct" // 直连模式
)

const (
	SourceTypeFile          = "file"            // 文件，只支持导入模式
	SourceTypeLarkWikiSpace = "lark_wiki_space" // 飞书知识空间，只支持直连模式
	SourceTypeLarkDoc       = "lark_doc"        // 飞书云文档，导入模式只支持docx
	SourceTypeLarkHelpdesk  = "lark_helpdesk"   // 飞书服务台，只支持直连模式
)

type AilyKnowledgeAskProcessData struct {
	ChartDsls []string `json:"chart_dsls,omitempty"` // 有数据分析时，根据数据生成的图表描述，按markdown语义描述

	Chunks []string `json:"chunks,omitempty"` // 召回的知识视图切片的文本数据

	SqlData []string `json:"sql_data,omitempty"` // 有数据分析时，查询到数据结果，每个元素为 json 序列化后的数据结果
}

type AilyKnowledgeAskProcessDataBuilder struct {
	chartDsls     []string // 有数据分析时，根据数据生成的图表描述，按markdown语义描述
	chartDslsFlag bool

	chunks     []string // 召回的知识视图切片的文本数据
	chunksFlag bool

	sqlData     []string // 有数据分析时，查询到数据结果，每个元素为 json 序列化后的数据结果
	sqlDataFlag bool
}

func NewAilyKnowledgeAskProcessDataBuilder() *AilyKnowledgeAskProcessDataBuilder {
	builder := &AilyKnowledgeAskProcessDataBuilder{}
	return builder
}

// 有数据分析时，根据数据生成的图表描述，按markdown语义描述
//
// 示例值：
func (builder *AilyKnowledgeAskProcessDataBuilder) ChartDsls(chartDsls []string) *AilyKnowledgeAskProcessDataBuilder {
	builder.chartDsls = chartDsls
	builder.chartDslsFlag = true
	return builder
}

// 召回的知识视图切片的文本数据
//
// 示例值：
func (builder *AilyKnowledgeAskProcessDataBuilder) Chunks(chunks []string) *AilyKnowledgeAskProcessDataBuilder {
	builder.chunks = chunks
	builder.chunksFlag = true
	return builder
}

// 有数据分析时，查询到数据结果，每个元素为 json 序列化后的数据结果
//
// 示例值：
func (builder *AilyKnowledgeAskProcessDataBuilder) SqlData(sqlData []string) *AilyKnowledgeAskProcessDataBuilder {
	builder.sqlData = sqlData
	builder.sqlDataFlag = true
	return builder
}

func (builder *AilyKnowledgeAskProcessDataBuilder) Build() *AilyKnowledgeAskProcessData {
	req := &AilyKnowledgeAskProcessData{}
	if builder.chartDslsFlag {
		req.ChartDsls = builder.chartDsls
	}
	if builder.chunksFlag {
		req.Chunks = builder.chunks
	}
	if builder.sqlDataFlag {
		req.SqlData = builder.sqlData
	}
	return req
}

type AilyKnowledgeDataset struct {
	ApiName *string `json:"api_name,omitempty"` // 分析表ID

	Title *string `json:"title,omitempty"` // 分析表标题
}

type AilyKnowledgeDatasetBuilder struct {
	apiName     string // 分析表ID
	apiNameFlag bool

	title     string // 分析表标题
	titleFlag bool
}

func NewAilyKnowledgeDatasetBuilder() *AilyKnowledgeDatasetBuilder {
	builder := &AilyKnowledgeDatasetBuilder{}
	return builder
}

// 分析表ID
//
// 示例值：object_x
func (builder *AilyKnowledgeDatasetBuilder) ApiName(apiName string) *AilyKnowledgeDatasetBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 分析表标题
//
// 示例值：title
func (builder *AilyKnowledgeDatasetBuilder) Title(title string) *AilyKnowledgeDatasetBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

func (builder *AilyKnowledgeDatasetBuilder) Build() *AilyKnowledgeDataset {
	req := &AilyKnowledgeDataset{}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	return req
}

type AilyKnowledgeDatatable struct {
	ApiName *string `json:"api_name,omitempty"` // 数据表ID

	Title *string `json:"title,omitempty"` // 数据表标题
}

type AilyKnowledgeDatatableBuilder struct {
	apiName     string // 数据表ID
	apiNameFlag bool

	title     string // 数据表标题
	titleFlag bool
}

func NewAilyKnowledgeDatatableBuilder() *AilyKnowledgeDatatableBuilder {
	builder := &AilyKnowledgeDatatableBuilder{}
	return builder
}

// 数据表ID
//
// 示例值：object_x
func (builder *AilyKnowledgeDatatableBuilder) ApiName(apiName string) *AilyKnowledgeDatatableBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 数据表标题
//
// 示例值：title
func (builder *AilyKnowledgeDatatableBuilder) Title(title string) *AilyKnowledgeDatatableBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

func (builder *AilyKnowledgeDatatableBuilder) Build() *AilyKnowledgeDatatable {
	req := &AilyKnowledgeDatatable{}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	return req
}

type AilyKnowledgeDocs struct {
	Title *string `json:"title,omitempty"` // 标题

	Type *string `json:"type,omitempty"` // 飞书云文档类型

	Token *string `json:"token,omitempty"` // 飞书云文档标识

	Url *string `json:"url,omitempty"` // 链接
}

type AilyKnowledgeDocsBuilder struct {
	title     string // 标题
	titleFlag bool

	type_    string // 飞书云文档类型
	typeFlag bool

	token     string // 飞书云文档标识
	tokenFlag bool

	url     string // 链接
	urlFlag bool
}

func NewAilyKnowledgeDocsBuilder() *AilyKnowledgeDocsBuilder {
	builder := &AilyKnowledgeDocsBuilder{}
	return builder
}

// 标题
//
// 示例值：title
func (builder *AilyKnowledgeDocsBuilder) Title(title string) *AilyKnowledgeDocsBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 飞书云文档类型
//
// 示例值：docx
func (builder *AilyKnowledgeDocsBuilder) Type(type_ string) *AilyKnowledgeDocsBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 飞书云文档标识
//
// 示例值：NWicfaD1Rlp2utdR0zycOabcdef
func (builder *AilyKnowledgeDocsBuilder) Token(token string) *AilyKnowledgeDocsBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 链接
//
// 示例值：https://feishu.cn/docx/NWicfaD1Rlp2utdR0zycOabcdef
func (builder *AilyKnowledgeDocsBuilder) Url(url string) *AilyKnowledgeDocsBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *AilyKnowledgeDocsBuilder) Build() *AilyKnowledgeDocs {
	req := &AilyKnowledgeDocs{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type AilyKnowledgeFaq struct {
	Question *string `json:"question,omitempty"` // 匹配问题

	Answer *string `json:"answer,omitempty"` // 匹配描述
}

type AilyKnowledgeFaqBuilder struct {
	question     string // 匹配问题
	questionFlag bool

	answer     string // 匹配描述
	answerFlag bool
}

func NewAilyKnowledgeFaqBuilder() *AilyKnowledgeFaqBuilder {
	builder := &AilyKnowledgeFaqBuilder{}
	return builder
}

// 匹配问题
//
// 示例值：问题
func (builder *AilyKnowledgeFaqBuilder) Question(question string) *AilyKnowledgeFaqBuilder {
	builder.question = question
	builder.questionFlag = true
	return builder
}

// 匹配描述
//
// 示例值：答案
func (builder *AilyKnowledgeFaqBuilder) Answer(answer string) *AilyKnowledgeFaqBuilder {
	builder.answer = answer
	builder.answerFlag = true
	return builder
}

func (builder *AilyKnowledgeFaqBuilder) Build() *AilyKnowledgeFaq {
	req := &AilyKnowledgeFaq{}
	if builder.questionFlag {
		req.Question = &builder.question

	}
	if builder.answerFlag {
		req.Answer = &builder.answer

	}
	return req
}

type AilyKnowledgeFile struct {
	Title *string `json:"title,omitempty"` // 标题

	MimeType *string `json:"mime_type,omitempty"` // 文件mime类型

	Content *string `json:"content,omitempty"` // 文件内容

	SourceUrl *string `json:"source_url,omitempty"` // 文件来源URL
}

type AilyKnowledgeFileBuilder struct {
	title     string // 标题
	titleFlag bool

	mimeType     string // 文件mime类型
	mimeTypeFlag bool

	content     string // 文件内容
	contentFlag bool

	sourceUrl     string // 文件来源URL
	sourceUrlFlag bool
}

func NewAilyKnowledgeFileBuilder() *AilyKnowledgeFileBuilder {
	builder := &AilyKnowledgeFileBuilder{}
	return builder
}

// 标题
//
// 示例值：title
func (builder *AilyKnowledgeFileBuilder) Title(title string) *AilyKnowledgeFileBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 文件mime类型
//
// 示例值：text/plain
func (builder *AilyKnowledgeFileBuilder) MimeType(mimeType string) *AilyKnowledgeFileBuilder {
	builder.mimeType = mimeType
	builder.mimeTypeFlag = true
	return builder
}

// 文件内容
//
// 示例值：content
func (builder *AilyKnowledgeFileBuilder) Content(content string) *AilyKnowledgeFileBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 文件来源URL
//
// 示例值：https://www.xx.xx
func (builder *AilyKnowledgeFileBuilder) SourceUrl(sourceUrl string) *AilyKnowledgeFileBuilder {
	builder.sourceUrl = sourceUrl
	builder.sourceUrlFlag = true
	return builder
}

func (builder *AilyKnowledgeFileBuilder) Build() *AilyKnowledgeFile {
	req := &AilyKnowledgeFile{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.mimeTypeFlag {
		req.MimeType = &builder.mimeType

	}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.sourceUrlFlag {
		req.SourceUrl = &builder.sourceUrl

	}
	return req
}

type AilyKnowledgeFolder struct {
	Title *string `json:"title,omitempty"` // 文件夹标题

	Token *string `json:"token,omitempty"` // 文件夹标识

	Url *string `json:"url,omitempty"` // 链接
}

type AilyKnowledgeFolderBuilder struct {
	title     string // 文件夹标题
	titleFlag bool

	token     string // 文件夹标识
	tokenFlag bool

	url     string // 链接
	urlFlag bool
}

func NewAilyKnowledgeFolderBuilder() *AilyKnowledgeFolderBuilder {
	builder := &AilyKnowledgeFolderBuilder{}
	return builder
}

// 文件夹标题
//
// 示例值：title
func (builder *AilyKnowledgeFolderBuilder) Title(title string) *AilyKnowledgeFolderBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 文件夹标识
//
// 示例值：xxx
func (builder *AilyKnowledgeFolderBuilder) Token(token string) *AilyKnowledgeFolderBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 链接
//
// 示例值：xxx
func (builder *AilyKnowledgeFolderBuilder) Url(url string) *AilyKnowledgeFolderBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *AilyKnowledgeFolderBuilder) Build() *AilyKnowledgeFolder {
	req := &AilyKnowledgeFolder{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type AilyKnowledgeHelpdesk struct {
	HelpdeskId *string `json:"helpdesk_id,omitempty"` // 服务台ID

	Title *string `json:"title,omitempty"` // 服务台标题
}

type AilyKnowledgeHelpdeskBuilder struct {
	helpdeskId     string // 服务台ID
	helpdeskIdFlag bool

	title     string // 服务台标题
	titleFlag bool
}

func NewAilyKnowledgeHelpdeskBuilder() *AilyKnowledgeHelpdeskBuilder {
	builder := &AilyKnowledgeHelpdeskBuilder{}
	return builder
}

// 服务台ID
//
// 示例值：123
func (builder *AilyKnowledgeHelpdeskBuilder) HelpdeskId(helpdeskId string) *AilyKnowledgeHelpdeskBuilder {
	builder.helpdeskId = helpdeskId
	builder.helpdeskIdFlag = true
	return builder
}

// 服务台标题
//
// 示例值：title
func (builder *AilyKnowledgeHelpdeskBuilder) Title(title string) *AilyKnowledgeHelpdeskBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

func (builder *AilyKnowledgeHelpdeskBuilder) Build() *AilyKnowledgeHelpdesk {
	req := &AilyKnowledgeHelpdesk{}
	if builder.helpdeskIdFlag {
		req.HelpdeskId = &builder.helpdeskId

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	return req
}

type AilyKnowledgeMessage struct {
	Content *string `json:"content,omitempty"` // 消息内容
}

type AilyKnowledgeMessageBuilder struct {
	content     string // 消息内容
	contentFlag bool
}

func NewAilyKnowledgeMessageBuilder() *AilyKnowledgeMessageBuilder {
	builder := &AilyKnowledgeMessageBuilder{}
	return builder
}

// 消息内容
//
// 示例值：推荐一部电影
func (builder *AilyKnowledgeMessageBuilder) Content(content string) *AilyKnowledgeMessageBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

func (builder *AilyKnowledgeMessageBuilder) Build() *AilyKnowledgeMessage {
	req := &AilyKnowledgeMessage{}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	return req
}

type AilyKnowledgeWeb struct {
	Url *string `json:"url,omitempty"` // 链接

	Title *string `json:"title,omitempty"` // 网页标题
}

type AilyKnowledgeWebBuilder struct {
	url     string // 链接
	urlFlag bool

	title     string // 网页标题
	titleFlag bool
}

func NewAilyKnowledgeWebBuilder() *AilyKnowledgeWebBuilder {
	builder := &AilyKnowledgeWebBuilder{}
	return builder
}

// 链接
//
// 示例值：xxx
func (builder *AilyKnowledgeWebBuilder) Url(url string) *AilyKnowledgeWebBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

// 网页标题
//
// 示例值：title
func (builder *AilyKnowledgeWebBuilder) Title(title string) *AilyKnowledgeWebBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

func (builder *AilyKnowledgeWebBuilder) Build() *AilyKnowledgeWeb {
	req := &AilyKnowledgeWeb{}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	return req
}

type AilyKnowledgeWikiSpace struct {
	Title *string `json:"title,omitempty"` // 知识空间标题

	SpaceId *string `json:"space_id,omitempty"` // 知识空间ID

	SubDocs []*AilyKnowledgeDocs `json:"sub_docs,omitempty"` // 子节点
}

type AilyKnowledgeWikiSpaceBuilder struct {
	title     string // 知识空间标题
	titleFlag bool

	spaceId     string // 知识空间ID
	spaceIdFlag bool

	subDocs     []*AilyKnowledgeDocs // 子节点
	subDocsFlag bool
}

func NewAilyKnowledgeWikiSpaceBuilder() *AilyKnowledgeWikiSpaceBuilder {
	builder := &AilyKnowledgeWikiSpaceBuilder{}
	return builder
}

// 知识空间标题
//
// 示例值：title
func (builder *AilyKnowledgeWikiSpaceBuilder) Title(title string) *AilyKnowledgeWikiSpaceBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 知识空间ID
//
// 示例值：123
func (builder *AilyKnowledgeWikiSpaceBuilder) SpaceId(spaceId string) *AilyKnowledgeWikiSpaceBuilder {
	builder.spaceId = spaceId
	builder.spaceIdFlag = true
	return builder
}

// 子节点
//
// 示例值：
func (builder *AilyKnowledgeWikiSpaceBuilder) SubDocs(subDocs []*AilyKnowledgeDocs) *AilyKnowledgeWikiSpaceBuilder {
	builder.subDocs = subDocs
	builder.subDocsFlag = true
	return builder
}

func (builder *AilyKnowledgeWikiSpaceBuilder) Build() *AilyKnowledgeWikiSpace {
	req := &AilyKnowledgeWikiSpace{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.spaceIdFlag {
		req.SpaceId = &builder.spaceId

	}
	if builder.subDocsFlag {
		req.SubDocs = builder.subDocs
	}
	return req
}

type AilyMention struct {
	EntityId *string `json:"entity_id,omitempty"` // 实体 ID

	IdentityProvider *string `json:"identity_provider,omitempty"` // 身份提供者

	Key *string `json:"key,omitempty"` // 被@实体在消息体中的占位符

	Name *string `json:"name,omitempty"` // 被@实体的名称

	AilyId *string `json:"aily_id,omitempty"` // Aily 账号体系下的 ID
}

type AilyMentionBuilder struct {
	entityId     string // 实体 ID
	entityIdFlag bool

	identityProvider     string // 身份提供者
	identityProviderFlag bool

	key     string // 被@实体在消息体中的占位符
	keyFlag bool

	name     string // 被@实体的名称
	nameFlag bool

	ailyId     string // Aily 账号体系下的 ID
	ailyIdFlag bool
}

func NewAilyMentionBuilder() *AilyMentionBuilder {
	builder := &AilyMentionBuilder{}
	return builder
}

// 实体 ID
//
// 示例值：ou_5ad573a6411d72b8305fda3a9c15c70e
func (builder *AilyMentionBuilder) EntityId(entityId string) *AilyMentionBuilder {
	builder.entityId = entityId
	builder.entityIdFlag = true
	return builder
}

// 身份提供者
//
// 示例值：FEISHU
func (builder *AilyMentionBuilder) IdentityProvider(identityProvider string) *AilyMentionBuilder {
	builder.identityProvider = identityProvider
	builder.identityProviderFlag = true
	return builder
}

// 被@实体在消息体中的占位符
//
// 示例值：@_user_1
func (builder *AilyMentionBuilder) Key(key string) *AilyMentionBuilder {
	builder.key = key
	builder.keyFlag = true
	return builder
}

// 被@实体的名称
//
// 示例值：张三
func (builder *AilyMentionBuilder) Name(name string) *AilyMentionBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// Aily 账号体系下的 ID
//
// 示例值：1794840334557292
func (builder *AilyMentionBuilder) AilyId(ailyId string) *AilyMentionBuilder {
	builder.ailyId = ailyId
	builder.ailyIdFlag = true
	return builder
}

func (builder *AilyMentionBuilder) Build() *AilyMention {
	req := &AilyMention{}
	if builder.entityIdFlag {
		req.EntityId = &builder.entityId

	}
	if builder.identityProviderFlag {
		req.IdentityProvider = &builder.identityProvider

	}
	if builder.keyFlag {
		req.Key = &builder.key

	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.ailyIdFlag {
		req.AilyId = &builder.ailyId

	}
	return req
}

type AilyMessage struct {
	Id *string `json:"id,omitempty"` // 消息 ID

	SessionId *string `json:"session_id,omitempty"` // 会话 ID

	RunId *string `json:"run_id,omitempty"` // 运行 ID

	ContentType *string `json:"content_type,omitempty"` // 消息内容类型

	Content *string `json:"content,omitempty"` // 消息内容

	Files []*AilyMessageFile `json:"files,omitempty"` // 消息中包含的文件

	QuoteMessageId *string `json:"quote_message_id,omitempty"` // 引用的消息 ID

	Sender *AilySender `json:"sender,omitempty"` // 发送者

	Mentions []*AilyMention `json:"mentions,omitempty"` // 被@的实体

	PlainText *string `json:"plain_text,omitempty"` // 消息体的纯文本表达

	CreatedAt *string `json:"created_at,omitempty"` // 消息的创建时间，毫秒时间戳

	Status *string `json:"status,omitempty"` // 状态

	ReasoningContent *string `json:"reasoning_content,omitempty"` // 推理内容
}

type AilyMessageBuilder struct {
	id     string // 消息 ID
	idFlag bool

	sessionId     string // 会话 ID
	sessionIdFlag bool

	runId     string // 运行 ID
	runIdFlag bool

	contentType     string // 消息内容类型
	contentTypeFlag bool

	content     string // 消息内容
	contentFlag bool

	files     []*AilyMessageFile // 消息中包含的文件
	filesFlag bool

	quoteMessageId     string // 引用的消息 ID
	quoteMessageIdFlag bool

	sender     *AilySender // 发送者
	senderFlag bool

	mentions     []*AilyMention // 被@的实体
	mentionsFlag bool

	plainText     string // 消息体的纯文本表达
	plainTextFlag bool

	createdAt     string // 消息的创建时间，毫秒时间戳
	createdAtFlag bool

	status     string // 状态
	statusFlag bool

	reasoningContent     string // 推理内容
	reasoningContentFlag bool
}

func NewAilyMessageBuilder() *AilyMessageBuilder {
	builder := &AilyMessageBuilder{}
	return builder
}

// 消息 ID
//
// 示例值：message_4df45f2xknvcc
func (builder *AilyMessageBuilder) Id(id string) *AilyMessageBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *AilyMessageBuilder) SessionId(sessionId string) *AilyMessageBuilder {
	builder.sessionId = sessionId
	builder.sessionIdFlag = true
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *AilyMessageBuilder) RunId(runId string) *AilyMessageBuilder {
	builder.runId = runId
	builder.runIdFlag = true
	return builder
}

// 消息内容类型
//
// 示例值：MDX
func (builder *AilyMessageBuilder) ContentType(contentType string) *AilyMessageBuilder {
	builder.contentType = contentType
	builder.contentTypeFlag = true
	return builder
}

// 消息内容
//
// 示例值：你好
func (builder *AilyMessageBuilder) Content(content string) *AilyMessageBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 消息中包含的文件
//
// 示例值：
func (builder *AilyMessageBuilder) Files(files []*AilyMessageFile) *AilyMessageBuilder {
	builder.files = files
	builder.filesFlag = true
	return builder
}

// 引用的消息 ID
//
// 示例值：message_4de9bpg70qskh
func (builder *AilyMessageBuilder) QuoteMessageId(quoteMessageId string) *AilyMessageBuilder {
	builder.quoteMessageId = quoteMessageId
	builder.quoteMessageIdFlag = true
	return builder
}

// 发送者
//
// 示例值：
func (builder *AilyMessageBuilder) Sender(sender *AilySender) *AilyMessageBuilder {
	builder.sender = sender
	builder.senderFlag = true
	return builder
}

// 被@的实体
//
// 示例值：
func (builder *AilyMessageBuilder) Mentions(mentions []*AilyMention) *AilyMessageBuilder {
	builder.mentions = mentions
	builder.mentionsFlag = true
	return builder
}

// 消息体的纯文本表达
//
// 示例值：你好
func (builder *AilyMessageBuilder) PlainText(plainText string) *AilyMessageBuilder {
	builder.plainText = plainText
	builder.plainTextFlag = true
	return builder
}

// 消息的创建时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *AilyMessageBuilder) CreatedAt(createdAt string) *AilyMessageBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// 状态
//
// 示例值：IN_PROGRESS
func (builder *AilyMessageBuilder) Status(status string) *AilyMessageBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 推理内容
//
// 示例值：推理内容
func (builder *AilyMessageBuilder) ReasoningContent(reasoningContent string) *AilyMessageBuilder {
	builder.reasoningContent = reasoningContent
	builder.reasoningContentFlag = true
	return builder
}

func (builder *AilyMessageBuilder) Build() *AilyMessage {
	req := &AilyMessage{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.sessionIdFlag {
		req.SessionId = &builder.sessionId

	}
	if builder.runIdFlag {
		req.RunId = &builder.runId

	}
	if builder.contentTypeFlag {
		req.ContentType = &builder.contentType

	}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.filesFlag {
		req.Files = builder.files
	}
	if builder.quoteMessageIdFlag {
		req.QuoteMessageId = &builder.quoteMessageId

	}
	if builder.senderFlag {
		req.Sender = builder.sender
	}
	if builder.mentionsFlag {
		req.Mentions = builder.mentions
	}
	if builder.plainTextFlag {
		req.PlainText = &builder.plainText

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.reasoningContentFlag {
		req.ReasoningContent = &builder.reasoningContent

	}
	return req
}

type AilyMessageFile struct {
	Id *string `json:"id,omitempty"` // 文件 ID

	MimeType *string `json:"mime_type,omitempty"` // 文件类型，参见 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types

	FileName *string `json:"file_name,omitempty"` // 文件名

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息

	CreatedAt *string `json:"created_at,omitempty"` // 文件的创建时间，毫秒时间戳

	PreviewUrl *AilyMessageFilePreview `json:"preview_url,omitempty"` // 文件预览链接
}

type AilyMessageFileBuilder struct {
	id     string // 文件 ID
	idFlag bool

	mimeType     string // 文件类型，参见 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types
	mimeTypeFlag bool

	fileName     string // 文件名
	fileNameFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool

	createdAt     string // 文件的创建时间，毫秒时间戳
	createdAtFlag bool

	previewUrl     *AilyMessageFilePreview // 文件预览链接
	previewUrlFlag bool
}

func NewAilyMessageFileBuilder() *AilyMessageFileBuilder {
	builder := &AilyMessageFileBuilder{}
	return builder
}

// 文件 ID
//
// 示例值：file_4d9nu1ev3a2rq
func (builder *AilyMessageFileBuilder) Id(id string) *AilyMessageFileBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 文件类型，参见 https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Basics_of_HTTP/MIME_types
//
// 示例值：image/png
func (builder *AilyMessageFileBuilder) MimeType(mimeType string) *AilyMessageFileBuilder {
	builder.mimeType = mimeType
	builder.mimeTypeFlag = true
	return builder
}

// 文件名
//
// 示例值：发票.png
func (builder *AilyMessageFileBuilder) FileName(fileName string) *AilyMessageFileBuilder {
	builder.fileName = fileName
	builder.fileNameFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *AilyMessageFileBuilder) Metadata(metadata string) *AilyMessageFileBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

// 文件的创建时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *AilyMessageFileBuilder) CreatedAt(createdAt string) *AilyMessageFileBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// 文件预览链接
//
// 示例值：
func (builder *AilyMessageFileBuilder) PreviewUrl(previewUrl *AilyMessageFilePreview) *AilyMessageFileBuilder {
	builder.previewUrl = previewUrl
	builder.previewUrlFlag = true
	return builder
}

func (builder *AilyMessageFileBuilder) Build() *AilyMessageFile {
	req := &AilyMessageFile{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.mimeTypeFlag {
		req.MimeType = &builder.mimeType

	}
	if builder.fileNameFlag {
		req.FileName = &builder.fileName

	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.previewUrlFlag {
		req.PreviewUrl = builder.previewUrl
	}
	return req
}

type AilyMessageFileFilter struct {
	WithPreviewUrl *bool `json:"with_preview_url,omitempty"` // 返回文件的预览链接
}

type AilyMessageFileFilterBuilder struct {
	withPreviewUrl     bool // 返回文件的预览链接
	withPreviewUrlFlag bool
}

func NewAilyMessageFileFilterBuilder() *AilyMessageFileFilterBuilder {
	builder := &AilyMessageFileFilterBuilder{}
	return builder
}

// 返回文件的预览链接
//
// 示例值：false
func (builder *AilyMessageFileFilterBuilder) WithPreviewUrl(withPreviewUrl bool) *AilyMessageFileFilterBuilder {
	builder.withPreviewUrl = withPreviewUrl
	builder.withPreviewUrlFlag = true
	return builder
}

func (builder *AilyMessageFileFilterBuilder) Build() *AilyMessageFileFilter {
	req := &AilyMessageFileFilter{}
	if builder.withPreviewUrlFlag {
		req.WithPreviewUrl = &builder.withPreviewUrl

	}
	return req
}

type AilyMessageFilePreview struct {
	Url *string `json:"url,omitempty"` // 文件的 URL

	ExpiredAt *string `json:"expired_at,omitempty"` // url 过期时间，秒时间戳
}

type AilyMessageFilePreviewBuilder struct {
	url     string // 文件的 URL
	urlFlag bool

	expiredAt     string // url 过期时间，秒时间戳
	expiredAtFlag bool
}

func NewAilyMessageFilePreviewBuilder() *AilyMessageFilePreviewBuilder {
	builder := &AilyMessageFilePreviewBuilder{}
	return builder
}

// 文件的 URL
//
// 示例值：http://path_to_file
func (builder *AilyMessageFilePreviewBuilder) Url(url string) *AilyMessageFilePreviewBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

// url 过期时间，秒时间戳
//
// 示例值：1719413169
func (builder *AilyMessageFilePreviewBuilder) ExpiredAt(expiredAt string) *AilyMessageFilePreviewBuilder {
	builder.expiredAt = expiredAt
	builder.expiredAtFlag = true
	return builder
}

func (builder *AilyMessageFilePreviewBuilder) Build() *AilyMessageFilePreview {
	req := &AilyMessageFilePreview{}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	if builder.expiredAtFlag {
		req.ExpiredAt = &builder.expiredAt

	}
	return req
}

type AilyMessageFilter struct {
	RunId *string `json:"run_id,omitempty"` // 运行 ID

	WithPartialMessage *bool `json:"with_partial_message,omitempty"` // 返回生成中的消息
}

type AilyMessageFilterBuilder struct {
	runId     string // 运行 ID
	runIdFlag bool

	withPartialMessage     bool // 返回生成中的消息
	withPartialMessageFlag bool
}

func NewAilyMessageFilterBuilder() *AilyMessageFilterBuilder {
	builder := &AilyMessageFilterBuilder{}
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *AilyMessageFilterBuilder) RunId(runId string) *AilyMessageFilterBuilder {
	builder.runId = runId
	builder.runIdFlag = true
	return builder
}

// 返回生成中的消息
//
// 示例值：false
func (builder *AilyMessageFilterBuilder) WithPartialMessage(withPartialMessage bool) *AilyMessageFilterBuilder {
	builder.withPartialMessage = withPartialMessage
	builder.withPartialMessageFlag = true
	return builder
}

func (builder *AilyMessageFilterBuilder) Build() *AilyMessageFilter {
	req := &AilyMessageFilter{}
	if builder.runIdFlag {
		req.RunId = &builder.runId

	}
	if builder.withPartialMessageFlag {
		req.WithPartialMessage = &builder.withPartialMessage

	}
	return req
}

type AilySender struct {
	EntityId *string `json:"entity_id,omitempty"` // 实体 ID

	IdentityProvider *string `json:"identity_provider,omitempty"` // 身份提供者

	SenderType *string `json:"sender_type,omitempty"` // 发送人类型

	AilyId *string `json:"aily_id,omitempty"` // Aily 账号体系下的 ID
}

type AilySenderBuilder struct {
	entityId     string // 实体 ID
	entityIdFlag bool

	identityProvider     string // 身份提供者
	identityProviderFlag bool

	senderType     string // 发送人类型
	senderTypeFlag bool

	ailyId     string // Aily 账号体系下的 ID
	ailyIdFlag bool
}

func NewAilySenderBuilder() *AilySenderBuilder {
	builder := &AilySenderBuilder{}
	return builder
}

// 实体 ID
//
// 示例值：ou_5ad573a6411d72b8305fda3a9c15c70e
func (builder *AilySenderBuilder) EntityId(entityId string) *AilySenderBuilder {
	builder.entityId = entityId
	builder.entityIdFlag = true
	return builder
}

// 身份提供者
//
// 示例值：FEISHU
func (builder *AilySenderBuilder) IdentityProvider(identityProvider string) *AilySenderBuilder {
	builder.identityProvider = identityProvider
	builder.identityProviderFlag = true
	return builder
}

// 发送人类型
//
// 示例值：USER
func (builder *AilySenderBuilder) SenderType(senderType string) *AilySenderBuilder {
	builder.senderType = senderType
	builder.senderTypeFlag = true
	return builder
}

// Aily 账号体系下的 ID
//
// 示例值：1794840334557292
func (builder *AilySenderBuilder) AilyId(ailyId string) *AilySenderBuilder {
	builder.ailyId = ailyId
	builder.ailyIdFlag = true
	return builder
}

func (builder *AilySenderBuilder) Build() *AilySender {
	req := &AilySender{}
	if builder.entityIdFlag {
		req.EntityId = &builder.entityId

	}
	if builder.identityProviderFlag {
		req.IdentityProvider = &builder.identityProvider

	}
	if builder.senderTypeFlag {
		req.SenderType = &builder.senderType

	}
	if builder.ailyIdFlag {
		req.AilyId = &builder.ailyId

	}
	return req
}

type AilySession struct {
	Id *string `json:"id,omitempty"` // 会话 ID

	CreatedAt *string `json:"created_at,omitempty"` // 会话的创建时间，毫秒时间戳

	ModifiedAt *string `json:"modified_at,omitempty"` // 会话的上次更新时间，毫秒时间戳

	CreatedBy *string `json:"created_by,omitempty"` // 会话的创建人

	ChannelContext *string `json:"channel_context,omitempty"` // 渠道上下文

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息
}

type AilySessionBuilder struct {
	id     string // 会话 ID
	idFlag bool

	createdAt     string // 会话的创建时间，毫秒时间戳
	createdAtFlag bool

	modifiedAt     string // 会话的上次更新时间，毫秒时间戳
	modifiedAtFlag bool

	createdBy     string // 会话的创建人
	createdByFlag bool

	channelContext     string // 渠道上下文
	channelContextFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool
}

func NewAilySessionBuilder() *AilySessionBuilder {
	builder := &AilySessionBuilder{}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *AilySessionBuilder) Id(id string) *AilySessionBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 会话的创建时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *AilySessionBuilder) CreatedAt(createdAt string) *AilySessionBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// 会话的上次更新时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *AilySessionBuilder) ModifiedAt(modifiedAt string) *AilySessionBuilder {
	builder.modifiedAt = modifiedAt
	builder.modifiedAtFlag = true
	return builder
}

// 会话的创建人
//
// 示例值：1794840334557292
func (builder *AilySessionBuilder) CreatedBy(createdBy string) *AilySessionBuilder {
	builder.createdBy = createdBy
	builder.createdByFlag = true
	return builder
}

// 渠道上下文
//
// 示例值：{}
func (builder *AilySessionBuilder) ChannelContext(channelContext string) *AilySessionBuilder {
	builder.channelContext = channelContext
	builder.channelContextFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *AilySessionBuilder) Metadata(metadata string) *AilySessionBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *AilySessionBuilder) Build() *AilySession {
	req := &AilySession{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.modifiedAtFlag {
		req.ModifiedAt = &builder.modifiedAt

	}
	if builder.createdByFlag {
		req.CreatedBy = &builder.createdBy

	}
	if builder.channelContextFlag {
		req.ChannelContext = &builder.channelContext

	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata

	}
	return req
}

type App struct {
	Id *string `json:"id,omitempty"` // aily app_id

	Label *string `json:"label,omitempty"` // 应用名称
}

type AppBuilder struct {
	id     string // aily app_id
	idFlag bool

	label     string // 应用名称
	labelFlag bool
}

func NewAppBuilder() *AppBuilder {
	builder := &AppBuilder{}
	return builder
}

// aily app_id
//
// 示例值：spring_xxx__c
func (builder *AppBuilder) Id(id string) *AppBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 应用名称
//
// 示例值：应用A
func (builder *AppBuilder) Label(label string) *AppBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

func (builder *AppBuilder) Build() *App {
	req := &App{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.labelFlag {
		req.Label = &builder.label

	}
	return req
}

type BuiltinAction struct {
	BuiltinActionType *string `json:"builtin_action_type,omitempty"` // 内置的消息交互类型

	Enable *bool `json:"enable,omitempty"` // 是否可交互

	ActionStatus *string `json:"action_status,omitempty"` // action 状态

	Extra *string `json:"extra,omitempty"` // action 的其它信息
}

type BuiltinActionBuilder struct {
	builtinActionType     string // 内置的消息交互类型
	builtinActionTypeFlag bool

	enable     bool // 是否可交互
	enableFlag bool

	actionStatus     string // action 状态
	actionStatusFlag bool

	extra     string // action 的其它信息
	extraFlag bool
}

func NewBuiltinActionBuilder() *BuiltinActionBuilder {
	builder := &BuiltinActionBuilder{}
	return builder
}

// 内置的消息交互类型
//
// 示例值：CANCEL
func (builder *BuiltinActionBuilder) BuiltinActionType(builtinActionType string) *BuiltinActionBuilder {
	builder.builtinActionType = builtinActionType
	builder.builtinActionTypeFlag = true
	return builder
}

// 是否可交互
//
// 示例值：true
func (builder *BuiltinActionBuilder) Enable(enable bool) *BuiltinActionBuilder {
	builder.enable = enable
	builder.enableFlag = true
	return builder
}

// action 状态
//
// 示例值：DISLIKE
func (builder *BuiltinActionBuilder) ActionStatus(actionStatus string) *BuiltinActionBuilder {
	builder.actionStatus = actionStatus
	builder.actionStatusFlag = true
	return builder
}

// action 的其它信息
//
// 示例值：{}
func (builder *BuiltinActionBuilder) Extra(extra string) *BuiltinActionBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

func (builder *BuiltinActionBuilder) Build() *BuiltinAction {
	req := &BuiltinAction{}
	if builder.builtinActionTypeFlag {
		req.BuiltinActionType = &builder.builtinActionType

	}
	if builder.enableFlag {
		req.Enable = &builder.enable

	}
	if builder.actionStatusFlag {
		req.ActionStatus = &builder.actionStatus

	}
	if builder.extraFlag {
		req.Extra = &builder.extra

	}
	return req
}

type Channel struct {
	Variables *string `json:"variables,omitempty"` // 自定义传入的变量
}

type ChannelBuilder struct {
	variables     string // 自定义传入的变量
	variablesFlag bool
}

func NewChannelBuilder() *ChannelBuilder {
	builder := &ChannelBuilder{}
	return builder
}

// 自定义传入的变量
//
// 示例值：{"custom_key": "custom_value"}
func (builder *ChannelBuilder) Variables(variables string) *ChannelBuilder {
	builder.variables = variables
	builder.variablesFlag = true
	return builder
}

func (builder *ChannelBuilder) Build() *Channel {
	req := &Channel{}
	if builder.variablesFlag {
		req.Variables = &builder.variables

	}
	return req
}

type DataAsset struct {
	DataAssetId *string `json:"data_asset_id,omitempty"` // 数据知识ID

	Label map[string]string `json:"label,omitempty"` // 数据知识标题

	Description map[string]string `json:"description,omitempty"` // 数据知识描述

	DataSourceType *string `json:"data_source_type,omitempty"` // 数据资源类型

	ConnectStatus *string `json:"connect_status,omitempty"` // 数据连接状态

	Tags []*DataAssetTag `json:"tags,omitempty"` // 数据知识分类列表

	Items []*DataAssetItem `json:"items,omitempty"` // 数据知识项列表

	ConnectFailedReason *string `json:"connect_failed_reason,omitempty"` // 连接状态失败信息

	ImportKnowledgeSetting *DataAssetImportKnowledgeSetting `json:"import_knowledge_setting,omitempty"` // 知识导入配置

	ConnectType *string `json:"connect_type,omitempty"` // 数据连接类型

	CreatedTime *string `json:"created_time,omitempty"` // 创建时间，毫秒时间戳

	UpdatedTime *string `json:"updated_time,omitempty"` // 更新时间，毫秒时间戳
}

type DataAssetBuilder struct {
	dataAssetId     string // 数据知识ID
	dataAssetIdFlag bool

	label     map[string]string // 数据知识标题
	labelFlag bool

	description     map[string]string // 数据知识描述
	descriptionFlag bool

	dataSourceType     string // 数据资源类型
	dataSourceTypeFlag bool

	connectStatus     string // 数据连接状态
	connectStatusFlag bool

	tags     []*DataAssetTag // 数据知识分类列表
	tagsFlag bool

	items     []*DataAssetItem // 数据知识项列表
	itemsFlag bool

	connectFailedReason     string // 连接状态失败信息
	connectFailedReasonFlag bool

	importKnowledgeSetting     *DataAssetImportKnowledgeSetting // 知识导入配置
	importKnowledgeSettingFlag bool

	connectType     string // 数据连接类型
	connectTypeFlag bool

	createdTime     string // 创建时间，毫秒时间戳
	createdTimeFlag bool

	updatedTime     string // 更新时间，毫秒时间戳
	updatedTimeFlag bool
}

func NewDataAssetBuilder() *DataAssetBuilder {
	builder := &DataAssetBuilder{}
	return builder
}

// 数据知识ID
//
// 示例值：asset_aadg3mcgvpybu
func (builder *DataAssetBuilder) DataAssetId(dataAssetId string) *DataAssetBuilder {
	builder.dataAssetId = dataAssetId
	builder.dataAssetIdFlag = true
	return builder
}

// 数据知识标题
//
// 示例值：
func (builder *DataAssetBuilder) Label(label map[string]string) *DataAssetBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 数据知识描述
//
// 示例值：
func (builder *DataAssetBuilder) Description(description map[string]string) *DataAssetBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 数据资源类型
//
// 示例值：excel
func (builder *DataAssetBuilder) DataSourceType(dataSourceType string) *DataAssetBuilder {
	builder.dataSourceType = dataSourceType
	builder.dataSourceTypeFlag = true
	return builder
}

// 数据连接状态
//
// 示例值：successful
func (builder *DataAssetBuilder) ConnectStatus(connectStatus string) *DataAssetBuilder {
	builder.connectStatus = connectStatus
	builder.connectStatusFlag = true
	return builder
}

// 数据知识分类列表
//
// 示例值：
func (builder *DataAssetBuilder) Tags(tags []*DataAssetTag) *DataAssetBuilder {
	builder.tags = tags
	builder.tagsFlag = true
	return builder
}

// 数据知识项列表
//
// 示例值：
func (builder *DataAssetBuilder) Items(items []*DataAssetItem) *DataAssetBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

// 连接状态失败信息
//
// 示例值：连接超时
func (builder *DataAssetBuilder) ConnectFailedReason(connectFailedReason string) *DataAssetBuilder {
	builder.connectFailedReason = connectFailedReason
	builder.connectFailedReasonFlag = true
	return builder
}

// 知识导入配置
//
// 示例值：
func (builder *DataAssetBuilder) ImportKnowledgeSetting(importKnowledgeSetting *DataAssetImportKnowledgeSetting) *DataAssetBuilder {
	builder.importKnowledgeSetting = importKnowledgeSetting
	builder.importKnowledgeSettingFlag = true
	return builder
}

// 数据连接类型
//
// 示例值：direct
func (builder *DataAssetBuilder) ConnectType(connectType string) *DataAssetBuilder {
	builder.connectType = connectType
	builder.connectTypeFlag = true
	return builder
}

// 创建时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *DataAssetBuilder) CreatedTime(createdTime string) *DataAssetBuilder {
	builder.createdTime = createdTime
	builder.createdTimeFlag = true
	return builder
}

// 更新时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *DataAssetBuilder) UpdatedTime(updatedTime string) *DataAssetBuilder {
	builder.updatedTime = updatedTime
	builder.updatedTimeFlag = true
	return builder
}

func (builder *DataAssetBuilder) Build() *DataAsset {
	req := &DataAsset{}
	if builder.dataAssetIdFlag {
		req.DataAssetId = &builder.dataAssetId

	}
	if builder.labelFlag {
		req.Label = builder.label
	}
	if builder.descriptionFlag {
		req.Description = builder.description
	}
	if builder.dataSourceTypeFlag {
		req.DataSourceType = &builder.dataSourceType

	}
	if builder.connectStatusFlag {
		req.ConnectStatus = &builder.connectStatus

	}
	if builder.tagsFlag {
		req.Tags = builder.tags
	}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	if builder.connectFailedReasonFlag {
		req.ConnectFailedReason = &builder.connectFailedReason

	}
	if builder.importKnowledgeSettingFlag {
		req.ImportKnowledgeSetting = builder.importKnowledgeSetting
	}
	if builder.connectTypeFlag {
		req.ConnectType = &builder.connectType

	}
	if builder.createdTimeFlag {
		req.CreatedTime = &builder.createdTime

	}
	if builder.updatedTimeFlag {
		req.UpdatedTime = &builder.updatedTime

	}
	return req
}

type DataAssetChunk struct {
	Content *string `json:"content,omitempty"` // 切片内容

	DataAssetId *string `json:"data_asset_id,omitempty"` // 切片所属的数据知识ID

	Score *float64 `json:"score,omitempty"` // 相关性分数

	DataAssetLabel map[string]string `json:"data_asset_label,omitempty"` // 切片所归属的数据知识名称

	DataAssetSourceUrl *string `json:"data_asset_source_url,omitempty"` // 归属数据知识的源链接。如云文档链接、文件链接等

	DataAssetDataSourceType *string `json:"data_asset_data_source_type,omitempty"` // 归属数据知识的数据资源类型

	DataAssetConnectType *string `json:"data_asset_connect_type,omitempty"` // 归属数据知识的数据连接类型

	SourceInfo *DataAssetChunkSourceInfo `json:"source_info,omitempty"` // 切片所归属数据源信息
}

type DataAssetChunkBuilder struct {
	content     string // 切片内容
	contentFlag bool

	dataAssetId     string // 切片所属的数据知识ID
	dataAssetIdFlag bool

	score     float64 // 相关性分数
	scoreFlag bool

	dataAssetLabel     map[string]string // 切片所归属的数据知识名称
	dataAssetLabelFlag bool

	dataAssetSourceUrl     string // 归属数据知识的源链接。如云文档链接、文件链接等
	dataAssetSourceUrlFlag bool

	dataAssetDataSourceType     string // 归属数据知识的数据资源类型
	dataAssetDataSourceTypeFlag bool

	dataAssetConnectType     string // 归属数据知识的数据连接类型
	dataAssetConnectTypeFlag bool

	sourceInfo     *DataAssetChunkSourceInfo // 切片所归属数据源信息
	sourceInfoFlag bool
}

func NewDataAssetChunkBuilder() *DataAssetChunkBuilder {
	builder := &DataAssetChunkBuilder{}
	return builder
}

// 切片内容
//
// 示例值：这是一段数据切片内容
func (builder *DataAssetChunkBuilder) Content(content string) *DataAssetChunkBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 切片所属的数据知识ID
//
// 示例值：asset_id_casdfh1
func (builder *DataAssetChunkBuilder) DataAssetId(dataAssetId string) *DataAssetChunkBuilder {
	builder.dataAssetId = dataAssetId
	builder.dataAssetIdFlag = true
	return builder
}

// 相关性分数
//
// 示例值：0.74
func (builder *DataAssetChunkBuilder) Score(score float64) *DataAssetChunkBuilder {
	builder.score = score
	builder.scoreFlag = true
	return builder
}

// 切片所归属的数据知识名称
//
// 示例值：
func (builder *DataAssetChunkBuilder) DataAssetLabel(dataAssetLabel map[string]string) *DataAssetChunkBuilder {
	builder.dataAssetLabel = dataAssetLabel
	builder.dataAssetLabelFlag = true
	return builder
}

// 归属数据知识的源链接。如云文档链接、文件链接等
//
// 示例值：https://doclink.com/1
func (builder *DataAssetChunkBuilder) DataAssetSourceUrl(dataAssetSourceUrl string) *DataAssetChunkBuilder {
	builder.dataAssetSourceUrl = dataAssetSourceUrl
	builder.dataAssetSourceUrlFlag = true
	return builder
}

// 归属数据知识的数据资源类型
//
// 示例值：excel
func (builder *DataAssetChunkBuilder) DataAssetDataSourceType(dataAssetDataSourceType string) *DataAssetChunkBuilder {
	builder.dataAssetDataSourceType = dataAssetDataSourceType
	builder.dataAssetDataSourceTypeFlag = true
	return builder
}

// 归属数据知识的数据连接类型
//
// 示例值：direct
func (builder *DataAssetChunkBuilder) DataAssetConnectType(dataAssetConnectType string) *DataAssetChunkBuilder {
	builder.dataAssetConnectType = dataAssetConnectType
	builder.dataAssetConnectTypeFlag = true
	return builder
}

// 切片所归属数据源信息
//
// 示例值：
func (builder *DataAssetChunkBuilder) SourceInfo(sourceInfo *DataAssetChunkSourceInfo) *DataAssetChunkBuilder {
	builder.sourceInfo = sourceInfo
	builder.sourceInfoFlag = true
	return builder
}

func (builder *DataAssetChunkBuilder) Build() *DataAssetChunk {
	req := &DataAssetChunk{}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.dataAssetIdFlag {
		req.DataAssetId = &builder.dataAssetId

	}
	if builder.scoreFlag {
		req.Score = &builder.score

	}
	if builder.dataAssetLabelFlag {
		req.DataAssetLabel = builder.dataAssetLabel
	}
	if builder.dataAssetSourceUrlFlag {
		req.DataAssetSourceUrl = &builder.dataAssetSourceUrl

	}
	if builder.dataAssetDataSourceTypeFlag {
		req.DataAssetDataSourceType = &builder.dataAssetDataSourceType

	}
	if builder.dataAssetConnectTypeFlag {
		req.DataAssetConnectType = &builder.dataAssetConnectType

	}
	if builder.sourceInfoFlag {
		req.SourceInfo = builder.sourceInfo
	}
	return req
}

type DataAssetChunkSourceInfo struct {
	Title *string `json:"title,omitempty"` // 数据源标题

	Url *string `json:"url,omitempty"` // 数据源链接
}

type DataAssetChunkSourceInfoBuilder struct {
	title     string // 数据源标题
	titleFlag bool

	url     string // 数据源链接
	urlFlag bool
}

func NewDataAssetChunkSourceInfoBuilder() *DataAssetChunkSourceInfoBuilder {
	builder := &DataAssetChunkSourceInfoBuilder{}
	return builder
}

// 数据源标题
//
// 示例值：文档标题
func (builder *DataAssetChunkSourceInfoBuilder) Title(title string) *DataAssetChunkSourceInfoBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 数据源链接
//
// 示例值：https://mydoc.com/1
func (builder *DataAssetChunkSourceInfoBuilder) Url(url string) *DataAssetChunkSourceInfoBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *DataAssetChunkSourceInfoBuilder) Build() *DataAssetChunkSourceInfo {
	req := &DataAssetChunkSourceInfo{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type DataAssetFile struct {
	Token *string `json:"token,omitempty"` // 文件token

	MimeType *string `json:"mime_type,omitempty"` // 文件内容类型
}

type DataAssetFileBuilder struct {
	token     string // 文件token
	tokenFlag bool

	mimeType     string // 文件内容类型
	mimeTypeFlag bool
}

func NewDataAssetFileBuilder() *DataAssetFileBuilder {
	builder := &DataAssetFileBuilder{}
	return builder
}

// 文件token
//
// 示例值：file_token_abcd123
func (builder *DataAssetFileBuilder) Token(token string) *DataAssetFileBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 文件内容类型
//
// 示例值：excel
func (builder *DataAssetFileBuilder) MimeType(mimeType string) *DataAssetFileBuilder {
	builder.mimeType = mimeType
	builder.mimeTypeFlag = true
	return builder
}

func (builder *DataAssetFileBuilder) Build() *DataAssetFile {
	req := &DataAssetFile{}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.mimeTypeFlag {
		req.MimeType = &builder.mimeType

	}
	return req
}

type DataAssetImportKnowledgeFile struct {
	Title *string `json:"title,omitempty"` // 文件标题

	Token *string `json:"token,omitempty"` // 上传文件获取到的token。和content二选一，优先使用token。

	Content *string `json:"content,omitempty"` // 文件内容。和token二选一，优先使用token。有长度限制，大文件优先使用token方式。

	MimeType *string `json:"mime_type,omitempty"` // 文件内容对应的 MIME 类型，使用token方式必须填写

	Url *string `json:"url,omitempty"` // 文件源的URL
}

type DataAssetImportKnowledgeFileBuilder struct {
	title     string // 文件标题
	titleFlag bool

	token     string // 上传文件获取到的token。和content二选一，优先使用token。
	tokenFlag bool

	content     string // 文件内容。和token二选一，优先使用token。有长度限制，大文件优先使用token方式。
	contentFlag bool

	mimeType     string // 文件内容对应的 MIME 类型，使用token方式必须填写
	mimeTypeFlag bool

	url     string // 文件源的URL
	urlFlag bool
}

func NewDataAssetImportKnowledgeFileBuilder() *DataAssetImportKnowledgeFileBuilder {
	builder := &DataAssetImportKnowledgeFileBuilder{}
	return builder
}

// 文件标题
//
// 示例值：文件标题
func (builder *DataAssetImportKnowledgeFileBuilder) Title(title string) *DataAssetImportKnowledgeFileBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 上传文件获取到的token。和content二选一，优先使用token。
//
// 示例值：bb690637b49440b08f39459a2fdcd2ca
func (builder *DataAssetImportKnowledgeFileBuilder) Token(token string) *DataAssetImportKnowledgeFileBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 文件内容。和token二选一，优先使用token。有长度限制，大文件优先使用token方式。
//
// 示例值：这是文件内容
func (builder *DataAssetImportKnowledgeFileBuilder) Content(content string) *DataAssetImportKnowledgeFileBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 文件内容对应的 MIME 类型，使用token方式必须填写
//
// 示例值：.docx
func (builder *DataAssetImportKnowledgeFileBuilder) MimeType(mimeType string) *DataAssetImportKnowledgeFileBuilder {
	builder.mimeType = mimeType
	builder.mimeTypeFlag = true
	return builder
}

// 文件源的URL
//
// 示例值：https://document.com/1
func (builder *DataAssetImportKnowledgeFileBuilder) Url(url string) *DataAssetImportKnowledgeFileBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeFileBuilder) Build() *DataAssetImportKnowledgeFile {
	req := &DataAssetImportKnowledgeFile{}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.mimeTypeFlag {
		req.MimeType = &builder.mimeType

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type DataAssetImportKnowledgeHelpdesk struct {
	HelpdeskId *string `json:"helpdesk_id,omitempty"` // 飞书服务台ID
}

type DataAssetImportKnowledgeHelpdeskBuilder struct {
	helpdeskId     string // 飞书服务台ID
	helpdeskIdFlag bool
}

func NewDataAssetImportKnowledgeHelpdeskBuilder() *DataAssetImportKnowledgeHelpdeskBuilder {
	builder := &DataAssetImportKnowledgeHelpdeskBuilder{}
	return builder
}

// 飞书服务台ID
//
// 示例值：123
func (builder *DataAssetImportKnowledgeHelpdeskBuilder) HelpdeskId(helpdeskId string) *DataAssetImportKnowledgeHelpdeskBuilder {
	builder.helpdeskId = helpdeskId
	builder.helpdeskIdFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeHelpdeskBuilder) Build() *DataAssetImportKnowledgeHelpdesk {
	req := &DataAssetImportKnowledgeHelpdesk{}
	if builder.helpdeskIdFlag {
		req.HelpdeskId = &builder.helpdeskId

	}
	return req
}

type DataAssetImportKnowledgeLarkDoc struct {
	Type *string `json:"type,omitempty"` // 云文档类型

	Token *string `json:"token,omitempty"` // 云文档标识

	WithSubDocs *bool `json:"with_sub_docs,omitempty"` // 是否包含子文档，只有wiki类型的云文档支持

	Url *string `json:"url,omitempty"` // 文档链接
}

type DataAssetImportKnowledgeLarkDocBuilder struct {
	type_    string // 云文档类型
	typeFlag bool

	token     string // 云文档标识
	tokenFlag bool

	withSubDocs     bool // 是否包含子文档，只有wiki类型的云文档支持
	withSubDocsFlag bool

	url     string // 文档链接
	urlFlag bool
}

func NewDataAssetImportKnowledgeLarkDocBuilder() *DataAssetImportKnowledgeLarkDocBuilder {
	builder := &DataAssetImportKnowledgeLarkDocBuilder{}
	return builder
}

// 云文档类型
//
// 示例值：docx
func (builder *DataAssetImportKnowledgeLarkDocBuilder) Type(type_ string) *DataAssetImportKnowledgeLarkDocBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 云文档标识
//
// 示例值：T8FAcuilgC1fdaxkt58vcp91xngh
func (builder *DataAssetImportKnowledgeLarkDocBuilder) Token(token string) *DataAssetImportKnowledgeLarkDocBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 是否包含子文档，只有wiki类型的云文档支持
//
// 示例值：
func (builder *DataAssetImportKnowledgeLarkDocBuilder) WithSubDocs(withSubDocs bool) *DataAssetImportKnowledgeLarkDocBuilder {
	builder.withSubDocs = withSubDocs
	builder.withSubDocsFlag = true
	return builder
}

// 文档链接
//
// 示例值：https://abc.feihsu.cn/docx/abcd123
func (builder *DataAssetImportKnowledgeLarkDocBuilder) Url(url string) *DataAssetImportKnowledgeLarkDocBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeLarkDocBuilder) Build() *DataAssetImportKnowledgeLarkDoc {
	req := &DataAssetImportKnowledgeLarkDoc{}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.withSubDocsFlag {
		req.WithSubDocs = &builder.withSubDocs

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type DataAssetImportKnowledgeSetting struct {
	ChunkSetting *DataAssetKnowledgeChunkSetting `json:"chunk_setting,omitempty"` // 知识切片配置

	File *DataAssetImportKnowledgeFile `json:"file,omitempty"` // 知识导入-文件

	LarkDoc *DataAssetImportKnowledgeLarkDoc `json:"lark_doc,omitempty"` // 知识导入-飞书云文档

	LarkWikiSpace *DataAssetImportKnowledgeWiki `json:"lark_wiki_space,omitempty"` // 知识导入-飞书知识空间

	LarkHelpdesk *DataAssetImportKnowledgeHelpdesk `json:"lark_helpdesk,omitempty"` // 知识导入-飞书服务台
}

type DataAssetImportKnowledgeSettingBuilder struct {
	chunkSetting     *DataAssetKnowledgeChunkSetting // 知识切片配置
	chunkSettingFlag bool

	file     *DataAssetImportKnowledgeFile // 知识导入-文件
	fileFlag bool

	larkDoc     *DataAssetImportKnowledgeLarkDoc // 知识导入-飞书云文档
	larkDocFlag bool

	larkWikiSpace     *DataAssetImportKnowledgeWiki // 知识导入-飞书知识空间
	larkWikiSpaceFlag bool

	larkHelpdesk     *DataAssetImportKnowledgeHelpdesk // 知识导入-飞书服务台
	larkHelpdeskFlag bool
}

func NewDataAssetImportKnowledgeSettingBuilder() *DataAssetImportKnowledgeSettingBuilder {
	builder := &DataAssetImportKnowledgeSettingBuilder{}
	return builder
}

// 知识切片配置
//
// 示例值：
func (builder *DataAssetImportKnowledgeSettingBuilder) ChunkSetting(chunkSetting *DataAssetKnowledgeChunkSetting) *DataAssetImportKnowledgeSettingBuilder {
	builder.chunkSetting = chunkSetting
	builder.chunkSettingFlag = true
	return builder
}

// 知识导入-文件
//
// 示例值：
func (builder *DataAssetImportKnowledgeSettingBuilder) File(file *DataAssetImportKnowledgeFile) *DataAssetImportKnowledgeSettingBuilder {
	builder.file = file
	builder.fileFlag = true
	return builder
}

// 知识导入-飞书云文档
//
// 示例值：
func (builder *DataAssetImportKnowledgeSettingBuilder) LarkDoc(larkDoc *DataAssetImportKnowledgeLarkDoc) *DataAssetImportKnowledgeSettingBuilder {
	builder.larkDoc = larkDoc
	builder.larkDocFlag = true
	return builder
}

// 知识导入-飞书知识空间
//
// 示例值：
func (builder *DataAssetImportKnowledgeSettingBuilder) LarkWikiSpace(larkWikiSpace *DataAssetImportKnowledgeWiki) *DataAssetImportKnowledgeSettingBuilder {
	builder.larkWikiSpace = larkWikiSpace
	builder.larkWikiSpaceFlag = true
	return builder
}

// 知识导入-飞书服务台
//
// 示例值：
func (builder *DataAssetImportKnowledgeSettingBuilder) LarkHelpdesk(larkHelpdesk *DataAssetImportKnowledgeHelpdesk) *DataAssetImportKnowledgeSettingBuilder {
	builder.larkHelpdesk = larkHelpdesk
	builder.larkHelpdeskFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeSettingBuilder) Build() *DataAssetImportKnowledgeSetting {
	req := &DataAssetImportKnowledgeSetting{}
	if builder.chunkSettingFlag {
		req.ChunkSetting = builder.chunkSetting
	}
	if builder.fileFlag {
		req.File = builder.file
	}
	if builder.larkDocFlag {
		req.LarkDoc = builder.larkDoc
	}
	if builder.larkWikiSpaceFlag {
		req.LarkWikiSpace = builder.larkWikiSpace
	}
	if builder.larkHelpdeskFlag {
		req.LarkHelpdesk = builder.larkHelpdesk
	}
	return req
}

type DataAssetImportKnowledgeWiki struct {
	SpaceId *string `json:"space_id,omitempty"` // 飞书知识空间ID

	SubDocs []*DataAssetImportKnowledgeWikiSubDoc `json:"sub_docs,omitempty"` // 指定知识空间子节点时使用

	Url *string `json:"url,omitempty"` // 知识空间URL
}

type DataAssetImportKnowledgeWikiBuilder struct {
	spaceId     string // 飞书知识空间ID
	spaceIdFlag bool

	subDocs     []*DataAssetImportKnowledgeWikiSubDoc // 指定知识空间子节点时使用
	subDocsFlag bool

	url     string // 知识空间URL
	urlFlag bool
}

func NewDataAssetImportKnowledgeWikiBuilder() *DataAssetImportKnowledgeWikiBuilder {
	builder := &DataAssetImportKnowledgeWikiBuilder{}
	return builder
}

// 飞书知识空间ID
//
// 示例值：798546548961351
func (builder *DataAssetImportKnowledgeWikiBuilder) SpaceId(spaceId string) *DataAssetImportKnowledgeWikiBuilder {
	builder.spaceId = spaceId
	builder.spaceIdFlag = true
	return builder
}

// 指定知识空间子节点时使用
//
// 示例值：
func (builder *DataAssetImportKnowledgeWikiBuilder) SubDocs(subDocs []*DataAssetImportKnowledgeWikiSubDoc) *DataAssetImportKnowledgeWikiBuilder {
	builder.subDocs = subDocs
	builder.subDocsFlag = true
	return builder
}

// 知识空间URL
//
// 示例值：https://ai-tenant.feishu-boe.cn/wiki/space/7283525110814736404
func (builder *DataAssetImportKnowledgeWikiBuilder) Url(url string) *DataAssetImportKnowledgeWikiBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeWikiBuilder) Build() *DataAssetImportKnowledgeWiki {
	req := &DataAssetImportKnowledgeWiki{}
	if builder.spaceIdFlag {
		req.SpaceId = &builder.spaceId

	}
	if builder.subDocsFlag {
		req.SubDocs = builder.subDocs
	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type DataAssetImportKnowledgeWikiSubDoc struct {
	Type *string `json:"type,omitempty"` // 云文档类型，只支持wiki中的云文档

	Token *string `json:"token,omitempty"` // 云文档标识

	Url *string `json:"url,omitempty"` // 云文档链接
}

type DataAssetImportKnowledgeWikiSubDocBuilder struct {
	type_    string // 云文档类型，只支持wiki中的云文档
	typeFlag bool

	token     string // 云文档标识
	tokenFlag bool

	url     string // 云文档链接
	urlFlag bool
}

func NewDataAssetImportKnowledgeWikiSubDocBuilder() *DataAssetImportKnowledgeWikiSubDocBuilder {
	builder := &DataAssetImportKnowledgeWikiSubDocBuilder{}
	return builder
}

// 云文档类型，只支持wiki中的云文档
//
// 示例值：wiki
func (builder *DataAssetImportKnowledgeWikiSubDocBuilder) Type(type_ string) *DataAssetImportKnowledgeWikiSubDocBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 云文档标识
//
// 示例值：T8FAcuilgC1fdaxkt58vcp91xngh
func (builder *DataAssetImportKnowledgeWikiSubDocBuilder) Token(token string) *DataAssetImportKnowledgeWikiSubDocBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

// 云文档链接
//
// 示例值：https://cdas.feishu.cn/wiki/fdisu1
func (builder *DataAssetImportKnowledgeWikiSubDocBuilder) Url(url string) *DataAssetImportKnowledgeWikiSubDocBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *DataAssetImportKnowledgeWikiSubDocBuilder) Build() *DataAssetImportKnowledgeWikiSubDoc {
	req := &DataAssetImportKnowledgeWikiSubDoc{}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.tokenFlag {
		req.Token = &builder.token

	}
	if builder.urlFlag {
		req.Url = &builder.url

	}
	return req
}

type DataAssetItem struct {
	DataAssetItemId *string `json:"data_asset_item_id,omitempty"` // 数据知识项ID

	ApiName *string `json:"api_name,omitempty"` // 数据知识项标识

	Label map[string]string `json:"label,omitempty"` // 数据知识项标题

	Description map[string]string `json:"description,omitempty"` // 数据知识项描述

	Resources []*DataAssetResource `json:"resources,omitempty"` // 数据知识资源
}

type DataAssetItemBuilder struct {
	dataAssetItemId     string // 数据知识项ID
	dataAssetItemIdFlag bool

	apiName     string // 数据知识项标识
	apiNameFlag bool

	label     map[string]string // 数据知识项标题
	labelFlag bool

	description     map[string]string // 数据知识项描述
	descriptionFlag bool

	resources     []*DataAssetResource // 数据知识资源
	resourcesFlag bool
}

func NewDataAssetItemBuilder() *DataAssetItemBuilder {
	builder := &DataAssetItemBuilder{}
	return builder
}

// 数据知识项ID
//
// 示例值：asset_item_aadg3mcgvpydu
func (builder *DataAssetItemBuilder) DataAssetItemId(dataAssetItemId string) *DataAssetItemBuilder {
	builder.dataAssetItemId = dataAssetItemId
	builder.dataAssetItemIdFlag = true
	return builder
}

// 数据知识项标识
//
// 示例值：movie
func (builder *DataAssetItemBuilder) ApiName(apiName string) *DataAssetItemBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 数据知识项标题
//
// 示例值：
func (builder *DataAssetItemBuilder) Label(label map[string]string) *DataAssetItemBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 数据知识项描述
//
// 示例值：
func (builder *DataAssetItemBuilder) Description(description map[string]string) *DataAssetItemBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 数据知识资源
//
// 示例值：
func (builder *DataAssetItemBuilder) Resources(resources []*DataAssetResource) *DataAssetItemBuilder {
	builder.resources = resources
	builder.resourcesFlag = true
	return builder
}

func (builder *DataAssetItemBuilder) Build() *DataAssetItem {
	req := &DataAssetItem{}
	if builder.dataAssetItemIdFlag {
		req.DataAssetItemId = &builder.dataAssetItemId

	}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.labelFlag {
		req.Label = builder.label
	}
	if builder.descriptionFlag {
		req.Description = builder.description
	}
	if builder.resourcesFlag {
		req.Resources = builder.resources
	}
	return req
}

type DataAssetKnowledgeChunkSetting struct {
	RuleType *string `json:"rule_type,omitempty"` // 切片规则

	SeparateType *string `json:"separate_type,omitempty"` // 切片分割符类型

	Size *int `json:"size,omitempty"` // 分段最大长度（字符），按标识符切片时必须填写

	Overlap *int `json:"overlap,omitempty"` // 分段重叠字符数，按标识符切片时必须填写，不能超过size的数值
}

type DataAssetKnowledgeChunkSettingBuilder struct {
	ruleType     string // 切片规则
	ruleTypeFlag bool

	separateType     string // 切片分割符类型
	separateTypeFlag bool

	size     int // 分段最大长度（字符），按标识符切片时必须填写
	sizeFlag bool

	overlap     int // 分段重叠字符数，按标识符切片时必须填写，不能超过size的数值
	overlapFlag bool
}

func NewDataAssetKnowledgeChunkSettingBuilder() *DataAssetKnowledgeChunkSettingBuilder {
	builder := &DataAssetKnowledgeChunkSettingBuilder{}
	return builder
}

// 切片规则
//
// 示例值：intelligent
func (builder *DataAssetKnowledgeChunkSettingBuilder) RuleType(ruleType string) *DataAssetKnowledgeChunkSettingBuilder {
	builder.ruleType = ruleType
	builder.ruleTypeFlag = true
	return builder
}

// 切片分割符类型
//
// 示例值：paragraph
func (builder *DataAssetKnowledgeChunkSettingBuilder) SeparateType(separateType string) *DataAssetKnowledgeChunkSettingBuilder {
	builder.separateType = separateType
	builder.separateTypeFlag = true
	return builder
}

// 分段最大长度（字符），按标识符切片时必须填写
//
// 示例值：600
func (builder *DataAssetKnowledgeChunkSettingBuilder) Size(size int) *DataAssetKnowledgeChunkSettingBuilder {
	builder.size = size
	builder.sizeFlag = true
	return builder
}

// 分段重叠字符数，按标识符切片时必须填写，不能超过size的数值
//
// 示例值：10
func (builder *DataAssetKnowledgeChunkSettingBuilder) Overlap(overlap int) *DataAssetKnowledgeChunkSettingBuilder {
	builder.overlap = overlap
	builder.overlapFlag = true
	return builder
}

func (builder *DataAssetKnowledgeChunkSettingBuilder) Build() *DataAssetKnowledgeChunkSetting {
	req := &DataAssetKnowledgeChunkSetting{}
	if builder.ruleTypeFlag {
		req.RuleType = &builder.ruleType

	}
	if builder.separateTypeFlag {
		req.SeparateType = &builder.separateType

	}
	if builder.sizeFlag {
		req.Size = &builder.size

	}
	if builder.overlapFlag {
		req.Overlap = &builder.overlap

	}
	return req
}

type DataAssetResource struct {
	ResourceId *string `json:"resource_id,omitempty"` // 数据知识资源ID

	ResouceType *string `json:"resouce_type,omitempty"` // 数据知识资源类型

	ResourceType *string `json:"resource_type,omitempty"` // 数据知识资源类型
}

type DataAssetResourceBuilder struct {
	resourceId     string // 数据知识资源ID
	resourceIdFlag bool

	resouceType     string // 数据知识资源类型
	resouceTypeFlag bool

	resourceType     string // 数据知识资源类型
	resourceTypeFlag bool
}

func NewDataAssetResourceBuilder() *DataAssetResourceBuilder {
	builder := &DataAssetResourceBuilder{}
	return builder
}

// 数据知识资源ID
//
// 示例值：spring_5862e4fea8__c__dataset_aadg3lxm4j6mg
func (builder *DataAssetResourceBuilder) ResourceId(resourceId string) *DataAssetResourceBuilder {
	builder.resourceId = resourceId
	builder.resourceIdFlag = true
	return builder
}

// 数据知识资源类型
//
// 示例值：dataset
func (builder *DataAssetResourceBuilder) ResouceType(resouceType string) *DataAssetResourceBuilder {
	builder.resouceType = resouceType
	builder.resouceTypeFlag = true
	return builder
}

// 数据知识资源类型
//
// 示例值：dataset
func (builder *DataAssetResourceBuilder) ResourceType(resourceType string) *DataAssetResourceBuilder {
	builder.resourceType = resourceType
	builder.resourceTypeFlag = true
	return builder
}

func (builder *DataAssetResourceBuilder) Build() *DataAssetResource {
	req := &DataAssetResource{}
	if builder.resourceIdFlag {
		req.ResourceId = &builder.resourceId

	}
	if builder.resouceTypeFlag {
		req.ResouceType = &builder.resouceType

	}
	if builder.resourceTypeFlag {
		req.ResourceType = &builder.resourceType

	}
	return req
}

type DataAssetTag struct {
	DataAssetTagId *string `json:"data_asset_tag_id,omitempty"` // 数据知识分类名称

	Name *string `json:"name,omitempty"` // 数据知识分类ID
}

type DataAssetTagBuilder struct {
	dataAssetTagId     string // 数据知识分类名称
	dataAssetTagIdFlag bool

	name     string // 数据知识分类ID
	nameFlag bool
}

func NewDataAssetTagBuilder() *DataAssetTagBuilder {
	builder := &DataAssetTagBuilder{}
	return builder
}

// 数据知识分类名称
//
// 示例值：spring_5862e4fea8__c__asset_tag_aadg2b5ql4gbs
func (builder *DataAssetTagBuilder) DataAssetTagId(dataAssetTagId string) *DataAssetTagBuilder {
	builder.dataAssetTagId = dataAssetTagId
	builder.dataAssetTagIdFlag = true
	return builder
}

// 数据知识分类ID
//
// 示例值：电影
func (builder *DataAssetTagBuilder) Name(name string) *DataAssetTagBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

func (builder *DataAssetTagBuilder) Build() *DataAssetTag {
	req := &DataAssetTag{}
	if builder.dataAssetTagIdFlag {
		req.DataAssetTagId = &builder.dataAssetTagId

	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	return req
}

type DatasetSource struct {
	Type *string `json:"type,omitempty"` // 分析表类型：object/external/dataflow

	Settings *SourceSetting `json:"settings,omitempty"` // 分析表数据源信息配置
}

type DatasetSourceBuilder struct {
	type_    string // 分析表类型：object/external/dataflow
	typeFlag bool

	settings     *SourceSetting // 分析表数据源信息配置
	settingsFlag bool
}

func NewDatasetSourceBuilder() *DatasetSourceBuilder {
	builder := &DatasetSourceBuilder{}
	return builder
}

// 分析表类型：object/external/dataflow
//
// 示例值：object
func (builder *DatasetSourceBuilder) Type(type_ string) *DatasetSourceBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 分析表数据源信息配置
//
// 示例值：
func (builder *DatasetSourceBuilder) Settings(settings *SourceSetting) *DatasetSourceBuilder {
	builder.settings = settings
	builder.settingsFlag = true
	return builder
}

func (builder *DatasetSourceBuilder) Build() *DatasetSource {
	req := &DatasetSource{}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.settingsFlag {
		req.Settings = builder.settings
	}
	return req
}

type DepartmentId struct {
	DepartmentId *string `json:"department_id,omitempty"` //

	OpenDepartmentId *string `json:"open_department_id,omitempty"` //
}

type DepartmentIdBuilder struct {
	departmentId     string //
	departmentIdFlag bool

	openDepartmentId     string //
	openDepartmentIdFlag bool
}

func NewDepartmentIdBuilder() *DepartmentIdBuilder {
	builder := &DepartmentIdBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *DepartmentIdBuilder) DepartmentId(departmentId string) *DepartmentIdBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *DepartmentIdBuilder) OpenDepartmentId(openDepartmentId string) *DepartmentIdBuilder {
	builder.openDepartmentId = openDepartmentId
	builder.openDepartmentIdFlag = true
	return builder
}

func (builder *DepartmentIdBuilder) Build() *DepartmentId {
	req := &DepartmentId{}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.openDepartmentIdFlag {
		req.OpenDepartmentId = &builder.openDepartmentId

	}
	return req
}

type Field struct {
	ApiName *string `json:"api_name,omitempty"` // 字段标识

	Label map[string]string `json:"label,omitempty"` // 字段名称

	AiDescription *string `json:"ai_description,omitempty"` // 字段描述信息

	AccessItems []string `json:"access_items,omitempty"` // 字段值读写权限

	TypeName *string `json:"type_name,omitempty"` // 字段的类型

	FieldSetting *FieldSetting `json:"field_setting,omitempty"` // 字段的属性
}

type FieldBuilder struct {
	apiName     string // 字段标识
	apiNameFlag bool

	label     map[string]string // 字段名称
	labelFlag bool

	aiDescription     string // 字段描述信息
	aiDescriptionFlag bool

	accessItems     []string // 字段值读写权限
	accessItemsFlag bool

	typeName     string // 字段的类型
	typeNameFlag bool

	fieldSetting     *FieldSetting // 字段的属性
	fieldSettingFlag bool
}

func NewFieldBuilder() *FieldBuilder {
	builder := &FieldBuilder{}
	return builder
}

// 字段标识
//
// 示例值：object_a
func (builder *FieldBuilder) ApiName(apiName string) *FieldBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 字段名称
//
// 示例值：
func (builder *FieldBuilder) Label(label map[string]string) *FieldBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 字段描述信息
//
// 示例值：这是一个商品的数据表
func (builder *FieldBuilder) AiDescription(aiDescription string) *FieldBuilder {
	builder.aiDescription = aiDescription
	builder.aiDescriptionFlag = true
	return builder
}

// 字段值读写权限
//
// 示例值：
func (builder *FieldBuilder) AccessItems(accessItems []string) *FieldBuilder {
	builder.accessItems = accessItems
	builder.accessItemsFlag = true
	return builder
}

// 字段的类型
//
// 示例值：bool
func (builder *FieldBuilder) TypeName(typeName string) *FieldBuilder {
	builder.typeName = typeName
	builder.typeNameFlag = true
	return builder
}

// 字段的属性
//
// 示例值：
func (builder *FieldBuilder) FieldSetting(fieldSetting *FieldSetting) *FieldBuilder {
	builder.fieldSetting = fieldSetting
	builder.fieldSettingFlag = true
	return builder
}

func (builder *FieldBuilder) Build() *Field {
	req := &Field{}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.labelFlag {
		req.Label = builder.label
	}
	if builder.aiDescriptionFlag {
		req.AiDescription = &builder.aiDescription

	}
	if builder.accessItemsFlag {
		req.AccessItems = builder.accessItems
	}
	if builder.typeNameFlag {
		req.TypeName = &builder.typeName

	}
	if builder.fieldSettingFlag {
		req.FieldSetting = builder.fieldSetting
	}
	return req
}

type FieldSetting struct {
	Required *bool `json:"required,omitempty"` // 必填属性

	Unique *bool `json:"unique,omitempty"` // 唯一性属性

	CaseSensitive *bool `json:"case_sensitive,omitempty"` // 大小写敏感的唯一性

	TextMaxLength *int `json:"text_max_length,omitempty"` // 文本最大长度

	Multiple *bool `json:"multiple,omitempty"` // 是否多值

	LookupObjectApiName *string `json:"lookup_object_api_name,omitempty"` // 关联对象的标识

	Options []string `json:"options,omitempty"` // 选项字段的选项值

	Detail *string `json:"detail,omitempty"` // 属性扩展信息
}

type FieldSettingBuilder struct {
	required     bool // 必填属性
	requiredFlag bool

	unique     bool // 唯一性属性
	uniqueFlag bool

	caseSensitive     bool // 大小写敏感的唯一性
	caseSensitiveFlag bool

	textMaxLength     int // 文本最大长度
	textMaxLengthFlag bool

	multiple     bool // 是否多值
	multipleFlag bool

	lookupObjectApiName     string // 关联对象的标识
	lookupObjectApiNameFlag bool

	options     []string // 选项字段的选项值
	optionsFlag bool

	detail     string // 属性扩展信息
	detailFlag bool
}

func NewFieldSettingBuilder() *FieldSettingBuilder {
	builder := &FieldSettingBuilder{}
	return builder
}

// 必填属性
//
// 示例值：false
func (builder *FieldSettingBuilder) Required(required bool) *FieldSettingBuilder {
	builder.required = required
	builder.requiredFlag = true
	return builder
}

// 唯一性属性
//
// 示例值：
func (builder *FieldSettingBuilder) Unique(unique bool) *FieldSettingBuilder {
	builder.unique = unique
	builder.uniqueFlag = true
	return builder
}

// 大小写敏感的唯一性
//
// 示例值：
func (builder *FieldSettingBuilder) CaseSensitive(caseSensitive bool) *FieldSettingBuilder {
	builder.caseSensitive = caseSensitive
	builder.caseSensitiveFlag = true
	return builder
}

// 文本最大长度
//
// 示例值：200
func (builder *FieldSettingBuilder) TextMaxLength(textMaxLength int) *FieldSettingBuilder {
	builder.textMaxLength = textMaxLength
	builder.textMaxLengthFlag = true
	return builder
}

// 是否多值
//
// 示例值：
func (builder *FieldSettingBuilder) Multiple(multiple bool) *FieldSettingBuilder {
	builder.multiple = multiple
	builder.multipleFlag = true
	return builder
}

// 关联对象的标识
//
// 示例值：_user
func (builder *FieldSettingBuilder) LookupObjectApiName(lookupObjectApiName string) *FieldSettingBuilder {
	builder.lookupObjectApiName = lookupObjectApiName
	builder.lookupObjectApiNameFlag = true
	return builder
}

// 选项字段的选项值
//
// 示例值：
func (builder *FieldSettingBuilder) Options(options []string) *FieldSettingBuilder {
	builder.options = options
	builder.optionsFlag = true
	return builder
}

// 属性扩展信息
//
// 示例值：[	 {	   "label": {		 "zh_cn": "示例文本",		 "en_us": "Sample text"	 },	   "api_name": "optionA",	   "description":{		 "zh_cn": "示例文本",		 "en_us": "Sample text"	 },	   "color": "R",	   "active": true	 }   ]
func (builder *FieldSettingBuilder) Detail(detail string) *FieldSettingBuilder {
	builder.detail = detail
	builder.detailFlag = true
	return builder
}

func (builder *FieldSettingBuilder) Build() *FieldSetting {
	req := &FieldSetting{}
	if builder.requiredFlag {
		req.Required = &builder.required

	}
	if builder.uniqueFlag {
		req.Unique = &builder.unique

	}
	if builder.caseSensitiveFlag {
		req.CaseSensitive = &builder.caseSensitive

	}
	if builder.textMaxLengthFlag {
		req.TextMaxLength = &builder.textMaxLength

	}
	if builder.multipleFlag {
		req.Multiple = &builder.multiple

	}
	if builder.lookupObjectApiNameFlag {
		req.LookupObjectApiName = &builder.lookupObjectApiName

	}
	if builder.optionsFlag {
		req.Options = builder.options
	}
	if builder.detailFlag {
		req.Detail = &builder.detail

	}
	return req
}

type Intent struct {
	Id *string `json:"id,omitempty"` // 意图 id

	CreatedAt *string `json:"created_at,omitempty"` // 意图创建时间，毫秒时间戳

	SessionId *string `json:"session_id,omitempty"` // 意图所属会话 id

	Status *string `json:"status,omitempty"` // 意图状态

	SubStatus *string `json:"sub_status,omitempty"` // 意图子状态

	ChannelType *string `json:"channel_type,omitempty"` // 渠道类型

	Error *MessageError `json:"error,omitempty"` // 意图失败原因
}

type IntentBuilder struct {
	id     string // 意图 id
	idFlag bool

	createdAt     string // 意图创建时间，毫秒时间戳
	createdAtFlag bool

	sessionId     string // 意图所属会话 id
	sessionIdFlag bool

	status     string // 意图状态
	statusFlag bool

	subStatus     string // 意图子状态
	subStatusFlag bool

	channelType     string // 渠道类型
	channelTypeFlag bool

	error     *MessageError // 意图失败原因
	errorFlag bool
}

func NewIntentBuilder() *IntentBuilder {
	builder := &IntentBuilder{}
	return builder
}

// 意图 id
//
// 示例值：7317093049367298068
func (builder *IntentBuilder) Id(id string) *IntentBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 意图创建时间，毫秒时间戳
//
// 示例值：1703658042000
func (builder *IntentBuilder) CreatedAt(createdAt string) *IntentBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// 意图所属会话 id
//
// 示例值：7317091019140972563
func (builder *IntentBuilder) SessionId(sessionId string) *IntentBuilder {
	builder.sessionId = sessionId
	builder.sessionIdFlag = true
	return builder
}

// 意图状态
//
// 示例值：RUNNING
func (builder *IntentBuilder) Status(status string) *IntentBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 意图子状态
//
// 示例值：WAITING_USER_RESPOND
func (builder *IntentBuilder) SubStatus(subStatus string) *IntentBuilder {
	builder.subStatus = subStatus
	builder.subStatusFlag = true
	return builder
}

// 渠道类型
//
// 示例值：LARK_OPEN_API
func (builder *IntentBuilder) ChannelType(channelType string) *IntentBuilder {
	builder.channelType = channelType
	builder.channelTypeFlag = true
	return builder
}

// 意图失败原因
//
// 示例值：
func (builder *IntentBuilder) Error(error *MessageError) *IntentBuilder {
	builder.error = error
	builder.errorFlag = true
	return builder
}

func (builder *IntentBuilder) Build() *Intent {
	req := &Intent{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.sessionIdFlag {
		req.SessionId = &builder.sessionId

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.subStatusFlag {
		req.SubStatus = &builder.subStatus

	}
	if builder.channelTypeFlag {
		req.ChannelType = &builder.channelType

	}
	if builder.errorFlag {
		req.Error = builder.error
	}
	return req
}

type Kctx struct {
	TenantId *int `json:"tenant_id,omitempty"` // 租户 id

	UserId *int `json:"user_id,omitempty"` // 用户 id

	TenantDomainName *string `json:"tenant_domain_name,omitempty"` // 租户域名

	UserSetting *string `json:"user_setting,omitempty"` // 用户设置

	LangId *int `json:"lang_id,omitempty"` // 语言

	RequestId *string `json:"request_id,omitempty"` // 请求 id

	Host *string `json:"host,omitempty"` // 域名

	TenantResourceRouteKey *string `json:"tenant_resource_route_key,omitempty"` // 资源路由 key

	Namespace *string `json:"namespace,omitempty"` // 命名空间

	TenantType *int `json:"tenant_type,omitempty"` // 租户类型

	TransactionId *int `json:"transaction_id,omitempty"` // 事务ID

	ConsistencyRetryType *string `json:"ConsistencyRetryType,omitempty"` // consistency retry type

	PsmLink *string `json:"PsmLink,omitempty"` // psm link

	BreakoutRetryPsm *string `json:"BreakoutRetryPsm,omitempty"` // breakout retry psm

	CredentialID *string `json:"CredentialID,omitempty"` // credential id

	AuthenticationType *string `json:"AuthenticationType,omitempty"` // 鉴权类型
}

type KctxBuilder struct {
	tenantId     int // 租户 id
	tenantIdFlag bool

	userId     int // 用户 id
	userIdFlag bool

	tenantDomainName     string // 租户域名
	tenantDomainNameFlag bool

	userSetting     string // 用户设置
	userSettingFlag bool

	langId     int // 语言
	langIdFlag bool

	requestId     string // 请求 id
	requestIdFlag bool

	host     string // 域名
	hostFlag bool

	tenantResourceRouteKey     string // 资源路由 key
	tenantResourceRouteKeyFlag bool

	namespace     string // 命名空间
	namespaceFlag bool

	tenantType     int // 租户类型
	tenantTypeFlag bool

	transactionId     int // 事务ID
	transactionIdFlag bool

	consistencyRetryType     string // consistency retry type
	consistencyRetryTypeFlag bool

	psmLink     string // psm link
	psmLinkFlag bool

	breakoutRetryPsm     string // breakout retry psm
	breakoutRetryPsmFlag bool

	credentialID     string // credential id
	credentialIDFlag bool

	authenticationType     string // 鉴权类型
	authenticationTypeFlag bool
}

func NewKctxBuilder() *KctxBuilder {
	builder := &KctxBuilder{}
	return builder
}

// 租户 id
//
// 示例值：0
func (builder *KctxBuilder) TenantId(tenantId int) *KctxBuilder {
	builder.tenantId = tenantId
	builder.tenantIdFlag = true
	return builder
}

// 用户 id
//
// 示例值：
func (builder *KctxBuilder) UserId(userId int) *KctxBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 租户域名
//
// 示例值：apaas
func (builder *KctxBuilder) TenantDomainName(tenantDomainName string) *KctxBuilder {
	builder.tenantDomainName = tenantDomainName
	builder.tenantDomainNameFlag = true
	return builder
}

// 用户设置
//
// 示例值："{}"
func (builder *KctxBuilder) UserSetting(userSetting string) *KctxBuilder {
	builder.userSetting = userSetting
	builder.userSettingFlag = true
	return builder
}

// 语言
//
// 示例值：1033
func (builder *KctxBuilder) LangId(langId int) *KctxBuilder {
	builder.langId = langId
	builder.langIdFlag = true
	return builder
}

// 请求 id
//
// 示例值：a
func (builder *KctxBuilder) RequestId(requestId string) *KctxBuilder {
	builder.requestId = requestId
	builder.requestIdFlag = true
	return builder
}

// 域名
//
// 示例值：a
func (builder *KctxBuilder) Host(host string) *KctxBuilder {
	builder.host = host
	builder.hostFlag = true
	return builder
}

// 资源路由 key
//
// 示例值："a"
func (builder *KctxBuilder) TenantResourceRouteKey(tenantResourceRouteKey string) *KctxBuilder {
	builder.tenantResourceRouteKey = tenantResourceRouteKey
	builder.tenantResourceRouteKeyFlag = true
	return builder
}

// 命名空间
//
// 示例值：package_abc
func (builder *KctxBuilder) Namespace(namespace string) *KctxBuilder {
	builder.namespace = namespace
	builder.namespaceFlag = true
	return builder
}

// 租户类型
//
// 示例值：1
func (builder *KctxBuilder) TenantType(tenantType int) *KctxBuilder {
	builder.tenantType = tenantType
	builder.tenantTypeFlag = true
	return builder
}

// 事务ID
//
// 示例值：0
func (builder *KctxBuilder) TransactionId(transactionId int) *KctxBuilder {
	builder.transactionId = transactionId
	builder.transactionIdFlag = true
	return builder
}

// consistency retry type
//
// 示例值：a
func (builder *KctxBuilder) ConsistencyRetryType(consistencyRetryType string) *KctxBuilder {
	builder.consistencyRetryType = consistencyRetryType
	builder.consistencyRetryTypeFlag = true
	return builder
}

// psm link
//
// 示例值：a
func (builder *KctxBuilder) PsmLink(psmLink string) *KctxBuilder {
	builder.psmLink = psmLink
	builder.psmLinkFlag = true
	return builder
}

// breakout retry psm
//
// 示例值：a
func (builder *KctxBuilder) BreakoutRetryPsm(breakoutRetryPsm string) *KctxBuilder {
	builder.breakoutRetryPsm = breakoutRetryPsm
	builder.breakoutRetryPsmFlag = true
	return builder
}

// credential id
//
// 示例值：a
func (builder *KctxBuilder) CredentialID(credentialID string) *KctxBuilder {
	builder.credentialID = credentialID
	builder.credentialIDFlag = true
	return builder
}

// 鉴权类型
//
// 示例值：user
func (builder *KctxBuilder) AuthenticationType(authenticationType string) *KctxBuilder {
	builder.authenticationType = authenticationType
	builder.authenticationTypeFlag = true
	return builder
}

func (builder *KctxBuilder) Build() *Kctx {
	req := &Kctx{}
	if builder.tenantIdFlag {
		req.TenantId = &builder.tenantId

	}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.tenantDomainNameFlag {
		req.TenantDomainName = &builder.tenantDomainName

	}
	if builder.userSettingFlag {
		req.UserSetting = &builder.userSetting

	}
	if builder.langIdFlag {
		req.LangId = &builder.langId

	}
	if builder.requestIdFlag {
		req.RequestId = &builder.requestId

	}
	if builder.hostFlag {
		req.Host = &builder.host

	}
	if builder.tenantResourceRouteKeyFlag {
		req.TenantResourceRouteKey = &builder.tenantResourceRouteKey

	}
	if builder.namespaceFlag {
		req.Namespace = &builder.namespace

	}
	if builder.tenantTypeFlag {
		req.TenantType = &builder.tenantType

	}
	if builder.transactionIdFlag {
		req.TransactionId = &builder.transactionId

	}
	if builder.consistencyRetryTypeFlag {
		req.ConsistencyRetryType = &builder.consistencyRetryType

	}
	if builder.psmLinkFlag {
		req.PsmLink = &builder.psmLink

	}
	if builder.breakoutRetryPsmFlag {
		req.BreakoutRetryPsm = &builder.breakoutRetryPsm

	}
	if builder.credentialIDFlag {
		req.CredentialID = &builder.credentialID

	}
	if builder.authenticationTypeFlag {
		req.AuthenticationType = &builder.authenticationType

	}
	return req
}

type Knowledge struct {
	Id *string `json:"id,omitempty"` // 知识ID

	KnowledgeBaseId *string `json:"knowledge_base_id,omitempty"` // 知识库ID

	Status *string `json:"status,omitempty"` // 学习状态

	Title *string `json:"title,omitempty"` // 知识标题

	Type *string `json:"type,omitempty"` // 知识类型

	File *AilyKnowledgeFile `json:"file,omitempty"` // 文件信息

	Docs *AilyKnowledgeDocs `json:"docs,omitempty"` // 飞书云文档信息

	WikiSpace *AilyKnowledgeWikiSpace `json:"wiki_space,omitempty"` // 飞书知识空间信息

	Folder *AilyKnowledgeFolder `json:"folder,omitempty"` // 飞书文件夹信息

	Helpdesk *AilyKnowledgeHelpdesk `json:"helpdesk,omitempty"` // 飞书服务台信息

	Datatable *AilyKnowledgeDatatable `json:"datatable,omitempty"` // 智能伙伴数据表

	Dataset *AilyKnowledgeDataset `json:"dataset,omitempty"` // 智能伙伴分析表

	Web *AilyKnowledgeWeb `json:"web,omitempty"` // 网页信息

	ChunkCount *int `json:"chunk_count,omitempty"` // 切片数量

	CreateTime *int `json:"create_time,omitempty"` // 创建时间

	UpdateTime *int `json:"update_time,omitempty"` // 更新时间

	FailMessage *string `json:"fail_message,omitempty"` // 学习失败提示
}

type KnowledgeBuilder struct {
	id     string // 知识ID
	idFlag bool

	knowledgeBaseId     string // 知识库ID
	knowledgeBaseIdFlag bool

	status     string // 学习状态
	statusFlag bool

	title     string // 知识标题
	titleFlag bool

	type_    string // 知识类型
	typeFlag bool

	file     *AilyKnowledgeFile // 文件信息
	fileFlag bool

	docs     *AilyKnowledgeDocs // 飞书云文档信息
	docsFlag bool

	wikiSpace     *AilyKnowledgeWikiSpace // 飞书知识空间信息
	wikiSpaceFlag bool

	folder     *AilyKnowledgeFolder // 飞书文件夹信息
	folderFlag bool

	helpdesk     *AilyKnowledgeHelpdesk // 飞书服务台信息
	helpdeskFlag bool

	datatable     *AilyKnowledgeDatatable // 智能伙伴数据表
	datatableFlag bool

	dataset     *AilyKnowledgeDataset // 智能伙伴分析表
	datasetFlag bool

	web     *AilyKnowledgeWeb // 网页信息
	webFlag bool

	chunkCount     int // 切片数量
	chunkCountFlag bool

	createTime     int // 创建时间
	createTimeFlag bool

	updateTime     int // 更新时间
	updateTimeFlag bool

	failMessage     string // 学习失败提示
	failMessageFlag bool
}

func NewKnowledgeBuilder() *KnowledgeBuilder {
	builder := &KnowledgeBuilder{}
	return builder
}

// 知识ID
//
// 示例值：spring_03c49e32bb__c_sdb_aadgfh
func (builder *KnowledgeBuilder) Id(id string) *KnowledgeBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 知识库ID
//
// 示例值：knowledge_aadgd7ozoxseilqpor
func (builder *KnowledgeBuilder) KnowledgeBaseId(knowledgeBaseId string) *KnowledgeBuilder {
	builder.knowledgeBaseId = knowledgeBaseId
	builder.knowledgeBaseIdFlag = true
	return builder
}

// 学习状态
//
// 示例值：
func (builder *KnowledgeBuilder) Status(status string) *KnowledgeBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 知识标题
//
// 示例值：title
func (builder *KnowledgeBuilder) Title(title string) *KnowledgeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 知识类型
//
// 示例值：
func (builder *KnowledgeBuilder) Type(type_ string) *KnowledgeBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 文件信息
//
// 示例值：
func (builder *KnowledgeBuilder) File(file *AilyKnowledgeFile) *KnowledgeBuilder {
	builder.file = file
	builder.fileFlag = true
	return builder
}

// 飞书云文档信息
//
// 示例值：
func (builder *KnowledgeBuilder) Docs(docs *AilyKnowledgeDocs) *KnowledgeBuilder {
	builder.docs = docs
	builder.docsFlag = true
	return builder
}

// 飞书知识空间信息
//
// 示例值：
func (builder *KnowledgeBuilder) WikiSpace(wikiSpace *AilyKnowledgeWikiSpace) *KnowledgeBuilder {
	builder.wikiSpace = wikiSpace
	builder.wikiSpaceFlag = true
	return builder
}

// 飞书文件夹信息
//
// 示例值：
func (builder *KnowledgeBuilder) Folder(folder *AilyKnowledgeFolder) *KnowledgeBuilder {
	builder.folder = folder
	builder.folderFlag = true
	return builder
}

// 飞书服务台信息
//
// 示例值：
func (builder *KnowledgeBuilder) Helpdesk(helpdesk *AilyKnowledgeHelpdesk) *KnowledgeBuilder {
	builder.helpdesk = helpdesk
	builder.helpdeskFlag = true
	return builder
}

// 智能伙伴数据表
//
// 示例值：
func (builder *KnowledgeBuilder) Datatable(datatable *AilyKnowledgeDatatable) *KnowledgeBuilder {
	builder.datatable = datatable
	builder.datatableFlag = true
	return builder
}

// 智能伙伴分析表
//
// 示例值：
func (builder *KnowledgeBuilder) Dataset(dataset *AilyKnowledgeDataset) *KnowledgeBuilder {
	builder.dataset = dataset
	builder.datasetFlag = true
	return builder
}

// 网页信息
//
// 示例值：
func (builder *KnowledgeBuilder) Web(web *AilyKnowledgeWeb) *KnowledgeBuilder {
	builder.web = web
	builder.webFlag = true
	return builder
}

// 切片数量
//
// 示例值：1
func (builder *KnowledgeBuilder) ChunkCount(chunkCount int) *KnowledgeBuilder {
	builder.chunkCount = chunkCount
	builder.chunkCountFlag = true
	return builder
}

// 创建时间
//
// 示例值：1715247397
func (builder *KnowledgeBuilder) CreateTime(createTime int) *KnowledgeBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 更新时间
//
// 示例值：1715247397
func (builder *KnowledgeBuilder) UpdateTime(updateTime int) *KnowledgeBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 学习失败提示
//
// 示例值：success
func (builder *KnowledgeBuilder) FailMessage(failMessage string) *KnowledgeBuilder {
	builder.failMessage = failMessage
	builder.failMessageFlag = true
	return builder
}

func (builder *KnowledgeBuilder) Build() *Knowledge {
	req := &Knowledge{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.knowledgeBaseIdFlag {
		req.KnowledgeBaseId = &builder.knowledgeBaseId

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.fileFlag {
		req.File = builder.file
	}
	if builder.docsFlag {
		req.Docs = builder.docs
	}
	if builder.wikiSpaceFlag {
		req.WikiSpace = builder.wikiSpace
	}
	if builder.folderFlag {
		req.Folder = builder.folder
	}
	if builder.helpdeskFlag {
		req.Helpdesk = builder.helpdesk
	}
	if builder.datatableFlag {
		req.Datatable = builder.datatable
	}
	if builder.datasetFlag {
		req.Dataset = builder.dataset
	}
	if builder.webFlag {
		req.Web = builder.web
	}
	if builder.chunkCountFlag {
		req.ChunkCount = &builder.chunkCount

	}
	if builder.createTimeFlag {
		req.CreateTime = &builder.createTime

	}
	if builder.updateTimeFlag {
		req.UpdateTime = &builder.updateTime

	}
	if builder.failMessageFlag {
		req.FailMessage = &builder.failMessage

	}
	return req
}

type Message struct {
	Id *string `json:"id,omitempty"` // 消息 id

	Title *string `json:"title,omitempty"` // 消息标题

	Content *string `json:"content,omitempty"` // 消息内容

	MessageStatus *string `json:"message_status,omitempty"` // 消息状态

	BuiltinActions []*BuiltinAction `json:"builtin_actions,omitempty"` // 消息上可接收的 action

	SkillBaseInfos []*SkillBaseInfo `json:"skill_base_infos,omitempty"` // 使用的 skill 信息

	MessageProgress *MessageProgress `json:"message_progress,omitempty"` // 进度条消息

	Sender *Sender `json:"sender,omitempty"` // 发送者信息

	Error *MessageError `json:"error,omitempty"` // 错误信息

	TriggerType *string `json:"trigger_type,omitempty"` // 触发类型

	Visibility *string `json:"visibility,omitempty"` // 消息的可见性
}

type MessageBuilder struct {
	id     string // 消息 id
	idFlag bool

	title     string // 消息标题
	titleFlag bool

	content     string // 消息内容
	contentFlag bool

	messageStatus     string // 消息状态
	messageStatusFlag bool

	builtinActions     []*BuiltinAction // 消息上可接收的 action
	builtinActionsFlag bool

	skillBaseInfos     []*SkillBaseInfo // 使用的 skill 信息
	skillBaseInfosFlag bool

	messageProgress     *MessageProgress // 进度条消息
	messageProgressFlag bool

	sender     *Sender // 发送者信息
	senderFlag bool

	error     *MessageError // 错误信息
	errorFlag bool

	triggerType     string // 触发类型
	triggerTypeFlag bool

	visibility     string // 消息的可见性
	visibilityFlag bool
}

func NewMessageBuilder() *MessageBuilder {
	builder := &MessageBuilder{}
	return builder
}

// 消息 id
//
// 示例值：7316801852719906836
func (builder *MessageBuilder) Id(id string) *MessageBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 消息标题
//
// 示例值：正在生成中...
func (builder *MessageBuilder) Title(title string) *MessageBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 消息内容
//
// 示例值：{}
func (builder *MessageBuilder) Content(content string) *MessageBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 消息状态
//
// 示例值：FINISHED
func (builder *MessageBuilder) MessageStatus(messageStatus string) *MessageBuilder {
	builder.messageStatus = messageStatus
	builder.messageStatusFlag = true
	return builder
}

// 消息上可接收的 action
//
// 示例值：
func (builder *MessageBuilder) BuiltinActions(builtinActions []*BuiltinAction) *MessageBuilder {
	builder.builtinActions = builtinActions
	builder.builtinActionsFlag = true
	return builder
}

// 使用的 skill 信息
//
// 示例值：
func (builder *MessageBuilder) SkillBaseInfos(skillBaseInfos []*SkillBaseInfo) *MessageBuilder {
	builder.skillBaseInfos = skillBaseInfos
	builder.skillBaseInfosFlag = true
	return builder
}

// 进度条消息
//
// 示例值：
func (builder *MessageBuilder) MessageProgress(messageProgress *MessageProgress) *MessageBuilder {
	builder.messageProgress = messageProgress
	builder.messageProgressFlag = true
	return builder
}

// 发送者信息
//
// 示例值：
func (builder *MessageBuilder) Sender(sender *Sender) *MessageBuilder {
	builder.sender = sender
	builder.senderFlag = true
	return builder
}

// 错误信息
//
// 示例值：
func (builder *MessageBuilder) Error(error *MessageError) *MessageBuilder {
	builder.error = error
	builder.errorFlag = true
	return builder
}

// 触发类型
//
// 示例值：''
func (builder *MessageBuilder) TriggerType(triggerType string) *MessageBuilder {
	builder.triggerType = triggerType
	builder.triggerTypeFlag = true
	return builder
}

// 消息的可见性
//
// 示例值：SELF
func (builder *MessageBuilder) Visibility(visibility string) *MessageBuilder {
	builder.visibility = visibility
	builder.visibilityFlag = true
	return builder
}

func (builder *MessageBuilder) Build() *Message {
	req := &Message{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.messageStatusFlag {
		req.MessageStatus = &builder.messageStatus

	}
	if builder.builtinActionsFlag {
		req.BuiltinActions = builder.builtinActions
	}
	if builder.skillBaseInfosFlag {
		req.SkillBaseInfos = builder.skillBaseInfos
	}
	if builder.messageProgressFlag {
		req.MessageProgress = builder.messageProgress
	}
	if builder.senderFlag {
		req.Sender = builder.sender
	}
	if builder.errorFlag {
		req.Error = builder.error
	}
	if builder.triggerTypeFlag {
		req.TriggerType = &builder.triggerType

	}
	if builder.visibilityFlag {
		req.Visibility = &builder.visibility

	}
	return req
}

type MessageError struct {
	Code *string `json:"code,omitempty"` // 错误码

	Message *string `json:"message,omitempty"` // 错误消息

	ErrorType *string `json:"error_type,omitempty"` // 错误类型

	LogId *string `json:"log_id,omitempty"` // 反馈码

	Title *string `json:"title,omitempty"` // 错误标题
}

type MessageErrorBuilder struct {
	code     string // 错误码
	codeFlag bool

	message     string // 错误消息
	messageFlag bool

	errorType     string // 错误类型
	errorTypeFlag bool

	logId     string // 反馈码
	logIdFlag bool

	title     string // 错误标题
	titleFlag bool
}

func NewMessageErrorBuilder() *MessageErrorBuilder {
	builder := &MessageErrorBuilder{}
	return builder
}

// 错误码
//
// 示例值：sp_ec_cr_200001
func (builder *MessageErrorBuilder) Code(code string) *MessageErrorBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 错误消息
//
// 示例值：意图状态不合法，当前为1，实际为4
func (builder *MessageErrorBuilder) Message(message string) *MessageErrorBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

// 错误类型
//
// 示例值：SYSTEM
func (builder *MessageErrorBuilder) ErrorType(errorType string) *MessageErrorBuilder {
	builder.errorType = errorType
	builder.errorTypeFlag = true
	return builder
}

// 反馈码
//
// 示例值：2023122620474996FAC90E4B49302D7C93
func (builder *MessageErrorBuilder) LogId(logId string) *MessageErrorBuilder {
	builder.logId = logId
	builder.logIdFlag = true
	return builder
}

// 错误标题
//
// 示例值：意图状态不合法
func (builder *MessageErrorBuilder) Title(title string) *MessageErrorBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

func (builder *MessageErrorBuilder) Build() *MessageError {
	req := &MessageError{}
	if builder.codeFlag {
		req.Code = &builder.code

	}
	if builder.messageFlag {
		req.Message = &builder.message

	}
	if builder.errorTypeFlag {
		req.ErrorType = &builder.errorType

	}
	if builder.logIdFlag {
		req.LogId = &builder.logId

	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	return req
}

type MessageProgress struct {
	ProgressType *string `json:"progress_type,omitempty"` // 进度条类型

	ProgressItems []*ProgressItem `json:"progress_items,omitempty"` // 进度条项
}

type MessageProgressBuilder struct {
	progressType     string // 进度条类型
	progressTypeFlag bool

	progressItems     []*ProgressItem // 进度条项
	progressItemsFlag bool
}

func NewMessageProgressBuilder() *MessageProgressBuilder {
	builder := &MessageProgressBuilder{}
	return builder
}

// 进度条类型
//
// 示例值：LIST
func (builder *MessageProgressBuilder) ProgressType(progressType string) *MessageProgressBuilder {
	builder.progressType = progressType
	builder.progressTypeFlag = true
	return builder
}

// 进度条项
//
// 示例值：
func (builder *MessageProgressBuilder) ProgressItems(progressItems []*ProgressItem) *MessageProgressBuilder {
	builder.progressItems = progressItems
	builder.progressItemsFlag = true
	return builder
}

func (builder *MessageProgressBuilder) Build() *MessageProgress {
	req := &MessageProgress{}
	if builder.progressTypeFlag {
		req.ProgressType = &builder.progressType

	}
	if builder.progressItemsFlag {
		req.ProgressItems = builder.progressItems
	}
	return req
}

type MessageWithOperation struct {
	Message *Message `json:"message,omitempty"` // 消息内容

	OperationType *string `json:"operation_type,omitempty"` // 操作类型

	OperationId *string `json:"operation_id,omitempty"` // 操作 id

	IntentId *string `json:"intent_id,omitempty"` // 产生操作的意图 id
}

type MessageWithOperationBuilder struct {
	message     *Message // 消息内容
	messageFlag bool

	operationType     string // 操作类型
	operationTypeFlag bool

	operationId     string // 操作 id
	operationIdFlag bool

	intentId     string // 产生操作的意图 id
	intentIdFlag bool
}

func NewMessageWithOperationBuilder() *MessageWithOperationBuilder {
	builder := &MessageWithOperationBuilder{}
	return builder
}

// 消息内容
//
// 示例值：
func (builder *MessageWithOperationBuilder) Message(message *Message) *MessageWithOperationBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

// 操作类型
//
// 示例值：APPEND
func (builder *MessageWithOperationBuilder) OperationType(operationType string) *MessageWithOperationBuilder {
	builder.operationType = operationType
	builder.operationTypeFlag = true
	return builder
}

// 操作 id
//
// 示例值：7317091517491167252
func (builder *MessageWithOperationBuilder) OperationId(operationId string) *MessageWithOperationBuilder {
	builder.operationId = operationId
	builder.operationIdFlag = true
	return builder
}

// 产生操作的意图 id
//
// 示例值：7317093049367298068
func (builder *MessageWithOperationBuilder) IntentId(intentId string) *MessageWithOperationBuilder {
	builder.intentId = intentId
	builder.intentIdFlag = true
	return builder
}

func (builder *MessageWithOperationBuilder) Build() *MessageWithOperation {
	req := &MessageWithOperation{}
	if builder.messageFlag {
		req.Message = builder.message
	}
	if builder.operationTypeFlag {
		req.OperationType = &builder.operationType

	}
	if builder.operationIdFlag {
		req.OperationId = &builder.operationId

	}
	if builder.intentIdFlag {
		req.IntentId = &builder.intentId

	}
	return req
}

type ObjectSetting struct {
	DisplayName *string `json:"display_name,omitempty"` // 数据表展示字段

	FieldOrders []string `json:"field_orders,omitempty"` // 字段顺序
}

type ObjectSettingBuilder struct {
	displayName     string // 数据表展示字段
	displayNameFlag bool

	fieldOrders     []string // 字段顺序
	fieldOrdersFlag bool
}

func NewObjectSettingBuilder() *ObjectSettingBuilder {
	builder := &ObjectSettingBuilder{}
	return builder
}

// 数据表展示字段
//
// 示例值："_id"
func (builder *ObjectSettingBuilder) DisplayName(displayName string) *ObjectSettingBuilder {
	builder.displayName = displayName
	builder.displayNameFlag = true
	return builder
}

// 字段顺序
//
// 示例值：
func (builder *ObjectSettingBuilder) FieldOrders(fieldOrders []string) *ObjectSettingBuilder {
	builder.fieldOrders = fieldOrders
	builder.fieldOrdersFlag = true
	return builder
}

func (builder *ObjectSettingBuilder) Build() *ObjectSetting {
	req := &ObjectSetting{}
	if builder.displayNameFlag {
		req.DisplayName = &builder.displayName

	}
	if builder.fieldOrdersFlag {
		req.FieldOrders = builder.fieldOrders
	}
	return req
}

type OrderCondition struct {
	Field *string `json:"field,omitempty"` // 字段名

	Direction *string `json:"direction,omitempty"` // 排序方式
}

type OrderConditionBuilder struct {
	field     string // 字段名
	fieldFlag bool

	direction     string // 排序方式
	directionFlag bool
}

func NewOrderConditionBuilder() *OrderConditionBuilder {
	builder := &OrderConditionBuilder{}
	return builder
}

// 字段名
//
// 示例值：name
func (builder *OrderConditionBuilder) Field(field string) *OrderConditionBuilder {
	builder.field = field
	builder.fieldFlag = true
	return builder
}

// 排序方式
//
// 示例值：asc
func (builder *OrderConditionBuilder) Direction(direction string) *OrderConditionBuilder {
	builder.direction = direction
	builder.directionFlag = true
	return builder
}

func (builder *OrderConditionBuilder) Build() *OrderCondition {
	req := &OrderCondition{}
	if builder.fieldFlag {
		req.Field = &builder.field

	}
	if builder.directionFlag {
		req.Direction = &builder.direction

	}
	return req
}

type ProgressItem struct {
	ProgressItemState *string `json:"progress_item_state,omitempty"` // 进度条项状态

	Content *string `json:"content,omitempty"` // 进度条项内容

	SkillId *string `json:"skill_id,omitempty"` // 选中的技能 id

	NodeId *string `json:"node_id,omitempty"` // 节点 id

	NodeType *string `json:"node_type,omitempty"` // 节点类型

	Input *string `json:"input,omitempty"` // 节点输入，调试模式返回

	Output *string `json:"output,omitempty"` // 节点输出，调试模式返回

	Usages []string `json:"usages,omitempty"` // 节点的时间以及 Token 消耗

	SkillStrategy *string `json:"skill_strategy,omitempty"` // 技能选择策略
}

type ProgressItemBuilder struct {
	progressItemState     string // 进度条项状态
	progressItemStateFlag bool

	content     string // 进度条项内容
	contentFlag bool

	skillId     string // 选中的技能 id
	skillIdFlag bool

	nodeId     string // 节点 id
	nodeIdFlag bool

	nodeType     string // 节点类型
	nodeTypeFlag bool

	input     string // 节点输入，调试模式返回
	inputFlag bool

	output     string // 节点输出，调试模式返回
	outputFlag bool

	usages     []string // 节点的时间以及 Token 消耗
	usagesFlag bool

	skillStrategy     string // 技能选择策略
	skillStrategyFlag bool
}

func NewProgressItemBuilder() *ProgressItemBuilder {
	builder := &ProgressItemBuilder{}
	return builder
}

// 进度条项状态
//
// 示例值：RUNNING
func (builder *ProgressItemBuilder) ProgressItemState(progressItemState string) *ProgressItemBuilder {
	builder.progressItemState = progressItemState
	builder.progressItemStateFlag = true
	return builder
}

// 进度条项内容
//
// 示例值：抽取字段
func (builder *ProgressItemBuilder) Content(content string) *ProgressItemBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 选中的技能 id
//
// 示例值：skill_43ec7b438a59
func (builder *ProgressItemBuilder) SkillId(skillId string) *ProgressItemBuilder {
	builder.skillId = skillId
	builder.skillIdFlag = true
	return builder
}

// 节点 id
//
// 示例值：7316877623309058067
func (builder *ProgressItemBuilder) NodeId(nodeId string) *ProgressItemBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// 节点类型
//
// 示例值：skill-selector
func (builder *ProgressItemBuilder) NodeType(nodeType string) *ProgressItemBuilder {
	builder.nodeType = nodeType
	builder.nodeTypeFlag = true
	return builder
}

// 节点输入，调试模式返回
//
// 示例值：{}
func (builder *ProgressItemBuilder) Input(input string) *ProgressItemBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

// 节点输出，调试模式返回
//
// 示例值：{}
func (builder *ProgressItemBuilder) Output(output string) *ProgressItemBuilder {
	builder.output = output
	builder.outputFlag = true
	return builder
}

// 节点的时间以及 Token 消耗
//
// 示例值：
func (builder *ProgressItemBuilder) Usages(usages []string) *ProgressItemBuilder {
	builder.usages = usages
	builder.usagesFlag = true
	return builder
}

// 技能选择策略
//
// 示例值：AUTO
func (builder *ProgressItemBuilder) SkillStrategy(skillStrategy string) *ProgressItemBuilder {
	builder.skillStrategy = skillStrategy
	builder.skillStrategyFlag = true
	return builder
}

func (builder *ProgressItemBuilder) Build() *ProgressItem {
	req := &ProgressItem{}
	if builder.progressItemStateFlag {
		req.ProgressItemState = &builder.progressItemState

	}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.skillIdFlag {
		req.SkillId = &builder.skillId

	}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.nodeTypeFlag {
		req.NodeType = &builder.nodeType

	}
	if builder.inputFlag {
		req.Input = &builder.input

	}
	if builder.outputFlag {
		req.Output = &builder.output

	}
	if builder.usagesFlag {
		req.Usages = builder.usages
	}
	if builder.skillStrategyFlag {
		req.SkillStrategy = &builder.skillStrategy

	}
	return req
}

type RecordError struct {
	Code *string `json:"code,omitempty"` // 内部错误码

	Message *string `json:"message,omitempty"` // 错误文本
}

type RecordErrorBuilder struct {
	code     string // 内部错误码
	codeFlag bool

	message     string // 错误文本
	messageFlag bool
}

func NewRecordErrorBuilder() *RecordErrorBuilder {
	builder := &RecordErrorBuilder{}
	return builder
}

// 内部错误码
//
// 示例值：k_mt_ec_001000
func (builder *RecordErrorBuilder) Code(code string) *RecordErrorBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 错误文本
//
// 示例值：权限不足
func (builder *RecordErrorBuilder) Message(message string) *RecordErrorBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

func (builder *RecordErrorBuilder) Build() *RecordError {
	req := &RecordError{}
	if builder.codeFlag {
		req.Code = &builder.code

	}
	if builder.messageFlag {
		req.Message = &builder.message

	}
	return req
}

type RecordQueryOption struct {
	StringifyNumber *bool `json:"stringify_number,omitempty"` // 是否以字符串形式返回数字

	NormalizeColumnName *bool `json:"normalize_column_name,omitempty"` // 返回的列名是否去除特殊字符
}

type RecordQueryOptionBuilder struct {
	stringifyNumber     bool // 是否以字符串形式返回数字
	stringifyNumberFlag bool

	normalizeColumnName     bool // 返回的列名是否去除特殊字符
	normalizeColumnNameFlag bool
}

func NewRecordQueryOptionBuilder() *RecordQueryOptionBuilder {
	builder := &RecordQueryOptionBuilder{}
	return builder
}

// 是否以字符串形式返回数字
//
// 示例值：false
func (builder *RecordQueryOptionBuilder) StringifyNumber(stringifyNumber bool) *RecordQueryOptionBuilder {
	builder.stringifyNumber = stringifyNumber
	builder.stringifyNumberFlag = true
	return builder
}

// 返回的列名是否去除特殊字符
//
// 示例值：false
func (builder *RecordQueryOptionBuilder) NormalizeColumnName(normalizeColumnName bool) *RecordQueryOptionBuilder {
	builder.normalizeColumnName = normalizeColumnName
	builder.normalizeColumnNameFlag = true
	return builder
}

func (builder *RecordQueryOptionBuilder) Build() *RecordQueryOption {
	req := &RecordQueryOption{}
	if builder.stringifyNumberFlag {
		req.StringifyNumber = &builder.stringifyNumber

	}
	if builder.normalizeColumnNameFlag {
		req.NormalizeColumnName = &builder.normalizeColumnName

	}
	return req
}

type RecordResult struct {
	Success *bool `json:"success,omitempty"` // 是否成功

	PrimaryKeyValue *string `json:"primary_key_value,omitempty"` // 记录失败的唯一键对应值

	Errors []*RecordError `json:"errors,omitempty"` // 记录失败的第一条报错

	Id *string `json:"_id,omitempty"` // 记录的内部 id
}

type RecordResultBuilder struct {
	success     bool // 是否成功
	successFlag bool

	primaryKeyValue     string // 记录失败的唯一键对应值
	primaryKeyValueFlag bool

	errors     []*RecordError // 记录失败的第一条报错
	errorsFlag bool

	id     string // 记录的内部 id
	idFlag bool
}

func NewRecordResultBuilder() *RecordResultBuilder {
	builder := &RecordResultBuilder{}
	return builder
}

// 是否成功
//
// 示例值：
func (builder *RecordResultBuilder) Success(success bool) *RecordResultBuilder {
	builder.success = success
	builder.successFlag = true
	return builder
}

// 记录失败的唯一键对应值
//
// 示例值：name
func (builder *RecordResultBuilder) PrimaryKeyValue(primaryKeyValue string) *RecordResultBuilder {
	builder.primaryKeyValue = primaryKeyValue
	builder.primaryKeyValueFlag = true
	return builder
}

// 记录失败的第一条报错
//
// 示例值：
func (builder *RecordResultBuilder) Errors(errors []*RecordError) *RecordResultBuilder {
	builder.errors = errors
	builder.errorsFlag = true
	return builder
}

// 记录的内部 id
//
// 示例值：543276126389
func (builder *RecordResultBuilder) Id(id string) *RecordResultBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

func (builder *RecordResultBuilder) Build() *RecordResult {
	req := &RecordResult{}
	if builder.successFlag {
		req.Success = &builder.success

	}
	if builder.primaryKeyValueFlag {
		req.PrimaryKeyValue = &builder.primaryKeyValue

	}
	if builder.errorsFlag {
		req.Errors = builder.errors
	}
	if builder.idFlag {
		req.Id = &builder.id

	}
	return req
}

type Run struct {
	Id *string `json:"id,omitempty"` // 运行 ID

	CreatedAt *string `json:"created_at,omitempty"` // 运行的创建时间，毫秒时间戳

	AppId *string `json:"app_id,omitempty"` // 应用 ID

	SessionId *string `json:"session_id,omitempty"` // 会话 ID

	Status *string `json:"status,omitempty"` // 状态

	StartedAt *string `json:"started_at,omitempty"` // 开始时间，毫秒时间戳

	EndedAt *string `json:"ended_at,omitempty"` // 结束时间，毫秒时间戳

	Error *RunError `json:"error,omitempty"` // 失败时的错误信息

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息
}

type RunBuilder struct {
	id     string // 运行 ID
	idFlag bool

	createdAt     string // 运行的创建时间，毫秒时间戳
	createdAtFlag bool

	appId     string // 应用 ID
	appIdFlag bool

	sessionId     string // 会话 ID
	sessionIdFlag bool

	status     string // 状态
	statusFlag bool

	startedAt     string // 开始时间，毫秒时间戳
	startedAtFlag bool

	endedAt     string // 结束时间，毫秒时间戳
	endedAtFlag bool

	error     *RunError // 失败时的错误信息
	errorFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool
}

func NewRunBuilder() *RunBuilder {
	builder := &RunBuilder{}
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *RunBuilder) Id(id string) *RunBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 运行的创建时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *RunBuilder) CreatedAt(createdAt string) *RunBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// 应用 ID
//
// 示例值：spring_xxx__c
func (builder *RunBuilder) AppId(appId string) *RunBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *RunBuilder) SessionId(sessionId string) *RunBuilder {
	builder.sessionId = sessionId
	builder.sessionIdFlag = true
	return builder
}

// 状态
//
// 示例值：IN_PROGRESS
func (builder *RunBuilder) Status(status string) *RunBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 开始时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *RunBuilder) StartedAt(startedAt string) *RunBuilder {
	builder.startedAt = startedAt
	builder.startedAtFlag = true
	return builder
}

// 结束时间，毫秒时间戳
//
// 示例值：1711975665710
func (builder *RunBuilder) EndedAt(endedAt string) *RunBuilder {
	builder.endedAt = endedAt
	builder.endedAtFlag = true
	return builder
}

// 失败时的错误信息
//
// 示例值：
func (builder *RunBuilder) Error(error *RunError) *RunBuilder {
	builder.error = error
	builder.errorFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *RunBuilder) Metadata(metadata string) *RunBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *RunBuilder) Build() *Run {
	req := &Run{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.appIdFlag {
		req.AppId = &builder.appId

	}
	if builder.sessionIdFlag {
		req.SessionId = &builder.sessionId

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.startedAtFlag {
		req.StartedAt = &builder.startedAt

	}
	if builder.endedAtFlag {
		req.EndedAt = &builder.endedAt

	}
	if builder.errorFlag {
		req.Error = builder.error
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata

	}
	return req
}

type RunError struct {
	Code *string `json:"code,omitempty"` // 错误码

	Message *string `json:"message,omitempty"` // 错误信息
}

type RunErrorBuilder struct {
	code     string // 错误码
	codeFlag bool

	message     string // 错误信息
	messageFlag bool
}

func NewRunErrorBuilder() *RunErrorBuilder {
	builder := &RunErrorBuilder{}
	return builder
}

// 错误码
//
// 示例值：sp_ec_sm_900101
func (builder *RunErrorBuilder) Code(code string) *RunErrorBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 错误信息
//
// 示例值：技能不存在或已删除
func (builder *RunErrorBuilder) Message(message string) *RunErrorBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

func (builder *RunErrorBuilder) Build() *RunError {
	req := &RunError{}
	if builder.codeFlag {
		req.Code = &builder.code

	}
	if builder.messageFlag {
		req.Message = &builder.message

	}
	return req
}

type Sender struct {
	Id *string `json:"id,omitempty"` // 发送人 id

	SenderType *string `json:"sender_type,omitempty"` // 发送者类型

	Name *string `json:"name,omitempty"` // 发送者名称

	Desc *string `json:"desc,omitempty"` // 发送者描述

	SenderId *string `json:"sender_id,omitempty"` // 发送者id
}

type SenderBuilder struct {
	id     string // 发送人 id
	idFlag bool

	senderType     string // 发送者类型
	senderTypeFlag bool

	name     string // 发送者名称
	nameFlag bool

	desc     string // 发送者描述
	descFlag bool

	senderId     string // 发送者id
	senderIdFlag bool
}

func NewSenderBuilder() *SenderBuilder {
	builder := &SenderBuilder{}
	return builder
}

// 发送人 id
//
// 示例值：1785351368700027
func (builder *SenderBuilder) Id(id string) *SenderBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 发送者类型
//
// 示例值：SKILL
func (builder *SenderBuilder) SenderType(senderType string) *SenderBuilder {
	builder.senderType = senderType
	builder.senderTypeFlag = true
	return builder
}

// 发送者名称
//
// 示例值：天气预报
func (builder *SenderBuilder) Name(name string) *SenderBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 发送者描述
//
// 示例值：''
func (builder *SenderBuilder) Desc(desc string) *SenderBuilder {
	builder.desc = desc
	builder.descFlag = true
	return builder
}

// 发送者id
//
// 示例值：skill_43ec7b438a59
func (builder *SenderBuilder) SenderId(senderId string) *SenderBuilder {
	builder.senderId = senderId
	builder.senderIdFlag = true
	return builder
}

func (builder *SenderBuilder) Build() *Sender {
	req := &Sender{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.senderTypeFlag {
		req.SenderType = &builder.senderType

	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.descFlag {
		req.Desc = &builder.desc

	}
	if builder.senderIdFlag {
		req.SenderId = &builder.senderId

	}
	return req
}

type Session struct {
	Id *string `json:"id,omitempty"` // session 的唯一标识

	CreatedAt *string `json:"created_at,omitempty"` // session 的创建时间，毫秒时间戳

	EffectedAt *string `json:"effected_at,omitempty"` // session 的过期时间，毫秒时间戳

	Type *string `json:"type,omitempty"` // session 类型

	Status *string `json:"status,omitempty"` // session 状态

	ActiveIntentId *string `json:"active_intent_id,omitempty"` // 当前运行中的意图 id

	ChannelType *string `json:"channel_type,omitempty"` // 渠道类型

	EnableDebug *bool `json:"enable_debug,omitempty"` // 是否开启调试模式

	Kvs *string `json:"kvs,omitempty"` // 会话中的自定义 kv 对，包括创建时传入的渠道上下文
}

type SessionBuilder struct {
	id     string // session 的唯一标识
	idFlag bool

	createdAt     string // session 的创建时间，毫秒时间戳
	createdAtFlag bool

	effectedAt     string // session 的过期时间，毫秒时间戳
	effectedAtFlag bool

	type_    string // session 类型
	typeFlag bool

	status     string // session 状态
	statusFlag bool

	activeIntentId     string // 当前运行中的意图 id
	activeIntentIdFlag bool

	channelType     string // 渠道类型
	channelTypeFlag bool

	enableDebug     bool // 是否开启调试模式
	enableDebugFlag bool

	kvs     string // 会话中的自定义 kv 对，包括创建时传入的渠道上下文
	kvsFlag bool
}

func NewSessionBuilder() *SessionBuilder {
	builder := &SessionBuilder{}
	return builder
}

// session 的唯一标识
//
// 示例值：7316801852719906836
func (builder *SessionBuilder) Id(id string) *SessionBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// session 的创建时间，毫秒时间戳
//
// 示例值：1703486238000
func (builder *SessionBuilder) CreatedAt(createdAt string) *SessionBuilder {
	builder.createdAt = createdAt
	builder.createdAtFlag = true
	return builder
}

// session 的过期时间，毫秒时间戳
//
// 示例值：1703486238000
func (builder *SessionBuilder) EffectedAt(effectedAt string) *SessionBuilder {
	builder.effectedAt = effectedAt
	builder.effectedAtFlag = true
	return builder
}

// session 类型
//
// 示例值：LONG-TERM
func (builder *SessionBuilder) Type(type_ string) *SessionBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// session 状态
//
// 示例值：VALID
func (builder *SessionBuilder) Status(status string) *SessionBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 当前运行中的意图 id
//
// 示例值：7312657247586009109
func (builder *SessionBuilder) ActiveIntentId(activeIntentId string) *SessionBuilder {
	builder.activeIntentId = activeIntentId
	builder.activeIntentIdFlag = true
	return builder
}

// 渠道类型
//
// 示例值：LARK_OPEN_API
func (builder *SessionBuilder) ChannelType(channelType string) *SessionBuilder {
	builder.channelType = channelType
	builder.channelTypeFlag = true
	return builder
}

// 是否开启调试模式
//
// 示例值：false
func (builder *SessionBuilder) EnableDebug(enableDebug bool) *SessionBuilder {
	builder.enableDebug = enableDebug
	builder.enableDebugFlag = true
	return builder
}

// 会话中的自定义 kv 对，包括创建时传入的渠道上下文
//
// 示例值：{}
func (builder *SessionBuilder) Kvs(kvs string) *SessionBuilder {
	builder.kvs = kvs
	builder.kvsFlag = true
	return builder
}

func (builder *SessionBuilder) Build() *Session {
	req := &Session{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.createdAtFlag {
		req.CreatedAt = &builder.createdAt

	}
	if builder.effectedAtFlag {
		req.EffectedAt = &builder.effectedAt

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.activeIntentIdFlag {
		req.ActiveIntentId = &builder.activeIntentId

	}
	if builder.channelTypeFlag {
		req.ChannelType = &builder.channelType

	}
	if builder.enableDebugFlag {
		req.EnableDebug = &builder.enableDebug

	}
	if builder.kvsFlag {
		req.Kvs = &builder.kvs

	}
	return req
}

type Skill struct {
	Id *string `json:"id,omitempty"` // 技能 ID

	Label *string `json:"label,omitempty"` // 技能名称

	Description *string `json:"description,omitempty"` // 技能描述

	Samples []string `json:"samples,omitempty"` // 用户提问示例

	InputSchema *string `json:"input_schema,omitempty"` // 技能入参定义

	OutputSchema *string `json:"output_schema,omitempty"` // 技能出参定义
}

type SkillBuilder struct {
	id     string // 技能 ID
	idFlag bool

	label     string // 技能名称
	labelFlag bool

	description     string // 技能描述
	descriptionFlag bool

	samples     []string // 用户提问示例
	samplesFlag bool

	inputSchema     string // 技能入参定义
	inputSchemaFlag bool

	outputSchema     string // 技能出参定义
	outputSchemaFlag bool
}

func NewSkillBuilder() *SkillBuilder {
	builder := &SkillBuilder{}
	return builder
}

// 技能 ID
//
// 示例值：skill_6cc6166178ca
func (builder *SkillBuilder) Id(id string) *SkillBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 技能名称
//
// 示例值：数据分析和问答
func (builder *SkillBuilder) Label(label string) *SkillBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 技能描述
//
// 示例值：理解用户提出的问题，对当前助手已经配置的数据资产进行知识搜索、数据分析、文档阅读，总结并返回答案。
func (builder *SkillBuilder) Description(description string) *SkillBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 用户提问示例
//
// 示例值：
func (builder *SkillBuilder) Samples(samples []string) *SkillBuilder {
	builder.samples = samples
	builder.samplesFlag = true
	return builder
}

// 技能入参定义
//
// 示例值：[{"name":"custom_s","type":"String","required":true,"defaultValue":"qwert","description":"自定义字符串"},{"name":"custom_i","type":"Integer","required":true,"defaultValue":null,"description":""},{"name":"custom_b","type":"Boolean","required":true,"defaultValue":true,"description":""},{"name":"custom_f","type":"Float","required":true,"defaultValue":2.1,"description":""}]
func (builder *SkillBuilder) InputSchema(inputSchema string) *SkillBuilder {
	builder.inputSchema = inputSchema
	builder.inputSchemaFlag = true
	return builder
}

// 技能出参定义
//
// 示例值：[{"name":"input","type":"String","required":false,"defaultValue":null},{"name":"custom","type":"Boolean","required":false,"defaultValue":null}]
func (builder *SkillBuilder) OutputSchema(outputSchema string) *SkillBuilder {
	builder.outputSchema = outputSchema
	builder.outputSchemaFlag = true
	return builder
}

func (builder *SkillBuilder) Build() *Skill {
	req := &Skill{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.labelFlag {
		req.Label = &builder.label

	}
	if builder.descriptionFlag {
		req.Description = &builder.description

	}
	if builder.samplesFlag {
		req.Samples = builder.samples
	}
	if builder.inputSchemaFlag {
		req.InputSchema = &builder.inputSchema

	}
	if builder.outputSchemaFlag {
		req.OutputSchema = &builder.outputSchema

	}
	return req
}

type SkillBaseInfo struct {
	Name *string `json:"name,omitempty"` // 技能名称

	SkillId *string `json:"skill_id,omitempty"` // 技能 id

	Type *string `json:"type,omitempty"` // 技能类型

	BuiltinType *string `json:"builtin_type,omitempty"` // 内置技能类型
}

type SkillBaseInfoBuilder struct {
	name     string // 技能名称
	nameFlag bool

	skillId     string // 技能 id
	skillIdFlag bool

	type_    string // 技能类型
	typeFlag bool

	builtinType     string // 内置技能类型
	builtinTypeFlag bool
}

func NewSkillBaseInfoBuilder() *SkillBaseInfoBuilder {
	builder := &SkillBaseInfoBuilder{}
	return builder
}

// 技能名称
//
// 示例值：天气预报
func (builder *SkillBaseInfoBuilder) Name(name string) *SkillBaseInfoBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 技能 id
//
// 示例值：skill_43ec7b438a59
func (builder *SkillBaseInfoBuilder) SkillId(skillId string) *SkillBaseInfoBuilder {
	builder.skillId = skillId
	builder.skillIdFlag = true
	return builder
}

// 技能类型
//
// 示例值：custom
func (builder *SkillBaseInfoBuilder) Type(type_ string) *SkillBaseInfoBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 内置技能类型
//
// 示例值：qna
func (builder *SkillBaseInfoBuilder) BuiltinType(builtinType string) *SkillBaseInfoBuilder {
	builder.builtinType = builtinType
	builder.builtinTypeFlag = true
	return builder
}

func (builder *SkillBaseInfoBuilder) Build() *SkillBaseInfo {
	req := &SkillBaseInfo{}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.skillIdFlag {
		req.SkillId = &builder.skillId

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.builtinTypeFlag {
		req.BuiltinType = &builder.builtinType

	}
	return req
}

type SkillCall struct {
	SkillCallId *string `json:"skill_call_id,omitempty"` // 中断调用 schema

	Input *string `json:"input,omitempty"` // 用户对中断的响应内容

	WaitingType *string `json:"waiting_type,omitempty"` // WAITING_USER_MESSAGE or WAITING_USER_RESPOND

	InputDsl *string `json:"input_dsl,omitempty"` // input 的 DSL，用户可参考 DSL 来写 input
}

type SkillCallBuilder struct {
	skillCallId     string // 中断调用 schema
	skillCallIdFlag bool

	input     string // 用户对中断的响应内容
	inputFlag bool

	waitingType     string // WAITING_USER_MESSAGE or WAITING_USER_RESPOND
	waitingTypeFlag bool

	inputDsl     string // input 的 DSL，用户可参考 DSL 来写 input
	inputDslFlag bool
}

func NewSkillCallBuilder() *SkillCallBuilder {
	builder := &SkillCallBuilder{}
	return builder
}

// 中断调用 schema
//
// 示例值：123
func (builder *SkillCallBuilder) SkillCallId(skillCallId string) *SkillCallBuilder {
	builder.skillCallId = skillCallId
	builder.skillCallIdFlag = true
	return builder
}

// 用户对中断的响应内容
//
// 示例值：{}
func (builder *SkillCallBuilder) Input(input string) *SkillCallBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

// WAITING_USER_MESSAGE or WAITING_USER_RESPOND
//
// 示例值：WAITING_USER_RESPOND
func (builder *SkillCallBuilder) WaitingType(waitingType string) *SkillCallBuilder {
	builder.waitingType = waitingType
	builder.waitingTypeFlag = true
	return builder
}

// input 的 DSL，用户可参考 DSL 来写 input
//
// 示例值：{}
func (builder *SkillCallBuilder) InputDsl(inputDsl string) *SkillCallBuilder {
	builder.inputDsl = inputDsl
	builder.inputDslFlag = true
	return builder
}

func (builder *SkillCallBuilder) Build() *SkillCall {
	req := &SkillCall{}
	if builder.skillCallIdFlag {
		req.SkillCallId = &builder.skillCallId

	}
	if builder.inputFlag {
		req.Input = &builder.input

	}
	if builder.waitingTypeFlag {
		req.WaitingType = &builder.waitingType

	}
	if builder.inputDslFlag {
		req.InputDsl = &builder.inputDsl

	}
	return req
}

type SkillGlobalVariable struct {
	Query *string `json:"query,omitempty"` // 触发技能的消息文本

	Files []string `json:"files,omitempty"` // 触发技能的消息文件

	Channel *Channel `json:"channel,omitempty"` // 渠道信息
}

type SkillGlobalVariableBuilder struct {
	query     string // 触发技能的消息文本
	queryFlag bool

	files     []string // 触发技能的消息文件
	filesFlag bool

	channel     *Channel // 渠道信息
	channelFlag bool
}

func NewSkillGlobalVariableBuilder() *SkillGlobalVariableBuilder {
	builder := &SkillGlobalVariableBuilder{}
	return builder
}

// 触发技能的消息文本
//
// 示例值：你好
func (builder *SkillGlobalVariableBuilder) Query(query string) *SkillGlobalVariableBuilder {
	builder.query = query
	builder.queryFlag = true
	return builder
}

// 触发技能的消息文件
//
// 示例值：
func (builder *SkillGlobalVariableBuilder) Files(files []string) *SkillGlobalVariableBuilder {
	builder.files = files
	builder.filesFlag = true
	return builder
}

// 渠道信息
//
// 示例值：
func (builder *SkillGlobalVariableBuilder) Channel(channel *Channel) *SkillGlobalVariableBuilder {
	builder.channel = channel
	builder.channelFlag = true
	return builder
}

func (builder *SkillGlobalVariableBuilder) Build() *SkillGlobalVariable {
	req := &SkillGlobalVariable{}
	if builder.queryFlag {
		req.Query = &builder.query

	}
	if builder.filesFlag {
		req.Files = builder.files
	}
	if builder.channelFlag {
		req.Channel = builder.channel
	}
	return req
}

type SkillInstance struct {
	SkillInstanceId *string `json:"skill_instance_id,omitempty"` // skill_instance 的唯一标识

	Status *string `json:"status,omitempty"` // skill_instance 的状态

	Input *string `json:"input,omitempty"` // skill_instance 的输入，结构需要符合 skill 的 input schema

	Output *string `json:"output,omitempty"` // skill_instance 的输出，结构需要符合 skill 的 output schema
}

type SkillInstanceBuilder struct {
	skillInstanceId     string // skill_instance 的唯一标识
	skillInstanceIdFlag bool

	status     string // skill_instance 的状态
	statusFlag bool

	input     string // skill_instance 的输入，结构需要符合 skill 的 input schema
	inputFlag bool

	output     string // skill_instance 的输出，结构需要符合 skill 的 output schema
	outputFlag bool
}

func NewSkillInstanceBuilder() *SkillInstanceBuilder {
	builder := &SkillInstanceBuilder{}
	return builder
}

// skill_instance 的唯一标识
//
// 示例值：1234567890
func (builder *SkillInstanceBuilder) SkillInstanceId(skillInstanceId string) *SkillInstanceBuilder {
	builder.skillInstanceId = skillInstanceId
	builder.skillInstanceIdFlag = true
	return builder
}

// skill_instance 的状态
//
// 示例值：success
func (builder *SkillInstanceBuilder) Status(status string) *SkillInstanceBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// skill_instance 的输入，结构需要符合 skill 的 input schema
//
// 示例值：{	 "userInput": "今天天气怎么样" }
func (builder *SkillInstanceBuilder) Input(input string) *SkillInstanceBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

// skill_instance 的输出，结构需要符合 skill 的 output schema
//
// 示例值：{}
func (builder *SkillInstanceBuilder) Output(output string) *SkillInstanceBuilder {
	builder.output = output
	builder.outputFlag = true
	return builder
}

func (builder *SkillInstanceBuilder) Build() *SkillInstance {
	req := &SkillInstance{}
	if builder.skillInstanceIdFlag {
		req.SkillInstanceId = &builder.skillInstanceId

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.inputFlag {
		req.Input = &builder.input

	}
	if builder.outputFlag {
		req.Output = &builder.output

	}
	return req
}

type SourceSetting struct {
	ApiId *string `json:"api_id,omitempty"` // 分表数据源api_id

	ApiName *string `json:"api_name,omitempty"` // 分表数据源api_name

	Label map[string]string `json:"label,omitempty"` // 分表数据源名称，国际化文本

	FromType *string `json:"from_type,omitempty"` // 数据源具体来源

	AuthKey *string `json:"auth_key,omitempty"` // 外部数据源的凭证key

	AuthName map[string]string `json:"auth_name,omitempty"` // 外部数据源的凭证名称，国际化文本（同上）

	DataSourceIntegrationType *string `json:"data_source_integration_type,omitempty"` // 外部数据源和对接方式 - direct: 直连 - Import: 导入
}

type SourceSettingBuilder struct {
	apiId     string // 分表数据源api_id
	apiIdFlag bool

	apiName     string // 分表数据源api_name
	apiNameFlag bool

	label     map[string]string // 分表数据源名称，国际化文本
	labelFlag bool

	fromType     string // 数据源具体来源
	fromTypeFlag bool

	authKey     string // 外部数据源的凭证key
	authKeyFlag bool

	authName     map[string]string // 外部数据源的凭证名称，国际化文本（同上）
	authNameFlag bool

	dataSourceIntegrationType     string // 外部数据源和对接方式 - direct: 直连 - Import: 导入
	dataSourceIntegrationTypeFlag bool
}

func NewSourceSettingBuilder() *SourceSettingBuilder {
	builder := &SourceSettingBuilder{}
	return builder
}

// 分表数据源api_id
//
// 示例值："source_api_id"
func (builder *SourceSettingBuilder) ApiId(apiId string) *SourceSettingBuilder {
	builder.apiId = apiId
	builder.apiIdFlag = true
	return builder
}

// 分表数据源api_name
//
// 示例值："source_api_name"
func (builder *SourceSettingBuilder) ApiName(apiName string) *SourceSettingBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 分表数据源名称，国际化文本
//
// 示例值：
func (builder *SourceSettingBuilder) Label(label map[string]string) *SourceSettingBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 数据源具体来源
//
// 示例值："mysql"
func (builder *SourceSettingBuilder) FromType(fromType string) *SourceSettingBuilder {
	builder.fromType = fromType
	builder.fromTypeFlag = true
	return builder
}

// 外部数据源的凭证key
//
// 示例值："auth_key_001"
func (builder *SourceSettingBuilder) AuthKey(authKey string) *SourceSettingBuilder {
	builder.authKey = authKey
	builder.authKeyFlag = true
	return builder
}

// 外部数据源的凭证名称，国际化文本（同上）
//
// 示例值：
func (builder *SourceSettingBuilder) AuthName(authName map[string]string) *SourceSettingBuilder {
	builder.authName = authName
	builder.authNameFlag = true
	return builder
}

// 外部数据源和对接方式 - direct: 直连 - Import: 导入
//
// 示例值："Import"
func (builder *SourceSettingBuilder) DataSourceIntegrationType(dataSourceIntegrationType string) *SourceSettingBuilder {
	builder.dataSourceIntegrationType = dataSourceIntegrationType
	builder.dataSourceIntegrationTypeFlag = true
	return builder
}

func (builder *SourceSettingBuilder) Build() *SourceSetting {
	req := &SourceSetting{}
	if builder.apiIdFlag {
		req.ApiId = &builder.apiId

	}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.labelFlag {
		req.Label = builder.label
	}
	if builder.fromTypeFlag {
		req.FromType = &builder.fromType

	}
	if builder.authKeyFlag {
		req.AuthKey = &builder.authKey

	}
	if builder.authNameFlag {
		req.AuthName = builder.authName
	}
	if builder.dataSourceIntegrationTypeFlag {
		req.DataSourceIntegrationType = &builder.dataSourceIntegrationType

	}
	return req
}

type Suggestion struct {
	Content *string `json:"content,omitempty"` // 推荐的内容

	SkillId *string `json:"skill_id,omitempty"` // 推荐的技能
}

type SuggestionBuilder struct {
	content     string // 推荐的内容
	contentFlag bool

	skillId     string // 推荐的技能
	skillIdFlag bool
}

func NewSuggestionBuilder() *SuggestionBuilder {
	builder := &SuggestionBuilder{}
	return builder
}

// 推荐的内容
//
// 示例值：今天天气如何
func (builder *SuggestionBuilder) Content(content string) *SuggestionBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 推荐的技能
//
// 示例值：skill_xxx
func (builder *SuggestionBuilder) SkillId(skillId string) *SuggestionBuilder {
	builder.skillId = skillId
	builder.skillIdFlag = true
	return builder
}

func (builder *SuggestionBuilder) Build() *Suggestion {
	req := &Suggestion{}
	if builder.contentFlag {
		req.Content = &builder.content

	}
	if builder.skillIdFlag {
		req.SkillId = &builder.skillId

	}
	return req
}

type Table struct {
	TableType *string `json:"table_type,omitempty"` // 表类型，分为 "datatable"、"dataset"

	ApiName *string `json:"api_name,omitempty"` // 数据表标识

	Label map[string]string `json:"label,omitempty"` // 数据表名称

	AccessItems []string `json:"access_items,omitempty"` // 数据表读写权限

	AiDescription *string `json:"ai_description,omitempty"` // 数据表描述信息

	Fields []*Field `json:"fields,omitempty"` // 数据表下的字段列表，获取数据表元信息详情时才会返回
}

type TableBuilder struct {
	tableType     string // 表类型，分为 "datatable"、"dataset"
	tableTypeFlag bool

	apiName     string // 数据表标识
	apiNameFlag bool

	label     map[string]string // 数据表名称
	labelFlag bool

	accessItems     []string // 数据表读写权限
	accessItemsFlag bool

	aiDescription     string // 数据表描述信息
	aiDescriptionFlag bool

	fields     []*Field // 数据表下的字段列表，获取数据表元信息详情时才会返回
	fieldsFlag bool
}

func NewTableBuilder() *TableBuilder {
	builder := &TableBuilder{}
	return builder
}

// 表类型，分为 "datatable"、"dataset"
//
// 示例值：datatable
func (builder *TableBuilder) TableType(tableType string) *TableBuilder {
	builder.tableType = tableType
	builder.tableTypeFlag = true
	return builder
}

// 数据表标识
//
// 示例值：object_a
func (builder *TableBuilder) ApiName(apiName string) *TableBuilder {
	builder.apiName = apiName
	builder.apiNameFlag = true
	return builder
}

// 数据表名称
//
// 示例值：
func (builder *TableBuilder) Label(label map[string]string) *TableBuilder {
	builder.label = label
	builder.labelFlag = true
	return builder
}

// 数据表读写权限
//
// 示例值：
func (builder *TableBuilder) AccessItems(accessItems []string) *TableBuilder {
	builder.accessItems = accessItems
	builder.accessItemsFlag = true
	return builder
}

// 数据表描述信息
//
// 示例值：这是一个商品的数据表
func (builder *TableBuilder) AiDescription(aiDescription string) *TableBuilder {
	builder.aiDescription = aiDescription
	builder.aiDescriptionFlag = true
	return builder
}

// 数据表下的字段列表，获取数据表元信息详情时才会返回
//
// 示例值：
func (builder *TableBuilder) Fields(fields []*Field) *TableBuilder {
	builder.fields = fields
	builder.fieldsFlag = true
	return builder
}

func (builder *TableBuilder) Build() *Table {
	req := &Table{}
	if builder.tableTypeFlag {
		req.TableType = &builder.tableType

	}
	if builder.apiNameFlag {
		req.ApiName = &builder.apiName

	}
	if builder.labelFlag {
		req.Label = builder.label
	}
	if builder.accessItemsFlag {
		req.AccessItems = builder.accessItems
	}
	if builder.aiDescriptionFlag {
		req.AiDescription = &builder.aiDescription

	}
	if builder.fieldsFlag {
		req.Fields = builder.fields
	}
	return req
}

type CreateAilySessionReqBodyBuilder struct {
	channelContext     string // 渠道上下文
	channelContextFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool
}

func NewCreateAilySessionReqBodyBuilder() *CreateAilySessionReqBodyBuilder {
	builder := &CreateAilySessionReqBodyBuilder{}
	return builder
}

// 渠道上下文
//
//示例值：{}
func (builder *CreateAilySessionReqBodyBuilder) ChannelContext(channelContext string) *CreateAilySessionReqBodyBuilder {
	builder.channelContext = channelContext
	builder.channelContextFlag = true
	return builder
}

// 其他透传信息
//
//示例值：{}
func (builder *CreateAilySessionReqBodyBuilder) Metadata(metadata string) *CreateAilySessionReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *CreateAilySessionReqBodyBuilder) Build() *CreateAilySessionReqBody {
	req := &CreateAilySessionReqBody{}
	if builder.channelContextFlag {
		req.ChannelContext = &builder.channelContext
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req
}

type CreateAilySessionPathReqBodyBuilder struct {
	channelContext     string
	channelContextFlag bool
	metadata           string
	metadataFlag       bool
}

func NewCreateAilySessionPathReqBodyBuilder() *CreateAilySessionPathReqBodyBuilder {
	builder := &CreateAilySessionPathReqBodyBuilder{}
	return builder
}

// 渠道上下文
//
// 示例值：{}
func (builder *CreateAilySessionPathReqBodyBuilder) ChannelContext(channelContext string) *CreateAilySessionPathReqBodyBuilder {
	builder.channelContext = channelContext
	builder.channelContextFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *CreateAilySessionPathReqBodyBuilder) Metadata(metadata string) *CreateAilySessionPathReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *CreateAilySessionPathReqBodyBuilder) Build() (*CreateAilySessionReqBody, error) {
	req := &CreateAilySessionReqBody{}
	if builder.channelContextFlag {
		req.ChannelContext = &builder.channelContext
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req, nil
}

type CreateAilySessionReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateAilySessionReqBody
}

func NewCreateAilySessionReqBuilder() *CreateAilySessionReqBuilder {
	builder := &CreateAilySessionReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 该 API 用于创建与某个飞书智能伙伴应用的一次会话（Session）。
func (builder *CreateAilySessionReqBuilder) Body(body *CreateAilySessionReqBody) *CreateAilySessionReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateAilySessionReqBuilder) Build() *CreateAilySessionReq {
	req := &CreateAilySessionReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type CreateAilySessionReqBody struct {
	ChannelContext *string `json:"channel_context,omitempty"` // 渠道上下文

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息
}

type CreateAilySessionReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateAilySessionReqBody `body:""`
}

type CreateAilySessionRespData struct {
	Session *AilySession `json:"session,omitempty"` // 创建的会话信息
}

type CreateAilySessionResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateAilySessionRespData `json:"data"` // 业务数据
}

func (resp *CreateAilySessionResp) Success() bool {
	return resp.Code == 0
}

type DeleteAilySessionReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewDeleteAilySessionReqBuilder() *DeleteAilySessionReqBuilder {
	builder := &DeleteAilySessionReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *DeleteAilySessionReqBuilder) AilySessionId(ailySessionId string) *DeleteAilySessionReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

func (builder *DeleteAilySessionReqBuilder) Build() *DeleteAilySessionReq {
	req := &DeleteAilySessionReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type DeleteAilySessionReq struct {
	apiReq *larkcore.ApiReq
}

type DeleteAilySessionResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *DeleteAilySessionResp) Success() bool {
	return resp.Code == 0
}

type GetAilySessionReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetAilySessionReqBuilder() *GetAilySessionReqBuilder {
	builder := &GetAilySessionReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *GetAilySessionReqBuilder) AilySessionId(ailySessionId string) *GetAilySessionReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

func (builder *GetAilySessionReqBuilder) Build() *GetAilySessionReq {
	req := &GetAilySessionReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type GetAilySessionReq struct {
	apiReq *larkcore.ApiReq
}

type GetAilySessionRespData struct {
	Session *AilySession `json:"session,omitempty"` // 会话信息
}

type GetAilySessionResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetAilySessionRespData `json:"data"` // 业务数据
}

func (resp *GetAilySessionResp) Success() bool {
	return resp.Code == 0
}

type UpdateAilySessionReqBodyBuilder struct {
	channelContext     string // 渠道上下文
	channelContextFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool
}

func NewUpdateAilySessionReqBodyBuilder() *UpdateAilySessionReqBodyBuilder {
	builder := &UpdateAilySessionReqBodyBuilder{}
	return builder
}

// 渠道上下文
//
//示例值：{}
func (builder *UpdateAilySessionReqBodyBuilder) ChannelContext(channelContext string) *UpdateAilySessionReqBodyBuilder {
	builder.channelContext = channelContext
	builder.channelContextFlag = true
	return builder
}

// 其他透传信息
//
//示例值：{}
func (builder *UpdateAilySessionReqBodyBuilder) Metadata(metadata string) *UpdateAilySessionReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *UpdateAilySessionReqBodyBuilder) Build() *UpdateAilySessionReqBody {
	req := &UpdateAilySessionReqBody{}
	if builder.channelContextFlag {
		req.ChannelContext = &builder.channelContext
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req
}

type UpdateAilySessionPathReqBodyBuilder struct {
	channelContext     string
	channelContextFlag bool
	metadata           string
	metadataFlag       bool
}

func NewUpdateAilySessionPathReqBodyBuilder() *UpdateAilySessionPathReqBodyBuilder {
	builder := &UpdateAilySessionPathReqBodyBuilder{}
	return builder
}

// 渠道上下文
//
// 示例值：{}
func (builder *UpdateAilySessionPathReqBodyBuilder) ChannelContext(channelContext string) *UpdateAilySessionPathReqBodyBuilder {
	builder.channelContext = channelContext
	builder.channelContextFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *UpdateAilySessionPathReqBodyBuilder) Metadata(metadata string) *UpdateAilySessionPathReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *UpdateAilySessionPathReqBodyBuilder) Build() (*UpdateAilySessionReqBody, error) {
	req := &UpdateAilySessionReqBody{}
	if builder.channelContextFlag {
		req.ChannelContext = &builder.channelContext
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req, nil
}

type UpdateAilySessionReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *UpdateAilySessionReqBody
}

func NewUpdateAilySessionReqBuilder() *UpdateAilySessionReqBuilder {
	builder := &UpdateAilySessionReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *UpdateAilySessionReqBuilder) AilySessionId(ailySessionId string) *UpdateAilySessionReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 该 API 用于更新与某个飞书智能伙伴应用的一次会话（Session）。
func (builder *UpdateAilySessionReqBuilder) Body(body *UpdateAilySessionReqBody) *UpdateAilySessionReqBuilder {
	builder.body = body
	return builder
}

func (builder *UpdateAilySessionReqBuilder) Build() *UpdateAilySessionReq {
	req := &UpdateAilySessionReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type UpdateAilySessionReqBody struct {
	ChannelContext *string `json:"channel_context,omitempty"` // 渠道上下文

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息
}

type UpdateAilySessionReq struct {
	apiReq *larkcore.ApiReq
	Body   *UpdateAilySessionReqBody `body:""`
}

type UpdateAilySessionRespData struct {
	Session *AilySession `json:"session,omitempty"` // 会话信息
}

type UpdateAilySessionResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *UpdateAilySessionRespData `json:"data"` // 业务数据
}

func (resp *UpdateAilySessionResp) Success() bool {
	return resp.Code == 0
}

type CreateAilySessionAilyMessageReqBodyBuilder struct {
	idempotentId     string // 幂等id，同一 session 下相同的幂等 id 算一条消息，有效期72h
	idempotentIdFlag bool

	contentType     string // 消息内容类型
	contentTypeFlag bool

	content     string // 消息内容
	contentFlag bool

	fileIds     []string // 消息中包含的文件 ID 列表
	fileIdsFlag bool

	quoteMessageId     string // 引用的消息 ID
	quoteMessageIdFlag bool

	mentions     []*AilyMention // 被@的实体
	mentionsFlag bool
}

func NewCreateAilySessionAilyMessageReqBodyBuilder() *CreateAilySessionAilyMessageReqBodyBuilder {
	builder := &CreateAilySessionAilyMessageReqBodyBuilder{}
	return builder
}

// 幂等id，同一 session 下相同的幂等 id 算一条消息，有效期72h
//
//示例值：idempotent_id_1
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) IdempotentId(idempotentId string) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.idempotentId = idempotentId
	builder.idempotentIdFlag = true
	return builder
}

// 消息内容类型
//
//示例值：MDX
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) ContentType(contentType string) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.contentType = contentType
	builder.contentTypeFlag = true
	return builder
}

// 消息内容
//
//示例值：你好
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) Content(content string) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 消息中包含的文件 ID 列表
//
//示例值：
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) FileIds(fileIds []string) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.fileIds = fileIds
	builder.fileIdsFlag = true
	return builder
}

// 引用的消息 ID
//
//示例值：message_4de9bpg70qskh
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) QuoteMessageId(quoteMessageId string) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.quoteMessageId = quoteMessageId
	builder.quoteMessageIdFlag = true
	return builder
}

// 被@的实体
//
//示例值：
func (builder *CreateAilySessionAilyMessageReqBodyBuilder) Mentions(mentions []*AilyMention) *CreateAilySessionAilyMessageReqBodyBuilder {
	builder.mentions = mentions
	builder.mentionsFlag = true
	return builder
}

func (builder *CreateAilySessionAilyMessageReqBodyBuilder) Build() *CreateAilySessionAilyMessageReqBody {
	req := &CreateAilySessionAilyMessageReqBody{}
	if builder.idempotentIdFlag {
		req.IdempotentId = &builder.idempotentId
	}
	if builder.contentTypeFlag {
		req.ContentType = &builder.contentType
	}
	if builder.contentFlag {
		req.Content = &builder.content
	}
	if builder.fileIdsFlag {
		req.FileIds = builder.fileIds
	}
	if builder.quoteMessageIdFlag {
		req.QuoteMessageId = &builder.quoteMessageId
	}
	if builder.mentionsFlag {
		req.Mentions = builder.mentions
	}
	return req
}

type CreateAilySessionAilyMessagePathReqBodyBuilder struct {
	idempotentId       string
	idempotentIdFlag   bool
	contentType        string
	contentTypeFlag    bool
	content            string
	contentFlag        bool
	fileIds            []string
	fileIdsFlag        bool
	quoteMessageId     string
	quoteMessageIdFlag bool
	mentions           []*AilyMention
	mentionsFlag       bool
}

func NewCreateAilySessionAilyMessagePathReqBodyBuilder() *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder := &CreateAilySessionAilyMessagePathReqBodyBuilder{}
	return builder
}

// 幂等id，同一 session 下相同的幂等 id 算一条消息，有效期72h
//
// 示例值：idempotent_id_1
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) IdempotentId(idempotentId string) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.idempotentId = idempotentId
	builder.idempotentIdFlag = true
	return builder
}

// 消息内容类型
//
// 示例值：MDX
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) ContentType(contentType string) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.contentType = contentType
	builder.contentTypeFlag = true
	return builder
}

// 消息内容
//
// 示例值：你好
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) Content(content string) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 消息中包含的文件 ID 列表
//
// 示例值：
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) FileIds(fileIds []string) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.fileIds = fileIds
	builder.fileIdsFlag = true
	return builder
}

// 引用的消息 ID
//
// 示例值：message_4de9bpg70qskh
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) QuoteMessageId(quoteMessageId string) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.quoteMessageId = quoteMessageId
	builder.quoteMessageIdFlag = true
	return builder
}

// 被@的实体
//
// 示例值：
func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) Mentions(mentions []*AilyMention) *CreateAilySessionAilyMessagePathReqBodyBuilder {
	builder.mentions = mentions
	builder.mentionsFlag = true
	return builder
}

func (builder *CreateAilySessionAilyMessagePathReqBodyBuilder) Build() (*CreateAilySessionAilyMessageReqBody, error) {
	req := &CreateAilySessionAilyMessageReqBody{}
	if builder.idempotentIdFlag {
		req.IdempotentId = &builder.idempotentId
	}
	if builder.contentTypeFlag {
		req.ContentType = &builder.contentType
	}
	if builder.contentFlag {
		req.Content = &builder.content
	}
	if builder.fileIdsFlag {
		req.FileIds = builder.fileIds
	}
	if builder.quoteMessageIdFlag {
		req.QuoteMessageId = &builder.quoteMessageId
	}
	if builder.mentionsFlag {
		req.Mentions = builder.mentions
	}
	return req, nil
}

type CreateAilySessionAilyMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateAilySessionAilyMessageReqBody
}

func NewCreateAilySessionAilyMessageReqBuilder() *CreateAilySessionAilyMessageReqBuilder {
	builder := &CreateAilySessionAilyMessageReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *CreateAilySessionAilyMessageReqBuilder) AilySessionId(ailySessionId string) *CreateAilySessionAilyMessageReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 该 API 用于向某个飞书智能伙伴应用发送一条消息（Message）。
func (builder *CreateAilySessionAilyMessageReqBuilder) Body(body *CreateAilySessionAilyMessageReqBody) *CreateAilySessionAilyMessageReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateAilySessionAilyMessageReqBuilder) Build() *CreateAilySessionAilyMessageReq {
	req := &CreateAilySessionAilyMessageReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type CreateAilySessionAilyMessageReqBody struct {
	IdempotentId *string `json:"idempotent_id,omitempty"` // 幂等id，同一 session 下相同的幂等 id 算一条消息，有效期72h

	ContentType *string `json:"content_type,omitempty"` // 消息内容类型

	Content *string `json:"content,omitempty"` // 消息内容

	FileIds []string `json:"file_ids,omitempty"` // 消息中包含的文件 ID 列表

	QuoteMessageId *string `json:"quote_message_id,omitempty"` // 引用的消息 ID

	Mentions []*AilyMention `json:"mentions,omitempty"` // 被@的实体
}

type CreateAilySessionAilyMessageReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateAilySessionAilyMessageReqBody `body:""`
}

type CreateAilySessionAilyMessageRespData struct {
	Message *AilyMessage `json:"message,omitempty"` // 消息信息
}

type CreateAilySessionAilyMessageResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateAilySessionAilyMessageRespData `json:"data"` // 业务数据
}

func (resp *CreateAilySessionAilyMessageResp) Success() bool {
	return resp.Code == 0
}

type GetAilySessionAilyMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetAilySessionAilyMessageReqBuilder() *GetAilySessionAilyMessageReqBuilder {
	builder := &GetAilySessionAilyMessageReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *GetAilySessionAilyMessageReqBuilder) AilySessionId(ailySessionId string) *GetAilySessionAilyMessageReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 消息 ID
//
// 示例值：message_4df45f2xknvcc
func (builder *GetAilySessionAilyMessageReqBuilder) AilyMessageId(ailyMessageId string) *GetAilySessionAilyMessageReqBuilder {
	builder.apiReq.PathParams.Set("aily_message_id", fmt.Sprint(ailyMessageId))
	return builder
}

func (builder *GetAilySessionAilyMessageReqBuilder) Build() *GetAilySessionAilyMessageReq {
	req := &GetAilySessionAilyMessageReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type GetAilySessionAilyMessageReq struct {
	apiReq *larkcore.ApiReq
}

type GetAilySessionAilyMessageRespData struct {
	Message *AilyMessage `json:"message,omitempty"` // 消息信息
}

type GetAilySessionAilyMessageResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetAilySessionAilyMessageRespData `json:"data"` // 业务数据
}

func (resp *GetAilySessionAilyMessageResp) Success() bool {
	return resp.Code == 0
}

type ListAilySessionAilyMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListAilySessionAilyMessageReqBuilder() *ListAilySessionAilyMessageReqBuilder {
	builder := &ListAilySessionAilyMessageReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListAilySessionAilyMessageReqBuilder) Limit(limit int) *ListAilySessionAilyMessageReqBuilder {
	builder.limit = limit
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *ListAilySessionAilyMessageReqBuilder) AilySessionId(ailySessionId string) *ListAilySessionAilyMessageReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 页面大小
//
// 示例值：
func (builder *ListAilySessionAilyMessageReqBuilder) PageSize(pageSize int) *ListAilySessionAilyMessageReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页偏移量
//
// 示例值：
func (builder *ListAilySessionAilyMessageReqBuilder) PageToken(pageToken string) *ListAilySessionAilyMessageReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *ListAilySessionAilyMessageReqBuilder) RunId(runId string) *ListAilySessionAilyMessageReqBuilder {
	builder.apiReq.QueryParams.Set("run_id", fmt.Sprint(runId))
	return builder
}

// 返回生成中的消息
//
// 示例值：false
func (builder *ListAilySessionAilyMessageReqBuilder) WithPartialMessage(withPartialMessage bool) *ListAilySessionAilyMessageReqBuilder {
	builder.apiReq.QueryParams.Set("with_partial_message", fmt.Sprint(withPartialMessage))
	return builder
}

func (builder *ListAilySessionAilyMessageReqBuilder) Build() *ListAilySessionAilyMessageReq {
	req := &ListAilySessionAilyMessageReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListAilySessionAilyMessageReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListAilySessionAilyMessageRespData struct {
	Messages []*AilyMessage `json:"messages,omitempty"` // 消息列表

	PageToken *string `json:"page_token,omitempty"` // 下一页的起始偏移量

	HasMore *bool `json:"has_more,omitempty"` // 是否还有更多数据
}

type ListAilySessionAilyMessageResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListAilySessionAilyMessageRespData `json:"data"` // 业务数据
}

func (resp *ListAilySessionAilyMessageResp) Success() bool {
	return resp.Code == 0
}

type CancelAilySessionRunReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewCancelAilySessionRunReqBuilder() *CancelAilySessionRunReqBuilder {
	builder := &CancelAilySessionRunReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *CancelAilySessionRunReqBuilder) AilySessionId(ailySessionId string) *CancelAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *CancelAilySessionRunReqBuilder) RunId(runId string) *CancelAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("run_id", fmt.Sprint(runId))
	return builder
}

func (builder *CancelAilySessionRunReqBuilder) Build() *CancelAilySessionRunReq {
	req := &CancelAilySessionRunReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type CancelAilySessionRunReq struct {
	apiReq *larkcore.ApiReq
}

type CancelAilySessionRunRespData struct {
	Run *Run `json:"run,omitempty"` // 运行信息
}

type CancelAilySessionRunResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CancelAilySessionRunRespData `json:"data"` // 业务数据
}

func (resp *CancelAilySessionRunResp) Success() bool {
	return resp.Code == 0
}

type CreateAilySessionRunReqBodyBuilder struct {
	appId     string // 应用 ID
	appIdFlag bool

	skillId     string // 技能 ID
	skillIdFlag bool

	skillInput     string // 指定技能 ID 时可以同时指定技能输入
	skillInputFlag bool

	metadata     string // 其他透传信息
	metadataFlag bool
}

func NewCreateAilySessionRunReqBodyBuilder() *CreateAilySessionRunReqBodyBuilder {
	builder := &CreateAilySessionRunReqBodyBuilder{}
	return builder
}

// 应用 ID
//
//示例值：spring_xxx__c
func (builder *CreateAilySessionRunReqBodyBuilder) AppId(appId string) *CreateAilySessionRunReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 技能 ID
//
//示例值：skill_6cc6166178ca
func (builder *CreateAilySessionRunReqBodyBuilder) SkillId(skillId string) *CreateAilySessionRunReqBodyBuilder {
	builder.skillId = skillId
	builder.skillIdFlag = true
	return builder
}

// 指定技能 ID 时可以同时指定技能输入
//
//示例值：{"key": "value"}
func (builder *CreateAilySessionRunReqBodyBuilder) SkillInput(skillInput string) *CreateAilySessionRunReqBodyBuilder {
	builder.skillInput = skillInput
	builder.skillInputFlag = true
	return builder
}

// 其他透传信息
//
//示例值：{}
func (builder *CreateAilySessionRunReqBodyBuilder) Metadata(metadata string) *CreateAilySessionRunReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *CreateAilySessionRunReqBodyBuilder) Build() *CreateAilySessionRunReqBody {
	req := &CreateAilySessionRunReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.skillIdFlag {
		req.SkillId = &builder.skillId
	}
	if builder.skillInputFlag {
		req.SkillInput = &builder.skillInput
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req
}

type CreateAilySessionRunPathReqBodyBuilder struct {
	appId          string
	appIdFlag      bool
	skillId        string
	skillIdFlag    bool
	skillInput     string
	skillInputFlag bool
	metadata       string
	metadataFlag   bool
}

func NewCreateAilySessionRunPathReqBodyBuilder() *CreateAilySessionRunPathReqBodyBuilder {
	builder := &CreateAilySessionRunPathReqBodyBuilder{}
	return builder
}

// 应用 ID
//
// 示例值：spring_xxx__c
func (builder *CreateAilySessionRunPathReqBodyBuilder) AppId(appId string) *CreateAilySessionRunPathReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 技能 ID
//
// 示例值：skill_6cc6166178ca
func (builder *CreateAilySessionRunPathReqBodyBuilder) SkillId(skillId string) *CreateAilySessionRunPathReqBodyBuilder {
	builder.skillId = skillId
	builder.skillIdFlag = true
	return builder
}

// 指定技能 ID 时可以同时指定技能输入
//
// 示例值：{"key": "value"}
func (builder *CreateAilySessionRunPathReqBodyBuilder) SkillInput(skillInput string) *CreateAilySessionRunPathReqBodyBuilder {
	builder.skillInput = skillInput
	builder.skillInputFlag = true
	return builder
}

// 其他透传信息
//
// 示例值：{}
func (builder *CreateAilySessionRunPathReqBodyBuilder) Metadata(metadata string) *CreateAilySessionRunPathReqBodyBuilder {
	builder.metadata = metadata
	builder.metadataFlag = true
	return builder
}

func (builder *CreateAilySessionRunPathReqBodyBuilder) Build() (*CreateAilySessionRunReqBody, error) {
	req := &CreateAilySessionRunReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.skillIdFlag {
		req.SkillId = &builder.skillId
	}
	if builder.skillInputFlag {
		req.SkillInput = &builder.skillInput
	}
	if builder.metadataFlag {
		req.Metadata = &builder.metadata
	}
	return req, nil
}

type CreateAilySessionRunReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateAilySessionRunReqBody
}

func NewCreateAilySessionRunReqBuilder() *CreateAilySessionRunReqBuilder {
	builder := &CreateAilySessionRunReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *CreateAilySessionRunReqBuilder) AilySessionId(ailySessionId string) *CreateAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 该 API 用于启动一次运行（Run）。
func (builder *CreateAilySessionRunReqBuilder) Body(body *CreateAilySessionRunReqBody) *CreateAilySessionRunReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateAilySessionRunReqBuilder) Build() *CreateAilySessionRunReq {
	req := &CreateAilySessionRunReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type CreateAilySessionRunReqBody struct {
	AppId *string `json:"app_id,omitempty"` // 应用 ID

	SkillId *string `json:"skill_id,omitempty"` // 技能 ID

	SkillInput *string `json:"skill_input,omitempty"` // 指定技能 ID 时可以同时指定技能输入

	Metadata *string `json:"metadata,omitempty"` // 其他透传信息
}

type CreateAilySessionRunReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateAilySessionRunReqBody `body:""`
}

type CreateAilySessionRunRespData struct {
	Run *Run `json:"run,omitempty"` // 运行信息
}

type CreateAilySessionRunResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateAilySessionRunRespData `json:"data"` // 业务数据
}

func (resp *CreateAilySessionRunResp) Success() bool {
	return resp.Code == 0
}

type GetAilySessionRunReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetAilySessionRunReqBuilder() *GetAilySessionRunReqBuilder {
	builder := &GetAilySessionRunReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *GetAilySessionRunReqBuilder) AilySessionId(ailySessionId string) *GetAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 运行 ID
//
// 示例值：run_4dfrxvctjqzzj
func (builder *GetAilySessionRunReqBuilder) RunId(runId string) *GetAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("run_id", fmt.Sprint(runId))
	return builder
}

func (builder *GetAilySessionRunReqBuilder) Build() *GetAilySessionRunReq {
	req := &GetAilySessionRunReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type GetAilySessionRunReq struct {
	apiReq *larkcore.ApiReq
}

type GetAilySessionRunRespData struct {
	Run *Run `json:"run,omitempty"` // 运行信息
}

type GetAilySessionRunResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetAilySessionRunRespData `json:"data"` // 业务数据
}

func (resp *GetAilySessionRunResp) Success() bool {
	return resp.Code == 0
}

type ListAilySessionRunReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListAilySessionRunReqBuilder() *ListAilySessionRunReqBuilder {
	builder := &ListAilySessionRunReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListAilySessionRunReqBuilder) Limit(limit int) *ListAilySessionRunReqBuilder {
	builder.limit = limit
	return builder
}

// 会话 ID
//
// 示例值：session_4dfunz7sp1g8m
func (builder *ListAilySessionRunReqBuilder) AilySessionId(ailySessionId string) *ListAilySessionRunReqBuilder {
	builder.apiReq.PathParams.Set("aily_session_id", fmt.Sprint(ailySessionId))
	return builder
}

// 页面大小
//
// 示例值：
func (builder *ListAilySessionRunReqBuilder) PageSize(pageSize int) *ListAilySessionRunReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页偏移量
//
// 示例值：
func (builder *ListAilySessionRunReqBuilder) PageToken(pageToken string) *ListAilySessionRunReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

func (builder *ListAilySessionRunReqBuilder) Build() *ListAilySessionRunReq {
	req := &ListAilySessionRunReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListAilySessionRunReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListAilySessionRunRespData struct {
	Runs []*Run `json:"runs,omitempty"` // 运行列表

	PageToken *string `json:"page_token,omitempty"` // 下一页的起始偏移量

	HasMore *bool `json:"has_more,omitempty"` // 是否还有更多数据
}

type ListAilySessionRunResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListAilySessionRunRespData `json:"data"` // 业务数据
}

func (resp *ListAilySessionRunResp) Success() bool {
	return resp.Code == 0
}

type CreateAppDataAssetReqBodyBuilder struct {
	connectType     string // 连接类型
	connectTypeFlag bool

	sourceType     string // 数据源类型
	sourceTypeFlag bool

	importKnowledgeSetting     *DataAssetImportKnowledgeSetting // 知识导入配置
	importKnowledgeSettingFlag bool

	description     map[string]string // 数据知识描述信息
	descriptionFlag bool
}

func NewCreateAppDataAssetReqBodyBuilder() *CreateAppDataAssetReqBodyBuilder {
	builder := &CreateAppDataAssetReqBodyBuilder{}
	return builder
}

// 连接类型
//
//示例值：direct
func (builder *CreateAppDataAssetReqBodyBuilder) ConnectType(connectType string) *CreateAppDataAssetReqBodyBuilder {
	builder.connectType = connectType
	builder.connectTypeFlag = true
	return builder
}

// 数据源类型
//
//示例值：
func (builder *CreateAppDataAssetReqBodyBuilder) SourceType(sourceType string) *CreateAppDataAssetReqBodyBuilder {
	builder.sourceType = sourceType
	builder.sourceTypeFlag = true
	return builder
}

// 知识导入配置
//
//示例值：
func (builder *CreateAppDataAssetReqBodyBuilder) ImportKnowledgeSetting(importKnowledgeSetting *DataAssetImportKnowledgeSetting) *CreateAppDataAssetReqBodyBuilder {
	builder.importKnowledgeSetting = importKnowledgeSetting
	builder.importKnowledgeSettingFlag = true
	return builder
}

// 数据知识描述信息
//
//示例值：
func (builder *CreateAppDataAssetReqBodyBuilder) Description(description map[string]string) *CreateAppDataAssetReqBodyBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

func (builder *CreateAppDataAssetReqBodyBuilder) Build() *CreateAppDataAssetReqBody {
	req := &CreateAppDataAssetReqBody{}
	if builder.connectTypeFlag {
		req.ConnectType = &builder.connectType
	}
	if builder.sourceTypeFlag {
		req.SourceType = &builder.sourceType
	}
	if builder.importKnowledgeSettingFlag {
		req.ImportKnowledgeSetting = builder.importKnowledgeSetting
	}
	if builder.descriptionFlag {
		req.Description = builder.description
	}
	return req
}

type CreateAppDataAssetPathReqBodyBuilder struct {
	connectType                string
	connectTypeFlag            bool
	sourceType                 string
	sourceTypeFlag             bool
	importKnowledgeSetting     *DataAssetImportKnowledgeSetting
	importKnowledgeSettingFlag bool
	description                map[string]string
	descriptionFlag            bool
}

func NewCreateAppDataAssetPathReqBodyBuilder() *CreateAppDataAssetPathReqBodyBuilder {
	builder := &CreateAppDataAssetPathReqBodyBuilder{}
	return builder
}

// 连接类型
//
// 示例值：direct
func (builder *CreateAppDataAssetPathReqBodyBuilder) ConnectType(connectType string) *CreateAppDataAssetPathReqBodyBuilder {
	builder.connectType = connectType
	builder.connectTypeFlag = true
	return builder
}

// 数据源类型
//
// 示例值：
func (builder *CreateAppDataAssetPathReqBodyBuilder) SourceType(sourceType string) *CreateAppDataAssetPathReqBodyBuilder {
	builder.sourceType = sourceType
	builder.sourceTypeFlag = true
	return builder
}

// 知识导入配置
//
// 示例值：
func (builder *CreateAppDataAssetPathReqBodyBuilder) ImportKnowledgeSetting(importKnowledgeSetting *DataAssetImportKnowledgeSetting) *CreateAppDataAssetPathReqBodyBuilder {
	builder.importKnowledgeSetting = importKnowledgeSetting
	builder.importKnowledgeSettingFlag = true
	return builder
}

// 数据知识描述信息
//
// 示例值：
func (builder *CreateAppDataAssetPathReqBodyBuilder) Description(description map[string]string) *CreateAppDataAssetPathReqBodyBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

func (builder *CreateAppDataAssetPathReqBodyBuilder) Build() (*CreateAppDataAssetReqBody, error) {
	req := &CreateAppDataAssetReqBody{}
	if builder.connectTypeFlag {
		req.ConnectType = &builder.connectType
	}
	if builder.sourceTypeFlag {
		req.SourceType = &builder.sourceType
	}
	if builder.importKnowledgeSettingFlag {
		req.ImportKnowledgeSetting = builder.importKnowledgeSetting
	}
	if builder.descriptionFlag {
		req.Description = builder.description
	}
	return req, nil
}

type CreateAppDataAssetReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateAppDataAssetReqBody
}

func NewCreateAppDataAssetReqBuilder() *CreateAppDataAssetReqBuilder {
	builder := &CreateAppDataAssetReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// APPID
//
// 示例值：spring_dfasdf__c
func (builder *CreateAppDataAssetReqBuilder) AppId(appId string) *CreateAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 应用环境，默认为线上环境，dev代表开发环境，只支持dev
//
// 示例值：dev
func (builder *CreateAppDataAssetReqBuilder) TenantType(tenantType string) *CreateAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("tenant_type", fmt.Sprint(tenantType))
	return builder
}

// 创建数据知识
func (builder *CreateAppDataAssetReqBuilder) Body(body *CreateAppDataAssetReqBody) *CreateAppDataAssetReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateAppDataAssetReqBuilder) Build() *CreateAppDataAssetReq {
	req := &CreateAppDataAssetReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.body
	return req
}

type CreateAppDataAssetReqBody struct {
	ConnectType *string `json:"connect_type,omitempty"` // 连接类型

	SourceType *string `json:"source_type,omitempty"` // 数据源类型

	ImportKnowledgeSetting *DataAssetImportKnowledgeSetting `json:"import_knowledge_setting,omitempty"` // 知识导入配置

	Description map[string]string `json:"description,omitempty"` // 数据知识描述信息
}

type CreateAppDataAssetReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateAppDataAssetReqBody `body:""`
}

type CreateAppDataAssetRespData struct {
	DataAsset *DataAsset `json:"data_asset,omitempty"` // 数据知识
}

type CreateAppDataAssetResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateAppDataAssetRespData `json:"data"` // 业务数据
}

func (resp *CreateAppDataAssetResp) Success() bool {
	return resp.Code == 0
}

type DeleteAppDataAssetReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewDeleteAppDataAssetReqBuilder() *DeleteAppDataAssetReqBuilder {
	builder := &DeleteAppDataAssetReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// APPID
//
// 示例值：spring_dfadsaf__c
func (builder *DeleteAppDataAssetReqBuilder) AppId(appId string) *DeleteAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 数据知识ID
//
// 示例值：data_asset_dfadsafe
func (builder *DeleteAppDataAssetReqBuilder) DataAssetId(dataAssetId string) *DeleteAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("data_asset_id", fmt.Sprint(dataAssetId))
	return builder
}

// 应用环境，默认为线上环境，dev代表开发环境，只支持dev
//
// 示例值：dev
func (builder *DeleteAppDataAssetReqBuilder) TenantType(tenantType string) *DeleteAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("tenant_type", fmt.Sprint(tenantType))
	return builder
}

func (builder *DeleteAppDataAssetReqBuilder) Build() *DeleteAppDataAssetReq {
	req := &DeleteAppDataAssetReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type DeleteAppDataAssetReq struct {
	apiReq *larkcore.ApiReq
}

type DeleteAppDataAssetRespData struct {
	DataAsset *DataAsset `json:"data_asset,omitempty"` // 数据知识
}

type DeleteAppDataAssetResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *DeleteAppDataAssetRespData `json:"data"` // 业务数据
}

func (resp *DeleteAppDataAssetResp) Success() bool {
	return resp.Code == 0
}

type GetAppDataAssetReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetAppDataAssetReqBuilder() *GetAppDataAssetReqBuilder {
	builder := &GetAppDataAssetReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// APIID
//
// 示例值：spring_feafdsaf__c
func (builder *GetAppDataAssetReqBuilder) AppId(appId string) *GetAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 数据知识ID
//
// 示例值：data_asset_dafefadsaf1
func (builder *GetAppDataAssetReqBuilder) DataAssetId(dataAssetId string) *GetAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("data_asset_id", fmt.Sprint(dataAssetId))
	return builder
}

// 结果是否包含数据与知识项
//
// 示例值：true
func (builder *GetAppDataAssetReqBuilder) WithDataAssetItem(withDataAssetItem bool) *GetAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_data_asset_item", fmt.Sprint(withDataAssetItem))
	return builder
}

// 结果是否包含数据知识连接状态
//
// 示例值：true
func (builder *GetAppDataAssetReqBuilder) WithConnectStatus(withConnectStatus bool) *GetAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_connect_status", fmt.Sprint(withConnectStatus))
	return builder
}

// 结果是否包含导入数据源信息
//
// 示例值：
func (builder *GetAppDataAssetReqBuilder) WithImportSetting(withImportSetting bool) *GetAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_import_setting", fmt.Sprint(withImportSetting))
	return builder
}

// 应用环境，默认为线上环境，dev代表开发环境
//
// 示例值：dev
func (builder *GetAppDataAssetReqBuilder) TenantType(tenantType string) *GetAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("tenant_type", fmt.Sprint(tenantType))
	return builder
}

func (builder *GetAppDataAssetReqBuilder) Build() *GetAppDataAssetReq {
	req := &GetAppDataAssetReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type GetAppDataAssetReq struct {
	apiReq *larkcore.ApiReq
}

type GetAppDataAssetRespData struct {
	DataAsset *DataAsset `json:"data_asset,omitempty"` // 数据知识
}

type GetAppDataAssetResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetAppDataAssetRespData `json:"data"` // 业务数据
}

func (resp *GetAppDataAssetResp) Success() bool {
	return resp.Code == 0
}

type ListAppDataAssetReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListAppDataAssetReqBuilder() *ListAppDataAssetReqBuilder {
	builder := &ListAppDataAssetReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListAppDataAssetReqBuilder) Limit(limit int) *ListAppDataAssetReqBuilder {
	builder.limit = limit
	return builder
}

// AppID
//
// 示例值：spring_5862e4fea8__c
func (builder *ListAppDataAssetReqBuilder) AppId(appId string) *ListAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 分页参数：分页大小，默认：20，最大：100
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) PageSize(pageSize int) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页参数：分页起始位置，为空表示首页
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) PageToken(pageToken string) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 模糊匹配关键词
//
// 示例值：电影
func (builder *ListAppDataAssetReqBuilder) Keyword(keyword string) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("keyword", fmt.Sprint(keyword))
	return builder
}

// 根据数据知识 ID 进行过滤
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) DataAssetIds(dataAssetIds []string) *ListAppDataAssetReqBuilder {
	for _, v := range dataAssetIds {
		builder.apiReq.QueryParams.Add("data_asset_ids", fmt.Sprint(v))
	}
	return builder
}

// 根据数据知识分类 ID 进行过滤
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) DataAssetTagIds(dataAssetTagIds []string) *ListAppDataAssetReqBuilder {
	for _, v := range dataAssetTagIds {
		builder.apiReq.QueryParams.Add("data_asset_tag_ids", fmt.Sprint(v))
	}
	return builder
}

// 结果是否包含数据与知识项目
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) WithDataAssetItem(withDataAssetItem bool) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_data_asset_item", fmt.Sprint(withDataAssetItem))
	return builder
}

// 结果是否包含数据连接状态
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) WithConnectStatus(withConnectStatus bool) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_connect_status", fmt.Sprint(withConnectStatus))
	return builder
}

// 结果是否包含导入数据源信息
//
// 示例值：
func (builder *ListAppDataAssetReqBuilder) WithImportSetting(withImportSetting bool) *ListAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("with_import_setting", fmt.Sprint(withImportSetting))
	return builder
}

func (builder *ListAppDataAssetReqBuilder) Build() *ListAppDataAssetReq {
	req := &ListAppDataAssetReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListAppDataAssetReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListAppDataAssetRespData struct {
	Items []*DataAsset `json:"items,omitempty"` // 数据知识列表

	PageToken *string `json:"page_token,omitempty"` // has_more=true，可使用page_token继续查询

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多
}

type ListAppDataAssetResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListAppDataAssetRespData `json:"data"` // 业务数据
}

func (resp *ListAppDataAssetResp) Success() bool {
	return resp.Code == 0
}

type UploadFileAppDataAssetReqBodyBuilder struct {
	file     io.Reader // 需要上传的文件
	fileFlag bool
}

func NewUploadFileAppDataAssetReqBodyBuilder() *UploadFileAppDataAssetReqBodyBuilder {
	builder := &UploadFileAppDataAssetReqBodyBuilder{}
	return builder
}

// 需要上传的文件
//
//示例值：
func (builder *UploadFileAppDataAssetReqBodyBuilder) File(file io.Reader) *UploadFileAppDataAssetReqBodyBuilder {
	builder.file = file
	builder.fileFlag = true
	return builder
}

func (builder *UploadFileAppDataAssetReqBodyBuilder) Build() *UploadFileAppDataAssetReqBody {
	req := &UploadFileAppDataAssetReqBody{}
	if builder.fileFlag {
		req.File = builder.file
	}
	return req
}

type UploadFileAppDataAssetPathReqBodyBuilder struct {
	filePath     string // 需要上传的文件
	filePathFlag bool
}

func NewUploadFileAppDataAssetPathReqBodyBuilder() *UploadFileAppDataAssetPathReqBodyBuilder {
	builder := &UploadFileAppDataAssetPathReqBodyBuilder{}
	return builder
}

// 需要上传的文件
//
// 示例值：
func (builder *UploadFileAppDataAssetPathReqBodyBuilder) FilePath(filePath string) *UploadFileAppDataAssetPathReqBodyBuilder {
	builder.filePath = filePath
	builder.filePathFlag = true
	return builder
}

func (builder *UploadFileAppDataAssetPathReqBodyBuilder) Build() (*UploadFileAppDataAssetReqBody, error) {
	req := &UploadFileAppDataAssetReqBody{}
	if builder.filePathFlag {
		data, err := larkcore.File2Bytes(builder.filePath)
		if err != nil {
			return nil, err
		}
		req.File = bytes.NewBuffer(data)
	}
	return req, nil
}

type UploadFileAppDataAssetReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *UploadFileAppDataAssetReqBody
}

func NewUploadFileAppDataAssetReqBuilder() *UploadFileAppDataAssetReqBuilder {
	builder := &UploadFileAppDataAssetReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// APPID
//
// 示例值：spring_dsafdsaf__c
func (builder *UploadFileAppDataAssetReqBuilder) AppId(appId string) *UploadFileAppDataAssetReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 应用环境，默认为线上环境，dev代表开发环境，只支持dev
//
// 示例值：dev
func (builder *UploadFileAppDataAssetReqBuilder) TenantType(tenantType string) *UploadFileAppDataAssetReqBuilder {
	builder.apiReq.QueryParams.Set("tenant_type", fmt.Sprint(tenantType))
	return builder
}

// 上传数据知识文件
func (builder *UploadFileAppDataAssetReqBuilder) Body(body *UploadFileAppDataAssetReqBody) *UploadFileAppDataAssetReqBuilder {
	builder.body = body
	return builder
}

func (builder *UploadFileAppDataAssetReqBuilder) Build() *UploadFileAppDataAssetReq {
	req := &UploadFileAppDataAssetReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.body
	return req
}

type UploadFileAppDataAssetReqBody struct {
	File io.Reader `json:"file,omitempty"` // 需要上传的文件
}

type UploadFileAppDataAssetReq struct {
	apiReq *larkcore.ApiReq
	Body   *UploadFileAppDataAssetReqBody `body:""`
}

type UploadFileAppDataAssetRespData struct {
	FileInfo *DataAssetFile `json:"file_info,omitempty"` // 数据知识文件
}

type UploadFileAppDataAssetResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *UploadFileAppDataAssetRespData `json:"data"` // 业务数据
}

func (resp *UploadFileAppDataAssetResp) Success() bool {
	return resp.Code == 0
}

type ListAppDataAssetTagReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListAppDataAssetTagReqBuilder() *ListAppDataAssetTagReqBuilder {
	builder := &ListAppDataAssetTagReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListAppDataAssetTagReqBuilder) Limit(limit int) *ListAppDataAssetTagReqBuilder {
	builder.limit = limit
	return builder
}

// AppID
//
// 示例值：spring_5862e4fea8__c
func (builder *ListAppDataAssetTagReqBuilder) AppId(appId string) *ListAppDataAssetTagReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 分页参数：分页大小，默认：20，最大：100
//
// 示例值：
func (builder *ListAppDataAssetTagReqBuilder) PageSize(pageSize int) *ListAppDataAssetTagReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页参数：分页起始位置，为空表示首页
//
// 示例值：
func (builder *ListAppDataAssetTagReqBuilder) PageToken(pageToken string) *ListAppDataAssetTagReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 模糊匹配分类名称
//
// 示例值：电影
func (builder *ListAppDataAssetTagReqBuilder) Keyword(keyword string) *ListAppDataAssetTagReqBuilder {
	builder.apiReq.QueryParams.Set("keyword", fmt.Sprint(keyword))
	return builder
}

// 模糊匹配分类名称
//
// 示例值：
func (builder *ListAppDataAssetTagReqBuilder) DataAssetTagIds(dataAssetTagIds []string) *ListAppDataAssetTagReqBuilder {
	for _, v := range dataAssetTagIds {
		builder.apiReq.QueryParams.Add("data_asset_tag_ids", fmt.Sprint(v))
	}
	return builder
}

func (builder *ListAppDataAssetTagReqBuilder) Build() *ListAppDataAssetTagReq {
	req := &ListAppDataAssetTagReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListAppDataAssetTagReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListAppDataAssetTagRespData struct {
	Items []*DataAssetTag `json:"items,omitempty"` // 数据知识分类列表

	PageToken *string `json:"page_token,omitempty"` // has_more=true，可使用 page_token继续查询

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多
}

type ListAppDataAssetTagResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListAppDataAssetTagRespData `json:"data"` // 业务数据
}

func (resp *ListAppDataAssetTagResp) Success() bool {
	return resp.Code == 0
}

type AskAppKnowledgeReqBodyBuilder struct {
	message     *AilyKnowledgeMessage // 输入消息（当前仅支持纯文本输入）
	messageFlag bool

	dataAssetIds     []string // 控制知识问答所依据的数据知识范围
	dataAssetIdsFlag bool

	dataAssetTagIds     []string // 控制知识问答所依据的数据知识分类范围
	dataAssetTagIdsFlag bool
}

func NewAskAppKnowledgeReqBodyBuilder() *AskAppKnowledgeReqBodyBuilder {
	builder := &AskAppKnowledgeReqBodyBuilder{}
	return builder
}

// 输入消息（当前仅支持纯文本输入）
//
//示例值：
func (builder *AskAppKnowledgeReqBodyBuilder) Message(message *AilyKnowledgeMessage) *AskAppKnowledgeReqBodyBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

// 控制知识问答所依据的数据知识范围
//
//示例值：
func (builder *AskAppKnowledgeReqBodyBuilder) DataAssetIds(dataAssetIds []string) *AskAppKnowledgeReqBodyBuilder {
	builder.dataAssetIds = dataAssetIds
	builder.dataAssetIdsFlag = true
	return builder
}

// 控制知识问答所依据的数据知识分类范围
//
//示例值：
func (builder *AskAppKnowledgeReqBodyBuilder) DataAssetTagIds(dataAssetTagIds []string) *AskAppKnowledgeReqBodyBuilder {
	builder.dataAssetTagIds = dataAssetTagIds
	builder.dataAssetTagIdsFlag = true
	return builder
}

func (builder *AskAppKnowledgeReqBodyBuilder) Build() *AskAppKnowledgeReqBody {
	req := &AskAppKnowledgeReqBody{}
	if builder.messageFlag {
		req.Message = builder.message
	}
	if builder.dataAssetIdsFlag {
		req.DataAssetIds = builder.dataAssetIds
	}
	if builder.dataAssetTagIdsFlag {
		req.DataAssetTagIds = builder.dataAssetTagIds
	}
	return req
}

type AskAppKnowledgePathReqBodyBuilder struct {
	message             *AilyKnowledgeMessage
	messageFlag         bool
	dataAssetIds        []string
	dataAssetIdsFlag    bool
	dataAssetTagIds     []string
	dataAssetTagIdsFlag bool
}

func NewAskAppKnowledgePathReqBodyBuilder() *AskAppKnowledgePathReqBodyBuilder {
	builder := &AskAppKnowledgePathReqBodyBuilder{}
	return builder
}

// 输入消息（当前仅支持纯文本输入）
//
// 示例值：
func (builder *AskAppKnowledgePathReqBodyBuilder) Message(message *AilyKnowledgeMessage) *AskAppKnowledgePathReqBodyBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

// 控制知识问答所依据的数据知识范围
//
// 示例值：
func (builder *AskAppKnowledgePathReqBodyBuilder) DataAssetIds(dataAssetIds []string) *AskAppKnowledgePathReqBodyBuilder {
	builder.dataAssetIds = dataAssetIds
	builder.dataAssetIdsFlag = true
	return builder
}

// 控制知识问答所依据的数据知识分类范围
//
// 示例值：
func (builder *AskAppKnowledgePathReqBodyBuilder) DataAssetTagIds(dataAssetTagIds []string) *AskAppKnowledgePathReqBodyBuilder {
	builder.dataAssetTagIds = dataAssetTagIds
	builder.dataAssetTagIdsFlag = true
	return builder
}

func (builder *AskAppKnowledgePathReqBodyBuilder) Build() (*AskAppKnowledgeReqBody, error) {
	req := &AskAppKnowledgeReqBody{}
	if builder.messageFlag {
		req.Message = builder.message
	}
	if builder.dataAssetIdsFlag {
		req.DataAssetIds = builder.dataAssetIds
	}
	if builder.dataAssetTagIdsFlag {
		req.DataAssetTagIds = builder.dataAssetTagIds
	}
	return req, nil
}

type AskAppKnowledgeReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *AskAppKnowledgeReqBody
}

func NewAskAppKnowledgeReqBuilder() *AskAppKnowledgeReqBuilder {
	builder := &AskAppKnowledgeReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 飞书智能伙伴搭建平台的AppID
//
// 示例值：spring_5862e4fea8__c
func (builder *AskAppKnowledgeReqBuilder) AppId(appId string) *AskAppKnowledgeReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 执行一次数据知识问答
func (builder *AskAppKnowledgeReqBuilder) Body(body *AskAppKnowledgeReqBody) *AskAppKnowledgeReqBuilder {
	builder.body = body
	return builder
}

func (builder *AskAppKnowledgeReqBuilder) Build() *AskAppKnowledgeReq {
	req := &AskAppKnowledgeReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type AskAppKnowledgeReqBody struct {
	Message *AilyKnowledgeMessage `json:"message,omitempty"` // 输入消息（当前仅支持纯文本输入）

	DataAssetIds []string `json:"data_asset_ids,omitempty"` // 控制知识问答所依据的数据知识范围

	DataAssetTagIds []string `json:"data_asset_tag_ids,omitempty"` // 控制知识问答所依据的数据知识分类范围
}

type AskAppKnowledgeReq struct {
	apiReq *larkcore.ApiReq
	Body   *AskAppKnowledgeReqBody `body:""`
}

type AskAppKnowledgeRespData struct {
	Status *string `json:"status,omitempty"` // 响应状态，枚举值

	FinishType *string `json:"finish_type,omitempty"` // 结束类型，枚举值

	Message *AilyKnowledgeMessage `json:"message,omitempty"` // 响应消息

	ProcessData *AilyKnowledgeAskProcessData `json:"process_data,omitempty"` // 知识问答运行过程结构化数据，status=finished 且 finish_type=qa 时返回

	FaqResult *AilyKnowledgeFaq `json:"faq_result,omitempty"` // 匹配标准问答对结果，status=finished 且 finish_type=faq时返回

	HasAnswer *bool `json:"has_answer,omitempty"` // 是否有结果，true 则 代表 message 中的内容是通过配置知识而生成的
}

type AskAppKnowledgeResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *AskAppKnowledgeRespData `json:"data"` // 业务数据
}

func (resp *AskAppKnowledgeResp) Success() bool {
	return resp.Code == 0
}

type GetAppSkillReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetAppSkillReqBuilder() *GetAppSkillReqBuilder {
	builder := &GetAppSkillReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 应用 ID
//
// 示例值：spring_xxx__c
func (builder *GetAppSkillReqBuilder) AppId(appId string) *GetAppSkillReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 技能 ID
//
// 示例值：skill_6cc6166178ca
func (builder *GetAppSkillReqBuilder) SkillId(skillId string) *GetAppSkillReqBuilder {
	builder.apiReq.PathParams.Set("skill_id", fmt.Sprint(skillId))
	return builder
}

func (builder *GetAppSkillReqBuilder) Build() *GetAppSkillReq {
	req := &GetAppSkillReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type GetAppSkillReq struct {
	apiReq *larkcore.ApiReq
}

type GetAppSkillRespData struct {
	Skill *Skill `json:"skill,omitempty"` // 技能信息
}

type GetAppSkillResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetAppSkillRespData `json:"data"` // 业务数据
}

func (resp *GetAppSkillResp) Success() bool {
	return resp.Code == 0
}

type ListAppSkillReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListAppSkillReqBuilder() *ListAppSkillReqBuilder {
	builder := &ListAppSkillReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListAppSkillReqBuilder) Limit(limit int) *ListAppSkillReqBuilder {
	builder.limit = limit
	return builder
}

// 应用 ID
//
// 示例值：spring_xxx__c
func (builder *ListAppSkillReqBuilder) AppId(appId string) *ListAppSkillReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 页面大小
//
// 示例值：
func (builder *ListAppSkillReqBuilder) PageSize(pageSize int) *ListAppSkillReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页偏移量
//
// 示例值：
func (builder *ListAppSkillReqBuilder) PageToken(pageToken string) *ListAppSkillReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

func (builder *ListAppSkillReqBuilder) Build() *ListAppSkillReq {
	req := &ListAppSkillReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListAppSkillReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListAppSkillRespData struct {
	Skills []*Skill `json:"skills,omitempty"` // 技能列表

	PageToken *string `json:"page_token,omitempty"` // 下一页的起始偏移量

	HasMore *bool `json:"has_more,omitempty"` // 是否还有更多数据
}

type ListAppSkillResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListAppSkillRespData `json:"data"` // 业务数据
}

func (resp *ListAppSkillResp) Success() bool {
	return resp.Code == 0
}

type StartAppSkillReqBodyBuilder struct {
	globalVariable     *SkillGlobalVariable // 技能的全局变量
	globalVariableFlag bool

	input     string // 技能的自定义变量
	inputFlag bool
}

func NewStartAppSkillReqBodyBuilder() *StartAppSkillReqBodyBuilder {
	builder := &StartAppSkillReqBodyBuilder{}
	return builder
}

// 技能的全局变量
//
//示例值：
func (builder *StartAppSkillReqBodyBuilder) GlobalVariable(globalVariable *SkillGlobalVariable) *StartAppSkillReqBodyBuilder {
	builder.globalVariable = globalVariable
	builder.globalVariableFlag = true
	return builder
}

// 技能的自定义变量
//
//示例值：{"custom_s":"text","custom_i":12,"custom_b":true,"custom_f":1.2}
func (builder *StartAppSkillReqBodyBuilder) Input(input string) *StartAppSkillReqBodyBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

func (builder *StartAppSkillReqBodyBuilder) Build() *StartAppSkillReqBody {
	req := &StartAppSkillReqBody{}
	if builder.globalVariableFlag {
		req.GlobalVariable = builder.globalVariable
	}
	if builder.inputFlag {
		req.Input = &builder.input
	}
	return req
}

type StartAppSkillPathReqBodyBuilder struct {
	globalVariable     *SkillGlobalVariable
	globalVariableFlag bool
	input              string
	inputFlag          bool
}

func NewStartAppSkillPathReqBodyBuilder() *StartAppSkillPathReqBodyBuilder {
	builder := &StartAppSkillPathReqBodyBuilder{}
	return builder
}

// 技能的全局变量
//
// 示例值：
func (builder *StartAppSkillPathReqBodyBuilder) GlobalVariable(globalVariable *SkillGlobalVariable) *StartAppSkillPathReqBodyBuilder {
	builder.globalVariable = globalVariable
	builder.globalVariableFlag = true
	return builder
}

// 技能的自定义变量
//
// 示例值：{"custom_s":"text","custom_i":12,"custom_b":true,"custom_f":1.2}
func (builder *StartAppSkillPathReqBodyBuilder) Input(input string) *StartAppSkillPathReqBodyBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

func (builder *StartAppSkillPathReqBodyBuilder) Build() (*StartAppSkillReqBody, error) {
	req := &StartAppSkillReqBody{}
	if builder.globalVariableFlag {
		req.GlobalVariable = builder.globalVariable
	}
	if builder.inputFlag {
		req.Input = &builder.input
	}
	return req, nil
}

type StartAppSkillReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *StartAppSkillReqBody
}

func NewStartAppSkillReqBuilder() *StartAppSkillReqBuilder {
	builder := &StartAppSkillReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 应用 ID
//
// 示例值：spring_xxx__c
func (builder *StartAppSkillReqBuilder) AppId(appId string) *StartAppSkillReqBuilder {
	builder.apiReq.PathParams.Set("app_id", fmt.Sprint(appId))
	return builder
}

// 技能 ID
//
// 示例值：skill_6cc6166178ca
func (builder *StartAppSkillReqBuilder) SkillId(skillId string) *StartAppSkillReqBuilder {
	builder.apiReq.PathParams.Set("skill_id", fmt.Sprint(skillId))
	return builder
}

// 该 API 用于执行飞书智能伙伴应用的技能（Skill）获取输出
func (builder *StartAppSkillReqBuilder) Body(body *StartAppSkillReqBody) *StartAppSkillReqBuilder {
	builder.body = body
	return builder
}

func (builder *StartAppSkillReqBuilder) Build() *StartAppSkillReq {
	req := &StartAppSkillReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type StartAppSkillReqBody struct {
	GlobalVariable *SkillGlobalVariable `json:"global_variable,omitempty"` // 技能的全局变量

	Input *string `json:"input,omitempty"` // 技能的自定义变量
}

type StartAppSkillReq struct {
	apiReq *larkcore.ApiReq
	Body   *StartAppSkillReqBody `body:""`
}

type StartAppSkillRespData struct {
	Output *string `json:"output,omitempty"` // 技能的输出

	Status *string `json:"status,omitempty"` // 技能的执行状态
}

type StartAppSkillResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *StartAppSkillRespData `json:"data"` // 业务数据
}

func (resp *StartAppSkillResp) Success() bool {
	return resp.Code == 0
}

type ListAilySessionAilyMessageIterator struct {
	nextPageToken *string
	items         []*AilyMessage
	index         int
	limit         int
	ctx           context.Context
	req           *ListAilySessionAilyMessageReq
	listFunc      func(ctx context.Context, req *ListAilySessionAilyMessageReq, options ...larkcore.RequestOptionFunc) (*ListAilySessionAilyMessageResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListAilySessionAilyMessageIterator) Next() (bool, *AilyMessage, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Messages) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Messages
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListAilySessionAilyMessageIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListAilySessionRunIterator struct {
	nextPageToken *string
	items         []*Run
	index         int
	limit         int
	ctx           context.Context
	req           *ListAilySessionRunReq
	listFunc      func(ctx context.Context, req *ListAilySessionRunReq, options ...larkcore.RequestOptionFunc) (*ListAilySessionRunResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListAilySessionRunIterator) Next() (bool, *Run, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Runs) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Runs
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListAilySessionRunIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListAppDataAssetIterator struct {
	nextPageToken *string
	items         []*DataAsset
	index         int
	limit         int
	ctx           context.Context
	req           *ListAppDataAssetReq
	listFunc      func(ctx context.Context, req *ListAppDataAssetReq, options ...larkcore.RequestOptionFunc) (*ListAppDataAssetResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListAppDataAssetIterator) Next() (bool, *DataAsset, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListAppDataAssetIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListAppDataAssetTagIterator struct {
	nextPageToken *string
	items         []*DataAssetTag
	index         int
	limit         int
	ctx           context.Context
	req           *ListAppDataAssetTagReq
	listFunc      func(ctx context.Context, req *ListAppDataAssetTagReq, options ...larkcore.RequestOptionFunc) (*ListAppDataAssetTagResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListAppDataAssetTagIterator) Next() (bool, *DataAssetTag, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListAppDataAssetTagIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListAppSkillIterator struct {
	nextPageToken *string
	items         []*Skill
	index         int
	limit         int
	ctx           context.Context
	req           *ListAppSkillReq
	listFunc      func(ctx context.Context, req *ListAppSkillReq, options ...larkcore.RequestOptionFunc) (*ListAppSkillResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListAppSkillIterator) Next() (bool, *Skill, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Skills) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Skills
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListAppSkillIterator) NextPageToken() *string {
	return iterator.nextPageToken
}
