// Package approval 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 larkapproval

import (
	"fmt"

	"context"
	"errors"

	"github.com/larksuite/oapi-sdk-go/v3/event"

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

const (
	CreateApprovalV4DepartmentIDTypeDepartmentId     = "department_id"      // 以自定义department_id来标识部门
	CreateApprovalV4DepartmentIDTypeOpenDepartmentId = "open_department_id" // 以open_department_id来标识部门
)

const (
	CreateApprovalV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CreateApprovalV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CreateApprovalV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	GetApprovalV4LocaleZhcn = "zh-CN" // 中文
	GetApprovalV4LocaleEnus = "en-US" // 英文
	GetApprovalV4LocaleJajp = "ja-JP" // 日文
	GetApprovalV4LocaleZhhk = "zh-HK" // 繁体中文（中国香港）
	GetApprovalV4LocaleZhtw = "zh-TW" // 繁体中文（中国台湾）
	GetApprovalV4LocaleDede = "de-DE" // 德语
	GetApprovalV4LocaleEses = "es-ES" // 西班牙语
	GetApprovalV4LocaleFrfr = "fr-FR" // 法语
	GetApprovalV4LocaleIdid = "id-ID" // 印度尼西亚语
	GetApprovalV4LocaleItit = "it-IT" // 意大利语
	GetApprovalV4LocaleKokr = "ko-KR" // 韩语
	GetApprovalV4LocalePtbr = "pt-BR" // 葡萄牙语
	GetApprovalV4LocaleThth = "th-TH" // 泰语
	GetApprovalV4LocaleVivn = "vi-VN" // 越南语
	GetApprovalV4LocaleMsmy = "ms-MY" // 马来语
	GetApprovalV4LocaleRuru = "ru-RU" // 俄语
)

const (
	GetApprovalV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetApprovalV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	GetApprovalV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	CreateExternalApprovalV4DepartmentIDTypeDepartmentId     = "department_id"      // 以自定义department_id来标识部门
	CreateExternalApprovalV4DepartmentIDTypeOpenDepartmentId = "open_department_id" // 以open_department_id来标识部门
)

const (
	CreateExternalApprovalV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CreateExternalApprovalV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CreateExternalApprovalV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	GetExternalApprovalV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetExternalApprovalV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	GetExternalApprovalV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	ExternalInstanceStatusPending    = "PENDING"    // 审批中
	ExternalInstanceStatusApproved   = "APPROVED"   // 审批流程结束，结果为同意
	ExternalInstanceStatusRejected   = "REJECTED"   // 审批流程结束，结果为拒绝
	ExternalInstanceStatusCanceled   = "CANCELED"   // 审批发起人撤回
	ExternalInstanceStatusDeleted    = "DELETED"    // 审批被删除
	ExternalInstanceStatusHidden     = "HIDDEN"     // 状态隐藏(不显示状态)
	ExternalInstanceStatusTerminated = "TERMINATED" // 审批终止
)

const (
	ExternalInstanceDisplayMethodBrowser     = "BROWSER"     // 跳转系统默认浏览器打开
	ExternalInstanceDisplayMethodSIdebar     = "SIDEBAR"     // 飞书中侧边抽屉打开
	ExternalInstanceDisplayMethodNormal      = "NORMAL"      // 飞书内嵌页面打开
	ExternalInstanceDisplayMethodTrusteeship = "TRUSTEESHIP" // 以托管打开
)

const (
	ExternalInstanceUpdateModeReplace = "REPLACE" // 全量替换，默认值
	ExternalInstanceUpdateModeUpdate  = "UPDATE"  // 增量更新
)

const (
	ExternalTaskStatusPending     = "PENDING"     // 审批中
	ExternalTaskStatusApproved    = "APPROVED"    // 审批流程结束，结果为同意
	ExternalTaskStatusRejected    = "REJECTED"    // 审批流程结束，结果为拒绝
	ExternalTaskStatusTransferred = "TRANSFERRED" // 任务转交
	ExternalTaskStatusDone        = "DONE"        // 任务通过但审批人未操作；审批人看不到这个任务, 若想要看到, 可以通过抄送该人.
)

const (
	AddSignEnumAddSignPre      = 1 // 前加签
	AddSignEnumAddSignPost     = 2 // 后加签
	AddSignEnumAddSignParallel = 3 // 并加签

)

const (
	ApprovalMethodEnumOrSign         = 1 // 或签
	ApprovalMethodEnumAddSign        = 2 // 会签
	ApprovalMethodEnumSequentialSign = 3 // 依次审批

)

const (
	CancelInstanceV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CancelInstanceV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CancelInstanceV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	CcInstanceV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CcInstanceV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CcInstanceV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	InstanceCreateTitleDisplayMethodDisplayAll           = 0 // 如果都有title，展示approval 和instance的title，竖线分割。
	InstanceCreateTitleDisplayMethodDisplayInstanceTitle = 1 // 如果都有title，只展示instance的title

)

const (
	GetInstanceV4LocaleZhcn = "zh-CN" // 中文
	GetInstanceV4LocaleEnus = "en-US" // 英文
	GetInstanceV4LocaleJajp = "ja-JP" // 日文
	GetInstanceV4LocaleZhhk = "zh-HK" // 繁体中文（中国香港）
	GetInstanceV4LocaleZhtw = "zh-TW" // 繁体中文（中国台湾）
	GetInstanceV4LocaleDede = "de-DE" // 德语
	GetInstanceV4LocaleEses = "es-ES" // 西班牙语
	GetInstanceV4LocaleFrfr = "fr-FR" // 法语
	GetInstanceV4LocaleIdid = "id-ID" // 印度尼西亚语
	GetInstanceV4LocaleItit = "it-IT" // 意大利语
	GetInstanceV4LocaleKokr = "ko-KR" // 韩语
	GetInstanceV4LocalePtbr = "pt-BR" // 葡萄牙语
	GetInstanceV4LocaleThth = "th-TH" // 泰语
	GetInstanceV4LocaleVivn = "vi-VN" // 越南语
	GetInstanceV4LocaleMsmy = "ms-MY" // 马来语
	GetInstanceV4LocaleRuru = "ru-RU" // 俄语
)

const (
	GetInstanceV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetInstanceV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
	GetInstanceV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
)

const (
	PreviewInstanceUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
	PreviewInstanceUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	PreviewInstanceUserIDTypeUnionId = "union_id" // 以union_id来识别用户
)

const (
	InstanceSearchInstanceStatusPending   = "PENDING"  // 审批中
	InstanceSearchInstanceStatusRecall    = "RECALL"   // 撤回
	InstanceSearchInstanceStatusReject    = "REJECT"   // 拒绝
	InstanceSearchInstanceStatusDeleted   = "DELETED"  // 已删除
	InstanceSearchInstanceStatusApproverd = "APPROVED" // 通过
	InstanceSearchInstanceStatusAll       = "ALL"      // 所有状态
)

const (
	InstanceSearchLocaleZhCn = "zh-CN" // 中文
	InstanceSearchLocaleEnUs = "en-US" // 英文
	InstanceSearchLocaleJaJp = "ja-JP" // 日文
	InstanceSearchLocaleZhHk = "zh-HK" // 繁体中文（中国香港）
	InstanceSearchLocaleZhTw = "zh-TW" // 繁体中文（中国台湾）
	InstanceSearchLocaleDeDe = "de-DE" // 德语
	InstanceSearchLocaleEsEs = "es-ES" // 西班牙语
	InstanceSearchLocaleFrFr = "fr-FR" // 法语
	InstanceSearchLocaleIdId = "id-ID" // 印度尼西亚语
	InstanceSearchLocaleItIt = "it-IT" // 意大利语
	InstanceSearchLocaleKoKr = "ko-KR" // 韩语
	InstanceSearchLocalePtBr = "pt-BR" // 葡萄牙语
	InstanceSearchLocaleThTh = "th-TH" // 泰语
	InstanceSearchLocaleViVn = "vi-VN" // 越南语
	InstanceSearchLocaleMsMy = "ms-MY" // 马来语
	InstanceSearchLocaleRuRu = "ru-RU" // 俄语
)

const (
	QueryInstanceV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	QueryInstanceV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	QueryInstanceV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	CcSearchReadStatusREAD   = "READ"   // 已读
	CcSearchReadStatusUNREAD = "UNREAD" // 未读
	CcSearchReadStatusALL    = "ALL"    // 所有状态
)

const (
	CcSearchLocaleZhCn = "zh-CN" // 中文
	CcSearchLocaleEnUs = "en-US" // 英文
	CcSearchLocaleJaJp = "ja-JP" // 日文
	CcSearchLocaleZhHk = "zh-HK" // 繁体中文（中国香港）
	CcSearchLocaleZhTw = "zh-TW" // 繁体中文（中国台湾）
	CcSearchLocaleDeDe = "de-DE" // 德语
	CcSearchLocaleEsEs = "es-ES" // 西班牙语
	CcSearchLocaleFrFr = "fr-FR" // 法语
	CcSearchLocaleIdId = "id-ID" // 印度尼西亚语
	CcSearchLocaleItIt = "it-IT" // 意大利语
	CcSearchLocaleKoKr = "ko-KR" // 韩语
	CcSearchLocalePtBr = "pt-BR" // 葡萄牙语
	CcSearchLocaleThTh = "th-TH" // 泰语
	CcSearchLocaleViVn = "vi-VN" // 越南语
	CcSearchLocaleMsMy = "ms-MY" // 马来语
	CcSearchLocaleRuRu = "ru-RU" // 俄语
)

const (
	SearchCcInstanceV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	SearchCcInstanceV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	SearchCcInstanceV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	SpecifiedRollbackInstanceUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	SpecifiedRollbackInstanceUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	SpecifiedRollbackInstanceUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	CreateInstanceCommentUserIDTypeOpenId  = "open_id"  // open_id(ou_开头)
	CreateInstanceCommentUserIDTypeUserId  = "user_id"  // user_id(字符串)
	CreateInstanceCommentUserIDTypeUnionId = "union_id" // union_id(on_开头)
)

const (
	DeleteInstanceCommentOAPIUserIDTypeOpenId  = "open_id"  // open_id(ou_开头)
	DeleteInstanceCommentOAPIUserIDTypeUserId  = "user_id"  // user_id（字符串）
	DeleteInstanceCommentOAPIUserIDTypeUnionId = "union_id" // union_id（on_开头）
)

const (
	ListInstanceCommentUserIDTypeOpenId  = "open_id"  // open_id(ou_开头)
	ListInstanceCommentUserIDTypeUserId  = "user_id"  // user_id(字符串)
	ListInstanceCommentUserIDTypeUnionId = "union_id" // union_id(on_开头)
)

const (
	RemoveInstanceCommentUserIDTypeOpenId  = "open_id"  // open_id(ou_开头)
	RemoveInstanceCommentUserIDTypeUserId  = "user_id"  // user_id(字符串）
	RemoveInstanceCommentUserIDTypeUnionId = "union_id" // union_id(on_开头)
)

const (
	ApproveTaskV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ApproveTaskV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ApproveTaskV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	TopicTodoApproval      = "1"  // 待办审批
	TopicDoneApproval      = "2"  // 已办审批
	TopicInitiatedApproval = "3"  // 已发起审批
	TopicUnreadNotice      = "17" // 未读知会
	TopicReadNotice        = "18" // 已读知会
)

const (
	OpenAPIListTaskUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	OpenAPIListTaskUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	OpenAPIListTaskUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	RejectTaskV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	RejectTaskV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	RejectTaskV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	ResubmitTaskV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ResubmitTaskV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ResubmitTaskV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	TaskSearchTaskStatusPending     = "PENDING"     // 审批中
	TaskSearchTaskStatusReject      = "REJECTED"    // 拒绝
	TaskSearchTaskStatusApproverd   = "APPROVED"    // 通过
	TaskSearchTaskStatusTRANSFERRED = "TRANSFERRED" // 转交
	TaskSearchTaskStatusDONE        = "DONE"        // 已完成
	TaskSearchTaskStatusRMREPEAT    = "RM_REPEAT"   // 去重
	TaskSearchTaskStatusPROCESSED   = "PROCESSED"   // 已处理
	TaskSearchTaskStatusALL         = "ALL"         // 所有状态
)

const (
	TaskSearchLocaleZhCn = "zh-CN" // 中文
	TaskSearchLocaleEnUs = "en-US" // 英文
	TaskSearchLocaleJaJp = "ja-JP" // 日文
	TaskSearchLocaleZhHk = "zh-HK" // 繁体中文（中国香港）
	TaskSearchLocaleZhTw = "zh-TW" // 繁体中文（中国台湾）
	TaskSearchLocaleDeDe = "de-DE" // 德语
	TaskSearchLocaleEsEs = "es-ES" // 西班牙语
	TaskSearchLocaleFrFr = "fr-FR" // 法语
	TaskSearchLocaleIdId = "id-ID" // 印度尼西亚语
	TaskSearchLocaleItIt = "it-IT" // 意大利语
	TaskSearchLocaleKoKr = "ko-KR" // 韩语
	TaskSearchLocalePtBr = "pt-BR" // 葡萄牙语
	TaskSearchLocaleThTh = "th-TH" // 泰语
	TaskSearchLocaleViVn = "vi-VN" // 越南语
	TaskSearchLocaleMsMy = "ms-MY" // 马来语
	TaskSearchLocaleRuRu = "ru-RU" // 俄语
)

const (
	TaskSearchOrderUpdateTimeDESC = 0 // 按update_time倒排
	TaskSearchOrderUpdateTimeASC  = 1 // 按update_time正排
	TaskSearchOrderStartTimeDESC  = 2 // 按start_time倒排
	TaskSearchOrderStartTimeASC   = 3 // 按start_time正排

)

const (
	SearchTaskV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	SearchTaskV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	SearchTaskV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	TransferTaskV4UserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	TransferTaskV4UserIDTypeUnionId = "union_id" // 以union_id来识别用户
	TransferTaskV4UserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

type ActionConfig struct {
	ActionType *string `json:"action_type,omitempty"` // 操作类型，每个任务都可以配置2个操作，会展示审批列表中，当用户操作时，回调请求会带上该字段，表示用户进行了同意操作还是拒绝操作

	ActionName *string `json:"action_name,omitempty"` // 操作名称，i18n key 用于前台展示，如果 action_type 不是 APPROVAL和REJECT，则必须提供该字段，用于展示特定的操作名称

	IsNeedReason *bool `json:"is_need_reason,omitempty"` // 是否需要意见, 如果为true,则用户操作时，会跳转到 意见填写页面

	IsReasonRequired *bool `json:"is_reason_required,omitempty"` // 审批意见是否必填

	IsNeedAttachment *bool `json:"is_need_attachment,omitempty"` // 意见是否支持上传附件
}

type ActionConfigBuilder struct {
	actionType     string // 操作类型，每个任务都可以配置2个操作，会展示审批列表中，当用户操作时，回调请求会带上该字段，表示用户进行了同意操作还是拒绝操作
	actionTypeFlag bool

	actionName     string // 操作名称，i18n key 用于前台展示，如果 action_type 不是 APPROVAL和REJECT，则必须提供该字段，用于展示特定的操作名称
	actionNameFlag bool

	isNeedReason     bool // 是否需要意见, 如果为true,则用户操作时，会跳转到 意见填写页面
	isNeedReasonFlag bool

	isReasonRequired     bool // 审批意见是否必填
	isReasonRequiredFlag bool

	isNeedAttachment     bool // 意见是否支持上传附件
	isNeedAttachmentFlag bool
}

func NewActionConfigBuilder() *ActionConfigBuilder {
	builder := &ActionConfigBuilder{}
	return builder
}

// 操作类型，每个任务都可以配置2个操作，会展示审批列表中，当用户操作时，回调请求会带上该字段，表示用户进行了同意操作还是拒绝操作
//
// 示例值：APPROVE
func (builder *ActionConfigBuilder) ActionType(actionType string) *ActionConfigBuilder {
	builder.actionType = actionType
	builder.actionTypeFlag = true
	return builder
}

// 操作名称，i18n key 用于前台展示，如果 action_type 不是 APPROVAL和REJECT，则必须提供该字段，用于展示特定的操作名称
//
// 示例值：@i18n@5
func (builder *ActionConfigBuilder) ActionName(actionName string) *ActionConfigBuilder {
	builder.actionName = actionName
	builder.actionNameFlag = true
	return builder
}

// 是否需要意见, 如果为true,则用户操作时，会跳转到 意见填写页面
//
// 示例值：false
func (builder *ActionConfigBuilder) IsNeedReason(isNeedReason bool) *ActionConfigBuilder {
	builder.isNeedReason = isNeedReason
	builder.isNeedReasonFlag = true
	return builder
}

// 审批意见是否必填
//
// 示例值：false
func (builder *ActionConfigBuilder) IsReasonRequired(isReasonRequired bool) *ActionConfigBuilder {
	builder.isReasonRequired = isReasonRequired
	builder.isReasonRequiredFlag = true
	return builder
}

// 意见是否支持上传附件
//
// 示例值：false
func (builder *ActionConfigBuilder) IsNeedAttachment(isNeedAttachment bool) *ActionConfigBuilder {
	builder.isNeedAttachment = isNeedAttachment
	builder.isNeedAttachmentFlag = true
	return builder
}

func (builder *ActionConfigBuilder) Build() *ActionConfig {
	req := &ActionConfig{}
	if builder.actionTypeFlag {
		req.ActionType = &builder.actionType

	}
	if builder.actionNameFlag {
		req.ActionName = &builder.actionName

	}
	if builder.isNeedReasonFlag {
		req.IsNeedReason = &builder.isNeedReason

	}
	if builder.isReasonRequiredFlag {
		req.IsReasonRequired = &builder.isReasonRequired

	}
	if builder.isNeedAttachmentFlag {
		req.IsNeedAttachment = &builder.isNeedAttachment

	}
	return req
}

type Approval struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code

	ApprovalName *string `json:"approval_name,omitempty"` // 审批定义名称

	Status *string `json:"status,omitempty"` // 审批定义状态

	Id *string `json:"id,omitempty"` // 审批定义id

	VersionId *string `json:"version_id,omitempty"` // 审批定义版本id

	Description *string `json:"description,omitempty"` // 审批定义描述

	ExternalId *string `json:"external_id,omitempty"` // 三方审批定义id

	CreateLink *string `json:"create_link,omitempty"` // 三方审批定义创建链接

	CreateCount *string `json:"create_count,omitempty"` // 历史提单次数（T+1）
}

type ApprovalBuilder struct {
	approvalCode     string // 审批定义code
	approvalCodeFlag bool

	approvalName     string // 审批定义名称
	approvalNameFlag bool

	status     string // 审批定义状态
	statusFlag bool

	id     string // 审批定义id
	idFlag bool

	versionId     string // 审批定义版本id
	versionIdFlag bool

	description     string // 审批定义描述
	descriptionFlag bool

	externalId     string // 三方审批定义id
	externalIdFlag bool

	createLink     string // 三方审批定义创建链接
	createLinkFlag bool

	createCount     string // 历史提单次数（T+1）
	createCountFlag bool
}

func NewApprovalBuilder() *ApprovalBuilder {
	builder := &ApprovalBuilder{}
	return builder
}

// 审批定义code
//
// 示例值：
func (builder *ApprovalBuilder) ApprovalCode(approvalCode string) *ApprovalBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批定义名称
//
// 示例值：
func (builder *ApprovalBuilder) ApprovalName(approvalName string) *ApprovalBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 审批定义状态
//
// 示例值：ACTIVE
func (builder *ApprovalBuilder) Status(status string) *ApprovalBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批定义id
//
// 示例值：
func (builder *ApprovalBuilder) Id(id string) *ApprovalBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 审批定义版本id
//
// 示例值：
func (builder *ApprovalBuilder) VersionId(versionId string) *ApprovalBuilder {
	builder.versionId = versionId
	builder.versionIdFlag = true
	return builder
}

// 审批定义描述
//
// 示例值：
func (builder *ApprovalBuilder) Description(description string) *ApprovalBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 三方审批定义id
//
// 示例值：
func (builder *ApprovalBuilder) ExternalId(externalId string) *ApprovalBuilder {
	builder.externalId = externalId
	builder.externalIdFlag = true
	return builder
}

// 三方审批定义创建链接
//
// 示例值：
func (builder *ApprovalBuilder) CreateLink(createLink string) *ApprovalBuilder {
	builder.createLink = createLink
	builder.createLinkFlag = true
	return builder
}

// 历史提单次数（T+1）
//
// 示例值：
func (builder *ApprovalBuilder) CreateCount(createCount string) *ApprovalBuilder {
	builder.createCount = createCount
	builder.createCountFlag = true
	return builder
}

func (builder *ApprovalBuilder) Build() *Approval {
	req := &Approval{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

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

	}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.versionIdFlag {
		req.VersionId = &builder.versionId

	}
	if builder.descriptionFlag {
		req.Description = &builder.description

	}
	if builder.externalIdFlag {
		req.ExternalId = &builder.externalId

	}
	if builder.createLinkFlag {
		req.CreateLink = &builder.createLink

	}
	if builder.createCountFlag {
		req.CreateCount = &builder.createCount

	}
	return req
}

type ApprovalApproverCcer struct {
	Type *string `json:"type,omitempty"` // 审批/抄送人类型， ; 1. 当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3；;; 2. 当 type 为 Personal 时，需要填写对应的user_id ，用于指定用户；;; 3. 当 approver 为 Free 发起人自选时，不需要指定 user_id 和level；;; 4. ccer不支持 Free 发起人自选

	UserId *string `json:"user_id,omitempty"` // 用户id，根据user_id_type填写

	Level *string `json:"level,omitempty"` // 审批级数，当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3
}

type ApprovalApproverCcerBuilder struct {
	type_    string // 审批/抄送人类型， ; 1. 当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3；;; 2. 当 type 为 Personal 时，需要填写对应的user_id ，用于指定用户；;; 3. 当 approver 为 Free 发起人自选时，不需要指定 user_id 和level；;; 4. ccer不支持 Free 发起人自选
	typeFlag bool

	userId     string // 用户id，根据user_id_type填写
	userIdFlag bool

	level     string // 审批级数，当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3
	levelFlag bool
}

func NewApprovalApproverCcerBuilder() *ApprovalApproverCcerBuilder {
	builder := &ApprovalApproverCcerBuilder{}
	return builder
}

// 审批/抄送人类型， ; 1. 当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3；;; 2. 当 type 为 Personal 时，需要填写对应的user_id ，用于指定用户；;; 3. 当 approver 为 Free 发起人自选时，不需要指定 user_id 和level；;; 4. ccer不支持 Free 发起人自选
//
// 示例值：Supervisor
func (builder *ApprovalApproverCcerBuilder) Type(type_ string) *ApprovalApproverCcerBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 用户id，根据user_id_type填写
//
// 示例值：f7cb567e
func (builder *ApprovalApproverCcerBuilder) UserId(userId string) *ApprovalApproverCcerBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批级数，当 type 为 Supervisor、SupervisorTopDown、DepartmentManager 、DepartmentManagerTopDown 这 4 种时，需要在 level 中填写对应的级数，例如：由下往上三级主管审批，level = 3
//
// 示例值：3
func (builder *ApprovalApproverCcerBuilder) Level(level string) *ApprovalApproverCcerBuilder {
	builder.level = level
	builder.levelFlag = true
	return builder
}

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

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

	}
	if builder.levelFlag {
		req.Level = &builder.level

	}
	return req
}

type ApprovalConfig struct {
	CanUpdateViewer *bool `json:"can_update_viewer,omitempty"` // 允许用户修改可见范围

	CanUpdateForm *bool `json:"can_update_form,omitempty"` // 允许用户更新表单

	CanUpdateProcess *bool `json:"can_update_process,omitempty"` // 允许用户更新流程定义

	CanUpdateRevert *bool `json:"can_update_revert,omitempty"` // 允许用户更新撤回设置

	HelpUrl *string `json:"help_url,omitempty"` // 帮助文档链接
}

type ApprovalConfigBuilder struct {
	canUpdateViewer     bool // 允许用户修改可见范围
	canUpdateViewerFlag bool

	canUpdateForm     bool // 允许用户更新表单
	canUpdateFormFlag bool

	canUpdateProcess     bool // 允许用户更新流程定义
	canUpdateProcessFlag bool

	canUpdateRevert     bool // 允许用户更新撤回设置
	canUpdateRevertFlag bool

	helpUrl     string // 帮助文档链接
	helpUrlFlag bool
}

func NewApprovalConfigBuilder() *ApprovalConfigBuilder {
	builder := &ApprovalConfigBuilder{}
	return builder
}

// 允许用户修改可见范围
//
// 示例值：false
func (builder *ApprovalConfigBuilder) CanUpdateViewer(canUpdateViewer bool) *ApprovalConfigBuilder {
	builder.canUpdateViewer = canUpdateViewer
	builder.canUpdateViewerFlag = true
	return builder
}

// 允许用户更新表单
//
// 示例值：false
func (builder *ApprovalConfigBuilder) CanUpdateForm(canUpdateForm bool) *ApprovalConfigBuilder {
	builder.canUpdateForm = canUpdateForm
	builder.canUpdateFormFlag = true
	return builder
}

// 允许用户更新流程定义
//
// 示例值：false
func (builder *ApprovalConfigBuilder) CanUpdateProcess(canUpdateProcess bool) *ApprovalConfigBuilder {
	builder.canUpdateProcess = canUpdateProcess
	builder.canUpdateProcessFlag = true
	return builder
}

// 允许用户更新撤回设置
//
// 示例值：false
func (builder *ApprovalConfigBuilder) CanUpdateRevert(canUpdateRevert bool) *ApprovalConfigBuilder {
	builder.canUpdateRevert = canUpdateRevert
	builder.canUpdateRevertFlag = true
	return builder
}

// 帮助文档链接
//
// 示例值：https://www.baidu.com
func (builder *ApprovalConfigBuilder) HelpUrl(helpUrl string) *ApprovalConfigBuilder {
	builder.helpUrl = helpUrl
	builder.helpUrlFlag = true
	return builder
}

func (builder *ApprovalConfigBuilder) Build() *ApprovalConfig {
	req := &ApprovalConfig{}
	if builder.canUpdateViewerFlag {
		req.CanUpdateViewer = &builder.canUpdateViewer

	}
	if builder.canUpdateFormFlag {
		req.CanUpdateForm = &builder.canUpdateForm

	}
	if builder.canUpdateProcessFlag {
		req.CanUpdateProcess = &builder.canUpdateProcess

	}
	if builder.canUpdateRevertFlag {
		req.CanUpdateRevert = &builder.canUpdateRevert

	}
	if builder.helpUrlFlag {
		req.HelpUrl = &builder.helpUrl

	}
	return req
}

type ApprovalCreate struct {
	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符

	ApprovalCode *string `json:"approval_code,omitempty"` // 传空表示新建

	Description *string `json:"description,omitempty"` // 审批描述的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符

	Viewers []*ApprovalCreateViewers `json:"viewers,omitempty"` // viewers 字段指定了哪些人能从审批应用的前台发起该审批。;; 1. 当 viewer_type 为 USER，需要填写viewer_user_id；;; 2. 当 viewer_type 为DEPARTMENT，需要填写viewer_department_id；;; 3. 当 viewer_type 为TENANT或NONE时，viewer_user_id和viewer_department_id无需填写

	Form *ApprovalForm `json:"form,omitempty"` // 审批定义表单

	NodeList []*ApprovalNode `json:"node_list,omitempty"` // 审批定义节点，需要将开始节点作为 list 第一个元素，结束节点作为最后一个元素

	Settings *ApprovalSetting `json:"settings,omitempty"` // 审批定义其他设置

	Config *ApprovalConfig `json:"config,omitempty"` // 审批定义配置项，用于配置对应审批定义是否可以由用户在审批后台进行修改

	Icon *int `json:"icon,omitempty"` // 审批图标枚举，详见下方说明，默认为 0

	I18nResources []*I18nResource `json:"i18n_resources,omitempty"` // 国际化文案

	ProcessManagerIds []string `json:"process_manager_ids,omitempty"` // 根据user_id_type填写流程管理员的用户id
}

type ApprovalCreateBuilder struct {
	approvalName     string // 审批名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
	approvalNameFlag bool

	approvalCode     string // 传空表示新建
	approvalCodeFlag bool

	description     string // 审批描述的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
	descriptionFlag bool

	viewers     []*ApprovalCreateViewers // viewers 字段指定了哪些人能从审批应用的前台发起该审批。;; 1. 当 viewer_type 为 USER，需要填写viewer_user_id；;; 2. 当 viewer_type 为DEPARTMENT，需要填写viewer_department_id；;; 3. 当 viewer_type 为TENANT或NONE时，viewer_user_id和viewer_department_id无需填写
	viewersFlag bool

	form     *ApprovalForm // 审批定义表单
	formFlag bool

	nodeList     []*ApprovalNode // 审批定义节点，需要将开始节点作为 list 第一个元素，结束节点作为最后一个元素
	nodeListFlag bool

	settings     *ApprovalSetting // 审批定义其他设置
	settingsFlag bool

	config     *ApprovalConfig // 审批定义配置项，用于配置对应审批定义是否可以由用户在审批后台进行修改
	configFlag bool

	icon     int // 审批图标枚举，详见下方说明，默认为 0
	iconFlag bool

	i18nResources     []*I18nResource // 国际化文案
	i18nResourcesFlag bool

	processManagerIds     []string // 根据user_id_type填写流程管理员的用户id
	processManagerIdsFlag bool
}

func NewApprovalCreateBuilder() *ApprovalCreateBuilder {
	builder := &ApprovalCreateBuilder{}
	return builder
}

// 审批名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
//
// 示例值：@i18n@approval_name
func (builder *ApprovalCreateBuilder) ApprovalName(approvalName string) *ApprovalCreateBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 传空表示新建
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *ApprovalCreateBuilder) ApprovalCode(approvalCode string) *ApprovalCreateBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批描述的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
//
// 示例值：@i18n@description
func (builder *ApprovalCreateBuilder) Description(description string) *ApprovalCreateBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// viewers 字段指定了哪些人能从审批应用的前台发起该审批。;; 1. 当 viewer_type 为 USER，需要填写viewer_user_id；;; 2. 当 viewer_type 为DEPARTMENT，需要填写viewer_department_id；;; 3. 当 viewer_type 为TENANT或NONE时，viewer_user_id和viewer_department_id无需填写
//
// 示例值：
func (builder *ApprovalCreateBuilder) Viewers(viewers []*ApprovalCreateViewers) *ApprovalCreateBuilder {
	builder.viewers = viewers
	builder.viewersFlag = true
	return builder
}

// 审批定义表单
//
// 示例值：
func (builder *ApprovalCreateBuilder) Form(form *ApprovalForm) *ApprovalCreateBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批定义节点，需要将开始节点作为 list 第一个元素，结束节点作为最后一个元素
//
// 示例值：
func (builder *ApprovalCreateBuilder) NodeList(nodeList []*ApprovalNode) *ApprovalCreateBuilder {
	builder.nodeList = nodeList
	builder.nodeListFlag = true
	return builder
}

// 审批定义其他设置
//
// 示例值：
func (builder *ApprovalCreateBuilder) Settings(settings *ApprovalSetting) *ApprovalCreateBuilder {
	builder.settings = settings
	builder.settingsFlag = true
	return builder
}

// 审批定义配置项，用于配置对应审批定义是否可以由用户在审批后台进行修改
//
// 示例值：
func (builder *ApprovalCreateBuilder) Config(config *ApprovalConfig) *ApprovalCreateBuilder {
	builder.config = config
	builder.configFlag = true
	return builder
}

// 审批图标枚举，详见下方说明，默认为 0
//
// 示例值：0
func (builder *ApprovalCreateBuilder) Icon(icon int) *ApprovalCreateBuilder {
	builder.icon = icon
	builder.iconFlag = true
	return builder
}

// 国际化文案
//
// 示例值：
func (builder *ApprovalCreateBuilder) I18nResources(i18nResources []*I18nResource) *ApprovalCreateBuilder {
	builder.i18nResources = i18nResources
	builder.i18nResourcesFlag = true
	return builder
}

// 根据user_id_type填写流程管理员的用户id
//
// 示例值：["1c5ea995"]
func (builder *ApprovalCreateBuilder) ProcessManagerIds(processManagerIds []string) *ApprovalCreateBuilder {
	builder.processManagerIds = processManagerIds
	builder.processManagerIdsFlag = true
	return builder
}

func (builder *ApprovalCreateBuilder) Build() *ApprovalCreate {
	req := &ApprovalCreate{}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.descriptionFlag {
		req.Description = &builder.description

	}
	if builder.viewersFlag {
		req.Viewers = builder.viewers
	}
	if builder.formFlag {
		req.Form = builder.form
	}
	if builder.nodeListFlag {
		req.NodeList = builder.nodeList
	}
	if builder.settingsFlag {
		req.Settings = builder.settings
	}
	if builder.configFlag {
		req.Config = builder.config
	}
	if builder.iconFlag {
		req.Icon = &builder.icon

	}
	if builder.i18nResourcesFlag {
		req.I18nResources = builder.i18nResources
	}
	if builder.processManagerIdsFlag {
		req.ProcessManagerIds = builder.processManagerIds
	}
	return req
}

type ApprovalCreateExternal struct {
	BizName *string `json:"biz_name,omitempty"` // 列表中用于提示审批来自哪里，i18n key， 注意不需要“来自”前缀，审批中心会拼上前缀

	BizType *string `json:"biz_type,omitempty"` // 审批定义业务类别

	CreateLinkMobile *string `json:"create_link_mobile,omitempty"` // 移动端发起链接，如果设置了该链接，则会在移动端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在mobile端不显示该审批

	CreateLinkPc *string `json:"create_link_pc,omitempty"` // PC端发起链接，如果设置了该链接，则会在PC端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在PC端不显示该审批；

	SupportPc *bool `json:"support_pc,omitempty"` // 审批实例、审批任务、审批抄送是否要在PC端展示，如果为 true，则PC端列表会展示该定义下的实例信息，否则，不展示

	SupportMobile *bool `json:"support_mobile,omitempty"` // 审批实例、审批任务、审批抄送是否要在移动端展示，如果为 true，则移动端列表会展示该定义下的实例信息，否则，不展示； support_pc和support_mobile不可都为false，否则不展示

	SupportBatchRead *bool `json:"support_batch_read,omitempty"` // 是否支持批量已读

	EnableMarkReaded *bool `json:"enable_mark_readed,omitempty"` // 是否支持标注可读（该字段无效）

	EnableQuickOperate *bool `json:"enable_quick_operate,omitempty"` // 是否支持快速操作

	ActionCallbackUrl *string `json:"action_callback_url,omitempty"` // 三方系统的操作回调 url，【待审批】列表的任务审批人点同意或拒绝操作后，审批中心调用该地址通知三方系统，回调地址相关信息可参见：[三方审批快捷审批回调](https://open.feishu.cn/document/ukTMukTMukTM/ukjNyYjL5YjM24SO2IjN/quick-approval-callback)

	ActionCallbackToken *string `json:"action_callback_token,omitempty"` // 回调时带的 token， 用于业务系统验证请求来自审批,具体参考 [开放平台文档](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM)

	ActionCallbackKey *string `json:"action_callback_key,omitempty"` // 请求参数加密密钥，如果配置了该参数，则会对请求参数进行加密，业务需要对请求进行解密，加解密算法参考 [关联外部选项说明](https://open.feishu.cn/document/ukTMukTMukTM/uADM4QjLwADO04CMwgDN)

	AllowBatchOperate *bool `json:"allow_batch_operate,omitempty"` // 是否支持批量审批

	ExcludeEfficiencyStatistics *bool `json:"exclude_efficiency_statistics,omitempty"` // 审批流程数据是否不纳入效率统计
}

type ApprovalCreateExternalBuilder struct {
	bizName     string // 列表中用于提示审批来自哪里，i18n key， 注意不需要“来自”前缀，审批中心会拼上前缀
	bizNameFlag bool

	bizType     string // 审批定义业务类别
	bizTypeFlag bool

	createLinkMobile     string // 移动端发起链接，如果设置了该链接，则会在移动端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在mobile端不显示该审批
	createLinkMobileFlag bool

	createLinkPc     string // PC端发起链接，如果设置了该链接，则会在PC端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在PC端不显示该审批；
	createLinkPcFlag bool

	supportPc     bool // 审批实例、审批任务、审批抄送是否要在PC端展示，如果为 true，则PC端列表会展示该定义下的实例信息，否则，不展示
	supportPcFlag bool

	supportMobile     bool // 审批实例、审批任务、审批抄送是否要在移动端展示，如果为 true，则移动端列表会展示该定义下的实例信息，否则，不展示； support_pc和support_mobile不可都为false，否则不展示
	supportMobileFlag bool

	supportBatchRead     bool // 是否支持批量已读
	supportBatchReadFlag bool

	enableMarkReaded     bool // 是否支持标注可读（该字段无效）
	enableMarkReadedFlag bool

	enableQuickOperate     bool // 是否支持快速操作
	enableQuickOperateFlag bool

	actionCallbackUrl     string // 三方系统的操作回调 url，【待审批】列表的任务审批人点同意或拒绝操作后，审批中心调用该地址通知三方系统，回调地址相关信息可参见：[三方审批快捷审批回调](https://open.feishu.cn/document/ukTMukTMukTM/ukjNyYjL5YjM24SO2IjN/quick-approval-callback)
	actionCallbackUrlFlag bool

	actionCallbackToken     string // 回调时带的 token， 用于业务系统验证请求来自审批,具体参考 [开放平台文档](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM)
	actionCallbackTokenFlag bool

	actionCallbackKey     string // 请求参数加密密钥，如果配置了该参数，则会对请求参数进行加密，业务需要对请求进行解密，加解密算法参考 [关联外部选项说明](https://open.feishu.cn/document/ukTMukTMukTM/uADM4QjLwADO04CMwgDN)
	actionCallbackKeyFlag bool

	allowBatchOperate     bool // 是否支持批量审批
	allowBatchOperateFlag bool

	excludeEfficiencyStatistics     bool // 审批流程数据是否不纳入效率统计
	excludeEfficiencyStatisticsFlag bool
}

func NewApprovalCreateExternalBuilder() *ApprovalCreateExternalBuilder {
	builder := &ApprovalCreateExternalBuilder{}
	return builder
}

// 列表中用于提示审批来自哪里，i18n key， 注意不需要“来自”前缀，审批中心会拼上前缀
//
// 示例值：@i18n@3
func (builder *ApprovalCreateExternalBuilder) BizName(bizName string) *ApprovalCreateExternalBuilder {
	builder.bizName = bizName
	builder.bizNameFlag = true
	return builder
}

// 审批定义业务类别
//
// 示例值：permission
func (builder *ApprovalCreateExternalBuilder) BizType(bizType string) *ApprovalCreateExternalBuilder {
	builder.bizType = bizType
	builder.bizTypeFlag = true
	return builder
}

// 移动端发起链接，如果设置了该链接，则会在移动端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在mobile端不显示该审批
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?appId=cli_9c90fc38e07a9101&path=pages/approval-form/index?id=9999
func (builder *ApprovalCreateExternalBuilder) CreateLinkMobile(createLinkMobile string) *ApprovalCreateExternalBuilder {
	builder.createLinkMobile = createLinkMobile
	builder.createLinkMobileFlag = true
	return builder
}

// PC端发起链接，如果设置了该链接，则会在PC端审批发起页展示该审批，用户点击后会跳转到该链接进行发起； 如果不填，则在PC端不显示该审批；
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9c90fc38e07a9101&path=pc/pages/create-form/index?id=9999
func (builder *ApprovalCreateExternalBuilder) CreateLinkPc(createLinkPc string) *ApprovalCreateExternalBuilder {
	builder.createLinkPc = createLinkPc
	builder.createLinkPcFlag = true
	return builder
}

// 审批实例、审批任务、审批抄送是否要在PC端展示，如果为 true，则PC端列表会展示该定义下的实例信息，否则，不展示
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) SupportPc(supportPc bool) *ApprovalCreateExternalBuilder {
	builder.supportPc = supportPc
	builder.supportPcFlag = true
	return builder
}

// 审批实例、审批任务、审批抄送是否要在移动端展示，如果为 true，则移动端列表会展示该定义下的实例信息，否则，不展示； support_pc和support_mobile不可都为false，否则不展示
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) SupportMobile(supportMobile bool) *ApprovalCreateExternalBuilder {
	builder.supportMobile = supportMobile
	builder.supportMobileFlag = true
	return builder
}

// 是否支持批量已读
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) SupportBatchRead(supportBatchRead bool) *ApprovalCreateExternalBuilder {
	builder.supportBatchRead = supportBatchRead
	builder.supportBatchReadFlag = true
	return builder
}

// 是否支持标注可读（该字段无效）
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) EnableMarkReaded(enableMarkReaded bool) *ApprovalCreateExternalBuilder {
	builder.enableMarkReaded = enableMarkReaded
	builder.enableMarkReadedFlag = true
	return builder
}

// 是否支持快速操作
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) EnableQuickOperate(enableQuickOperate bool) *ApprovalCreateExternalBuilder {
	builder.enableQuickOperate = enableQuickOperate
	builder.enableQuickOperateFlag = true
	return builder
}

// 三方系统的操作回调 url，【待审批】列表的任务审批人点同意或拒绝操作后，审批中心调用该地址通知三方系统，回调地址相关信息可参见：[三方审批快捷审批回调](https://open.feishu.cn/document/ukTMukTMukTM/ukjNyYjL5YjM24SO2IjN/quick-approval-callback)
//
// 示例值：http://www.feishu.cn/approval/openapi/instanceOperate
func (builder *ApprovalCreateExternalBuilder) ActionCallbackUrl(actionCallbackUrl string) *ApprovalCreateExternalBuilder {
	builder.actionCallbackUrl = actionCallbackUrl
	builder.actionCallbackUrlFlag = true
	return builder
}

// 回调时带的 token， 用于业务系统验证请求来自审批,具体参考 [开放平台文档](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM)
//
// 示例值：sdjkljkx9lsadf110
func (builder *ApprovalCreateExternalBuilder) ActionCallbackToken(actionCallbackToken string) *ApprovalCreateExternalBuilder {
	builder.actionCallbackToken = actionCallbackToken
	builder.actionCallbackTokenFlag = true
	return builder
}

// 请求参数加密密钥，如果配置了该参数，则会对请求参数进行加密，业务需要对请求进行解密，加解密算法参考 [关联外部选项说明](https://open.feishu.cn/document/ukTMukTMukTM/uADM4QjLwADO04CMwgDN)
//
// 示例值：gfdqedvsadfgfsd
func (builder *ApprovalCreateExternalBuilder) ActionCallbackKey(actionCallbackKey string) *ApprovalCreateExternalBuilder {
	builder.actionCallbackKey = actionCallbackKey
	builder.actionCallbackKeyFlag = true
	return builder
}

// 是否支持批量审批
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) AllowBatchOperate(allowBatchOperate bool) *ApprovalCreateExternalBuilder {
	builder.allowBatchOperate = allowBatchOperate
	builder.allowBatchOperateFlag = true
	return builder
}

// 审批流程数据是否不纳入效率统计
//
// 示例值：true
func (builder *ApprovalCreateExternalBuilder) ExcludeEfficiencyStatistics(excludeEfficiencyStatistics bool) *ApprovalCreateExternalBuilder {
	builder.excludeEfficiencyStatistics = excludeEfficiencyStatistics
	builder.excludeEfficiencyStatisticsFlag = true
	return builder
}

func (builder *ApprovalCreateExternalBuilder) Build() *ApprovalCreateExternal {
	req := &ApprovalCreateExternal{}
	if builder.bizNameFlag {
		req.BizName = &builder.bizName

	}
	if builder.bizTypeFlag {
		req.BizType = &builder.bizType

	}
	if builder.createLinkMobileFlag {
		req.CreateLinkMobile = &builder.createLinkMobile

	}
	if builder.createLinkPcFlag {
		req.CreateLinkPc = &builder.createLinkPc

	}
	if builder.supportPcFlag {
		req.SupportPc = &builder.supportPc

	}
	if builder.supportMobileFlag {
		req.SupportMobile = &builder.supportMobile

	}
	if builder.supportBatchReadFlag {
		req.SupportBatchRead = &builder.supportBatchRead

	}
	if builder.enableMarkReadedFlag {
		req.EnableMarkReaded = &builder.enableMarkReaded

	}
	if builder.enableQuickOperateFlag {
		req.EnableQuickOperate = &builder.enableQuickOperate

	}
	if builder.actionCallbackUrlFlag {
		req.ActionCallbackUrl = &builder.actionCallbackUrl

	}
	if builder.actionCallbackTokenFlag {
		req.ActionCallbackToken = &builder.actionCallbackToken

	}
	if builder.actionCallbackKeyFlag {
		req.ActionCallbackKey = &builder.actionCallbackKey

	}
	if builder.allowBatchOperateFlag {
		req.AllowBatchOperate = &builder.allowBatchOperate

	}
	if builder.excludeEfficiencyStatisticsFlag {
		req.ExcludeEfficiencyStatistics = &builder.excludeEfficiencyStatistics

	}
	return req
}

type ApprovalCreateViewers struct {
	ViewerType *string `json:"viewer_type,omitempty"` // 可见人类型

	ViewerUserId *string `json:"viewer_user_id,omitempty"` // 当 viewer_type 是 USER，根据user_id_type填写用户id

	ViewerDepartmentId *string `json:"viewer_department_id,omitempty"` // 当 viewer_type 为DEPARTMENT，根据department_id_type填写部门id
}

type ApprovalCreateViewersBuilder struct {
	viewerType     string // 可见人类型
	viewerTypeFlag bool

	viewerUserId     string // 当 viewer_type 是 USER，根据user_id_type填写用户id
	viewerUserIdFlag bool

	viewerDepartmentId     string // 当 viewer_type 为DEPARTMENT，根据department_id_type填写部门id
	viewerDepartmentIdFlag bool
}

func NewApprovalCreateViewersBuilder() *ApprovalCreateViewersBuilder {
	builder := &ApprovalCreateViewersBuilder{}
	return builder
}

// 可见人类型
//
// 示例值：USER
func (builder *ApprovalCreateViewersBuilder) ViewerType(viewerType string) *ApprovalCreateViewersBuilder {
	builder.viewerType = viewerType
	builder.viewerTypeFlag = true
	return builder
}

// 当 viewer_type 是 USER，根据user_id_type填写用户id
//
// 示例值：19a294c2
func (builder *ApprovalCreateViewersBuilder) ViewerUserId(viewerUserId string) *ApprovalCreateViewersBuilder {
	builder.viewerUserId = viewerUserId
	builder.viewerUserIdFlag = true
	return builder
}

// 当 viewer_type 为DEPARTMENT，根据department_id_type填写部门id
//
// 示例值：od-ac9d697abfa990b715dcc33d58a62a9d
func (builder *ApprovalCreateViewersBuilder) ViewerDepartmentId(viewerDepartmentId string) *ApprovalCreateViewersBuilder {
	builder.viewerDepartmentId = viewerDepartmentId
	builder.viewerDepartmentIdFlag = true
	return builder
}

func (builder *ApprovalCreateViewersBuilder) Build() *ApprovalCreateViewers {
	req := &ApprovalCreateViewers{}
	if builder.viewerTypeFlag {
		req.ViewerType = &builder.viewerType

	}
	if builder.viewerUserIdFlag {
		req.ViewerUserId = &builder.viewerUserId

	}
	if builder.viewerDepartmentIdFlag {
		req.ViewerDepartmentId = &builder.viewerDepartmentId

	}
	return req
}

type ApprovalEvent struct {
	ApprovalId *string `json:"approval_id,omitempty"` //

	ApprovalCode *string `json:"approval_code,omitempty"` //

	VersionId *string `json:"version_id,omitempty"` //

	WidgetGroupType *int `json:"widget_group_type,omitempty"` //

	FormDefinitionId *string `json:"form_definition_id,omitempty"` //

	ProcessObj *string `json:"process_obj,omitempty"` //

	Timestamp *string `json:"timestamp,omitempty"` //

	Extra *string `json:"extra,omitempty"` //
}

type ApprovalEventBuilder struct {
	approvalId     string //
	approvalIdFlag bool

	approvalCode     string //
	approvalCodeFlag bool

	versionId     string //
	versionIdFlag bool

	widgetGroupType     int //
	widgetGroupTypeFlag bool

	formDefinitionId     string //
	formDefinitionIdFlag bool

	processObj     string //
	processObjFlag bool

	timestamp     string //
	timestampFlag bool

	extra     string //
	extraFlag bool
}

func NewApprovalEventBuilder() *ApprovalEventBuilder {
	builder := &ApprovalEventBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) ApprovalId(approvalId string) *ApprovalEventBuilder {
	builder.approvalId = approvalId
	builder.approvalIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) ApprovalCode(approvalCode string) *ApprovalEventBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) VersionId(versionId string) *ApprovalEventBuilder {
	builder.versionId = versionId
	builder.versionIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) WidgetGroupType(widgetGroupType int) *ApprovalEventBuilder {
	builder.widgetGroupType = widgetGroupType
	builder.widgetGroupTypeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) FormDefinitionId(formDefinitionId string) *ApprovalEventBuilder {
	builder.formDefinitionId = formDefinitionId
	builder.formDefinitionIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) ProcessObj(processObj string) *ApprovalEventBuilder {
	builder.processObj = processObj
	builder.processObjFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) Timestamp(timestamp string) *ApprovalEventBuilder {
	builder.timestamp = timestamp
	builder.timestampFlag = true
	return builder
}

//
//
// 示例值：
func (builder *ApprovalEventBuilder) Extra(extra string) *ApprovalEventBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

func (builder *ApprovalEventBuilder) Build() *ApprovalEvent {
	req := &ApprovalEvent{}
	if builder.approvalIdFlag {
		req.ApprovalId = &builder.approvalId

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.versionIdFlag {
		req.VersionId = &builder.versionId

	}
	if builder.widgetGroupTypeFlag {
		req.WidgetGroupType = &builder.widgetGroupType

	}
	if builder.formDefinitionIdFlag {
		req.FormDefinitionId = &builder.formDefinitionId

	}
	if builder.processObjFlag {
		req.ProcessObj = &builder.processObj

	}
	if builder.timestampFlag {
		req.Timestamp = &builder.timestamp

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

	}
	return req
}

type ApprovalForm struct {
	FormContent *string `json:"form_content,omitempty"` // 审批定义表单，json 数组，见下方form_content字段说明

	WidgetRelation *string `json:"widget_relation,omitempty"` // 控件之间数据条件约束表达式
}

type ApprovalFormBuilder struct {
	formContent     string // 审批定义表单，json 数组，见下方form_content字段说明
	formContentFlag bool

	widgetRelation     string // 控件之间数据条件约束表达式
	widgetRelationFlag bool
}

func NewApprovalFormBuilder() *ApprovalFormBuilder {
	builder := &ApprovalFormBuilder{}
	return builder
}

// 审批定义表单，json 数组，见下方form_content字段说明
//
// 示例值：[{\"id\":\"user_name\", \"type\": \"input\", \"required\":true, \"name\":\"@i18n@widget1\"}]
func (builder *ApprovalFormBuilder) FormContent(formContent string) *ApprovalFormBuilder {
	builder.formContent = formContent
	builder.formContentFlag = true
	return builder
}

// 控件之间数据条件约束表达式
//
// 示例值：{\"groups\":[{\"id\":\"1\",\"parent_widgets_ids\":[\"widget1\",\"widget4\"],\"children_widget_ids\":[\"widget2.widget3\"],\"conditions\":[{\"parents_expr\":{\"type\":\"Multi\",\"expr\":{\"type\":\"and\",\"exprs\":[{\"type\":\"SingleWidget\",\"expr\":{\"type\":\"in\",\"widget_id\":\"widget1\",\"expect\":{\"type\":\"local\",\"value\":[{\"value\":\"value_0\"},{\"value\":\"value_1\"}]}}},{\"type\":\"Const\",\"expr\":{\"value\":true,\"widget_ids\":[\"widget4\"]}}]}},\"children_rule\":{\"expr\":{\"type\":\"SingleWidget\",\"expr\":{\"type\":\"in\",\"widget_id\":\"widget2.widget3\",\"expect\":{\"type\":\"local\",\"value\":[{\"value\":\"value_3\"},{\"value\":\"value_5\"}]}}},\"actions\":[{\"type\":\"SetOptions\",\"widget_id\":\"widget2.widget3\",\"value\":{\"type\":\"local\",\"value\":[{\"value\":\"value_3\"},{\"value\":\"value_4\"}]}}]}}]}]}
func (builder *ApprovalFormBuilder) WidgetRelation(widgetRelation string) *ApprovalFormBuilder {
	builder.widgetRelation = widgetRelation
	builder.widgetRelationFlag = true
	return builder
}

func (builder *ApprovalFormBuilder) Build() *ApprovalForm {
	req := &ApprovalForm{}
	if builder.formContentFlag {
		req.FormContent = &builder.formContent

	}
	if builder.widgetRelationFlag {
		req.WidgetRelation = &builder.widgetRelation

	}
	return req
}

type ApprovalNode struct {
	Id *string `json:"id,omitempty"` // 节点 ID，开始节点的 ID 为 START，结束节点的 ID 为 END，开始和结束节点不需要指定 name、node_type 以及 approver

	Name *string `json:"name,omitempty"` // 节点名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符

	NodeType *string `json:"node_type,omitempty"` // 审批类型枚举,当 node_type 为依次审批时，审批人必须为『发起人自选』

	Approver []*ApprovalApproverCcer `json:"approver,omitempty"` // 审批人列表

	Ccer []*ApprovalApproverCcer `json:"ccer,omitempty"` // 抄送人列表

	PrivilegeField *FieldGroup `json:"privilege_field,omitempty"` // 表单项的控件权限

	ApproverChosenMulti *bool `json:"approver_chosen_multi,omitempty"` // 自选审批人是否允许多选

	ApproverChosenRange []*ApproverRange `json:"approver_chosen_range,omitempty"` // 自选审批人选择范围

	StarterAssignee *string `json:"starter_assignee,omitempty"` // 审批人为提交人时的操作
}

type ApprovalNodeBuilder struct {
	id     string // 节点 ID，开始节点的 ID 为 START，结束节点的 ID 为 END，开始和结束节点不需要指定 name、node_type 以及 approver
	idFlag bool

	name     string // 节点名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
	nameFlag bool

	nodeType     string // 审批类型枚举,当 node_type 为依次审批时，审批人必须为『发起人自选』
	nodeTypeFlag bool

	approver     []*ApprovalApproverCcer // 审批人列表
	approverFlag bool

	ccer     []*ApprovalApproverCcer // 抄送人列表
	ccerFlag bool

	privilegeField     *FieldGroup // 表单项的控件权限
	privilegeFieldFlag bool

	approverChosenMulti     bool // 自选审批人是否允许多选
	approverChosenMultiFlag bool

	approverChosenRange     []*ApproverRange // 自选审批人选择范围
	approverChosenRangeFlag bool

	starterAssignee     string // 审批人为提交人时的操作
	starterAssigneeFlag bool
}

func NewApprovalNodeBuilder() *ApprovalNodeBuilder {
	builder := &ApprovalNodeBuilder{}
	return builder
}

// 节点 ID，开始节点的 ID 为 START，结束节点的 ID 为 END，开始和结束节点不需要指定 name、node_type 以及 approver
//
// 示例值：START
func (builder *ApprovalNodeBuilder) Id(id string) *ApprovalNodeBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 节点名称的国际化文案 Key，以 @i18n@ 开头，长度不得少于 9 个字符
//
// 示例值：@i18n@node_name
func (builder *ApprovalNodeBuilder) Name(name string) *ApprovalNodeBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 审批类型枚举,当 node_type 为依次审批时，审批人必须为『发起人自选』
//
// 示例值：AND
func (builder *ApprovalNodeBuilder) NodeType(nodeType string) *ApprovalNodeBuilder {
	builder.nodeType = nodeType
	builder.nodeTypeFlag = true
	return builder
}

// 审批人列表
//
// 示例值：
func (builder *ApprovalNodeBuilder) Approver(approver []*ApprovalApproverCcer) *ApprovalNodeBuilder {
	builder.approver = approver
	builder.approverFlag = true
	return builder
}

// 抄送人列表
//
// 示例值：
func (builder *ApprovalNodeBuilder) Ccer(ccer []*ApprovalApproverCcer) *ApprovalNodeBuilder {
	builder.ccer = ccer
	builder.ccerFlag = true
	return builder
}

// 表单项的控件权限
//
// 示例值：
func (builder *ApprovalNodeBuilder) PrivilegeField(privilegeField *FieldGroup) *ApprovalNodeBuilder {
	builder.privilegeField = privilegeField
	builder.privilegeFieldFlag = true
	return builder
}

// 自选审批人是否允许多选
//
// 示例值：false
func (builder *ApprovalNodeBuilder) ApproverChosenMulti(approverChosenMulti bool) *ApprovalNodeBuilder {
	builder.approverChosenMulti = approverChosenMulti
	builder.approverChosenMultiFlag = true
	return builder
}

// 自选审批人选择范围
//
// 示例值：
func (builder *ApprovalNodeBuilder) ApproverChosenRange(approverChosenRange []*ApproverRange) *ApprovalNodeBuilder {
	builder.approverChosenRange = approverChosenRange
	builder.approverChosenRangeFlag = true
	return builder
}

// 审批人为提交人时的操作
//
// 示例值：STARTER
func (builder *ApprovalNodeBuilder) StarterAssignee(starterAssignee string) *ApprovalNodeBuilder {
	builder.starterAssignee = starterAssignee
	builder.starterAssigneeFlag = true
	return builder
}

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

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

	}
	if builder.nodeTypeFlag {
		req.NodeType = &builder.nodeType

	}
	if builder.approverFlag {
		req.Approver = builder.approver
	}
	if builder.ccerFlag {
		req.Ccer = builder.ccer
	}
	if builder.privilegeFieldFlag {
		req.PrivilegeField = builder.privilegeField
	}
	if builder.approverChosenMultiFlag {
		req.ApproverChosenMulti = &builder.approverChosenMulti

	}
	if builder.approverChosenRangeFlag {
		req.ApproverChosenRange = builder.approverChosenRange
	}
	if builder.starterAssigneeFlag {
		req.StarterAssignee = &builder.starterAssignee

	}
	return req
}

type ApprovalNodeInfo struct {
	Name *string `json:"name,omitempty"` // 节点名称

	NeedApprover *bool `json:"need_approver,omitempty"` // 是否发起人自选节点 true - 发起审批时需要提交审批人

	NodeId *string `json:"node_id,omitempty"` // 节点 ID

	CustomNodeId *string `json:"custom_node_id,omitempty"` // 节点自定义 ID，如果没有设置则不返回

	NodeType *string `json:"node_type,omitempty"` // 审批方式

	ApproverChosenMulti *bool `json:"approver_chosen_multi,omitempty"` // 是否支持多选：true-支持，发起、结束节点该值无意义

	ApproverChosenRange []*ApproverChosenRange `json:"approver_chosen_range,omitempty"` // 自选范围

	RequireSignature *bool `json:"require_signature,omitempty"` // 是否签名
}

type ApprovalNodeInfoBuilder struct {
	name     string // 节点名称
	nameFlag bool

	needApprover     bool // 是否发起人自选节点 true - 发起审批时需要提交审批人
	needApproverFlag bool

	nodeId     string // 节点 ID
	nodeIdFlag bool

	customNodeId     string // 节点自定义 ID，如果没有设置则不返回
	customNodeIdFlag bool

	nodeType     string // 审批方式
	nodeTypeFlag bool

	approverChosenMulti     bool // 是否支持多选：true-支持，发起、结束节点该值无意义
	approverChosenMultiFlag bool

	approverChosenRange     []*ApproverChosenRange // 自选范围
	approverChosenRangeFlag bool

	requireSignature     bool // 是否签名
	requireSignatureFlag bool
}

func NewApprovalNodeInfoBuilder() *ApprovalNodeInfoBuilder {
	builder := &ApprovalNodeInfoBuilder{}
	return builder
}

// 节点名称
//
// 示例值：Approval
func (builder *ApprovalNodeInfoBuilder) Name(name string) *ApprovalNodeInfoBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 是否发起人自选节点 true - 发起审批时需要提交审批人
//
// 示例值：true
func (builder *ApprovalNodeInfoBuilder) NeedApprover(needApprover bool) *ApprovalNodeInfoBuilder {
	builder.needApprover = needApprover
	builder.needApproverFlag = true
	return builder
}

// 节点 ID
//
// 示例值：46e6d96cfa756980907209209ec03b64
func (builder *ApprovalNodeInfoBuilder) NodeId(nodeId string) *ApprovalNodeInfoBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// 节点自定义 ID，如果没有设置则不返回
//
// 示例值：46e6d96cfa756980907209209ec03b64
func (builder *ApprovalNodeInfoBuilder) CustomNodeId(customNodeId string) *ApprovalNodeInfoBuilder {
	builder.customNodeId = customNodeId
	builder.customNodeIdFlag = true
	return builder
}

// 审批方式
//
// 示例值：AND
func (builder *ApprovalNodeInfoBuilder) NodeType(nodeType string) *ApprovalNodeInfoBuilder {
	builder.nodeType = nodeType
	builder.nodeTypeFlag = true
	return builder
}

// 是否支持多选：true-支持，发起、结束节点该值无意义
//
// 示例值：true
func (builder *ApprovalNodeInfoBuilder) ApproverChosenMulti(approverChosenMulti bool) *ApprovalNodeInfoBuilder {
	builder.approverChosenMulti = approverChosenMulti
	builder.approverChosenMultiFlag = true
	return builder
}

// 自选范围
//
// 示例值：
func (builder *ApprovalNodeInfoBuilder) ApproverChosenRange(approverChosenRange []*ApproverChosenRange) *ApprovalNodeInfoBuilder {
	builder.approverChosenRange = approverChosenRange
	builder.approverChosenRangeFlag = true
	return builder
}

// 是否签名
//
// 示例值：false
func (builder *ApprovalNodeInfoBuilder) RequireSignature(requireSignature bool) *ApprovalNodeInfoBuilder {
	builder.requireSignature = requireSignature
	builder.requireSignatureFlag = true
	return builder
}

func (builder *ApprovalNodeInfoBuilder) Build() *ApprovalNodeInfo {
	req := &ApprovalNodeInfo{}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.needApproverFlag {
		req.NeedApprover = &builder.needApprover

	}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.customNodeIdFlag {
		req.CustomNodeId = &builder.customNodeId

	}
	if builder.nodeTypeFlag {
		req.NodeType = &builder.nodeType

	}
	if builder.approverChosenMultiFlag {
		req.ApproverChosenMulti = &builder.approverChosenMulti

	}
	if builder.approverChosenRangeFlag {
		req.ApproverChosenRange = builder.approverChosenRange
	}
	if builder.requireSignatureFlag {
		req.RequireSignature = &builder.requireSignature

	}
	return req
}

type ApprovalSetting struct {
	RevertInterval *int `json:"revert_interval,omitempty"` // 审批实例通过后允许撤回的时间，以秒为单位，默认 31 天，0 为不可撤回

	RevertOption *int `json:"revert_option,omitempty"` // 是否支持审批通过第一个节点后撤回，默认为1，0为不支持

	RejectOption *int `json:"reject_option,omitempty"` // 拒绝设置

	QuickApprovalOption *int `json:"quick_approval_option,omitempty"` // 快捷审批配置项，开启后可在卡片上直接审批。默认值1为启用， 0为禁用

	OvertimeDisable *bool `json:"overtime_disable,omitempty"` // 流程关闭超时配置，传true就是关闭超时配置

	OvertimeNoticeTime *int `json:"overtime_notice_time,omitempty"` // 单据未处理超时时间，单位天

	OvertimeCloseTime *int `json:"overtime_close_time,omitempty"` // 单据已超时后，自动关闭时间，单位天

	OvertimeRecoverTime *int `json:"overtime_recover_time,omitempty"` // 单据自动关闭后，可恢复时间，单位天
}

type ApprovalSettingBuilder struct {
	revertInterval     int // 审批实例通过后允许撤回的时间，以秒为单位，默认 31 天，0 为不可撤回
	revertIntervalFlag bool

	revertOption     int // 是否支持审批通过第一个节点后撤回，默认为1，0为不支持
	revertOptionFlag bool

	rejectOption     int // 拒绝设置
	rejectOptionFlag bool

	quickApprovalOption     int // 快捷审批配置项，开启后可在卡片上直接审批。默认值1为启用， 0为禁用
	quickApprovalOptionFlag bool

	overtimeDisable     bool // 流程关闭超时配置，传true就是关闭超时配置
	overtimeDisableFlag bool

	overtimeNoticeTime     int // 单据未处理超时时间，单位天
	overtimeNoticeTimeFlag bool

	overtimeCloseTime     int // 单据已超时后，自动关闭时间，单位天
	overtimeCloseTimeFlag bool

	overtimeRecoverTime     int // 单据自动关闭后，可恢复时间，单位天
	overtimeRecoverTimeFlag bool
}

func NewApprovalSettingBuilder() *ApprovalSettingBuilder {
	builder := &ApprovalSettingBuilder{}
	return builder
}

// 审批实例通过后允许撤回的时间，以秒为单位，默认 31 天，0 为不可撤回
//
// 示例值：0
func (builder *ApprovalSettingBuilder) RevertInterval(revertInterval int) *ApprovalSettingBuilder {
	builder.revertInterval = revertInterval
	builder.revertIntervalFlag = true
	return builder
}

// 是否支持审批通过第一个节点后撤回，默认为1，0为不支持
//
// 示例值：0
func (builder *ApprovalSettingBuilder) RevertOption(revertOption int) *ApprovalSettingBuilder {
	builder.revertOption = revertOption
	builder.revertOptionFlag = true
	return builder
}

// 拒绝设置
//
// 示例值：0
func (builder *ApprovalSettingBuilder) RejectOption(rejectOption int) *ApprovalSettingBuilder {
	builder.rejectOption = rejectOption
	builder.rejectOptionFlag = true
	return builder
}

// 快捷审批配置项，开启后可在卡片上直接审批。默认值1为启用， 0为禁用
//
// 示例值：1
func (builder *ApprovalSettingBuilder) QuickApprovalOption(quickApprovalOption int) *ApprovalSettingBuilder {
	builder.quickApprovalOption = quickApprovalOption
	builder.quickApprovalOptionFlag = true
	return builder
}

// 流程关闭超时配置，传true就是关闭超时配置
//
// 示例值：true
func (builder *ApprovalSettingBuilder) OvertimeDisable(overtimeDisable bool) *ApprovalSettingBuilder {
	builder.overtimeDisable = overtimeDisable
	builder.overtimeDisableFlag = true
	return builder
}

// 单据未处理超时时间，单位天
//
// 示例值：0
func (builder *ApprovalSettingBuilder) OvertimeNoticeTime(overtimeNoticeTime int) *ApprovalSettingBuilder {
	builder.overtimeNoticeTime = overtimeNoticeTime
	builder.overtimeNoticeTimeFlag = true
	return builder
}

// 单据已超时后，自动关闭时间，单位天
//
// 示例值：0
func (builder *ApprovalSettingBuilder) OvertimeCloseTime(overtimeCloseTime int) *ApprovalSettingBuilder {
	builder.overtimeCloseTime = overtimeCloseTime
	builder.overtimeCloseTimeFlag = true
	return builder
}

// 单据自动关闭后，可恢复时间，单位天
//
// 示例值：0
func (builder *ApprovalSettingBuilder) OvertimeRecoverTime(overtimeRecoverTime int) *ApprovalSettingBuilder {
	builder.overtimeRecoverTime = overtimeRecoverTime
	builder.overtimeRecoverTimeFlag = true
	return builder
}

func (builder *ApprovalSettingBuilder) Build() *ApprovalSetting {
	req := &ApprovalSetting{}
	if builder.revertIntervalFlag {
		req.RevertInterval = &builder.revertInterval

	}
	if builder.revertOptionFlag {
		req.RevertOption = &builder.revertOption

	}
	if builder.rejectOptionFlag {
		req.RejectOption = &builder.rejectOption

	}
	if builder.quickApprovalOptionFlag {
		req.QuickApprovalOption = &builder.quickApprovalOption

	}
	if builder.overtimeDisableFlag {
		req.OvertimeDisable = &builder.overtimeDisable

	}
	if builder.overtimeNoticeTimeFlag {
		req.OvertimeNoticeTime = &builder.overtimeNoticeTime

	}
	if builder.overtimeCloseTimeFlag {
		req.OvertimeCloseTime = &builder.overtimeCloseTime

	}
	if builder.overtimeRecoverTimeFlag {
		req.OvertimeRecoverTime = &builder.overtimeRecoverTime

	}
	return req
}

type ApprovalViewer struct {
	Type *string `json:"type,omitempty"` // 可见人类型，人员、部门或全体

	OpenId *string `json:"open_id,omitempty"` // 同一个应用中对用户进行标识的id

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

	UnionId *string `json:"union_id,omitempty"` // 同一个应用开发主体下对用户进行标识的id
}

type ApprovalViewerBuilder struct {
	type_    string // 可见人类型，人员、部门或全体
	typeFlag bool

	openId     string // 同一个应用中对用户进行标识的id
	openIdFlag bool

	userId     string // 用户id
	userIdFlag bool

	unionId     string // 同一个应用开发主体下对用户进行标识的id
	unionIdFlag bool
}

func NewApprovalViewerBuilder() *ApprovalViewerBuilder {
	builder := &ApprovalViewerBuilder{}
	return builder
}

// 可见人类型，人员、部门或全体
//
// 示例值：TENANT
func (builder *ApprovalViewerBuilder) Type(type_ string) *ApprovalViewerBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 同一个应用中对用户进行标识的id
//
// 示例值：ou_e03053f0541cecc3269d7a9dc34a0b21
func (builder *ApprovalViewerBuilder) OpenId(openId string) *ApprovalViewerBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

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

// 同一个应用开发主体下对用户进行标识的id
//
// 示例值：f7cb567e
func (builder *ApprovalViewerBuilder) UnionId(unionId string) *ApprovalViewerBuilder {
	builder.unionId = unionId
	builder.unionIdFlag = true
	return builder
}

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

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

	}
	if builder.unionIdFlag {
		req.UnionId = &builder.unionId

	}
	return req
}

type ApprovalViewerInfo struct {
	Type *string `json:"type,omitempty"` // 可见人类型

	Id *string `json:"id,omitempty"` // 在可见人类型为DEPARTMENT时，id为部门的id ；在可见人类型为USER时，id为用户的id ；在可见人类型为ROLE时，id为角色的id ；在可见人类型为USER_GROUP时，id为用户组的id

	UserId *string `json:"user_id,omitempty"` // 在可见人类型为USER时，表示可见人用户id
}

type ApprovalViewerInfoBuilder struct {
	type_    string // 可见人类型
	typeFlag bool

	id     string // 在可见人类型为DEPARTMENT时，id为部门的id ；在可见人类型为USER时，id为用户的id ；在可见人类型为ROLE时，id为角色的id ；在可见人类型为USER_GROUP时，id为用户组的id
	idFlag bool

	userId     string // 在可见人类型为USER时，表示可见人用户id
	userIdFlag bool
}

func NewApprovalViewerInfoBuilder() *ApprovalViewerInfoBuilder {
	builder := &ApprovalViewerInfoBuilder{}
	return builder
}

// 可见人类型
//
// 示例值：TENANT
func (builder *ApprovalViewerInfoBuilder) Type(type_ string) *ApprovalViewerInfoBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 在可见人类型为DEPARTMENT时，id为部门的id ；在可见人类型为USER时，id为用户的id ；在可见人类型为ROLE时，id为角色的id ；在可见人类型为USER_GROUP时，id为用户组的id
//
// 示例值：ou_e03053f0541cecc3269d7a9dc34a0b21
func (builder *ApprovalViewerInfoBuilder) Id(id string) *ApprovalViewerInfoBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 在可见人类型为USER时，表示可见人用户id
//
// 示例值：f7cb567e
func (builder *ApprovalViewerInfoBuilder) UserId(userId string) *ApprovalViewerInfoBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

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

	}
	if builder.idFlag {
		req.Id = &builder.id

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

	}
	return req
}

type ApproverChosenRange struct {
	ApproverRangeType *int `json:"approver_range_type,omitempty"` // 指定范围：0-all，1-指定角色，2-指定人员

	ApproverRangeIds []string `json:"approver_range_ids,omitempty"` // 根据上面的type，分别存放角色id与userid，type为0时本字段为空列表
}

type ApproverChosenRangeBuilder struct {
	approverRangeType     int // 指定范围：0-all，1-指定角色，2-指定人员
	approverRangeTypeFlag bool

	approverRangeIds     []string // 根据上面的type，分别存放角色id与userid，type为0时本字段为空列表
	approverRangeIdsFlag bool
}

func NewApproverChosenRangeBuilder() *ApproverChosenRangeBuilder {
	builder := &ApproverChosenRangeBuilder{}
	return builder
}

// 指定范围：0-all，1-指定角色，2-指定人员
//
// 示例值：2
func (builder *ApproverChosenRangeBuilder) ApproverRangeType(approverRangeType int) *ApproverChosenRangeBuilder {
	builder.approverRangeType = approverRangeType
	builder.approverRangeTypeFlag = true
	return builder
}

// 根据上面的type，分别存放角色id与userid，type为0时本字段为空列表
//
// 示例值：
func (builder *ApproverChosenRangeBuilder) ApproverRangeIds(approverRangeIds []string) *ApproverChosenRangeBuilder {
	builder.approverRangeIds = approverRangeIds
	builder.approverRangeIdsFlag = true
	return builder
}

func (builder *ApproverChosenRangeBuilder) Build() *ApproverChosenRange {
	req := &ApproverChosenRange{}
	if builder.approverRangeTypeFlag {
		req.ApproverRangeType = &builder.approverRangeType

	}
	if builder.approverRangeIdsFlag {
		req.ApproverRangeIds = builder.approverRangeIds
	}
	return req
}

type ApproverRange struct {
	Type *string `json:"type,omitempty"` // 审批人类型

	IdList []string `json:"id_list,omitempty"` // 审批人id
}

type ApproverRangeBuilder struct {
	type_    string // 审批人类型
	typeFlag bool

	idList     []string // 审批人id
	idListFlag bool
}

func NewApproverRangeBuilder() *ApproverRangeBuilder {
	builder := &ApproverRangeBuilder{}
	return builder
}

// 审批人类型
//
// 示例值：ALL
func (builder *ApproverRangeBuilder) Type(type_ string) *ApproverRangeBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 审批人id
//
// 示例值：f7cb567e
func (builder *ApproverRangeBuilder) IdList(idList []string) *ApproverRangeBuilder {
	builder.idList = idList
	builder.idListFlag = true
	return builder
}

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

	}
	if builder.idListFlag {
		req.IdList = builder.idList
	}
	return req
}

type CcNode struct {
	CcId *string `json:"cc_id,omitempty"` // 审批实例内唯一标识

	UserId *string `json:"user_id,omitempty"` // 抄送人 employee id

	OpenId *string `json:"open_id,omitempty"` // 抄送人 open id，和user id 二者至少填一个

	Links *ExternalInstanceLink `json:"links,omitempty"` // 跳转链接，用于【抄送我的】列表中的跳转pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响

	ReadStatus *string `json:"read_status,omitempty"` // 阅读状态，空值表示不支持已读未读：

	Extra *string `json:"extra,omitempty"` // 扩展 json

	Title *string `json:"title,omitempty"` // 抄送任务名称

	CreateTime *string `json:"create_time,omitempty"` // 抄送发起时间，Unix 毫秒时间戳

	UpdateTime *string `json:"update_time,omitempty"` // 抄送最近更新时间，用于推送数据版本控制更新策略同 instance 的update_time

	DisplayMethod *string `json:"display_method,omitempty"` // 列表页打开审批任务的方式
}

type CcNodeBuilder struct {
	ccId     string // 审批实例内唯一标识
	ccIdFlag bool

	userId     string // 抄送人 employee id
	userIdFlag bool

	openId     string // 抄送人 open id，和user id 二者至少填一个
	openIdFlag bool

	links     *ExternalInstanceLink // 跳转链接，用于【抄送我的】列表中的跳转pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
	linksFlag bool

	readStatus     string // 阅读状态，空值表示不支持已读未读：
	readStatusFlag bool

	extra     string // 扩展 json
	extraFlag bool

	title     string // 抄送任务名称
	titleFlag bool

	createTime     string // 抄送发起时间，Unix 毫秒时间戳
	createTimeFlag bool

	updateTime     string // 抄送最近更新时间，用于推送数据版本控制更新策略同 instance 的update_time
	updateTimeFlag bool

	displayMethod     string // 列表页打开审批任务的方式
	displayMethodFlag bool
}

func NewCcNodeBuilder() *CcNodeBuilder {
	builder := &CcNodeBuilder{}
	return builder
}

// 审批实例内唯一标识
//
// 示例值：123456
func (builder *CcNodeBuilder) CcId(ccId string) *CcNodeBuilder {
	builder.ccId = ccId
	builder.ccIdFlag = true
	return builder
}

// 抄送人 employee id
//
// 示例值：12345
func (builder *CcNodeBuilder) UserId(userId string) *CcNodeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 抄送人 open id，和user id 二者至少填一个
//
// 示例值：ou_be73cbc0ee35eb6ca54e9e7cc14998c1
func (builder *CcNodeBuilder) OpenId(openId string) *CcNodeBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 跳转链接，用于【抄送我的】列表中的跳转pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
//
// 示例值：
func (builder *CcNodeBuilder) Links(links *ExternalInstanceLink) *CcNodeBuilder {
	builder.links = links
	builder.linksFlag = true
	return builder
}

// 阅读状态，空值表示不支持已读未读：
//
// 示例值：READ
func (builder *CcNodeBuilder) ReadStatus(readStatus string) *CcNodeBuilder {
	builder.readStatus = readStatus
	builder.readStatusFlag = true
	return builder
}

// 扩展 json
//
// 示例值：{\"xxx\":\"xxx\"}
func (builder *CcNodeBuilder) Extra(extra string) *CcNodeBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 抄送任务名称
//
// 示例值：xxx
func (builder *CcNodeBuilder) Title(title string) *CcNodeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 抄送发起时间，Unix 毫秒时间戳
//
// 示例值：1556468012678
func (builder *CcNodeBuilder) CreateTime(createTime string) *CcNodeBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 抄送最近更新时间，用于推送数据版本控制更新策略同 instance 的update_time
//
// 示例值：1556468012678
func (builder *CcNodeBuilder) UpdateTime(updateTime string) *CcNodeBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 列表页打开审批任务的方式
//
// 示例值：BROWSER
func (builder *CcNodeBuilder) DisplayMethod(displayMethod string) *CcNodeBuilder {
	builder.displayMethod = displayMethod
	builder.displayMethodFlag = true
	return builder
}

func (builder *CcNodeBuilder) Build() *CcNode {
	req := &CcNode{}
	if builder.ccIdFlag {
		req.CcId = &builder.ccId

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.linksFlag {
		req.Links = builder.links
	}
	if builder.readStatusFlag {
		req.ReadStatus = &builder.readStatus

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

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

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

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

	}
	if builder.displayMethodFlag {
		req.DisplayMethod = &builder.displayMethod

	}
	return req
}

type CcSearch struct {
	UserId *string `json:"user_id,omitempty"` // 根据x_user_type填写用户 id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 code

	InstanceExternalId *string `json:"instance_external_id,omitempty"` // 审批实例第三方 id 注：和 approval_code 取并集

	GroupExternalId *string `json:"group_external_id,omitempty"` // 审批定义分组第三方 id 注：和 instance_code 取并集

	CcTitle *string `json:"cc_title,omitempty"` // 审批抄送标题（只有第三方审批有）

	ReadStatus *string `json:"read_status,omitempty"` // 审批抄送状态，注：若不设置，查询全部状态 若不在集合中，报错

	CcCreateTimeFrom *string `json:"cc_create_time_from,omitempty"` // 抄送查询开始时间（unix毫秒时间戳）

	CcCreateTimeTo *string `json:"cc_create_time_to,omitempty"` // 抄送查询结束时间 (unix毫秒时间戳)

	Locale *string `json:"locale,omitempty"` // 地区

	WithRevokedInstance *bool `json:"with_revoked_instance,omitempty"` // 是否包含撤销申请对应的审批单
}

type CcSearchBuilder struct {
	userId     string // 根据x_user_type填写用户 id
	userIdFlag bool

	approvalCode     string // 审批定义 code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 code
	instanceCodeFlag bool

	instanceExternalId     string // 审批实例第三方 id 注：和 approval_code 取并集
	instanceExternalIdFlag bool

	groupExternalId     string // 审批定义分组第三方 id 注：和 instance_code 取并集
	groupExternalIdFlag bool

	ccTitle     string // 审批抄送标题（只有第三方审批有）
	ccTitleFlag bool

	readStatus     string // 审批抄送状态，注：若不设置，查询全部状态 若不在集合中，报错
	readStatusFlag bool

	ccCreateTimeFrom     string // 抄送查询开始时间（unix毫秒时间戳）
	ccCreateTimeFromFlag bool

	ccCreateTimeTo     string // 抄送查询结束时间 (unix毫秒时间戳)
	ccCreateTimeToFlag bool

	locale     string // 地区
	localeFlag bool

	withRevokedInstance     bool // 是否包含撤销申请对应的审批单
	withRevokedInstanceFlag bool
}

func NewCcSearchBuilder() *CcSearchBuilder {
	builder := &CcSearchBuilder{}
	return builder
}

// 根据x_user_type填写用户 id
//
// 示例值：lwiu098wj
func (builder *CcSearchBuilder) UserId(userId string) *CcSearchBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED942
func (builder *CcSearchBuilder) ApprovalCode(approvalCode string) *CcSearchBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *CcSearchBuilder) InstanceCode(instanceCode string) *CcSearchBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 审批实例第三方 id 注：和 approval_code 取并集
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED976
func (builder *CcSearchBuilder) InstanceExternalId(instanceExternalId string) *CcSearchBuilder {
	builder.instanceExternalId = instanceExternalId
	builder.instanceExternalIdFlag = true
	return builder
}

// 审批定义分组第三方 id 注：和 instance_code 取并集
//
// 示例值：1234567
func (builder *CcSearchBuilder) GroupExternalId(groupExternalId string) *CcSearchBuilder {
	builder.groupExternalId = groupExternalId
	builder.groupExternalIdFlag = true
	return builder
}

// 审批抄送标题（只有第三方审批有）
//
// 示例值：test
func (builder *CcSearchBuilder) CcTitle(ccTitle string) *CcSearchBuilder {
	builder.ccTitle = ccTitle
	builder.ccTitleFlag = true
	return builder
}

// 审批抄送状态，注：若不设置，查询全部状态 若不在集合中，报错
//
// 示例值：read
func (builder *CcSearchBuilder) ReadStatus(readStatus string) *CcSearchBuilder {
	builder.readStatus = readStatus
	builder.readStatusFlag = true
	return builder
}

// 抄送查询开始时间（unix毫秒时间戳）
//
// 示例值：1547654251506
func (builder *CcSearchBuilder) CcCreateTimeFrom(ccCreateTimeFrom string) *CcSearchBuilder {
	builder.ccCreateTimeFrom = ccCreateTimeFrom
	builder.ccCreateTimeFromFlag = true
	return builder
}

// 抄送查询结束时间 (unix毫秒时间戳)
//
// 示例值：1547654251506
func (builder *CcSearchBuilder) CcCreateTimeTo(ccCreateTimeTo string) *CcSearchBuilder {
	builder.ccCreateTimeTo = ccCreateTimeTo
	builder.ccCreateTimeToFlag = true
	return builder
}

// 地区
//
// 示例值：zh-CN
func (builder *CcSearchBuilder) Locale(locale string) *CcSearchBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 是否包含撤销申请对应的审批单
//
// 示例值：false
func (builder *CcSearchBuilder) WithRevokedInstance(withRevokedInstance bool) *CcSearchBuilder {
	builder.withRevokedInstance = withRevokedInstance
	builder.withRevokedInstanceFlag = true
	return builder
}

func (builder *CcSearchBuilder) Build() *CcSearch {
	req := &CcSearch{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.instanceExternalIdFlag {
		req.InstanceExternalId = &builder.instanceExternalId

	}
	if builder.groupExternalIdFlag {
		req.GroupExternalId = &builder.groupExternalId

	}
	if builder.ccTitleFlag {
		req.CcTitle = &builder.ccTitle

	}
	if builder.readStatusFlag {
		req.ReadStatus = &builder.readStatus

	}
	if builder.ccCreateTimeFromFlag {
		req.CcCreateTimeFrom = &builder.ccCreateTimeFrom

	}
	if builder.ccCreateTimeToFlag {
		req.CcCreateTimeTo = &builder.ccCreateTimeTo

	}
	if builder.localeFlag {
		req.Locale = &builder.locale

	}
	if builder.withRevokedInstanceFlag {
		req.WithRevokedInstance = &builder.withRevokedInstance

	}
	return req
}

type CcSearchItem struct {
	Approval *InstanceSearchApproval `json:"approval,omitempty"` // 审批定义

	Group *InstanceSearchGroup `json:"group,omitempty"` // 审批定义分组

	Instance *InstanceSearchNode `json:"instance,omitempty"` // 审批实例信息

	Cc *CcSearchNode `json:"cc,omitempty"` // 审批抄送
}

type CcSearchItemBuilder struct {
	approval     *InstanceSearchApproval // 审批定义
	approvalFlag bool

	group     *InstanceSearchGroup // 审批定义分组
	groupFlag bool

	instance     *InstanceSearchNode // 审批实例信息
	instanceFlag bool

	cc     *CcSearchNode // 审批抄送
	ccFlag bool
}

func NewCcSearchItemBuilder() *CcSearchItemBuilder {
	builder := &CcSearchItemBuilder{}
	return builder
}

// 审批定义
//
// 示例值：
func (builder *CcSearchItemBuilder) Approval(approval *InstanceSearchApproval) *CcSearchItemBuilder {
	builder.approval = approval
	builder.approvalFlag = true
	return builder
}

// 审批定义分组
//
// 示例值：
func (builder *CcSearchItemBuilder) Group(group *InstanceSearchGroup) *CcSearchItemBuilder {
	builder.group = group
	builder.groupFlag = true
	return builder
}

// 审批实例信息
//
// 示例值：
func (builder *CcSearchItemBuilder) Instance(instance *InstanceSearchNode) *CcSearchItemBuilder {
	builder.instance = instance
	builder.instanceFlag = true
	return builder
}

// 审批抄送
//
// 示例值：
func (builder *CcSearchItemBuilder) Cc(cc *CcSearchNode) *CcSearchItemBuilder {
	builder.cc = cc
	builder.ccFlag = true
	return builder
}

func (builder *CcSearchItemBuilder) Build() *CcSearchItem {
	req := &CcSearchItem{}
	if builder.approvalFlag {
		req.Approval = builder.approval
	}
	if builder.groupFlag {
		req.Group = builder.group
	}
	if builder.instanceFlag {
		req.Instance = builder.instance
	}
	if builder.ccFlag {
		req.Cc = builder.cc
	}
	return req
}

type CcSearchNode struct {
	UserId *string `json:"user_id,omitempty"` // 审批抄送发起人 id

	CreateTime *string `json:"create_time,omitempty"` // 审批抄送开始时间

	ReadStatus *string `json:"read_status,omitempty"` // 审批抄送状态

	Title *string `json:"title,omitempty"` // 审批抄送名称（只有第三方审批有）

	Extra *string `json:"extra,omitempty"` // 审批抄送扩展字段，string型json

	Link *InstanceSearchLink `json:"link,omitempty"` // 审批抄送链接（只有第三方审批有）
}

type CcSearchNodeBuilder struct {
	userId     string // 审批抄送发起人 id
	userIdFlag bool

	createTime     string // 审批抄送开始时间
	createTimeFlag bool

	readStatus     string // 审批抄送状态
	readStatusFlag bool

	title     string // 审批抄送名称（只有第三方审批有）
	titleFlag bool

	extra     string // 审批抄送扩展字段，string型json
	extraFlag bool

	link     *InstanceSearchLink // 审批抄送链接（只有第三方审批有）
	linkFlag bool
}

func NewCcSearchNodeBuilder() *CcSearchNodeBuilder {
	builder := &CcSearchNodeBuilder{}
	return builder
}

// 审批抄送发起人 id
//
// 示例值：lwiu098wj
func (builder *CcSearchNodeBuilder) UserId(userId string) *CcSearchNodeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批抄送开始时间
//
// 示例值：1547654251506
func (builder *CcSearchNodeBuilder) CreateTime(createTime string) *CcSearchNodeBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 审批抄送状态
//
// 示例值：read
func (builder *CcSearchNodeBuilder) ReadStatus(readStatus string) *CcSearchNodeBuilder {
	builder.readStatus = readStatus
	builder.readStatusFlag = true
	return builder
}

// 审批抄送名称（只有第三方审批有）
//
// 示例值：test
func (builder *CcSearchNodeBuilder) Title(title string) *CcSearchNodeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 审批抄送扩展字段，string型json
//
// 示例值：{}
func (builder *CcSearchNodeBuilder) Extra(extra string) *CcSearchNodeBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 审批抄送链接（只有第三方审批有）
//
// 示例值：
func (builder *CcSearchNodeBuilder) Link(link *InstanceSearchLink) *CcSearchNodeBuilder {
	builder.link = link
	builder.linkFlag = true
	return builder
}

func (builder *CcSearchNodeBuilder) Build() *CcSearchNode {
	req := &CcSearchNode{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

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

	}
	if builder.readStatusFlag {
		req.ReadStatus = &builder.readStatus

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

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

	}
	if builder.linkFlag {
		req.Link = builder.link
	}
	return req
}

type Comment struct {
	Id *string `json:"id,omitempty"` // 评论ID

	Content *string `json:"content,omitempty"` // 评论内容

	CreateTime *string `json:"create_time,omitempty"` // 评论创建时间

	UpdateTime *string `json:"update_time,omitempty"` // 评论更新时间

	IsDelete *int `json:"is_delete,omitempty"` // 是否删除，0:未删除，1:已删除

	Replies []*CommentReply `json:"replies,omitempty"` // 评论的回复

	AtInfoList []*CommentAtInfo `json:"at_info_list,omitempty"` // 评论中艾特人信息

	Commentator *string `json:"commentator,omitempty"` // 评论创建人

	Extra *string `json:"extra,omitempty"` // 附加字段
}

type CommentBuilder struct {
	id     string // 评论ID
	idFlag bool

	content     string // 评论内容
	contentFlag bool

	createTime     string // 评论创建时间
	createTimeFlag bool

	updateTime     string // 评论更新时间
	updateTimeFlag bool

	isDelete     int // 是否删除，0:未删除，1:已删除
	isDeleteFlag bool

	replies     []*CommentReply // 评论的回复
	repliesFlag bool

	atInfoList     []*CommentAtInfo // 评论中艾特人信息
	atInfoListFlag bool

	commentator     string // 评论创建人
	commentatorFlag bool

	extra     string // 附加字段
	extraFlag bool
}

func NewCommentBuilder() *CommentBuilder {
	builder := &CommentBuilder{}
	return builder
}

// 评论ID
//
// 示例值：7081516627711524883
func (builder *CommentBuilder) Id(id string) *CommentBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 评论内容
//
// 示例值：{\"text\":\"x@王某自小程序的评论111我带了附件，而且我艾特了人 \",\"files\":[{\"url\":\"https://xx-xxx-xxx.bytedance.net/lark-approval-attachment/image/20220401/1/d43216ca-93b5-43a8-8a34-23c66820463a.png~tplv-k7bg0smxju-image.image?x-orig-authkey=boeorigin\&x-orig-expires=1650963890\&x-orig-sign=668QhQbRSt6638x2Ws8wFI%2FxqVg%3D#.png\",\"fileSize\":155149,\"title\":\"9a9fedc5cfb01a4a20c715098.png\",\"type\":\"image\"}]}
func (builder *CommentBuilder) Content(content string) *CommentBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 评论创建时间
//
// 示例值：1648801211000
func (builder *CommentBuilder) CreateTime(createTime string) *CommentBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 评论更新时间
//
// 示例值：1648801211000
func (builder *CommentBuilder) UpdateTime(updateTime string) *CommentBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 是否删除，0:未删除，1:已删除
//
// 示例值：1
func (builder *CommentBuilder) IsDelete(isDelete int) *CommentBuilder {
	builder.isDelete = isDelete
	builder.isDeleteFlag = true
	return builder
}

// 评论的回复
//
// 示例值：
func (builder *CommentBuilder) Replies(replies []*CommentReply) *CommentBuilder {
	builder.replies = replies
	builder.repliesFlag = true
	return builder
}

// 评论中艾特人信息
//
// 示例值：
func (builder *CommentBuilder) AtInfoList(atInfoList []*CommentAtInfo) *CommentBuilder {
	builder.atInfoList = atInfoList
	builder.atInfoListFlag = true
	return builder
}

// 评论创建人
//
// 示例值：893g4c45
func (builder *CommentBuilder) Commentator(commentator string) *CommentBuilder {
	builder.commentator = commentator
	builder.commentatorFlag = true
	return builder
}

// 附加字段
//
// 示例值：{\"a\":\"a\"}
func (builder *CommentBuilder) Extra(extra string) *CommentBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

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

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

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

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

	}
	if builder.isDeleteFlag {
		req.IsDelete = &builder.isDelete

	}
	if builder.repliesFlag {
		req.Replies = builder.replies
	}
	if builder.atInfoListFlag {
		req.AtInfoList = builder.atInfoList
	}
	if builder.commentatorFlag {
		req.Commentator = &builder.commentator

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

	}
	return req
}

type CommentAtInfo struct {
	UserId *string `json:"user_id,omitempty"` // 被艾特人的ID

	Name *string `json:"name,omitempty"` // 被艾特人的姓名

	Offset *string `json:"offset,omitempty"` // 被艾特人在评论中的位置，从0开始
}

type CommentAtInfoBuilder struct {
	userId     string // 被艾特人的ID
	userIdFlag bool

	name     string // 被艾特人的姓名
	nameFlag bool

	offset     string // 被艾特人在评论中的位置，从0开始
	offsetFlag bool
}

func NewCommentAtInfoBuilder() *CommentAtInfoBuilder {
	builder := &CommentAtInfoBuilder{}
	return builder
}

// 被艾特人的ID
//
// 示例值：579fd9c4
func (builder *CommentAtInfoBuilder) UserId(userId string) *CommentAtInfoBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 被艾特人的姓名
//
// 示例值：张某
func (builder *CommentAtInfoBuilder) Name(name string) *CommentAtInfoBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 被艾特人在评论中的位置，从0开始
//
// 示例值：1
func (builder *CommentAtInfoBuilder) Offset(offset string) *CommentAtInfoBuilder {
	builder.offset = offset
	builder.offsetFlag = true
	return builder
}

func (builder *CommentAtInfoBuilder) Build() *CommentAtInfo {
	req := &CommentAtInfo{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

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

	}
	if builder.offsetFlag {
		req.Offset = &builder.offset

	}
	return req
}

type CommentReply struct {
	Id *string `json:"id,omitempty"` // 评论ID

	Content *string `json:"content,omitempty"` // 评论内容

	CreateTime *string `json:"create_time,omitempty"` // 评论创建时间

	UpdateTime *string `json:"update_time,omitempty"` // 评论更新时间

	IsDelete *int `json:"is_delete,omitempty"` // 是否删除，0:未删除，1:已删除

	AtInfoList []*CommentAtInfo `json:"at_info_list,omitempty"` // 评论中艾特人信息

	Commentator *string `json:"commentator,omitempty"` // 评论创建人

	Extra *string `json:"extra,omitempty"` // 附加字段
}

type CommentReplyBuilder struct {
	id     string // 评论ID
	idFlag bool

	content     string // 评论内容
	contentFlag bool

	createTime     string // 评论创建时间
	createTimeFlag bool

	updateTime     string // 评论更新时间
	updateTimeFlag bool

	isDelete     int // 是否删除，0:未删除，1:已删除
	isDeleteFlag bool

	atInfoList     []*CommentAtInfo // 评论中艾特人信息
	atInfoListFlag bool

	commentator     string // 评论创建人
	commentatorFlag bool

	extra     string // 附加字段
	extraFlag bool
}

func NewCommentReplyBuilder() *CommentReplyBuilder {
	builder := &CommentReplyBuilder{}
	return builder
}

// 评论ID
//
// 示例值：7081516611634741268
func (builder *CommentReplyBuilder) Id(id string) *CommentReplyBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 评论内容
//
// 示例值：{\"text\":\"x@张某来自小程序的评论111,这是一条回复\",\"files\":[{\"url\":\"https://xx-xxx-xxx.bytedance.net/lark-approval-attachment/image/20220401/1/d43216ca-93b5-43a8-8a34-23c66820463a.png~tplv-k7bg0smxju-image.image?x-orig-authkey=boeorigin\&x-orig-expires=1650963890\&x-orig-sign=668QhQbRSt6638x2Ws8wFI%2FxqVg%3D#.png\",\"fileSize\":155149,\"title\":\"9a9fedc5cfb01a4a20c715098.png\",\"type\":\"image\"}]}
func (builder *CommentReplyBuilder) Content(content string) *CommentReplyBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 评论创建时间
//
// 示例值：1648803677000
func (builder *CommentReplyBuilder) CreateTime(createTime string) *CommentReplyBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 评论更新时间
//
// 示例值：1648803677000
func (builder *CommentReplyBuilder) UpdateTime(updateTime string) *CommentReplyBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 是否删除，0:未删除，1:已删除
//
// 示例值：0
func (builder *CommentReplyBuilder) IsDelete(isDelete int) *CommentReplyBuilder {
	builder.isDelete = isDelete
	builder.isDeleteFlag = true
	return builder
}

// 评论中艾特人信息
//
// 示例值：
func (builder *CommentReplyBuilder) AtInfoList(atInfoList []*CommentAtInfo) *CommentReplyBuilder {
	builder.atInfoList = atInfoList
	builder.atInfoListFlag = true
	return builder
}

// 评论创建人
//
// 示例值：893g4c45
func (builder *CommentReplyBuilder) Commentator(commentator string) *CommentReplyBuilder {
	builder.commentator = commentator
	builder.commentatorFlag = true
	return builder
}

// 附加字段
//
// 示例值：{\"a\":\"a\"}
func (builder *CommentReplyBuilder) Extra(extra string) *CommentReplyBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

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

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

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

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

	}
	if builder.isDeleteFlag {
		req.IsDelete = &builder.isDelete

	}
	if builder.atInfoListFlag {
		req.AtInfoList = builder.atInfoList
	}
	if builder.commentatorFlag {
		req.Commentator = &builder.commentator

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

	}
	return req
}

type CommentRequest struct {
	Content *string `json:"content,omitempty"` // 评论内容，包含艾特人、附件等

	AtInfoList []*CommentAtInfo `json:"at_info_list,omitempty"` // 评论中艾特人信息

	ParentCommentId *string `json:"parent_comment_id,omitempty"` // 父评论ID，如果是回复评论，需要传

	CommentId *string `json:"comment_id,omitempty"` // 评论ID，如果是编辑、删除一条评论，需要传

	DisableBot *bool `json:"disable_bot,omitempty"` // disable_bot=true只同步数据，不触发bot

	Extra *string `json:"extra,omitempty"` // 附加字段
}

type CommentRequestBuilder struct {
	content     string // 评论内容，包含艾特人、附件等
	contentFlag bool

	atInfoList     []*CommentAtInfo // 评论中艾特人信息
	atInfoListFlag bool

	parentCommentId     string // 父评论ID，如果是回复评论，需要传
	parentCommentIdFlag bool

	commentId     string // 评论ID，如果是编辑、删除一条评论，需要传
	commentIdFlag bool

	disableBot     bool // disable_bot=true只同步数据，不触发bot
	disableBotFlag bool

	extra     string // 附加字段
	extraFlag bool
}

func NewCommentRequestBuilder() *CommentRequestBuilder {
	builder := &CommentRequestBuilder{}
	return builder
}

// 评论内容，包含艾特人、附件等
//
// 示例值：{\"text\":\"来自小程序的评论111我带附件中有extra \",\"files\":[{\"url\":\"xxx\",\"fileSize\":155149,\"title\":\"9a9fedc5cfb01a4a20c715098.png\",\"type\":\"image\",\"extra\":\"\"}]}
func (builder *CommentRequestBuilder) Content(content string) *CommentRequestBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 评论中艾特人信息
//
// 示例值：
func (builder *CommentRequestBuilder) AtInfoList(atInfoList []*CommentAtInfo) *CommentRequestBuilder {
	builder.atInfoList = atInfoList
	builder.atInfoListFlag = true
	return builder
}

// 父评论ID，如果是回复评论，需要传
//
// 示例值：7081516627711524883
func (builder *CommentRequestBuilder) ParentCommentId(parentCommentId string) *CommentRequestBuilder {
	builder.parentCommentId = parentCommentId
	builder.parentCommentIdFlag = true
	return builder
}

// 评论ID，如果是编辑、删除一条评论，需要传
//
// 示例值：7081516627711524883
func (builder *CommentRequestBuilder) CommentId(commentId string) *CommentRequestBuilder {
	builder.commentId = commentId
	builder.commentIdFlag = true
	return builder
}

// disable_bot=true只同步数据，不触发bot
//
// 示例值：false
func (builder *CommentRequestBuilder) DisableBot(disableBot bool) *CommentRequestBuilder {
	builder.disableBot = disableBot
	builder.disableBotFlag = true
	return builder
}

// 附加字段
//
// 示例值：{\"a\":\"a\"}
func (builder *CommentRequestBuilder) Extra(extra string) *CommentRequestBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

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

	}
	if builder.atInfoListFlag {
		req.AtInfoList = builder.atInfoList
	}
	if builder.parentCommentIdFlag {
		req.ParentCommentId = &builder.parentCommentId

	}
	if builder.commentIdFlag {
		req.CommentId = &builder.commentId

	}
	if builder.disableBotFlag {
		req.DisableBot = &builder.disableBot

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

	}
	return req
}

type ConnectorLog struct {
	LogData []*ConnectorLogData `json:"log_data,omitempty"` // 日志数据
}

type ConnectorLogBuilder struct {
	logData     []*ConnectorLogData // 日志数据
	logDataFlag bool
}

func NewConnectorLogBuilder() *ConnectorLogBuilder {
	builder := &ConnectorLogBuilder{}
	return builder
}

// 日志数据
//
// 示例值：
func (builder *ConnectorLogBuilder) LogData(logData []*ConnectorLogData) *ConnectorLogBuilder {
	builder.logData = logData
	builder.logDataFlag = true
	return builder
}

func (builder *ConnectorLogBuilder) Build() *ConnectorLog {
	req := &ConnectorLog{}
	if builder.logDataFlag {
		req.LogData = builder.logData
	}
	return req
}

type ConnectorLogData struct {
	DateTime *string `json:"date_time,omitempty"` // 时间

	Data *string `json:"data,omitempty"` // 数据（脱敏）

	Level *string `json:"level,omitempty"` // 数据等级

	Pod *string `json:"pod,omitempty"` // 机器名称

	Location *string `json:"location,omitempty"` // 打印位置（脱敏）

	Type *string `json:"type,omitempty"` // 数据类型

	Version *string `json:"version,omitempty"` // 版本号
}

type ConnectorLogDataBuilder struct {
	dateTime     string // 时间
	dateTimeFlag bool

	data     string // 数据（脱敏）
	dataFlag bool

	level     string // 数据等级
	levelFlag bool

	pod     string // 机器名称
	podFlag bool

	location     string // 打印位置（脱敏）
	locationFlag bool

	type_    string // 数据类型
	typeFlag bool

	version     string // 版本号
	versionFlag bool
}

func NewConnectorLogDataBuilder() *ConnectorLogDataBuilder {
	builder := &ConnectorLogDataBuilder{}
	return builder
}

// 时间
//
// 示例值：2023-03-23 10:05:11
func (builder *ConnectorLogDataBuilder) DateTime(dateTime string) *ConnectorLogDataBuilder {
	builder.dateTime = dateTime
	builder.dateTimeFlag = true
	return builder
}

// 数据（脱敏）
//
// 示例值：cwyFtNZSO7wKZ2Bi+WHJVbb6uZ3G2hlsje
func (builder *ConnectorLogDataBuilder) Data(data string) *ConnectorLogDataBuilder {
	builder.data = data
	builder.dataFlag = true
	return builder
}

// 数据等级
//
// 示例值：INFO
func (builder *ConnectorLogDataBuilder) Level(level string) *ConnectorLogDataBuilder {
	builder.level = level
	builder.levelFlag = true
	return builder
}

// 机器名称
//
// 示例值：C02GD65CMD6R
func (builder *ConnectorLogDataBuilder) Pod(pod string) *ConnectorLogDataBuilder {
	builder.pod = pod
	builder.podFlag = true
	return builder
}

// 打印位置（脱敏）
//
// 示例值：K+GFMIO+2aTIX8yXkPLK2hoEPof4
func (builder *ConnectorLogDataBuilder) Location(location string) *ConnectorLogDataBuilder {
	builder.location = location
	builder.locationFlag = true
	return builder
}

// 数据类型
//
// 示例值：MONITOR
func (builder *ConnectorLogDataBuilder) Type(type_ string) *ConnectorLogDataBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 版本号
//
// 示例值：2.0.1
func (builder *ConnectorLogDataBuilder) Version(version string) *ConnectorLogDataBuilder {
	builder.version = version
	builder.versionFlag = true
	return builder
}

func (builder *ConnectorLogDataBuilder) Build() *ConnectorLogData {
	req := &ConnectorLogData{}
	if builder.dateTimeFlag {
		req.DateTime = &builder.dateTime

	}
	if builder.dataFlag {
		req.Data = &builder.data

	}
	if builder.levelFlag {
		req.Level = &builder.level

	}
	if builder.podFlag {
		req.Pod = &builder.pod

	}
	if builder.locationFlag {
		req.Location = &builder.location

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

	}
	if builder.versionFlag {
		req.Version = &builder.version

	}
	return req
}

type Count struct {
	Total *int `json:"total,omitempty"` // 总数，大于等于 1000 个项目时将返回 999

	HasMore *bool `json:"has_more,omitempty"` // 还有更多，当大于等于 1000 时将返回 true
}

type CountBuilder struct {
	total     int // 总数，大于等于 1000 个项目时将返回 999
	totalFlag bool

	hasMore     bool // 还有更多，当大于等于 1000 时将返回 true
	hasMoreFlag bool
}

func NewCountBuilder() *CountBuilder {
	builder := &CountBuilder{}
	return builder
}

// 总数，大于等于 1000 个项目时将返回 999
//
// 示例值：123
func (builder *CountBuilder) Total(total int) *CountBuilder {
	builder.total = total
	builder.totalFlag = true
	return builder
}

// 还有更多，当大于等于 1000 时将返回 true
//
// 示例值：false
func (builder *CountBuilder) HasMore(hasMore bool) *CountBuilder {
	builder.hasMore = hasMore
	builder.hasMoreFlag = true
	return builder
}

func (builder *CountBuilder) Build() *Count {
	req := &Count{}
	if builder.totalFlag {
		req.Total = &builder.total

	}
	if builder.hasMoreFlag {
		req.HasMore = &builder.hasMore

	}
	return req
}

type Definition struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"

	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称，根据传入的local字段返回对应的国际化文案，未设置该国际化文案时返回默认语言对应文案

	GroupName *string `json:"group_name,omitempty"` // 分组名称，值的格式是 i18n key，文案放在 i18n_resource

	Description *string `json:"description,omitempty"` // 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段

	IconUrl *string `json:"icon_url,omitempty"` // 审批图标链接

	GroupCode *string `json:"group_code,omitempty"` // 审批定义所属审批分组

	IsExternal *bool `json:"is_external,omitempty"` // 是否为第三方审批

	CreateLinkPc *string `json:"create_link_pc,omitempty"` // PC端发起页链接

	CreateLinkMobile *string `json:"create_link_mobile,omitempty"` // 移动端发起页链接
}

type DefinitionBuilder struct {
	approvalCode     string // 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"
	approvalCodeFlag bool

	approvalName     string // 审批名称，根据传入的local字段返回对应的国际化文案，未设置该国际化文案时返回默认语言对应文案
	approvalNameFlag bool

	groupName     string // 分组名称，值的格式是 i18n key，文案放在 i18n_resource
	groupNameFlag bool

	description     string // 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段
	descriptionFlag bool

	iconUrl     string // 审批图标链接
	iconUrlFlag bool

	groupCode     string // 审批定义所属审批分组
	groupCodeFlag bool

	isExternal     bool // 是否为第三方审批
	isExternalFlag bool

	createLinkPc     string // PC端发起页链接
	createLinkPcFlag bool

	createLinkMobile     string // 移动端发起页链接
	createLinkMobileFlag bool
}

func NewDefinitionBuilder() *DefinitionBuilder {
	builder := &DefinitionBuilder{}
	return builder
}

// 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *DefinitionBuilder) ApprovalCode(approvalCode string) *DefinitionBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批名称，根据传入的local字段返回对应的国际化文案，未设置该国际化文案时返回默认语言对应文案
//
// 示例值：请假
func (builder *DefinitionBuilder) ApprovalName(approvalName string) *DefinitionBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 分组名称，值的格式是 i18n key，文案放在 i18n_resource
//
// 示例值：分组名称
func (builder *DefinitionBuilder) GroupName(groupName string) *DefinitionBuilder {
	builder.groupName = groupName
	builder.groupNameFlag = true
	return builder
}

// 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段
//
// 示例值：审批定义说明
func (builder *DefinitionBuilder) Description(description string) *DefinitionBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 审批图标链接
//
// 示例值：https://lf3-ea.bytetos.com/obj/goofy/ee/approval/approval-admin/image/iconLib/v3/person.png
func (builder *DefinitionBuilder) IconUrl(iconUrl string) *DefinitionBuilder {
	builder.iconUrl = iconUrl
	builder.iconUrlFlag = true
	return builder
}

// 审批定义所属审批分组
//
// 示例值：work_group
func (builder *DefinitionBuilder) GroupCode(groupCode string) *DefinitionBuilder {
	builder.groupCode = groupCode
	builder.groupCodeFlag = true
	return builder
}

// 是否为第三方审批
//
// 示例值：false
func (builder *DefinitionBuilder) IsExternal(isExternal bool) *DefinitionBuilder {
	builder.isExternal = isExternal
	builder.isExternalFlag = true
	return builder
}

// PC端发起页链接
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9c90fc38e07a9101&path=pc/pages/create-form/index?id=9999
func (builder *DefinitionBuilder) CreateLinkPc(createLinkPc string) *DefinitionBuilder {
	builder.createLinkPc = createLinkPc
	builder.createLinkPcFlag = true
	return builder
}

// 移动端发起页链接
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?appId=cli_9c90fc38e07a9101&path=pages/approval-form/index?id=9999
func (builder *DefinitionBuilder) CreateLinkMobile(createLinkMobile string) *DefinitionBuilder {
	builder.createLinkMobile = createLinkMobile
	builder.createLinkMobileFlag = true
	return builder
}

func (builder *DefinitionBuilder) Build() *Definition {
	req := &Definition{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

	}
	if builder.groupNameFlag {
		req.GroupName = &builder.groupName

	}
	if builder.descriptionFlag {
		req.Description = &builder.description

	}
	if builder.iconUrlFlag {
		req.IconUrl = &builder.iconUrl

	}
	if builder.groupCodeFlag {
		req.GroupCode = &builder.groupCode

	}
	if builder.isExternalFlag {
		req.IsExternal = &builder.isExternal

	}
	if builder.createLinkPcFlag {
		req.CreateLinkPc = &builder.createLinkPc

	}
	if builder.createLinkMobileFlag {
		req.CreateLinkMobile = &builder.createLinkMobile

	}
	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 District struct {
	Id *string `json:"id,omitempty"` // 区域的唯一标识

	Name *string `json:"name,omitempty"` // 名称

	Level *string `json:"level,omitempty"` // 层级

	HasSubDistrict *bool `json:"has_sub_district,omitempty"` // 是否有子区域

	ParentDistricts []*DistrictBaseInfo `json:"parent_districts,omitempty"` // 父区域列表，顺序由叶子节点到根节点，不包含叶子节点本身，仅遍历方式为leaf_level时返回
}

type DistrictBuilder struct {
	id     string // 区域的唯一标识
	idFlag bool

	name     string // 名称
	nameFlag bool

	level     string // 层级
	levelFlag bool

	hasSubDistrict     bool // 是否有子区域
	hasSubDistrictFlag bool

	parentDistricts     []*DistrictBaseInfo // 父区域列表，顺序由叶子节点到根节点，不包含叶子节点本身，仅遍历方式为leaf_level时返回
	parentDistrictsFlag bool
}

func NewDistrictBuilder() *DistrictBuilder {
	builder := &DistrictBuilder{}
	return builder
}

// 区域的唯一标识
//
// 示例值：2038349
func (builder *DistrictBuilder) Id(id string) *DistrictBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 名称
//
// 示例值：Beijing
func (builder *DistrictBuilder) Name(name string) *DistrictBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 层级
//
// 示例值：Province
func (builder *DistrictBuilder) Level(level string) *DistrictBuilder {
	builder.level = level
	builder.levelFlag = true
	return builder
}

// 是否有子区域
//
// 示例值：false
func (builder *DistrictBuilder) HasSubDistrict(hasSubDistrict bool) *DistrictBuilder {
	builder.hasSubDistrict = hasSubDistrict
	builder.hasSubDistrictFlag = true
	return builder
}

// 父区域列表，顺序由叶子节点到根节点，不包含叶子节点本身，仅遍历方式为leaf_level时返回
//
// 示例值：
func (builder *DistrictBuilder) ParentDistricts(parentDistricts []*DistrictBaseInfo) *DistrictBuilder {
	builder.parentDistricts = parentDistricts
	builder.parentDistrictsFlag = true
	return builder
}

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

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

	}
	if builder.levelFlag {
		req.Level = &builder.level

	}
	if builder.hasSubDistrictFlag {
		req.HasSubDistrict = &builder.hasSubDistrict

	}
	if builder.parentDistrictsFlag {
		req.ParentDistricts = builder.parentDistricts
	}
	return req
}

type DistrictBaseInfo struct {
	Id *string `json:"id,omitempty"` // 区域的唯一标识

	Name *string `json:"name,omitempty"` // 名称

	Level *string `json:"level,omitempty"` // 层级
}

type DistrictBaseInfoBuilder struct {
	id     string // 区域的唯一标识
	idFlag bool

	name     string // 名称
	nameFlag bool

	level     string // 层级
	levelFlag bool
}

func NewDistrictBaseInfoBuilder() *DistrictBaseInfoBuilder {
	builder := &DistrictBaseInfoBuilder{}
	return builder
}

// 区域的唯一标识
//
// 示例值：1814991
func (builder *DistrictBaseInfoBuilder) Id(id string) *DistrictBaseInfoBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 名称
//
// 示例值：China
func (builder *DistrictBaseInfoBuilder) Name(name string) *DistrictBaseInfoBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 层级
//
// 示例值：Country
func (builder *DistrictBaseInfoBuilder) Level(level string) *DistrictBaseInfoBuilder {
	builder.level = level
	builder.levelFlag = true
	return builder
}

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

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

	}
	if builder.levelFlag {
		req.Level = &builder.level

	}
	return req
}

type EntityProcessRecord struct {
	InsertNum *int `json:"insert_num,omitempty"` // 新增的条数

	UpdateNum *int `json:"update_num,omitempty"` // 更新的条数

	DeleteNum *int `json:"delete_num,omitempty"` // 删除的条数
}

type EntityProcessRecordBuilder struct {
	insertNum     int // 新增的条数
	insertNumFlag bool

	updateNum     int // 更新的条数
	updateNumFlag bool

	deleteNum     int // 删除的条数
	deleteNumFlag bool
}

func NewEntityProcessRecordBuilder() *EntityProcessRecordBuilder {
	builder := &EntityProcessRecordBuilder{}
	return builder
}

// 新增的条数
//
// 示例值：10
func (builder *EntityProcessRecordBuilder) InsertNum(insertNum int) *EntityProcessRecordBuilder {
	builder.insertNum = insertNum
	builder.insertNumFlag = true
	return builder
}

// 更新的条数
//
// 示例值：10
func (builder *EntityProcessRecordBuilder) UpdateNum(updateNum int) *EntityProcessRecordBuilder {
	builder.updateNum = updateNum
	builder.updateNumFlag = true
	return builder
}

// 删除的条数
//
// 示例值：10
func (builder *EntityProcessRecordBuilder) DeleteNum(deleteNum int) *EntityProcessRecordBuilder {
	builder.deleteNum = deleteNum
	builder.deleteNumFlag = true
	return builder
}

func (builder *EntityProcessRecordBuilder) Build() *EntityProcessRecord {
	req := &EntityProcessRecord{}
	if builder.insertNumFlag {
		req.InsertNum = &builder.insertNum

	}
	if builder.updateNumFlag {
		req.UpdateNum = &builder.updateNum

	}
	if builder.deleteNumFlag {
		req.DeleteNum = &builder.deleteNum

	}
	return req
}

type ExteranlInstanceCheck struct {
	InstanceId *string `json:"instance_id,omitempty"` // 审批实例 id

	UpdateTime *string `json:"update_time,omitempty"` // 审批实例最近更新时间

	Tasks []*ExternalInstanceTask `json:"tasks,omitempty"` // 任务信息
}

type ExteranlInstanceCheckBuilder struct {
	instanceId     string // 审批实例 id
	instanceIdFlag bool

	updateTime     string // 审批实例最近更新时间
	updateTimeFlag bool

	tasks     []*ExternalInstanceTask // 任务信息
	tasksFlag bool
}

func NewExteranlInstanceCheckBuilder() *ExteranlInstanceCheckBuilder {
	builder := &ExteranlInstanceCheckBuilder{}
	return builder
}

// 审批实例 id
//
// 示例值：1234234234242423
func (builder *ExteranlInstanceCheckBuilder) InstanceId(instanceId string) *ExteranlInstanceCheckBuilder {
	builder.instanceId = instanceId
	builder.instanceIdFlag = true
	return builder
}

// 审批实例最近更新时间
//
// 示例值：1591603040000
func (builder *ExteranlInstanceCheckBuilder) UpdateTime(updateTime string) *ExteranlInstanceCheckBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 任务信息
//
// 示例值：
func (builder *ExteranlInstanceCheckBuilder) Tasks(tasks []*ExternalInstanceTask) *ExteranlInstanceCheckBuilder {
	builder.tasks = tasks
	builder.tasksFlag = true
	return builder
}

func (builder *ExteranlInstanceCheckBuilder) Build() *ExteranlInstanceCheck {
	req := &ExteranlInstanceCheck{}
	if builder.instanceIdFlag {
		req.InstanceId = &builder.instanceId

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

	}
	if builder.tasksFlag {
		req.Tasks = builder.tasks
	}
	return req
}

type ExteranlInstanceCheckResponse struct {
	InstanceId *string `json:"instance_id,omitempty"` // 审批实例 id

	UpdateTime *string `json:"update_time,omitempty"` // 任务最近更新时间

	Tasks []*ExternalInstanceTask `json:"tasks,omitempty"` // 任务信息
}

type ExteranlInstanceCheckResponseBuilder struct {
	instanceId     string // 审批实例 id
	instanceIdFlag bool

	updateTime     string // 任务最近更新时间
	updateTimeFlag bool

	tasks     []*ExternalInstanceTask // 任务信息
	tasksFlag bool
}

func NewExteranlInstanceCheckResponseBuilder() *ExteranlInstanceCheckResponseBuilder {
	builder := &ExteranlInstanceCheckResponseBuilder{}
	return builder
}

// 审批实例 id
//
// 示例值：1234234234242423
func (builder *ExteranlInstanceCheckResponseBuilder) InstanceId(instanceId string) *ExteranlInstanceCheckResponseBuilder {
	builder.instanceId = instanceId
	builder.instanceIdFlag = true
	return builder
}

// 任务最近更新时间
//
// 示例值：1591603040000
func (builder *ExteranlInstanceCheckResponseBuilder) UpdateTime(updateTime string) *ExteranlInstanceCheckResponseBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 任务信息
//
// 示例值：
func (builder *ExteranlInstanceCheckResponseBuilder) Tasks(tasks []*ExternalInstanceTask) *ExteranlInstanceCheckResponseBuilder {
	builder.tasks = tasks
	builder.tasksFlag = true
	return builder
}

func (builder *ExteranlInstanceCheckResponseBuilder) Build() *ExteranlInstanceCheckResponse {
	req := &ExteranlInstanceCheckResponse{}
	if builder.instanceIdFlag {
		req.InstanceId = &builder.instanceId

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

	}
	if builder.tasksFlag {
		req.Tasks = builder.tasks
	}
	return req
}

type ExternalApproval struct {
	ApprovalName *string `json:"approval_name,omitempty"` // 审批定义名称，创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段。

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code，用户自定义，定义的唯一标识，如果不存在该 code，则创建，否则更新

	GroupCode *string `json:"group_code,omitempty"` // 审批定义所属审批分组，用户自定义； 如果group_code当前不存在，则会新建审批分组； 如果group_code已经存在，则会使用group_name更新审批分组名称

	GroupName *string `json:"group_name,omitempty"` // 分组名称，值的格式是 i18n key，文案放在 i18n_resource； 如果是 group_code 当前不存在，则该 group_name 必填，否则，如果填写了则会更新分组名称，不填则不更新分组名称； 审批发起页 审批定义的分组名称来自该字段

	Description *string `json:"description,omitempty"` // 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段

	External *ApprovalCreateExternal `json:"external,omitempty"` // 三方审批相关

	Viewers []*ApprovalCreateViewers `json:"viewers,omitempty"` // 可见人列表，可通知配置多个可见人，只有在配置的范围内用户可以在审批发起也看到该审批，默认不传，则是任何人不可见

	I18nResources []*I18nResource `json:"i18n_resources,omitempty"` // 国际化文案

	Managers []string `json:"managers,omitempty"` // 根据user_id_type填写流程管理员id
}

type ExternalApprovalBuilder struct {
	approvalName     string // 审批定义名称，创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段。
	approvalNameFlag bool

	approvalCode     string // 审批定义 code，用户自定义，定义的唯一标识，如果不存在该 code，则创建，否则更新
	approvalCodeFlag bool

	groupCode     string // 审批定义所属审批分组，用户自定义； 如果group_code当前不存在，则会新建审批分组； 如果group_code已经存在，则会使用group_name更新审批分组名称
	groupCodeFlag bool

	groupName     string // 分组名称，值的格式是 i18n key，文案放在 i18n_resource； 如果是 group_code 当前不存在，则该 group_name 必填，否则，如果填写了则会更新分组名称，不填则不更新分组名称； 审批发起页 审批定义的分组名称来自该字段
	groupNameFlag bool

	description     string // 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段
	descriptionFlag bool

	external     *ApprovalCreateExternal // 三方审批相关
	externalFlag bool

	viewers     []*ApprovalCreateViewers // 可见人列表，可通知配置多个可见人，只有在配置的范围内用户可以在审批发起也看到该审批，默认不传，则是任何人不可见
	viewersFlag bool

	i18nResources     []*I18nResource // 国际化文案
	i18nResourcesFlag bool

	managers     []string // 根据user_id_type填写流程管理员id
	managersFlag bool
}

func NewExternalApprovalBuilder() *ExternalApprovalBuilder {
	builder := &ExternalApprovalBuilder{}
	return builder
}

// 审批定义名称，创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段。
//
// 示例值：@i18n@1
func (builder *ExternalApprovalBuilder) ApprovalName(approvalName string) *ExternalApprovalBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 审批定义 code，用户自定义，定义的唯一标识，如果不存在该 code，则创建，否则更新
//
// 示例值：permission_test
func (builder *ExternalApprovalBuilder) ApprovalCode(approvalCode string) *ExternalApprovalBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批定义所属审批分组，用户自定义； 如果group_code当前不存在，则会新建审批分组； 如果group_code已经存在，则会使用group_name更新审批分组名称
//
// 示例值：work_group
func (builder *ExternalApprovalBuilder) GroupCode(groupCode string) *ExternalApprovalBuilder {
	builder.groupCode = groupCode
	builder.groupCodeFlag = true
	return builder
}

// 分组名称，值的格式是 i18n key，文案放在 i18n_resource； 如果是 group_code 当前不存在，则该 group_name 必填，否则，如果填写了则会更新分组名称，不填则不更新分组名称； 审批发起页 审批定义的分组名称来自该字段
//
// 示例值：@i18n@2
func (builder *ExternalApprovalBuilder) GroupName(groupName string) *ExternalApprovalBuilder {
	builder.groupName = groupName
	builder.groupNameFlag = true
	return builder
}

// 审批定义的说明，值的格式是 i18n key，文案放在 i18n_resource； 审批发起页 审批定义的说明内容来自该字段
//
// 示例值：@i18n@2
func (builder *ExternalApprovalBuilder) Description(description string) *ExternalApprovalBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 三方审批相关
//
// 示例值：
func (builder *ExternalApprovalBuilder) External(external *ApprovalCreateExternal) *ExternalApprovalBuilder {
	builder.external = external
	builder.externalFlag = true
	return builder
}

// 可见人列表，可通知配置多个可见人，只有在配置的范围内用户可以在审批发起也看到该审批，默认不传，则是任何人不可见
//
// 示例值：
func (builder *ExternalApprovalBuilder) Viewers(viewers []*ApprovalCreateViewers) *ExternalApprovalBuilder {
	builder.viewers = viewers
	builder.viewersFlag = true
	return builder
}

// 国际化文案
//
// 示例值：
func (builder *ExternalApprovalBuilder) I18nResources(i18nResources []*I18nResource) *ExternalApprovalBuilder {
	builder.i18nResources = i18nResources
	builder.i18nResourcesFlag = true
	return builder
}

// 根据user_id_type填写流程管理员id
//
// 示例值：19a294c2
func (builder *ExternalApprovalBuilder) Managers(managers []string) *ExternalApprovalBuilder {
	builder.managers = managers
	builder.managersFlag = true
	return builder
}

func (builder *ExternalApprovalBuilder) Build() *ExternalApproval {
	req := &ExternalApproval{}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.groupCodeFlag {
		req.GroupCode = &builder.groupCode

	}
	if builder.groupNameFlag {
		req.GroupName = &builder.groupName

	}
	if builder.descriptionFlag {
		req.Description = &builder.description

	}
	if builder.externalFlag {
		req.External = builder.external
	}
	if builder.viewersFlag {
		req.Viewers = builder.viewers
	}
	if builder.i18nResourcesFlag {
		req.I18nResources = builder.i18nResources
	}
	if builder.managersFlag {
		req.Managers = builder.managers
	}
	return req
}

type ExternalApprovalItem struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code

	ApprovalExternalId *string `json:"approval_external_id,omitempty"` // 三方审批定义ID
}

type ExternalApprovalItemBuilder struct {
	approvalCode     string // 审批定义code
	approvalCodeFlag bool

	approvalExternalId     string // 三方审批定义ID
	approvalExternalIdFlag bool
}

func NewExternalApprovalItemBuilder() *ExternalApprovalItemBuilder {
	builder := &ExternalApprovalItemBuilder{}
	return builder
}

// 审批定义code
//
// 示例值：C30381C8-7A5F-4717-A9CF-C233BF0202D4
func (builder *ExternalApprovalItemBuilder) ApprovalCode(approvalCode string) *ExternalApprovalItemBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 三方审批定义ID
//
// 示例值：permission_test
func (builder *ExternalApprovalItemBuilder) ApprovalExternalId(approvalExternalId string) *ExternalApprovalItemBuilder {
	builder.approvalExternalId = approvalExternalId
	builder.approvalExternalIdFlag = true
	return builder
}

func (builder *ExternalApprovalItemBuilder) Build() *ExternalApprovalItem {
	req := &ExternalApprovalItem{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.approvalExternalIdFlag {
		req.ApprovalExternalId = &builder.approvalExternalId

	}
	return req
}

type ExternalInstance struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code， 创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段

	Status *string `json:"status,omitempty"` // 审批实例状态

	Extra *string `json:"extra,omitempty"` // 审批实例扩展 JSON

	InstanceId *string `json:"instance_id,omitempty"` // 审批实例唯一标识，用户自定义，需确保证租户下唯一

	Links *ExternalInstanceLink `json:"links,omitempty"` // 审批实例链接集合 ，用于【已发起】列表的跳转，跳转回三方系统； pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响

	Title *string `json:"title,omitempty"` // 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称

	Form []*ExternalInstanceForm `json:"form,omitempty"` // 用户提交审批时填写的表单数据，用于所有审批列表中展示。可传多个值，但审批中心pc展示前2个,移动端展示前3个,长度不超过2048字符

	UserId *string `json:"user_id,omitempty"` // 审批发起人 user_id，发起人可在【已发起】列表中看到所有已发起的审批; 在【待审批】，【已审批】【抄送我】列表中，该字段展示审批是谁发起的。审批发起人 open id，和 user id 二者至少填一个。

	UserName *string `json:"user_name,omitempty"` // 审批发起人 用户名，如果发起人不是真实的用户（例如是某个部门），没有 user_id，则可以使用该字段传名称

	OpenId *string `json:"open_id,omitempty"` // 审批发起人 open id，和 user id 二者至少填一个

	DepartmentId *string `json:"department_id,omitempty"` // 发起人部门，用于列表中展示发起人所属部门。不传则不展示。如果用户没加入任何部门，传 ""，将展示租户名称传 department_name 展示部门名称

	DepartmentName *string `json:"department_name,omitempty"` // 审批发起人 部门，如果发起人不是真实的用户（例如是某个部门），没有 department_id，则可以使用该字段传名称

	StartTime *string `json:"start_time,omitempty"` // 审批发起时间，Unix毫秒时间戳

	EndTime *string `json:"end_time,omitempty"` // 审批实例结束时间：未结束的审批为 0，Unix毫秒时间戳

	UpdateTime *string `json:"update_time,omitempty"` // 审批实例最近更新时间；用于推送数据版本控制如果 update_mode 值为 UPDATE，则只有传过来的 update_time 有变化时（变大），才会更新审批中心中的审批实例信息。使用该字段主要用来避免并发时老的数据更新了新的数据

	DisplayMethod *string `json:"display_method,omitempty"` // 列表页打开审批实例的方式

	UpdateMode *string `json:"update_mode,omitempty"` // 更新方式， 当 update_mode=REPLACE时，每次都以当前推送的数据为最终数据，会删掉审批中心中多余的任务、抄送数据（不在这次推送的数据中）; 当 update_mode=UPDATE时，则不会删除审批中心的数据，而只是进行新增和更新实例、任务数据

	TaskList []*ExternalInstanceTaskNode `json:"task_list,omitempty"` // 任务列表

	CcList []*CcNode `json:"cc_list,omitempty"` // 抄送列表

	I18nResources []*I18nResource `json:"i18n_resources,omitempty"` // 国际化文案

	TrusteeshipUrlToken *string `json:"trusteeship_url_token,omitempty"` // 单据托管认证token，托管回调会附带此token，帮助业务方认证

	TrusteeshipUserIdType *string `json:"trusteeship_user_id_type,omitempty"` // 用户的类型，会影响请求参数用户标识域的选择，包括加签操作回传的目标用户， 目前仅支持 "user_id"

	TrusteeshipUrls *TrusteeshipUrls `json:"trusteeship_urls,omitempty"` // 单据托管回调接入方的接口的URL地址

	TrusteeshipCacheConfig *TrusteeshipInstanceCacheConfig `json:"trusteeship_cache_config,omitempty"` // 托管预缓存策略

	ResourceRegion *string `json:"resource_region,omitempty"` // 资源所在地区， 内部统计用字段， 不需要填
}

type ExternalInstanceBuilder struct {
	approvalCode     string // 审批定义 code， 创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段
	approvalCodeFlag bool

	status     string // 审批实例状态
	statusFlag bool

	extra     string // 审批实例扩展 JSON
	extraFlag bool

	instanceId     string // 审批实例唯一标识，用户自定义，需确保证租户下唯一
	instanceIdFlag bool

	links     *ExternalInstanceLink // 审批实例链接集合 ，用于【已发起】列表的跳转，跳转回三方系统； pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
	linksFlag bool

	title     string // 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称
	titleFlag bool

	form     []*ExternalInstanceForm // 用户提交审批时填写的表单数据，用于所有审批列表中展示。可传多个值，但审批中心pc展示前2个,移动端展示前3个,长度不超过2048字符
	formFlag bool

	userId     string // 审批发起人 user_id，发起人可在【已发起】列表中看到所有已发起的审批; 在【待审批】，【已审批】【抄送我】列表中，该字段展示审批是谁发起的。审批发起人 open id，和 user id 二者至少填一个。
	userIdFlag bool

	userName     string // 审批发起人 用户名，如果发起人不是真实的用户（例如是某个部门），没有 user_id，则可以使用该字段传名称
	userNameFlag bool

	openId     string // 审批发起人 open id，和 user id 二者至少填一个
	openIdFlag bool

	departmentId     string // 发起人部门，用于列表中展示发起人所属部门。不传则不展示。如果用户没加入任何部门，传 ""，将展示租户名称传 department_name 展示部门名称
	departmentIdFlag bool

	departmentName     string // 审批发起人 部门，如果发起人不是真实的用户（例如是某个部门），没有 department_id，则可以使用该字段传名称
	departmentNameFlag bool

	startTime     string // 审批发起时间，Unix毫秒时间戳
	startTimeFlag bool

	endTime     string // 审批实例结束时间：未结束的审批为 0，Unix毫秒时间戳
	endTimeFlag bool

	updateTime     string // 审批实例最近更新时间；用于推送数据版本控制如果 update_mode 值为 UPDATE，则只有传过来的 update_time 有变化时（变大），才会更新审批中心中的审批实例信息。使用该字段主要用来避免并发时老的数据更新了新的数据
	updateTimeFlag bool

	displayMethod     string // 列表页打开审批实例的方式
	displayMethodFlag bool

	updateMode     string // 更新方式， 当 update_mode=REPLACE时，每次都以当前推送的数据为最终数据，会删掉审批中心中多余的任务、抄送数据（不在这次推送的数据中）; 当 update_mode=UPDATE时，则不会删除审批中心的数据，而只是进行新增和更新实例、任务数据
	updateModeFlag bool

	taskList     []*ExternalInstanceTaskNode // 任务列表
	taskListFlag bool

	ccList     []*CcNode // 抄送列表
	ccListFlag bool

	i18nResources     []*I18nResource // 国际化文案
	i18nResourcesFlag bool

	trusteeshipUrlToken     string // 单据托管认证token，托管回调会附带此token，帮助业务方认证
	trusteeshipUrlTokenFlag bool

	trusteeshipUserIdType     string // 用户的类型，会影响请求参数用户标识域的选择，包括加签操作回传的目标用户， 目前仅支持 "user_id"
	trusteeshipUserIdTypeFlag bool

	trusteeshipUrls     *TrusteeshipUrls // 单据托管回调接入方的接口的URL地址
	trusteeshipUrlsFlag bool

	trusteeshipCacheConfig     *TrusteeshipInstanceCacheConfig // 托管预缓存策略
	trusteeshipCacheConfigFlag bool

	resourceRegion     string // 资源所在地区， 内部统计用字段， 不需要填
	resourceRegionFlag bool
}

func NewExternalInstanceBuilder() *ExternalInstanceBuilder {
	builder := &ExternalInstanceBuilder{}
	return builder
}

// 审批定义 code， 创建审批定义返回的值，表示该实例属于哪个流程；该字段会影响到列表中该实例的标题，标题取自对应定义的 name 字段
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *ExternalInstanceBuilder) ApprovalCode(approvalCode string) *ExternalInstanceBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例状态
//
// 示例值：PENDING
func (builder *ExternalInstanceBuilder) Status(status string) *ExternalInstanceBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批实例扩展 JSON
//
// 示例值：{\"xxx\":\"xxx\"}
func (builder *ExternalInstanceBuilder) Extra(extra string) *ExternalInstanceBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 审批实例唯一标识，用户自定义，需确保证租户下唯一
//
// 示例值：24492654
func (builder *ExternalInstanceBuilder) InstanceId(instanceId string) *ExternalInstanceBuilder {
	builder.instanceId = instanceId
	builder.instanceIdFlag = true
	return builder
}

// 审批实例链接集合 ，用于【已发起】列表的跳转，跳转回三方系统； pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
//
// 示例值：
func (builder *ExternalInstanceBuilder) Links(links *ExternalInstanceLink) *ExternalInstanceBuilder {
	builder.links = links
	builder.linksFlag = true
	return builder
}

// 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称
//
// 示例值：@i18n@1
func (builder *ExternalInstanceBuilder) Title(title string) *ExternalInstanceBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 用户提交审批时填写的表单数据，用于所有审批列表中展示。可传多个值，但审批中心pc展示前2个,移动端展示前3个,长度不超过2048字符
//
// 示例值：[{ "name": "@i18n@2", "value": "@i18n@3" }]
func (builder *ExternalInstanceBuilder) Form(form []*ExternalInstanceForm) *ExternalInstanceBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批发起人 user_id，发起人可在【已发起】列表中看到所有已发起的审批; 在【待审批】，【已审批】【抄送我】列表中，该字段展示审批是谁发起的。审批发起人 open id，和 user id 二者至少填一个。
//
// 示例值：a987sf9s
func (builder *ExternalInstanceBuilder) UserId(userId string) *ExternalInstanceBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批发起人 用户名，如果发起人不是真实的用户（例如是某个部门），没有 user_id，则可以使用该字段传名称
//
// 示例值：@i18n@9
func (builder *ExternalInstanceBuilder) UserName(userName string) *ExternalInstanceBuilder {
	builder.userName = userName
	builder.userNameFlag = true
	return builder
}

// 审批发起人 open id，和 user id 二者至少填一个
//
// 示例值：ou_be73cbc0ee35eb6ca54e9e7cc14998c1
func (builder *ExternalInstanceBuilder) OpenId(openId string) *ExternalInstanceBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 发起人部门，用于列表中展示发起人所属部门。不传则不展示。如果用户没加入任何部门，传 ""，将展示租户名称传 department_name 展示部门名称
//
// 示例值：od-8ec33278bc2
func (builder *ExternalInstanceBuilder) DepartmentId(departmentId string) *ExternalInstanceBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 审批发起人 部门，如果发起人不是真实的用户（例如是某个部门），没有 department_id，则可以使用该字段传名称
//
// 示例值：@i18n@10
func (builder *ExternalInstanceBuilder) DepartmentName(departmentName string) *ExternalInstanceBuilder {
	builder.departmentName = departmentName
	builder.departmentNameFlag = true
	return builder
}

// 审批发起时间，Unix毫秒时间戳
//
// 示例值：1556468012678
func (builder *ExternalInstanceBuilder) StartTime(startTime string) *ExternalInstanceBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 审批实例结束时间：未结束的审批为 0，Unix毫秒时间戳
//
// 示例值：1556468012678
func (builder *ExternalInstanceBuilder) EndTime(endTime string) *ExternalInstanceBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 审批实例最近更新时间；用于推送数据版本控制如果 update_mode 值为 UPDATE，则只有传过来的 update_time 有变化时（变大），才会更新审批中心中的审批实例信息。使用该字段主要用来避免并发时老的数据更新了新的数据
//
// 示例值：1556468012678
func (builder *ExternalInstanceBuilder) UpdateTime(updateTime string) *ExternalInstanceBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 列表页打开审批实例的方式
//
// 示例值：BROWSER
func (builder *ExternalInstanceBuilder) DisplayMethod(displayMethod string) *ExternalInstanceBuilder {
	builder.displayMethod = displayMethod
	builder.displayMethodFlag = true
	return builder
}

// 更新方式， 当 update_mode=REPLACE时，每次都以当前推送的数据为最终数据，会删掉审批中心中多余的任务、抄送数据（不在这次推送的数据中）; 当 update_mode=UPDATE时，则不会删除审批中心的数据，而只是进行新增和更新实例、任务数据
//
// 示例值：UPDATE
func (builder *ExternalInstanceBuilder) UpdateMode(updateMode string) *ExternalInstanceBuilder {
	builder.updateMode = updateMode
	builder.updateModeFlag = true
	return builder
}

// 任务列表
//
// 示例值：
func (builder *ExternalInstanceBuilder) TaskList(taskList []*ExternalInstanceTaskNode) *ExternalInstanceBuilder {
	builder.taskList = taskList
	builder.taskListFlag = true
	return builder
}

// 抄送列表
//
// 示例值：
func (builder *ExternalInstanceBuilder) CcList(ccList []*CcNode) *ExternalInstanceBuilder {
	builder.ccList = ccList
	builder.ccListFlag = true
	return builder
}

// 国际化文案
//
// 示例值：
func (builder *ExternalInstanceBuilder) I18nResources(i18nResources []*I18nResource) *ExternalInstanceBuilder {
	builder.i18nResources = i18nResources
	builder.i18nResourcesFlag = true
	return builder
}

// 单据托管认证token，托管回调会附带此token，帮助业务方认证
//
// 示例值：788981c886b1c28ac29d1e68efd60683d6d90dfce80938ee9453e2a5f3e9e306
func (builder *ExternalInstanceBuilder) TrusteeshipUrlToken(trusteeshipUrlToken string) *ExternalInstanceBuilder {
	builder.trusteeshipUrlToken = trusteeshipUrlToken
	builder.trusteeshipUrlTokenFlag = true
	return builder
}

// 用户的类型，会影响请求参数用户标识域的选择，包括加签操作回传的目标用户， 目前仅支持 "user_id"
//
// 示例值：user_id
func (builder *ExternalInstanceBuilder) TrusteeshipUserIdType(trusteeshipUserIdType string) *ExternalInstanceBuilder {
	builder.trusteeshipUserIdType = trusteeshipUserIdType
	builder.trusteeshipUserIdTypeFlag = true
	return builder
}

// 单据托管回调接入方的接口的URL地址
//
// 示例值：
func (builder *ExternalInstanceBuilder) TrusteeshipUrls(trusteeshipUrls *TrusteeshipUrls) *ExternalInstanceBuilder {
	builder.trusteeshipUrls = trusteeshipUrls
	builder.trusteeshipUrlsFlag = true
	return builder
}

// 托管预缓存策略
//
// 示例值：
func (builder *ExternalInstanceBuilder) TrusteeshipCacheConfig(trusteeshipCacheConfig *TrusteeshipInstanceCacheConfig) *ExternalInstanceBuilder {
	builder.trusteeshipCacheConfig = trusteeshipCacheConfig
	builder.trusteeshipCacheConfigFlag = true
	return builder
}

// 资源所在地区， 内部统计用字段， 不需要填
//
// 示例值：""
func (builder *ExternalInstanceBuilder) ResourceRegion(resourceRegion string) *ExternalInstanceBuilder {
	builder.resourceRegion = resourceRegion
	builder.resourceRegionFlag = true
	return builder
}

func (builder *ExternalInstanceBuilder) Build() *ExternalInstance {
	req := &ExternalInstance{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

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

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

	}
	if builder.instanceIdFlag {
		req.InstanceId = &builder.instanceId

	}
	if builder.linksFlag {
		req.Links = builder.links
	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.formFlag {
		req.Form = builder.form
	}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.userNameFlag {
		req.UserName = &builder.userName

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.departmentNameFlag {
		req.DepartmentName = &builder.departmentName

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

	}
	if builder.displayMethodFlag {
		req.DisplayMethod = &builder.displayMethod

	}
	if builder.updateModeFlag {
		req.UpdateMode = &builder.updateMode

	}
	if builder.taskListFlag {
		req.TaskList = builder.taskList
	}
	if builder.ccListFlag {
		req.CcList = builder.ccList
	}
	if builder.i18nResourcesFlag {
		req.I18nResources = builder.i18nResources
	}
	if builder.trusteeshipUrlTokenFlag {
		req.TrusteeshipUrlToken = &builder.trusteeshipUrlToken

	}
	if builder.trusteeshipUserIdTypeFlag {
		req.TrusteeshipUserIdType = &builder.trusteeshipUserIdType

	}
	if builder.trusteeshipUrlsFlag {
		req.TrusteeshipUrls = builder.trusteeshipUrls
	}
	if builder.trusteeshipCacheConfigFlag {
		req.TrusteeshipCacheConfig = builder.trusteeshipCacheConfig
	}
	if builder.resourceRegionFlag {
		req.ResourceRegion = &builder.resourceRegion

	}
	return req
}

type ExternalInstanceForm struct {
	Name *string `json:"name,omitempty"` // 表单字段名称

	Value *string `json:"value,omitempty"` // 表单值
}

type ExternalInstanceFormBuilder struct {
	name     string // 表单字段名称
	nameFlag bool

	value     string // 表单值
	valueFlag bool
}

func NewExternalInstanceFormBuilder() *ExternalInstanceFormBuilder {
	builder := &ExternalInstanceFormBuilder{}
	return builder
}

// 表单字段名称
//
// 示例值：@i18n@2
func (builder *ExternalInstanceFormBuilder) Name(name string) *ExternalInstanceFormBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 表单值
//
// 示例值：@i18n@3
func (builder *ExternalInstanceFormBuilder) Value(value string) *ExternalInstanceFormBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *ExternalInstanceFormBuilder) Build() *ExternalInstanceForm {
	req := &ExternalInstanceForm{}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.valueFlag {
		req.Value = &builder.value

	}
	return req
}

type ExternalInstanceLink struct {
	PcLink *string `json:"pc_link,omitempty"` // pc 端的跳转链接，当用户使用飞书 pc 端时，使用该字段进行跳转

	MobileLink *string `json:"mobile_link,omitempty"` // 移动端 跳转链接，当用户使用飞书 移动端时，使用该字段进行跳转
}

type ExternalInstanceLinkBuilder struct {
	pcLink     string // pc 端的跳转链接，当用户使用飞书 pc 端时，使用该字段进行跳转
	pcLinkFlag bool

	mobileLink     string // 移动端 跳转链接，当用户使用飞书 移动端时，使用该字段进行跳转
	mobileLinkFlag bool
}

func NewExternalInstanceLinkBuilder() *ExternalInstanceLinkBuilder {
	builder := &ExternalInstanceLinkBuilder{}
	return builder
}

// pc 端的跳转链接，当用户使用飞书 pc 端时，使用该字段进行跳转
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?mode=appCenter&appId=cli_9c90fc38e07a9101&path=pc/pages/detail?id=1234
func (builder *ExternalInstanceLinkBuilder) PcLink(pcLink string) *ExternalInstanceLinkBuilder {
	builder.pcLink = pcLink
	builder.pcLinkFlag = true
	return builder
}

// 移动端 跳转链接，当用户使用飞书 移动端时，使用该字段进行跳转
//
// 示例值：https://applink.feishu.cn/client/mini_program/open?appId=cli_9c90fc38e07a9101&path=pages/detail?id=1234
func (builder *ExternalInstanceLinkBuilder) MobileLink(mobileLink string) *ExternalInstanceLinkBuilder {
	builder.mobileLink = mobileLink
	builder.mobileLinkFlag = true
	return builder
}

func (builder *ExternalInstanceLinkBuilder) Build() *ExternalInstanceLink {
	req := &ExternalInstanceLink{}
	if builder.pcLinkFlag {
		req.PcLink = &builder.pcLink

	}
	if builder.mobileLinkFlag {
		req.MobileLink = &builder.mobileLink

	}
	return req
}

type ExternalInstanceTask struct {
	TaskId *string `json:"task_id,omitempty"` // 任务 id

	UpdateTime *string `json:"update_time,omitempty"` // 任务最近更新时间
}

type ExternalInstanceTaskBuilder struct {
	taskId     string // 任务 id
	taskIdFlag bool

	updateTime     string // 任务最近更新时间
	updateTimeFlag bool
}

func NewExternalInstanceTaskBuilder() *ExternalInstanceTaskBuilder {
	builder := &ExternalInstanceTaskBuilder{}
	return builder
}

// 任务 id
//
// 示例值：112253
func (builder *ExternalInstanceTaskBuilder) TaskId(taskId string) *ExternalInstanceTaskBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 任务最近更新时间
//
// 示例值：1591603040000
func (builder *ExternalInstanceTaskBuilder) UpdateTime(updateTime string) *ExternalInstanceTaskBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

func (builder *ExternalInstanceTaskBuilder) Build() *ExternalInstanceTask {
	req := &ExternalInstanceTask{}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

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

	}
	return req
}

type ExternalInstanceTaskNode struct {
	TaskId *string `json:"task_id,omitempty"` // 审批实例内的唯一标识，用于更新审批任务时定位数据

	UserId *string `json:"user_id,omitempty"` // 审批人 user_id ，和 open_id 二者至少填一个。该任务会出现在审批人的【待审批】或【已审批】列表中

	OpenId *string `json:"open_id,omitempty"` // 审批人 open_id，和 user_id 二者至少填一个

	Title *string `json:"title,omitempty"` // 审批任务名称

	Links *ExternalInstanceLink `json:"links,omitempty"` // 【待审批】或【已审批】中使用的跳转链接，用于跳转回三方系统pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响

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

	Extra *string `json:"extra,omitempty"` // 扩展 json，任务结束原因需传complete_reason字段。枚举值与对应说明：;  - approved：同意;  - rejected：拒绝;  - node_auto_reject：（因逻辑判断产生的）自动拒绝;  - specific_rollback：退回（包括退回到发起人、退回到中间任一审批人）;  - add：并加签（添加新审批人，和我一起审批）;  - add_pre：前加签（添加新审批人，在我之前审批）;  - add_post：后加签（添加新审批人，在我之后审批）;  - delete_assignee：减签;  - forward_resign：转交（转给其他人审批）;  - recall：撤销（撤回单据，单据失效）;  - delete ：删除审批单;  - admin_forward：管理员在后台操作转交;  - system_forward：系统自动转交;  - auto_skip：自动通过;  - manual_skip：手动跳过;  - submit_again：重新提交任务;  - restart：重新启动流程;  - others：其他（作为兜底）

	CreateTime *string `json:"create_time,omitempty"` // 任务创建时间，Unix 毫秒时间戳

	EndTime *string `json:"end_time,omitempty"` // 任务完成时间：未结束的审批为 0，Unix 毫秒时间戳

	UpdateTime *string `json:"update_time,omitempty"` // task最近更新时间，用于推送数据版本控制； 更新策略同 instance 中的 update_time

	ActionContext *string `json:"action_context,omitempty"` // 操作上下文，当用户操作时，回调请求中带上该参数，用于传递该任务的上下文数据

	ActionConfigs []*ActionConfig `json:"action_configs,omitempty"` // 任务级别操作配置,快捷审批目前支持移动端操作

	DisplayMethod *string `json:"display_method,omitempty"` // 列表页打开审批任务的方式

	ExcludeStatistics *bool `json:"exclude_statistics,omitempty"` // 三方任务支持不纳入效率统计。;false：纳入效率统计。;true：不纳入效率统计

	NodeId *string `json:"node_id,omitempty"` // 节点id：必须同时满足;- 一个流程内，每个节点id唯一。如一个流程下「直属上级」、「隔级上级」等每个节点的Node_id均不一样;- 同一个流程定义内，不同审批实例中的相同节点，Node_id要保持不变。例如张三和李四分别发起了请假申请，这2个审批实例中的「直属上级」节点的node_id应该保持一致

	NodeName *string `json:"node_name,omitempty"` // 节点名称，如「财务审批」「法务审批」，支持中英日三种语言。示例：i18n@name。需要在i18n_resources中传该名称对应的国际化文案

	GenerateType *string `json:"generate_type,omitempty"` // 任务生成类型
}

type ExternalInstanceTaskNodeBuilder struct {
	taskId     string // 审批实例内的唯一标识，用于更新审批任务时定位数据
	taskIdFlag bool

	userId     string // 审批人 user_id ，和 open_id 二者至少填一个。该任务会出现在审批人的【待审批】或【已审批】列表中
	userIdFlag bool

	openId     string // 审批人 open_id，和 user_id 二者至少填一个
	openIdFlag bool

	title     string // 审批任务名称
	titleFlag bool

	links     *ExternalInstanceLink // 【待审批】或【已审批】中使用的跳转链接，用于跳转回三方系统pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
	linksFlag bool

	status     string // 任务状态
	statusFlag bool

	extra     string // 扩展 json，任务结束原因需传complete_reason字段。枚举值与对应说明：;  - approved：同意;  - rejected：拒绝;  - node_auto_reject：（因逻辑判断产生的）自动拒绝;  - specific_rollback：退回（包括退回到发起人、退回到中间任一审批人）;  - add：并加签（添加新审批人，和我一起审批）;  - add_pre：前加签（添加新审批人，在我之前审批）;  - add_post：后加签（添加新审批人，在我之后审批）;  - delete_assignee：减签;  - forward_resign：转交（转给其他人审批）;  - recall：撤销（撤回单据，单据失效）;  - delete ：删除审批单;  - admin_forward：管理员在后台操作转交;  - system_forward：系统自动转交;  - auto_skip：自动通过;  - manual_skip：手动跳过;  - submit_again：重新提交任务;  - restart：重新启动流程;  - others：其他（作为兜底）
	extraFlag bool

	createTime     string // 任务创建时间，Unix 毫秒时间戳
	createTimeFlag bool

	endTime     string // 任务完成时间：未结束的审批为 0，Unix 毫秒时间戳
	endTimeFlag bool

	updateTime     string // task最近更新时间，用于推送数据版本控制； 更新策略同 instance 中的 update_time
	updateTimeFlag bool

	actionContext     string // 操作上下文，当用户操作时，回调请求中带上该参数，用于传递该任务的上下文数据
	actionContextFlag bool

	actionConfigs     []*ActionConfig // 任务级别操作配置,快捷审批目前支持移动端操作
	actionConfigsFlag bool

	displayMethod     string // 列表页打开审批任务的方式
	displayMethodFlag bool

	excludeStatistics     bool // 三方任务支持不纳入效率统计。;false：纳入效率统计。;true：不纳入效率统计
	excludeStatisticsFlag bool

	nodeId     string // 节点id：必须同时满足;- 一个流程内，每个节点id唯一。如一个流程下「直属上级」、「隔级上级」等每个节点的Node_id均不一样;- 同一个流程定义内，不同审批实例中的相同节点，Node_id要保持不变。例如张三和李四分别发起了请假申请，这2个审批实例中的「直属上级」节点的node_id应该保持一致
	nodeIdFlag bool

	nodeName     string // 节点名称，如「财务审批」「法务审批」，支持中英日三种语言。示例：i18n@name。需要在i18n_resources中传该名称对应的国际化文案
	nodeNameFlag bool

	generateType     string // 任务生成类型
	generateTypeFlag bool
}

func NewExternalInstanceTaskNodeBuilder() *ExternalInstanceTaskNodeBuilder {
	builder := &ExternalInstanceTaskNodeBuilder{}
	return builder
}

// 审批实例内的唯一标识，用于更新审批任务时定位数据
//
// 示例值：112534
func (builder *ExternalInstanceTaskNodeBuilder) TaskId(taskId string) *ExternalInstanceTaskNodeBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 审批人 user_id ，和 open_id 二者至少填一个。该任务会出现在审批人的【待审批】或【已审批】列表中
//
// 示例值：a987sf9s
func (builder *ExternalInstanceTaskNodeBuilder) UserId(userId string) *ExternalInstanceTaskNodeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批人 open_id，和 user_id 二者至少填一个
//
// 示例值：ou_be73cbc0ee35eb6ca54e9e7cc14998c1
func (builder *ExternalInstanceTaskNodeBuilder) OpenId(openId string) *ExternalInstanceTaskNodeBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 审批任务名称
//
// 示例值：i18n1
func (builder *ExternalInstanceTaskNodeBuilder) Title(title string) *ExternalInstanceTaskNodeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 【待审批】或【已审批】中使用的跳转链接，用于跳转回三方系统pc_link 和 mobile_link 必须填一个，填写的是哪一端的链接，即会跳转到该链接，不受平台影响
//
// 示例值：
func (builder *ExternalInstanceTaskNodeBuilder) Links(links *ExternalInstanceLink) *ExternalInstanceTaskNodeBuilder {
	builder.links = links
	builder.linksFlag = true
	return builder
}

// 任务状态
//
// 示例值：PENDING
func (builder *ExternalInstanceTaskNodeBuilder) Status(status string) *ExternalInstanceTaskNodeBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 扩展 json，任务结束原因需传complete_reason字段。枚举值与对应说明：;  - approved：同意;  - rejected：拒绝;  - node_auto_reject：（因逻辑判断产生的）自动拒绝;  - specific_rollback：退回（包括退回到发起人、退回到中间任一审批人）;  - add：并加签（添加新审批人，和我一起审批）;  - add_pre：前加签（添加新审批人，在我之前审批）;  - add_post：后加签（添加新审批人，在我之后审批）;  - delete_assignee：减签;  - forward_resign：转交（转给其他人审批）;  - recall：撤销（撤回单据，单据失效）;  - delete ：删除审批单;  - admin_forward：管理员在后台操作转交;  - system_forward：系统自动转交;  - auto_skip：自动通过;  - manual_skip：手动跳过;  - submit_again：重新提交任务;  - restart：重新启动流程;  - others：其他（作为兜底）
//
// 示例值：{\"xxx\":\"xxx\",\"complete_reason\":\"approved\"}
func (builder *ExternalInstanceTaskNodeBuilder) Extra(extra string) *ExternalInstanceTaskNodeBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 任务创建时间，Unix 毫秒时间戳
//
// 示例值：1556468012678
func (builder *ExternalInstanceTaskNodeBuilder) CreateTime(createTime string) *ExternalInstanceTaskNodeBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 任务完成时间：未结束的审批为 0，Unix 毫秒时间戳
//
// 示例值：1556468012678
func (builder *ExternalInstanceTaskNodeBuilder) EndTime(endTime string) *ExternalInstanceTaskNodeBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// task最近更新时间，用于推送数据版本控制； 更新策略同 instance 中的 update_time
//
// 示例值：1556468012678
func (builder *ExternalInstanceTaskNodeBuilder) UpdateTime(updateTime string) *ExternalInstanceTaskNodeBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 操作上下文，当用户操作时，回调请求中带上该参数，用于传递该任务的上下文数据
//
// 示例值：123456
func (builder *ExternalInstanceTaskNodeBuilder) ActionContext(actionContext string) *ExternalInstanceTaskNodeBuilder {
	builder.actionContext = actionContext
	builder.actionContextFlag = true
	return builder
}

// 任务级别操作配置,快捷审批目前支持移动端操作
//
// 示例值：
func (builder *ExternalInstanceTaskNodeBuilder) ActionConfigs(actionConfigs []*ActionConfig) *ExternalInstanceTaskNodeBuilder {
	builder.actionConfigs = actionConfigs
	builder.actionConfigsFlag = true
	return builder
}

// 列表页打开审批任务的方式
//
// 示例值：BROWSER
func (builder *ExternalInstanceTaskNodeBuilder) DisplayMethod(displayMethod string) *ExternalInstanceTaskNodeBuilder {
	builder.displayMethod = displayMethod
	builder.displayMethodFlag = true
	return builder
}

// 三方任务支持不纳入效率统计。;false：纳入效率统计。;true：不纳入效率统计
//
// 示例值：false
func (builder *ExternalInstanceTaskNodeBuilder) ExcludeStatistics(excludeStatistics bool) *ExternalInstanceTaskNodeBuilder {
	builder.excludeStatistics = excludeStatistics
	builder.excludeStatisticsFlag = true
	return builder
}

// 节点id：必须同时满足;- 一个流程内，每个节点id唯一。如一个流程下「直属上级」、「隔级上级」等每个节点的Node_id均不一样;- 同一个流程定义内，不同审批实例中的相同节点，Node_id要保持不变。例如张三和李四分别发起了请假申请，这2个审批实例中的「直属上级」节点的node_id应该保持一致
//
// 示例值：node
func (builder *ExternalInstanceTaskNodeBuilder) NodeId(nodeId string) *ExternalInstanceTaskNodeBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// 节点名称，如「财务审批」「法务审批」，支持中英日三种语言。示例：i18n@name。需要在i18n_resources中传该名称对应的国际化文案
//
// 示例值：i18n@name
func (builder *ExternalInstanceTaskNodeBuilder) NodeName(nodeName string) *ExternalInstanceTaskNodeBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

// 任务生成类型
//
// 示例值：EXTERNAL_CONSIGN
func (builder *ExternalInstanceTaskNodeBuilder) GenerateType(generateType string) *ExternalInstanceTaskNodeBuilder {
	builder.generateType = generateType
	builder.generateTypeFlag = true
	return builder
}

func (builder *ExternalInstanceTaskNodeBuilder) Build() *ExternalInstanceTaskNode {
	req := &ExternalInstanceTaskNode{}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

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

	}
	if builder.linksFlag {
		req.Links = builder.links
	}
	if builder.statusFlag {
		req.Status = &builder.status

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

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

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

	}
	if builder.actionContextFlag {
		req.ActionContext = &builder.actionContext

	}
	if builder.actionConfigsFlag {
		req.ActionConfigs = builder.actionConfigs
	}
	if builder.displayMethodFlag {
		req.DisplayMethod = &builder.displayMethod

	}
	if builder.excludeStatisticsFlag {
		req.ExcludeStatistics = &builder.excludeStatistics

	}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	if builder.generateTypeFlag {
		req.GenerateType = &builder.generateType

	}
	return req
}

type ExternalTaskItem struct {
	Id *string `json:"id,omitempty"` // 审批任务 ID

	Status *string `json:"status,omitempty"` // 审批任务状态

	UpdateTime *string `json:"update_time,omitempty"` // 审批任务最后更新时间，单位 毫秒
}

type ExternalTaskItemBuilder struct {
	id     string // 审批任务 ID
	idFlag bool

	status     string // 审批任务状态
	statusFlag bool

	updateTime     string // 审批任务最后更新时间，单位 毫秒
	updateTimeFlag bool
}

func NewExternalTaskItemBuilder() *ExternalTaskItemBuilder {
	builder := &ExternalTaskItemBuilder{}
	return builder
}

// 审批任务 ID
//
// 示例值：310
func (builder *ExternalTaskItemBuilder) Id(id string) *ExternalTaskItemBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 审批任务状态
//
// 示例值：PENDING
func (builder *ExternalTaskItemBuilder) Status(status string) *ExternalTaskItemBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批任务最后更新时间，单位 毫秒
//
// 示例值：1621863215000
func (builder *ExternalTaskItemBuilder) UpdateTime(updateTime string) *ExternalTaskItemBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

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

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

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

	}
	return req
}

type ExternalTaskList struct {
	InstanceId *string `json:"instance_id,omitempty"` // 审批实例 ID

	ApprovalId *string `json:"approval_id,omitempty"` // 审批的id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批对应的 approval_code

	Status *string `json:"status,omitempty"` // 审批实例当前的状态

	UpdateTime *string `json:"update_time,omitempty"` // 审批实例最后更新时间，单位 毫秒

	Tasks []*ExternalTaskItem `json:"tasks,omitempty"` // 审批实例下的审批任务
}

type ExternalTaskListBuilder struct {
	instanceId     string // 审批实例 ID
	instanceIdFlag bool

	approvalId     string // 审批的id
	approvalIdFlag bool

	approvalCode     string // 审批对应的 approval_code
	approvalCodeFlag bool

	status     string // 审批实例当前的状态
	statusFlag bool

	updateTime     string // 审批实例最后更新时间，单位 毫秒
	updateTimeFlag bool

	tasks     []*ExternalTaskItem // 审批实例下的审批任务
	tasksFlag bool
}

func NewExternalTaskListBuilder() *ExternalTaskListBuilder {
	builder := &ExternalTaskListBuilder{}
	return builder
}

// 审批实例 ID
//
// 示例值：29075
func (builder *ExternalTaskListBuilder) InstanceId(instanceId string) *ExternalTaskListBuilder {
	builder.instanceId = instanceId
	builder.instanceIdFlag = true
	return builder
}

// 审批的id
//
// 示例值：fwwweffff33111133xxx
func (builder *ExternalTaskListBuilder) ApprovalId(approvalId string) *ExternalTaskListBuilder {
	builder.approvalId = approvalId
	builder.approvalIdFlag = true
	return builder
}

// 审批对应的 approval_code
//
// 示例值：B7B65FFE-C2GC-452F-9F0F-9AA8352363D6
func (builder *ExternalTaskListBuilder) ApprovalCode(approvalCode string) *ExternalTaskListBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例当前的状态
//
// 示例值：PENDING
func (builder *ExternalTaskListBuilder) Status(status string) *ExternalTaskListBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批实例最后更新时间，单位 毫秒
//
// 示例值：1621863215000
func (builder *ExternalTaskListBuilder) UpdateTime(updateTime string) *ExternalTaskListBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 审批实例下的审批任务
//
// 示例值：
func (builder *ExternalTaskListBuilder) Tasks(tasks []*ExternalTaskItem) *ExternalTaskListBuilder {
	builder.tasks = tasks
	builder.tasksFlag = true
	return builder
}

func (builder *ExternalTaskListBuilder) Build() *ExternalTaskList {
	req := &ExternalTaskList{}
	if builder.instanceIdFlag {
		req.InstanceId = &builder.instanceId

	}
	if builder.approvalIdFlag {
		req.ApprovalId = &builder.approvalId

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

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

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

	}
	if builder.tasksFlag {
		req.Tasks = builder.tasks
	}
	return req
}

type FieldGroup struct {
	Writable []string `json:"writable,omitempty"` // 可写权限的表单项的 id列表

	Readable []string `json:"readable,omitempty"` // 可读权限的表单项的 id列表
}

type FieldGroupBuilder struct {
	writable     []string // 可写权限的表单项的 id列表
	writableFlag bool

	readable     []string // 可读权限的表单项的 id列表
	readableFlag bool
}

func NewFieldGroupBuilder() *FieldGroupBuilder {
	builder := &FieldGroupBuilder{}
	return builder
}

// 可写权限的表单项的 id列表
//
// 示例值：9293493
func (builder *FieldGroupBuilder) Writable(writable []string) *FieldGroupBuilder {
	builder.writable = writable
	builder.writableFlag = true
	return builder
}

// 可读权限的表单项的 id列表
//
// 示例值：9293493
func (builder *FieldGroupBuilder) Readable(readable []string) *FieldGroupBuilder {
	builder.readable = readable
	builder.readableFlag = true
	return builder
}

func (builder *FieldGroupBuilder) Build() *FieldGroup {
	req := &FieldGroup{}
	if builder.writableFlag {
		req.Writable = builder.writable
	}
	if builder.readableFlag {
		req.Readable = builder.readable
	}
	return req
}

type File struct {
	Url *string `json:"url,omitempty"` // 附件路径

	FileSize *int `json:"file_size,omitempty"` // 附件大小

	Title *string `json:"title,omitempty"` // 附件标题

	Type *string `json:"type,omitempty"` // 附件类别
}

type FileBuilder struct {
	url     string // 附件路径
	urlFlag bool

	fileSize     int // 附件大小
	fileSizeFlag bool

	title     string // 附件标题
	titleFlag bool

	type_    string // 附件类别
	typeFlag bool
}

func NewFileBuilder() *FileBuilder {
	builder := &FileBuilder{}
	return builder
}

// 附件路径
//
// 示例值：https://p3-approval-sign.byteimg.com/lark-approval-attachment/image/20220714/1/332f3596-0845-4746-a4bc-818d54ad435b.png~tplv-ottatrvjsm-image.image?x-expires=1659033558&x-signature=6edF3k%2BaHeAuvfcBRGOkbckoUl4%3D#.png
func (builder *FileBuilder) Url(url string) *FileBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

// 附件大小
//
// 示例值：186823
func (builder *FileBuilder) FileSize(fileSize int) *FileBuilder {
	builder.fileSize = fileSize
	builder.fileSizeFlag = true
	return builder
}

// 附件标题
//
// 示例值：e018906140ed9388234bd03b0.png
func (builder *FileBuilder) Title(title string) *FileBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 附件类别
//
// 示例值：image
func (builder *FileBuilder) Type(type_ string) *FileBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

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

	}
	if builder.fileSizeFlag {
		req.FileSize = &builder.fileSize

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

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

	}
	return req
}

type FileUrl struct {
	Name *string `json:"name,omitempty"` // 不给出即使用从url从获得的，如果给出则使用用户给出的

	Url *string `json:"url,omitempty"` // 用户上传的url
}

type FileUrlBuilder struct {
	name     string // 不给出即使用从url从获得的，如果给出则使用用户给出的
	nameFlag bool

	url     string // 用户上传的url
	urlFlag bool
}

func NewFileUrlBuilder() *FileUrlBuilder {
	builder := &FileUrlBuilder{}
	return builder
}

// 不给出即使用从url从获得的，如果给出则使用用户给出的
//
// 示例值：xxxxx.png
func (builder *FileUrlBuilder) Name(name string) *FileUrlBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 用户上传的url
//
// 示例值：https://xxxxx.com/i/2022/06/08/xxxxx.png
func (builder *FileUrlBuilder) Url(url string) *FileUrlBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

func (builder *FileUrlBuilder) Build() *FileUrl {
	req := &FileUrl{}
	if builder.nameFlag {
		req.Name = &builder.name

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

	}
	return req
}

type I18nResource struct {
	Locale *string `json:"locale,omitempty"` // 语言可选值有： zh-CN：中文 en-US：英文 ja-JP：日文

	Texts []*I18nResourceText `json:"texts,omitempty"` // 文案 key, value, i18n key 以 @i18n@ 开头； 该字段主要用于做国际化，允许用户同时传多个语言的文案，审批中心会根据用户当前的语音环境使用对应的文案，如果没有传用户当前的语音环境文案，则会使用默认的语言文案。

	IsDefault *bool `json:"is_default,omitempty"` // 是否默认语言，默认语言需要包含所有key，非默认语言如果key不存在会使用默认语言代替
}

type I18nResourceBuilder struct {
	locale     string // 语言可选值有： zh-CN：中文 en-US：英文 ja-JP：日文
	localeFlag bool

	texts     []*I18nResourceText // 文案 key, value, i18n key 以 @i18n@ 开头； 该字段主要用于做国际化，允许用户同时传多个语言的文案，审批中心会根据用户当前的语音环境使用对应的文案，如果没有传用户当前的语音环境文案，则会使用默认的语言文案。
	textsFlag bool

	isDefault     bool // 是否默认语言，默认语言需要包含所有key，非默认语言如果key不存在会使用默认语言代替
	isDefaultFlag bool
}

func NewI18nResourceBuilder() *I18nResourceBuilder {
	builder := &I18nResourceBuilder{}
	return builder
}

// 语言可选值有： zh-CN：中文 en-US：英文 ja-JP：日文
//
// 示例值：zh-CN
func (builder *I18nResourceBuilder) Locale(locale string) *I18nResourceBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 文案 key, value, i18n key 以 @i18n@ 开头； 该字段主要用于做国际化，允许用户同时传多个语言的文案，审批中心会根据用户当前的语音环境使用对应的文案，如果没有传用户当前的语音环境文案，则会使用默认的语言文案。
//
// 示例值：{ "@i18n@1": "权限申请", "@i18n@2": "OA审批", "@i18n@3": "Permission" }
func (builder *I18nResourceBuilder) Texts(texts []*I18nResourceText) *I18nResourceBuilder {
	builder.texts = texts
	builder.textsFlag = true
	return builder
}

// 是否默认语言，默认语言需要包含所有key，非默认语言如果key不存在会使用默认语言代替
//
// 示例值：true
func (builder *I18nResourceBuilder) IsDefault(isDefault bool) *I18nResourceBuilder {
	builder.isDefault = isDefault
	builder.isDefaultFlag = true
	return builder
}

func (builder *I18nResourceBuilder) Build() *I18nResource {
	req := &I18nResource{}
	if builder.localeFlag {
		req.Locale = &builder.locale

	}
	if builder.textsFlag {
		req.Texts = builder.texts
	}
	if builder.isDefaultFlag {
		req.IsDefault = &builder.isDefault

	}
	return req
}

type I18nResourceText struct {
	Key *string `json:"key,omitempty"` // 文案key

	Value *string `json:"value,omitempty"` // 文案
}

type I18nResourceTextBuilder struct {
	key     string // 文案key
	keyFlag bool

	value     string // 文案
	valueFlag bool
}

func NewI18nResourceTextBuilder() *I18nResourceTextBuilder {
	builder := &I18nResourceTextBuilder{}
	return builder
}

// 文案key
//
// 示例值：@i18n@1
func (builder *I18nResourceTextBuilder) Key(key string) *I18nResourceTextBuilder {
	builder.key = key
	builder.keyFlag = true
	return builder
}

// 文案
//
// 示例值：people
func (builder *I18nResourceTextBuilder) Value(value string) *I18nResourceTextBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *I18nResourceTextBuilder) Build() *I18nResourceText {
	req := &I18nResourceText{}
	if builder.keyFlag {
		req.Key = &builder.key

	}
	if builder.valueFlag {
		req.Value = &builder.value

	}
	return req
}

type Instance struct {
	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例code

	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称

	StartTime *string `json:"start_time,omitempty"` // 审批实例发起时间戳

	EndTime *string `json:"end_time,omitempty"` // 审批实例结束时间戳

	UserId *string `json:"user_id,omitempty"` // 发起人

	SerialId *string `json:"serial_id,omitempty"` // 申请编号
}

type InstanceBuilder struct {
	instanceCode     string // 审批实例code
	instanceCodeFlag bool

	approvalName     string // 审批名称
	approvalNameFlag bool

	startTime     string // 审批实例发起时间戳
	startTimeFlag bool

	endTime     string // 审批实例结束时间戳
	endTimeFlag bool

	userId     string // 发起人
	userIdFlag bool

	serialId     string // 申请编号
	serialIdFlag bool
}

func NewInstanceBuilder() *InstanceBuilder {
	builder := &InstanceBuilder{}
	return builder
}

// 审批实例code
//
// 示例值：
func (builder *InstanceBuilder) InstanceCode(instanceCode string) *InstanceBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 审批名称
//
// 示例值：
func (builder *InstanceBuilder) ApprovalName(approvalName string) *InstanceBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 审批实例发起时间戳
//
// 示例值：
func (builder *InstanceBuilder) StartTime(startTime string) *InstanceBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 审批实例结束时间戳
//
// 示例值：
func (builder *InstanceBuilder) EndTime(endTime string) *InstanceBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 发起人
//
// 示例值：
func (builder *InstanceBuilder) UserId(userId string) *InstanceBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 申请编号
//
// 示例值：
func (builder *InstanceBuilder) SerialId(serialId string) *InstanceBuilder {
	builder.serialId = serialId
	builder.serialIdFlag = true
	return builder
}

func (builder *InstanceBuilder) Build() *Instance {
	req := &Instance{}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

	}
	if builder.serialIdFlag {
		req.SerialId = &builder.serialId

	}
	return req
}

type InstanceCancel struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义Code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例Code

	UserId *string `json:"user_id,omitempty"` // 操作用户, 根据user_id_type填写
}

type InstanceCancelBuilder struct {
	approvalCode     string // 审批定义Code
	approvalCodeFlag bool

	instanceCode     string // 审批实例Code
	instanceCodeFlag bool

	userId     string // 操作用户, 根据user_id_type填写
	userIdFlag bool
}

func NewInstanceCancelBuilder() *InstanceCancelBuilder {
	builder := &InstanceCancelBuilder{}
	return builder
}

// 审批定义Code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *InstanceCancelBuilder) ApprovalCode(approvalCode string) *InstanceCancelBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例Code
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *InstanceCancelBuilder) InstanceCode(instanceCode string) *InstanceCancelBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 操作用户, 根据user_id_type填写
//
// 示例值：f7cb567e
func (builder *InstanceCancelBuilder) UserId(userId string) *InstanceCancelBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

func (builder *InstanceCancelBuilder) Build() *InstanceCancel {
	req := &InstanceCancel{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	return req
}

type InstanceCc struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 code

	UserId *string `json:"user_id,omitempty"` // 根据user_id_type填写发起抄送的人的用户id

	CcUserIds []string `json:"cc_user_ids,omitempty"` // 根据user_id_type填写被抄送人的 用户id 列表

	Comment *string `json:"comment,omitempty"` // 抄送留言
}

type InstanceCcBuilder struct {
	approvalCode     string // 审批定义 code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 code
	instanceCodeFlag bool

	userId     string // 根据user_id_type填写发起抄送的人的用户id
	userIdFlag bool

	ccUserIds     []string // 根据user_id_type填写被抄送人的 用户id 列表
	ccUserIdsFlag bool

	comment     string // 抄送留言
	commentFlag bool
}

func NewInstanceCcBuilder() *InstanceCcBuilder {
	builder := &InstanceCcBuilder{}
	return builder
}

// 审批定义 code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *InstanceCcBuilder) ApprovalCode(approvalCode string) *InstanceCcBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *InstanceCcBuilder) InstanceCode(instanceCode string) *InstanceCcBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 根据user_id_type填写发起抄送的人的用户id
//
// 示例值：f7cb567e
func (builder *InstanceCcBuilder) UserId(userId string) *InstanceCcBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 根据user_id_type填写被抄送人的 用户id 列表
//
// 示例值：f7cb567e
func (builder *InstanceCcBuilder) CcUserIds(ccUserIds []string) *InstanceCcBuilder {
	builder.ccUserIds = ccUserIds
	builder.ccUserIdsFlag = true
	return builder
}

// 抄送留言
//
// 示例值：ok
func (builder *InstanceCcBuilder) Comment(comment string) *InstanceCcBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

func (builder *InstanceCcBuilder) Build() *InstanceCc {
	req := &InstanceCc{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.ccUserIdsFlag {
		req.CcUserIds = builder.ccUserIds
	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	return req
}

type InstanceCcUser struct {
	UserId *string `json:"user_id,omitempty"` // 抄送人 user id

	CcId *string `json:"cc_id,omitempty"` // 审批实例内抄送唯一标识

	OpenId *string `json:"open_id,omitempty"` // 抄送人 open id
}

type InstanceCcUserBuilder struct {
	userId     string // 抄送人 user id
	userIdFlag bool

	ccId     string // 审批实例内抄送唯一标识
	ccIdFlag bool

	openId     string // 抄送人 open id
	openIdFlag bool
}

func NewInstanceCcUserBuilder() *InstanceCcUserBuilder {
	builder := &InstanceCcUserBuilder{}
	return builder
}

// 抄送人 user id
//
// 示例值：eea5gefe
func (builder *InstanceCcUserBuilder) UserId(userId string) *InstanceCcUserBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批实例内抄送唯一标识
//
// 示例值：123445
func (builder *InstanceCcUserBuilder) CcId(ccId string) *InstanceCcUserBuilder {
	builder.ccId = ccId
	builder.ccIdFlag = true
	return builder
}

// 抄送人 open id
//
// 示例值：ou_12345
func (builder *InstanceCcUserBuilder) OpenId(openId string) *InstanceCcUserBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

func (builder *InstanceCcUserBuilder) Build() *InstanceCcUser {
	req := &InstanceCcUser{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.ccIdFlag {
		req.CcId = &builder.ccId

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	return req
}

type InstanceComment struct {
	Id *string `json:"id,omitempty"` // 评论 id

	UserId *string `json:"user_id,omitempty"` // 发表评论用户

	OpenId *string `json:"open_id,omitempty"` // 发表评论用户 open id

	Comment *string `json:"comment,omitempty"` // 评论内容

	CreateTime *string `json:"create_time,omitempty"` // 1564590532967

	Files []*File `json:"files,omitempty"` // 评论附件
}

type InstanceCommentBuilder struct {
	id     string // 评论 id
	idFlag bool

	userId     string // 发表评论用户
	userIdFlag bool

	openId     string // 发表评论用户 open id
	openIdFlag bool

	comment     string // 评论内容
	commentFlag bool

	createTime     string // 1564590532967
	createTimeFlag bool

	files     []*File // 评论附件
	filesFlag bool
}

func NewInstanceCommentBuilder() *InstanceCommentBuilder {
	builder := &InstanceCommentBuilder{}
	return builder
}

// 评论 id
//
// 示例值：1234
func (builder *InstanceCommentBuilder) Id(id string) *InstanceCommentBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 发表评论用户
//
// 示例值：f7cb567e
func (builder *InstanceCommentBuilder) UserId(userId string) *InstanceCommentBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 发表评论用户 open id
//
// 示例值：ou_123456
func (builder *InstanceCommentBuilder) OpenId(openId string) *InstanceCommentBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 评论内容
//
// 示例值：ok
func (builder *InstanceCommentBuilder) Comment(comment string) *InstanceCommentBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 1564590532967
//
// 示例值：评论时间
func (builder *InstanceCommentBuilder) CreateTime(createTime string) *InstanceCommentBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 评论附件
//
// 示例值：
func (builder *InstanceCommentBuilder) Files(files []*File) *InstanceCommentBuilder {
	builder.files = files
	builder.filesFlag = true
	return builder
}

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

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

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

	}
	if builder.filesFlag {
		req.Files = builder.files
	}
	return req
}

type InstanceCreate struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code

	UserId *string `json:"user_id,omitempty"` // 发起审批用户

	OpenId *string `json:"open_id,omitempty"` // 发起审批用户 open id, 如果传了 user_id 则优先使用 user_id

	DepartmentId *string `json:"department_id,omitempty"` // 发起审批用户部门id，如果用户只属于一个部门，可以不填。如果属于多个部门，默认会选择部门列表第一个部门

	Form *string `json:"form,omitempty"` // json 数组，控件值

	NodeApproverUserIdList []*NodeApprover `json:"node_approver_user_id_list,omitempty"` // 如果有发起人自选节点，则需要填写对应节点的审批人

	NodeApproverOpenIdList []*NodeApprover `json:"node_approver_open_id_list,omitempty"` // 审批人发起人自选 open id，与上述node_approver_user_id_list字段取并集

	NodeCcUserIdList []*NodeCc `json:"node_cc_user_id_list,omitempty"` // 如果有发起人自选节点，则可填写对应节点的抄送人，单个节点最多选择20位抄送人

	NodeCcOpenIdList []*NodeCc `json:"node_cc_open_id_list,omitempty"` // 抄送人发起人自选 open id 单个节点最多选择20位抄送人

	Uuid *string `json:"uuid,omitempty"` // 审批实例 uuid，用于幂等操作, 每个租户下面的唯一key，同一个 uuid 只能用于创建一个审批实例，如果冲突，返回错误码 60012 ，格式建议为 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX，不区分大小写

	AllowResubmit *bool `json:"allow_resubmit,omitempty"` // 可配置是否可以再次提交

	AllowSubmitAgain *bool `json:"allow_submit_again,omitempty"` // 可配置是否可以重新提交

	CancelBotNotification *string `json:"cancel_bot_notification,omitempty"` // 配置bot是否取消通知结果

	ForbidRevoke *bool `json:"forbid_revoke,omitempty"` // 配置是否可以禁止撤销

	I18nResources []*I18nResource `json:"i18n_resources,omitempty"` // 国际化文案

	Title *string `json:"title,omitempty"` // 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称

	TitleDisplayMethod *int `json:"title_display_method,omitempty"` // 详情页title展示模式

	NodeAutoApprovalList []*NodeAutoApproval `json:"node_auto_approval_list,omitempty"` // 自动通过节点ID

	ByteExtra *string `json:"byte_extra,omitempty"` // 字节内部扩展字段

	WithLink *bool `json:"with_link,omitempty"` // 是否可选返回链接
}

type InstanceCreateBuilder struct {
	approvalCode     string // 审批定义 code
	approvalCodeFlag bool

	userId     string // 发起审批用户
	userIdFlag bool

	openId     string // 发起审批用户 open id, 如果传了 user_id 则优先使用 user_id
	openIdFlag bool

	departmentId     string // 发起审批用户部门id，如果用户只属于一个部门，可以不填。如果属于多个部门，默认会选择部门列表第一个部门
	departmentIdFlag bool

	form     string // json 数组，控件值
	formFlag bool

	nodeApproverUserIdList     []*NodeApprover // 如果有发起人自选节点，则需要填写对应节点的审批人
	nodeApproverUserIdListFlag bool

	nodeApproverOpenIdList     []*NodeApprover // 审批人发起人自选 open id，与上述node_approver_user_id_list字段取并集
	nodeApproverOpenIdListFlag bool

	nodeCcUserIdList     []*NodeCc // 如果有发起人自选节点，则可填写对应节点的抄送人，单个节点最多选择20位抄送人
	nodeCcUserIdListFlag bool

	nodeCcOpenIdList     []*NodeCc // 抄送人发起人自选 open id 单个节点最多选择20位抄送人
	nodeCcOpenIdListFlag bool

	uuid     string // 审批实例 uuid，用于幂等操作, 每个租户下面的唯一key，同一个 uuid 只能用于创建一个审批实例，如果冲突，返回错误码 60012 ，格式建议为 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX，不区分大小写
	uuidFlag bool

	allowResubmit     bool // 可配置是否可以再次提交
	allowResubmitFlag bool

	allowSubmitAgain     bool // 可配置是否可以重新提交
	allowSubmitAgainFlag bool

	cancelBotNotification     string // 配置bot是否取消通知结果
	cancelBotNotificationFlag bool

	forbidRevoke     bool // 配置是否可以禁止撤销
	forbidRevokeFlag bool

	i18nResources     []*I18nResource // 国际化文案
	i18nResourcesFlag bool

	title     string // 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称
	titleFlag bool

	titleDisplayMethod     int // 详情页title展示模式
	titleDisplayMethodFlag bool

	nodeAutoApprovalList     []*NodeAutoApproval // 自动通过节点ID
	nodeAutoApprovalListFlag bool

	byteExtra     string // 字节内部扩展字段
	byteExtraFlag bool

	withLink     bool // 是否可选返回链接
	withLinkFlag bool
}

func NewInstanceCreateBuilder() *InstanceCreateBuilder {
	builder := &InstanceCreateBuilder{}
	return builder
}

// 审批定义 code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *InstanceCreateBuilder) ApprovalCode(approvalCode string) *InstanceCreateBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 发起审批用户
//
// 示例值：f7cb567e
func (builder *InstanceCreateBuilder) UserId(userId string) *InstanceCreateBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 发起审批用户 open id, 如果传了 user_id 则优先使用 user_id
//
// 示例值：ou_3cda9c969f737aaa05e6915dce306cb9
func (builder *InstanceCreateBuilder) OpenId(openId string) *InstanceCreateBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 发起审批用户部门id，如果用户只属于一个部门，可以不填。如果属于多个部门，默认会选择部门列表第一个部门
//
// 示例值：9293493ccacbdb9a
func (builder *InstanceCreateBuilder) DepartmentId(departmentId string) *InstanceCreateBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// json 数组，控件值
//
// 示例值：[{\"id\":\"111\", \"type\": \"input\", \"value\":\"test\"}]
func (builder *InstanceCreateBuilder) Form(form string) *InstanceCreateBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 如果有发起人自选节点，则需要填写对应节点的审批人
//
// 示例值：
func (builder *InstanceCreateBuilder) NodeApproverUserIdList(nodeApproverUserIdList []*NodeApprover) *InstanceCreateBuilder {
	builder.nodeApproverUserIdList = nodeApproverUserIdList
	builder.nodeApproverUserIdListFlag = true
	return builder
}

// 审批人发起人自选 open id，与上述node_approver_user_id_list字段取并集
//
// 示例值：
func (builder *InstanceCreateBuilder) NodeApproverOpenIdList(nodeApproverOpenIdList []*NodeApprover) *InstanceCreateBuilder {
	builder.nodeApproverOpenIdList = nodeApproverOpenIdList
	builder.nodeApproverOpenIdListFlag = true
	return builder
}

// 如果有发起人自选节点，则可填写对应节点的抄送人，单个节点最多选择20位抄送人
//
// 示例值：
func (builder *InstanceCreateBuilder) NodeCcUserIdList(nodeCcUserIdList []*NodeCc) *InstanceCreateBuilder {
	builder.nodeCcUserIdList = nodeCcUserIdList
	builder.nodeCcUserIdListFlag = true
	return builder
}

// 抄送人发起人自选 open id 单个节点最多选择20位抄送人
//
// 示例值：
func (builder *InstanceCreateBuilder) NodeCcOpenIdList(nodeCcOpenIdList []*NodeCc) *InstanceCreateBuilder {
	builder.nodeCcOpenIdList = nodeCcOpenIdList
	builder.nodeCcOpenIdListFlag = true
	return builder
}

// 审批实例 uuid，用于幂等操作, 每个租户下面的唯一key，同一个 uuid 只能用于创建一个审批实例，如果冲突，返回错误码 60012 ，格式建议为 XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX，不区分大小写
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A87
func (builder *InstanceCreateBuilder) Uuid(uuid string) *InstanceCreateBuilder {
	builder.uuid = uuid
	builder.uuidFlag = true
	return builder
}

// 可配置是否可以再次提交
//
// 示例值：true
func (builder *InstanceCreateBuilder) AllowResubmit(allowResubmit bool) *InstanceCreateBuilder {
	builder.allowResubmit = allowResubmit
	builder.allowResubmitFlag = true
	return builder
}

// 可配置是否可以重新提交
//
// 示例值：true
func (builder *InstanceCreateBuilder) AllowSubmitAgain(allowSubmitAgain bool) *InstanceCreateBuilder {
	builder.allowSubmitAgain = allowSubmitAgain
	builder.allowSubmitAgainFlag = true
	return builder
}

// 配置bot是否取消通知结果
//
// 示例值：0
func (builder *InstanceCreateBuilder) CancelBotNotification(cancelBotNotification string) *InstanceCreateBuilder {
	builder.cancelBotNotification = cancelBotNotification
	builder.cancelBotNotificationFlag = true
	return builder
}

// 配置是否可以禁止撤销
//
// 示例值：false
func (builder *InstanceCreateBuilder) ForbidRevoke(forbidRevoke bool) *InstanceCreateBuilder {
	builder.forbidRevoke = forbidRevoke
	builder.forbidRevokeFlag = true
	return builder
}

// 国际化文案
//
// 示例值：
func (builder *InstanceCreateBuilder) I18nResources(i18nResources []*I18nResource) *InstanceCreateBuilder {
	builder.i18nResources = i18nResources
	builder.i18nResourcesFlag = true
	return builder
}

// 审批展示名称，如果填写了该字段，则审批列表中的审批名称使用该字段，如果不填该字段，则审批名称使用审批定义的名称
//
// 示例值：@i18n@1
func (builder *InstanceCreateBuilder) Title(title string) *InstanceCreateBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 详情页title展示模式
//
// 示例值：0
func (builder *InstanceCreateBuilder) TitleDisplayMethod(titleDisplayMethod int) *InstanceCreateBuilder {
	builder.titleDisplayMethod = titleDisplayMethod
	builder.titleDisplayMethodFlag = true
	return builder
}

// 自动通过节点ID
//
// 示例值：
func (builder *InstanceCreateBuilder) NodeAutoApprovalList(nodeAutoApprovalList []*NodeAutoApproval) *InstanceCreateBuilder {
	builder.nodeAutoApprovalList = nodeAutoApprovalList
	builder.nodeAutoApprovalListFlag = true
	return builder
}

// 字节内部扩展字段
//
// 示例值：{}
func (builder *InstanceCreateBuilder) ByteExtra(byteExtra string) *InstanceCreateBuilder {
	builder.byteExtra = byteExtra
	builder.byteExtraFlag = true
	return builder
}

// 是否可选返回链接
//
// 示例值：
func (builder *InstanceCreateBuilder) WithLink(withLink bool) *InstanceCreateBuilder {
	builder.withLink = withLink
	builder.withLinkFlag = true
	return builder
}

func (builder *InstanceCreateBuilder) Build() *InstanceCreate {
	req := &InstanceCreate{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.formFlag {
		req.Form = &builder.form

	}
	if builder.nodeApproverUserIdListFlag {
		req.NodeApproverUserIdList = builder.nodeApproverUserIdList
	}
	if builder.nodeApproverOpenIdListFlag {
		req.NodeApproverOpenIdList = builder.nodeApproverOpenIdList
	}
	if builder.nodeCcUserIdListFlag {
		req.NodeCcUserIdList = builder.nodeCcUserIdList
	}
	if builder.nodeCcOpenIdListFlag {
		req.NodeCcOpenIdList = builder.nodeCcOpenIdList
	}
	if builder.uuidFlag {
		req.Uuid = &builder.uuid

	}
	if builder.allowResubmitFlag {
		req.AllowResubmit = &builder.allowResubmit

	}
	if builder.allowSubmitAgainFlag {
		req.AllowSubmitAgain = &builder.allowSubmitAgain

	}
	if builder.cancelBotNotificationFlag {
		req.CancelBotNotification = &builder.cancelBotNotification

	}
	if builder.forbidRevokeFlag {
		req.ForbidRevoke = &builder.forbidRevoke

	}
	if builder.i18nResourcesFlag {
		req.I18nResources = builder.i18nResources
	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.titleDisplayMethodFlag {
		req.TitleDisplayMethod = &builder.titleDisplayMethod

	}
	if builder.nodeAutoApprovalListFlag {
		req.NodeAutoApprovalList = builder.nodeAutoApprovalList
	}
	if builder.byteExtraFlag {
		req.ByteExtra = &builder.byteExtra

	}
	if builder.withLinkFlag {
		req.WithLink = &builder.withLink

	}
	return req
}

type InstanceDetailScenarioContext struct {
	Object *ObjectContext `json:"object,omitempty"` // object context

	Extra *MyAiInstanceDetailExtra `json:"extra,omitempty"` // extra
}

type InstanceDetailScenarioContextBuilder struct {
	object     *ObjectContext // object context
	objectFlag bool

	extra     *MyAiInstanceDetailExtra // extra
	extraFlag bool
}

func NewInstanceDetailScenarioContextBuilder() *InstanceDetailScenarioContextBuilder {
	builder := &InstanceDetailScenarioContextBuilder{}
	return builder
}

// object context
//
// 示例值：
func (builder *InstanceDetailScenarioContextBuilder) Object(object *ObjectContext) *InstanceDetailScenarioContextBuilder {
	builder.object = object
	builder.objectFlag = true
	return builder
}

// extra
//
// 示例值：
func (builder *InstanceDetailScenarioContextBuilder) Extra(extra *MyAiInstanceDetailExtra) *InstanceDetailScenarioContextBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

func (builder *InstanceDetailScenarioContextBuilder) Build() *InstanceDetailScenarioContext {
	req := &InstanceDetailScenarioContext{}
	if builder.objectFlag {
		req.Object = builder.object
	}
	if builder.extraFlag {
		req.Extra = builder.extra
	}
	return req
}

type InstanceDraft struct {
	ApprovalId *string `json:"approval_id,omitempty"` // 审批定义id
}

type InstanceDraftBuilder struct {
	approvalId     string // 审批定义id
	approvalIdFlag bool
}

func NewInstanceDraftBuilder() *InstanceDraftBuilder {
	builder := &InstanceDraftBuilder{}
	return builder
}

// 审批定义id
//
// 示例值：7545781352325070867
func (builder *InstanceDraftBuilder) ApprovalId(approvalId string) *InstanceDraftBuilder {
	builder.approvalId = approvalId
	builder.approvalIdFlag = true
	return builder
}

func (builder *InstanceDraftBuilder) Build() *InstanceDraft {
	req := &InstanceDraft{}
	if builder.approvalIdFlag {
		req.ApprovalId = &builder.approvalId

	}
	return req
}

type InstanceSearch struct {
	UserId *string `json:"user_id,omitempty"` // 根据x_user_type填写用户 id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 code

	InstanceExternalId *string `json:"instance_external_id,omitempty"` // 审批实例第三方 id 注：和 approval_code 取并集

	GroupExternalId *string `json:"group_external_id,omitempty"` // 审批定义分组第三方 id 注：和 instance_code 取并集

	InstanceTitle *string `json:"instance_title,omitempty"` // 审批实例标题（只有第三方审批有）

	InstanceStatus *string `json:"instance_status,omitempty"` // 审批实例状态，注：若不设置，查询全部状态 若不在集合中，报错

	InstanceStartTimeFrom *string `json:"instance_start_time_from,omitempty"` // 实例查询开始时间（unix毫秒时间戳）

	InstanceStartTimeTo *string `json:"instance_start_time_to,omitempty"` // 实例查询结束时间 (unix毫秒时间戳)

	Locale *string `json:"locale,omitempty"` // 地区

	WithRevokedInstance *bool `json:"with_revoked_instance,omitempty"` // 是否包含撤销申请对应的审批单
}

type InstanceSearchBuilder struct {
	userId     string // 根据x_user_type填写用户 id
	userIdFlag bool

	approvalCode     string // 审批定义 code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 code
	instanceCodeFlag bool

	instanceExternalId     string // 审批实例第三方 id 注：和 approval_code 取并集
	instanceExternalIdFlag bool

	groupExternalId     string // 审批定义分组第三方 id 注：和 instance_code 取并集
	groupExternalIdFlag bool

	instanceTitle     string // 审批实例标题（只有第三方审批有）
	instanceTitleFlag bool

	instanceStatus     string // 审批实例状态，注：若不设置，查询全部状态 若不在集合中，报错
	instanceStatusFlag bool

	instanceStartTimeFrom     string // 实例查询开始时间（unix毫秒时间戳）
	instanceStartTimeFromFlag bool

	instanceStartTimeTo     string // 实例查询结束时间 (unix毫秒时间戳)
	instanceStartTimeToFlag bool

	locale     string // 地区
	localeFlag bool

	withRevokedInstance     bool // 是否包含撤销申请对应的审批单
	withRevokedInstanceFlag bool
}

func NewInstanceSearchBuilder() *InstanceSearchBuilder {
	builder := &InstanceSearchBuilder{}
	return builder
}

// 根据x_user_type填写用户 id
//
// 示例值：lwiu098wj
func (builder *InstanceSearchBuilder) UserId(userId string) *InstanceSearchBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED942
func (builder *InstanceSearchBuilder) ApprovalCode(approvalCode string) *InstanceSearchBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *InstanceSearchBuilder) InstanceCode(instanceCode string) *InstanceSearchBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 审批实例第三方 id 注：和 approval_code 取并集
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED976
func (builder *InstanceSearchBuilder) InstanceExternalId(instanceExternalId string) *InstanceSearchBuilder {
	builder.instanceExternalId = instanceExternalId
	builder.instanceExternalIdFlag = true
	return builder
}

// 审批定义分组第三方 id 注：和 instance_code 取并集
//
// 示例值：1234567
func (builder *InstanceSearchBuilder) GroupExternalId(groupExternalId string) *InstanceSearchBuilder {
	builder.groupExternalId = groupExternalId
	builder.groupExternalIdFlag = true
	return builder
}

// 审批实例标题（只有第三方审批有）
//
// 示例值：test
func (builder *InstanceSearchBuilder) InstanceTitle(instanceTitle string) *InstanceSearchBuilder {
	builder.instanceTitle = instanceTitle
	builder.instanceTitleFlag = true
	return builder
}

// 审批实例状态，注：若不设置，查询全部状态 若不在集合中，报错
//
// 示例值：PENDING
func (builder *InstanceSearchBuilder) InstanceStatus(instanceStatus string) *InstanceSearchBuilder {
	builder.instanceStatus = instanceStatus
	builder.instanceStatusFlag = true
	return builder
}

// 实例查询开始时间（unix毫秒时间戳）
//
// 示例值：1547654251506
func (builder *InstanceSearchBuilder) InstanceStartTimeFrom(instanceStartTimeFrom string) *InstanceSearchBuilder {
	builder.instanceStartTimeFrom = instanceStartTimeFrom
	builder.instanceStartTimeFromFlag = true
	return builder
}

// 实例查询结束时间 (unix毫秒时间戳)
//
// 示例值：1547654251506
func (builder *InstanceSearchBuilder) InstanceStartTimeTo(instanceStartTimeTo string) *InstanceSearchBuilder {
	builder.instanceStartTimeTo = instanceStartTimeTo
	builder.instanceStartTimeToFlag = true
	return builder
}

// 地区
//
// 示例值：zh-CN
func (builder *InstanceSearchBuilder) Locale(locale string) *InstanceSearchBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 是否包含撤销申请对应的审批单
//
// 示例值：false
func (builder *InstanceSearchBuilder) WithRevokedInstance(withRevokedInstance bool) *InstanceSearchBuilder {
	builder.withRevokedInstance = withRevokedInstance
	builder.withRevokedInstanceFlag = true
	return builder
}

func (builder *InstanceSearchBuilder) Build() *InstanceSearch {
	req := &InstanceSearch{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.instanceExternalIdFlag {
		req.InstanceExternalId = &builder.instanceExternalId

	}
	if builder.groupExternalIdFlag {
		req.GroupExternalId = &builder.groupExternalId

	}
	if builder.instanceTitleFlag {
		req.InstanceTitle = &builder.instanceTitle

	}
	if builder.instanceStatusFlag {
		req.InstanceStatus = &builder.instanceStatus

	}
	if builder.instanceStartTimeFromFlag {
		req.InstanceStartTimeFrom = &builder.instanceStartTimeFrom

	}
	if builder.instanceStartTimeToFlag {
		req.InstanceStartTimeTo = &builder.instanceStartTimeTo

	}
	if builder.localeFlag {
		req.Locale = &builder.locale

	}
	if builder.withRevokedInstanceFlag {
		req.WithRevokedInstance = &builder.withRevokedInstance

	}
	return req
}

type InstanceSearchApproval struct {
	Code *string `json:"code,omitempty"` // 审批定义 code

	Name *string `json:"name,omitempty"` // 审批定义名称

	IsExternal *bool `json:"is_external,omitempty"` // 是否为第三方审批

	External *InstanceSearchApprovalExternal `json:"external,omitempty"` // 第三方审批信息

	ApprovalId *string `json:"approval_id,omitempty"` // 审批定义Id

	Icon *string `json:"icon,omitempty"` // 审批定义图标信息
}

type InstanceSearchApprovalBuilder struct {
	code     string // 审批定义 code
	codeFlag bool

	name     string // 审批定义名称
	nameFlag bool

	isExternal     bool // 是否为第三方审批
	isExternalFlag bool

	external     *InstanceSearchApprovalExternal // 第三方审批信息
	externalFlag bool

	approvalId     string // 审批定义Id
	approvalIdFlag bool

	icon     string // 审批定义图标信息
	iconFlag bool
}

func NewInstanceSearchApprovalBuilder() *InstanceSearchApprovalBuilder {
	builder := &InstanceSearchApprovalBuilder{}
	return builder
}

// 审批定义 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *InstanceSearchApprovalBuilder) Code(code string) *InstanceSearchApprovalBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 审批定义名称
//
// 示例值：approval
func (builder *InstanceSearchApprovalBuilder) Name(name string) *InstanceSearchApprovalBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 是否为第三方审批
//
// 示例值：true
func (builder *InstanceSearchApprovalBuilder) IsExternal(isExternal bool) *InstanceSearchApprovalBuilder {
	builder.isExternal = isExternal
	builder.isExternalFlag = true
	return builder
}

// 第三方审批信息
//
// 示例值：
func (builder *InstanceSearchApprovalBuilder) External(external *InstanceSearchApprovalExternal) *InstanceSearchApprovalBuilder {
	builder.external = external
	builder.externalFlag = true
	return builder
}

// 审批定义Id
//
// 示例值：7090754740375519252
func (builder *InstanceSearchApprovalBuilder) ApprovalId(approvalId string) *InstanceSearchApprovalBuilder {
	builder.approvalId = approvalId
	builder.approvalIdFlag = true
	return builder
}

// 审批定义图标信息
//
// 示例值：https://lf3-ea.bytetos.com/obj/goofy/ee/approval/approval-admin/image/iconLib/v3/person.png
func (builder *InstanceSearchApprovalBuilder) Icon(icon string) *InstanceSearchApprovalBuilder {
	builder.icon = icon
	builder.iconFlag = true
	return builder
}

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

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

	}
	if builder.isExternalFlag {
		req.IsExternal = &builder.isExternal

	}
	if builder.externalFlag {
		req.External = builder.external
	}
	if builder.approvalIdFlag {
		req.ApprovalId = &builder.approvalId

	}
	if builder.iconFlag {
		req.Icon = &builder.icon

	}
	return req
}

type InstanceSearchApprovalExternal struct {
	BatchCcRead *bool `json:"batch_cc_read,omitempty"` // 是否支持批量读
}

type InstanceSearchApprovalExternalBuilder struct {
	batchCcRead     bool // 是否支持批量读
	batchCcReadFlag bool
}

func NewInstanceSearchApprovalExternalBuilder() *InstanceSearchApprovalExternalBuilder {
	builder := &InstanceSearchApprovalExternalBuilder{}
	return builder
}

// 是否支持批量读
//
// 示例值：false
func (builder *InstanceSearchApprovalExternalBuilder) BatchCcRead(batchCcRead bool) *InstanceSearchApprovalExternalBuilder {
	builder.batchCcRead = batchCcRead
	builder.batchCcReadFlag = true
	return builder
}

func (builder *InstanceSearchApprovalExternalBuilder) Build() *InstanceSearchApprovalExternal {
	req := &InstanceSearchApprovalExternal{}
	if builder.batchCcReadFlag {
		req.BatchCcRead = &builder.batchCcRead

	}
	return req
}

type InstanceSearchGroup struct {
	ExternalId *string `json:"external_id,omitempty"` // 审批定义分组外部 id

	Name *string `json:"name,omitempty"` // 审批定义分组名称
}

type InstanceSearchGroupBuilder struct {
	externalId     string // 审批定义分组外部 id
	externalIdFlag bool

	name     string // 审批定义分组名称
	nameFlag bool
}

func NewInstanceSearchGroupBuilder() *InstanceSearchGroupBuilder {
	builder := &InstanceSearchGroupBuilder{}
	return builder
}

// 审批定义分组外部 id
//
// 示例值：0004
func (builder *InstanceSearchGroupBuilder) ExternalId(externalId string) *InstanceSearchGroupBuilder {
	builder.externalId = externalId
	builder.externalIdFlag = true
	return builder
}

// 审批定义分组名称
//
// 示例值：groupA
func (builder *InstanceSearchGroupBuilder) Name(name string) *InstanceSearchGroupBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

func (builder *InstanceSearchGroupBuilder) Build() *InstanceSearchGroup {
	req := &InstanceSearchGroup{}
	if builder.externalIdFlag {
		req.ExternalId = &builder.externalId

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

	}
	return req
}

type InstanceSearchItem struct {
	Approval *InstanceSearchApproval `json:"approval,omitempty"` // 审批定义

	Group *InstanceSearchGroup `json:"group,omitempty"` // 审批定义分组

	Instance *InstanceSearchNode `json:"instance,omitempty"` // 审批实例信息
}

type InstanceSearchItemBuilder struct {
	approval     *InstanceSearchApproval // 审批定义
	approvalFlag bool

	group     *InstanceSearchGroup // 审批定义分组
	groupFlag bool

	instance     *InstanceSearchNode // 审批实例信息
	instanceFlag bool
}

func NewInstanceSearchItemBuilder() *InstanceSearchItemBuilder {
	builder := &InstanceSearchItemBuilder{}
	return builder
}

// 审批定义
//
// 示例值：
func (builder *InstanceSearchItemBuilder) Approval(approval *InstanceSearchApproval) *InstanceSearchItemBuilder {
	builder.approval = approval
	builder.approvalFlag = true
	return builder
}

// 审批定义分组
//
// 示例值：
func (builder *InstanceSearchItemBuilder) Group(group *InstanceSearchGroup) *InstanceSearchItemBuilder {
	builder.group = group
	builder.groupFlag = true
	return builder
}

// 审批实例信息
//
// 示例值：
func (builder *InstanceSearchItemBuilder) Instance(instance *InstanceSearchNode) *InstanceSearchItemBuilder {
	builder.instance = instance
	builder.instanceFlag = true
	return builder
}

func (builder *InstanceSearchItemBuilder) Build() *InstanceSearchItem {
	req := &InstanceSearchItem{}
	if builder.approvalFlag {
		req.Approval = builder.approval
	}
	if builder.groupFlag {
		req.Group = builder.group
	}
	if builder.instanceFlag {
		req.Instance = builder.instance
	}
	return req
}

type InstanceSearchLink struct {
	PcLink *string `json:"pc_link,omitempty"` // 审批实例 pc 端链接

	MobileLink *string `json:"mobile_link,omitempty"` // 审批实例移动端链接
}

type InstanceSearchLinkBuilder struct {
	pcLink     string // 审批实例 pc 端链接
	pcLinkFlag bool

	mobileLink     string // 审批实例移动端链接
	mobileLinkFlag bool
}

func NewInstanceSearchLinkBuilder() *InstanceSearchLinkBuilder {
	builder := &InstanceSearchLinkBuilder{}
	return builder
}

// 审批实例 pc 端链接
//
// 示例值：https://www.baidu.com/
func (builder *InstanceSearchLinkBuilder) PcLink(pcLink string) *InstanceSearchLinkBuilder {
	builder.pcLink = pcLink
	builder.pcLinkFlag = true
	return builder
}

// 审批实例移动端链接
//
// 示例值：https://www.baidu.com/
func (builder *InstanceSearchLinkBuilder) MobileLink(mobileLink string) *InstanceSearchLinkBuilder {
	builder.mobileLink = mobileLink
	builder.mobileLinkFlag = true
	return builder
}

func (builder *InstanceSearchLinkBuilder) Build() *InstanceSearchLink {
	req := &InstanceSearchLink{}
	if builder.pcLinkFlag {
		req.PcLink = &builder.pcLink

	}
	if builder.mobileLinkFlag {
		req.MobileLink = &builder.mobileLink

	}
	return req
}

type InstanceSearchNode struct {
	Code *string `json:"code,omitempty"` // 审批实例 code

	ExternalId *string `json:"external_id,omitempty"` // 审批实例外部 id

	UserId *string `json:"user_id,omitempty"` // 审批实例发起人 id

	StartTime *string `json:"start_time,omitempty"` // 审批实例开始时间

	EndTime *string `json:"end_time,omitempty"` // 审批实例结束时间

	Status *string `json:"status,omitempty"` // 审批实例状态

	Title *string `json:"title,omitempty"` // 审批实例名称（只有第三方审批有）

	Extra *string `json:"extra,omitempty"` // 审批实例扩展字段，string型json

	SerialId *string `json:"serial_id,omitempty"` // 审批流水号

	Link *InstanceSearchLink `json:"link,omitempty"` // 审批实例链接（只有第三方审批有）
}

type InstanceSearchNodeBuilder struct {
	code     string // 审批实例 code
	codeFlag bool

	externalId     string // 审批实例外部 id
	externalIdFlag bool

	userId     string // 审批实例发起人 id
	userIdFlag bool

	startTime     string // 审批实例开始时间
	startTimeFlag bool

	endTime     string // 审批实例结束时间
	endTimeFlag bool

	status     string // 审批实例状态
	statusFlag bool

	title     string // 审批实例名称（只有第三方审批有）
	titleFlag bool

	extra     string // 审批实例扩展字段，string型json
	extraFlag bool

	serialId     string // 审批流水号
	serialIdFlag bool

	link     *InstanceSearchLink // 审批实例链接（只有第三方审批有）
	linkFlag bool
}

func NewInstanceSearchNodeBuilder() *InstanceSearchNodeBuilder {
	builder := &InstanceSearchNodeBuilder{}
	return builder
}

// 审批实例 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *InstanceSearchNodeBuilder) Code(code string) *InstanceSearchNodeBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 审批实例外部 id
//
// 示例值：0004_3ED52DC1-AA6C
func (builder *InstanceSearchNodeBuilder) ExternalId(externalId string) *InstanceSearchNodeBuilder {
	builder.externalId = externalId
	builder.externalIdFlag = true
	return builder
}

// 审批实例发起人 id
//
// 示例值：lwiu098wj
func (builder *InstanceSearchNodeBuilder) UserId(userId string) *InstanceSearchNodeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批实例开始时间
//
// 示例值：1547654251506
func (builder *InstanceSearchNodeBuilder) StartTime(startTime string) *InstanceSearchNodeBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 审批实例结束时间
//
// 示例值：1547654251506
func (builder *InstanceSearchNodeBuilder) EndTime(endTime string) *InstanceSearchNodeBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 审批实例状态
//
// 示例值：pending
func (builder *InstanceSearchNodeBuilder) Status(status string) *InstanceSearchNodeBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批实例名称（只有第三方审批有）
//
// 示例值：test
func (builder *InstanceSearchNodeBuilder) Title(title string) *InstanceSearchNodeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 审批实例扩展字段，string型json
//
// 示例值：{}
func (builder *InstanceSearchNodeBuilder) Extra(extra string) *InstanceSearchNodeBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 审批流水号
//
// 示例值：201902020001
func (builder *InstanceSearchNodeBuilder) SerialId(serialId string) *InstanceSearchNodeBuilder {
	builder.serialId = serialId
	builder.serialIdFlag = true
	return builder
}

// 审批实例链接（只有第三方审批有）
//
// 示例值：
func (builder *InstanceSearchNodeBuilder) Link(link *InstanceSearchLink) *InstanceSearchNodeBuilder {
	builder.link = link
	builder.linkFlag = true
	return builder
}

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

	}
	if builder.externalIdFlag {
		req.ExternalId = &builder.externalId

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

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

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

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

	}
	if builder.serialIdFlag {
		req.SerialId = &builder.serialId

	}
	if builder.linkFlag {
		req.Link = builder.link
	}
	return req
}

type InstanceTask struct {
	Id *string `json:"id,omitempty"` // task id

	UserId *string `json:"user_id,omitempty"` // 审批人的用户id，自动通过、自动拒绝 时为空

	OpenId *string `json:"open_id,omitempty"` // 审批人 open id

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

	NodeId *string `json:"node_id,omitempty"` // task 所属节点 id

	NodeName *string `json:"node_name,omitempty"` // task 所属节点名称

	CustomNodeId *string `json:"custom_node_id,omitempty"` // task 所属节点自定义 id, 如果没设置自定义 id, 则不返回该字段

	Type *string `json:"type,omitempty"` // 审批方式

	StartTime *string `json:"start_time,omitempty"` // task 开始时间

	EndTime *string `json:"end_time,omitempty"` // task 完成时间, 未完成为 0
}

type InstanceTaskBuilder struct {
	id     string // task id
	idFlag bool

	userId     string // 审批人的用户id，自动通过、自动拒绝 时为空
	userIdFlag bool

	openId     string // 审批人 open id
	openIdFlag bool

	status     string // 任务状态
	statusFlag bool

	nodeId     string // task 所属节点 id
	nodeIdFlag bool

	nodeName     string // task 所属节点名称
	nodeNameFlag bool

	customNodeId     string // task 所属节点自定义 id, 如果没设置自定义 id, 则不返回该字段
	customNodeIdFlag bool

	type_    string // 审批方式
	typeFlag bool

	startTime     string // task 开始时间
	startTimeFlag bool

	endTime     string // task 完成时间, 未完成为 0
	endTimeFlag bool
}

func NewInstanceTaskBuilder() *InstanceTaskBuilder {
	builder := &InstanceTaskBuilder{}
	return builder
}

// task id
//
// 示例值：1234
func (builder *InstanceTaskBuilder) Id(id string) *InstanceTaskBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 审批人的用户id，自动通过、自动拒绝 时为空
//
// 示例值：f7cb567e
func (builder *InstanceTaskBuilder) UserId(userId string) *InstanceTaskBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批人 open id
//
// 示例值：ou_123457
func (builder *InstanceTaskBuilder) OpenId(openId string) *InstanceTaskBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 任务状态
//
// 示例值：PENDING
func (builder *InstanceTaskBuilder) Status(status string) *InstanceTaskBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// task 所属节点 id
//
// 示例值：46e6d96cfa756980907209209ec03b64
func (builder *InstanceTaskBuilder) NodeId(nodeId string) *InstanceTaskBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// task 所属节点名称
//
// 示例值：开始
func (builder *InstanceTaskBuilder) NodeName(nodeName string) *InstanceTaskBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

// task 所属节点自定义 id, 如果没设置自定义 id, 则不返回该字段
//
// 示例值：manager
func (builder *InstanceTaskBuilder) CustomNodeId(customNodeId string) *InstanceTaskBuilder {
	builder.customNodeId = customNodeId
	builder.customNodeIdFlag = true
	return builder
}

// 审批方式
//
// 示例值：AND
func (builder *InstanceTaskBuilder) Type(type_ string) *InstanceTaskBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// task 开始时间
//
// 示例值：1564590532967
func (builder *InstanceTaskBuilder) StartTime(startTime string) *InstanceTaskBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// task 完成时间, 未完成为 0
//
// 示例值：0
func (builder *InstanceTaskBuilder) EndTime(endTime string) *InstanceTaskBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

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

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

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

	}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	if builder.customNodeIdFlag {
		req.CustomNodeId = &builder.customNodeId

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

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	return req
}

type InstanceTimeline struct {
	Type *string `json:"type,omitempty"` // 动态类型，不同类型 ext 内的 user_id_list 含义不一样

	CreateTime *string `json:"create_time,omitempty"` // 发生时间

	UserId *string `json:"user_id,omitempty"` // 动态产生用户

	OpenId *string `json:"open_id,omitempty"` // 动态产生用户 open id

	UserIdList []string `json:"user_id_list,omitempty"` // 被抄送人列表

	OpenIdList []string `json:"open_id_list,omitempty"` // 被抄送人列表

	TaskId *string `json:"task_id,omitempty"` // 产生动态关联的task_id

	Comment *string `json:"comment,omitempty"` // 理由

	CcUserList []*InstanceCcUser `json:"cc_user_list,omitempty"` // 抄送人列表

	Ext *string `json:"ext,omitempty"` // 动态其他信息，json格式，目前包括 user_id_list, user_id，open_id_list，open_id

	NodeKey *string `json:"node_key,omitempty"` // 产生task的节点key

	Files []*File `json:"files,omitempty"` // 审批附件
}

type InstanceTimelineBuilder struct {
	type_    string // 动态类型，不同类型 ext 内的 user_id_list 含义不一样
	typeFlag bool

	createTime     string // 发生时间
	createTimeFlag bool

	userId     string // 动态产生用户
	userIdFlag bool

	openId     string // 动态产生用户 open id
	openIdFlag bool

	userIdList     []string // 被抄送人列表
	userIdListFlag bool

	openIdList     []string // 被抄送人列表
	openIdListFlag bool

	taskId     string // 产生动态关联的task_id
	taskIdFlag bool

	comment     string // 理由
	commentFlag bool

	ccUserList     []*InstanceCcUser // 抄送人列表
	ccUserListFlag bool

	ext     string // 动态其他信息，json格式，目前包括 user_id_list, user_id，open_id_list，open_id
	extFlag bool

	nodeKey     string // 产生task的节点key
	nodeKeyFlag bool

	files     []*File // 审批附件
	filesFlag bool
}

func NewInstanceTimelineBuilder() *InstanceTimelineBuilder {
	builder := &InstanceTimelineBuilder{}
	return builder
}

// 动态类型，不同类型 ext 内的 user_id_list 含义不一样
//
// 示例值：PASS
func (builder *InstanceTimelineBuilder) Type(type_ string) *InstanceTimelineBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 发生时间
//
// 示例值：1564590532967
func (builder *InstanceTimelineBuilder) CreateTime(createTime string) *InstanceTimelineBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 动态产生用户
//
// 示例值：f7cb567e
func (builder *InstanceTimelineBuilder) UserId(userId string) *InstanceTimelineBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 动态产生用户 open id
//
// 示例值：ou_123456
func (builder *InstanceTimelineBuilder) OpenId(openId string) *InstanceTimelineBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 被抄送人列表
//
// 示例值：
func (builder *InstanceTimelineBuilder) UserIdList(userIdList []string) *InstanceTimelineBuilder {
	builder.userIdList = userIdList
	builder.userIdListFlag = true
	return builder
}

// 被抄送人列表
//
// 示例值：
func (builder *InstanceTimelineBuilder) OpenIdList(openIdList []string) *InstanceTimelineBuilder {
	builder.openIdList = openIdList
	builder.openIdListFlag = true
	return builder
}

// 产生动态关联的task_id
//
// 示例值：1234
func (builder *InstanceTimelineBuilder) TaskId(taskId string) *InstanceTimelineBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 理由
//
// 示例值：ok
func (builder *InstanceTimelineBuilder) Comment(comment string) *InstanceTimelineBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 抄送人列表
//
// 示例值：
func (builder *InstanceTimelineBuilder) CcUserList(ccUserList []*InstanceCcUser) *InstanceTimelineBuilder {
	builder.ccUserList = ccUserList
	builder.ccUserListFlag = true
	return builder
}

// 动态其他信息，json格式，目前包括 user_id_list, user_id，open_id_list，open_id
//
// 示例值：{\"user_id\":\"62d4a44c\",\"open_id\":\"ou_123456\"}
func (builder *InstanceTimelineBuilder) Ext(ext string) *InstanceTimelineBuilder {
	builder.ext = ext
	builder.extFlag = true
	return builder
}

// 产生task的节点key
//
// 示例值：APPROVAL_240330_4058663
func (builder *InstanceTimelineBuilder) NodeKey(nodeKey string) *InstanceTimelineBuilder {
	builder.nodeKey = nodeKey
	builder.nodeKeyFlag = true
	return builder
}

// 审批附件
//
// 示例值：
func (builder *InstanceTimelineBuilder) Files(files []*File) *InstanceTimelineBuilder {
	builder.files = files
	builder.filesFlag = true
	return builder
}

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

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

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

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.userIdListFlag {
		req.UserIdList = builder.userIdList
	}
	if builder.openIdListFlag {
		req.OpenIdList = builder.openIdList
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	if builder.ccUserListFlag {
		req.CcUserList = builder.ccUserList
	}
	if builder.extFlag {
		req.Ext = &builder.ext

	}
	if builder.nodeKeyFlag {
		req.NodeKey = &builder.nodeKey

	}
	if builder.filesFlag {
		req.Files = builder.files
	}
	return req
}

type ManageableDefinition struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"

	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称，根据传入的local字段返回对应的国际化文案，未设置国际化文案时该字段为空

	ApprovalStatus *string `json:"approval_status,omitempty"` // 审批定义状态

	ApprovalAdminIds []string `json:"approval_admin_ids,omitempty"` // 有数据管理权限的审批流程管理员ID
}

type ManageableDefinitionBuilder struct {
	approvalCode     string // 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"
	approvalCodeFlag bool

	approvalName     string // 审批名称，根据传入的local字段返回对应的国际化文案，未设置国际化文案时该字段为空
	approvalNameFlag bool

	approvalStatus     string // 审批定义状态
	approvalStatusFlag bool

	approvalAdminIds     []string // 有数据管理权限的审批流程管理员ID
	approvalAdminIdsFlag bool
}

func NewManageableDefinitionBuilder() *ManageableDefinitionBuilder {
	builder := &ManageableDefinitionBuilder{}
	return builder
}

// 审批定义 code  示例值："7C468A54-8745-2245-9675-08B7C63E7A85"
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *ManageableDefinitionBuilder) ApprovalCode(approvalCode string) *ManageableDefinitionBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批名称，根据传入的local字段返回对应的国际化文案，未设置国际化文案时该字段为空
//
// 示例值：请假
func (builder *ManageableDefinitionBuilder) ApprovalName(approvalName string) *ManageableDefinitionBuilder {
	builder.approvalName = approvalName
	builder.approvalNameFlag = true
	return builder
}

// 审批定义状态
//
// 示例值：ACTIVE
func (builder *ManageableDefinitionBuilder) ApprovalStatus(approvalStatus string) *ManageableDefinitionBuilder {
	builder.approvalStatus = approvalStatus
	builder.approvalStatusFlag = true
	return builder
}

// 有数据管理权限的审批流程管理员ID
//
// 示例值：
func (builder *ManageableDefinitionBuilder) ApprovalAdminIds(approvalAdminIds []string) *ManageableDefinitionBuilder {
	builder.approvalAdminIds = approvalAdminIds
	builder.approvalAdminIdsFlag = true
	return builder
}

func (builder *ManageableDefinitionBuilder) Build() *ManageableDefinition {
	req := &ManageableDefinition{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.approvalNameFlag {
		req.ApprovalName = &builder.approvalName

	}
	if builder.approvalStatusFlag {
		req.ApprovalStatus = &builder.approvalStatus

	}
	if builder.approvalAdminIdsFlag {
		req.ApprovalAdminIds = builder.approvalAdminIds
	}
	return req
}

type ManageableInstanceItem struct {
	Instance *ManageableInstanceNode `json:"instance,omitempty"` // 审批实例信息
}

type ManageableInstanceItemBuilder struct {
	instance     *ManageableInstanceNode // 审批实例信息
	instanceFlag bool
}

func NewManageableInstanceItemBuilder() *ManageableInstanceItemBuilder {
	builder := &ManageableInstanceItemBuilder{}
	return builder
}

// 审批实例信息
//
// 示例值：
func (builder *ManageableInstanceItemBuilder) Instance(instance *ManageableInstanceNode) *ManageableInstanceItemBuilder {
	builder.instance = instance
	builder.instanceFlag = true
	return builder
}

func (builder *ManageableInstanceItemBuilder) Build() *ManageableInstanceItem {
	req := &ManageableInstanceItem{}
	if builder.instanceFlag {
		req.Instance = builder.instance
	}
	return req
}

type ManageableInstanceNode struct {
	Code *string `json:"code,omitempty"` // 审批实例 code

	StartUserId *string `json:"start_user_id,omitempty"` // 审批实例发起人id

	CurrentUserIds []string `json:"current_user_ids,omitempty"` // 当前处理人id

	DepartmentId *string `json:"department_id,omitempty"` // 审批实例所属部门id

	NodeName *string `json:"node_name,omitempty"` // 当前处理节点名称

	Form *string `json:"form,omitempty"` // json字符串，控件值

	Version *string `json:"version,omitempty"` // 审批实例对应的审批定义版本

	StartTime *string `json:"start_time,omitempty"` // 审批实例发起时间

	EndTime *string `json:"end_time,omitempty"` // 审批实例结束时间

	Status *string `json:"status,omitempty"` // 审批实例状态

	SerialId *string `json:"serial_id,omitempty"` // 审批流水号

	StatusDisplay *string `json:"status_display,omitempty"` // 审批状态展示值
}

type ManageableInstanceNodeBuilder struct {
	code     string // 审批实例 code
	codeFlag bool

	startUserId     string // 审批实例发起人id
	startUserIdFlag bool

	currentUserIds     []string // 当前处理人id
	currentUserIdsFlag bool

	departmentId     string // 审批实例所属部门id
	departmentIdFlag bool

	nodeName     string // 当前处理节点名称
	nodeNameFlag bool

	form     string // json字符串，控件值
	formFlag bool

	version     string // 审批实例对应的审批定义版本
	versionFlag bool

	startTime     string // 审批实例发起时间
	startTimeFlag bool

	endTime     string // 审批实例结束时间
	endTimeFlag bool

	status     string // 审批实例状态
	statusFlag bool

	serialId     string // 审批流水号
	serialIdFlag bool

	statusDisplay     string // 审批状态展示值
	statusDisplayFlag bool
}

func NewManageableInstanceNodeBuilder() *ManageableInstanceNodeBuilder {
	builder := &ManageableInstanceNodeBuilder{}
	return builder
}

// 审批实例 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *ManageableInstanceNodeBuilder) Code(code string) *ManageableInstanceNodeBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 审批实例发起人id
//
// 示例值：lwiu098wj
func (builder *ManageableInstanceNodeBuilder) StartUserId(startUserId string) *ManageableInstanceNodeBuilder {
	builder.startUserId = startUserId
	builder.startUserIdFlag = true
	return builder
}

// 当前处理人id
//
// 示例值：lwiu098wj
func (builder *ManageableInstanceNodeBuilder) CurrentUserIds(currentUserIds []string) *ManageableInstanceNodeBuilder {
	builder.currentUserIds = currentUserIds
	builder.currentUserIdsFlag = true
	return builder
}

// 审批实例所属部门id
//
// 示例值：od-8ec33ffec336c3a39a278bc25e931676
func (builder *ManageableInstanceNodeBuilder) DepartmentId(departmentId string) *ManageableInstanceNodeBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 当前处理节点名称
//
// 示例值：审批节点1
func (builder *ManageableInstanceNodeBuilder) NodeName(nodeName string) *ManageableInstanceNodeBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

// json字符串，控件值
//
// 示例值：[{\"id\": \"widget1\",\"custom_id\": \"user_info\",\"name\": \"Item application\",\"type\": \"textarea\"},\"value\":\"aaaa\"]
func (builder *ManageableInstanceNodeBuilder) Form(form string) *ManageableInstanceNodeBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批实例对应的审批定义版本
//
// 示例值：7129705107930742803
func (builder *ManageableInstanceNodeBuilder) Version(version string) *ManageableInstanceNodeBuilder {
	builder.version = version
	builder.versionFlag = true
	return builder
}

// 审批实例发起时间
//
// 示例值：1547654251506
func (builder *ManageableInstanceNodeBuilder) StartTime(startTime string) *ManageableInstanceNodeBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 审批实例结束时间
//
// 示例值：1547654251506
func (builder *ManageableInstanceNodeBuilder) EndTime(endTime string) *ManageableInstanceNodeBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 审批实例状态
//
// 示例值：PENDING
func (builder *ManageableInstanceNodeBuilder) Status(status string) *ManageableInstanceNodeBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批流水号
//
// 示例值：201902020001
func (builder *ManageableInstanceNodeBuilder) SerialId(serialId string) *ManageableInstanceNodeBuilder {
	builder.serialId = serialId
	builder.serialIdFlag = true
	return builder
}

// 审批状态展示值
//
// 示例值："已通过"
func (builder *ManageableInstanceNodeBuilder) StatusDisplay(statusDisplay string) *ManageableInstanceNodeBuilder {
	builder.statusDisplay = statusDisplay
	builder.statusDisplayFlag = true
	return builder
}

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

	}
	if builder.startUserIdFlag {
		req.StartUserId = &builder.startUserId

	}
	if builder.currentUserIdsFlag {
		req.CurrentUserIds = builder.currentUserIds
	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	if builder.formFlag {
		req.Form = &builder.form

	}
	if builder.versionFlag {
		req.Version = &builder.version

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

	}
	if builder.serialIdFlag {
		req.SerialId = &builder.serialId

	}
	if builder.statusDisplayFlag {
		req.StatusDisplay = &builder.statusDisplay

	}
	return req
}

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

	ReceiveId *string `json:"receive_id,omitempty"` // 接受消息的各类id

	Content *string `json:"content,omitempty"` // 消息体, json格式

	MsgType *string `json:"msg_type,omitempty"` // 消息类型

	Config *string `json:"config,omitempty"` // 发送配置

	Extra *string `json:"extra,omitempty"` // 特殊配制

	Uuid *string `json:"uuid,omitempty"` // 幂等key
}

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

	receiveId     string // 接受消息的各类id
	receiveIdFlag bool

	content     string // 消息体, json格式
	contentFlag bool

	msgType     string // 消息类型
	msgTypeFlag bool

	config     string // 发送配置
	configFlag bool

	extra     string // 特殊配制
	extraFlag bool

	uuid     string // 幂等key
	uuidFlag bool
}

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

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

// 接受消息的各类id
//
// 示例值：ou_xxx
func (builder *MessageBuilder) ReceiveId(receiveId string) *MessageBuilder {
	builder.receiveId = receiveId
	builder.receiveIdFlag = true
	return builder
}

// 消息体, json格式
//
// 示例值：{}
func (builder *MessageBuilder) Content(content string) *MessageBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 消息类型
//
// 示例值：interactive
func (builder *MessageBuilder) MsgType(msgType string) *MessageBuilder {
	builder.msgType = msgType
	builder.msgTypeFlag = true
	return builder
}

// 发送配置
//
// 示例值：{}
func (builder *MessageBuilder) Config(config string) *MessageBuilder {
	builder.config = config
	builder.configFlag = true
	return builder
}

// 特殊配制
//
// 示例值：v2
func (builder *MessageBuilder) Extra(extra string) *MessageBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 幂等key
//
// 示例值：a60cfe61268e10f054a3211ab72185c
func (builder *MessageBuilder) Uuid(uuid string) *MessageBuilder {
	builder.uuid = uuid
	builder.uuidFlag = true
	return builder
}

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

	}
	if builder.receiveIdFlag {
		req.ReceiveId = &builder.receiveId

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

	}
	if builder.msgTypeFlag {
		req.MsgType = &builder.msgType

	}
	if builder.configFlag {
		req.Config = &builder.config

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

	}
	if builder.uuidFlag {
		req.Uuid = &builder.uuid

	}
	return req
}

type MyAiCardAction struct {
	Tag *string `json:"tag,omitempty"` // tag

	Value *MyAiCardValue `json:"value,omitempty"` // value
}

type MyAiCardActionBuilder struct {
	tag     string // tag
	tagFlag bool

	value     *MyAiCardValue // value
	valueFlag bool
}

func NewMyAiCardActionBuilder() *MyAiCardActionBuilder {
	builder := &MyAiCardActionBuilder{}
	return builder
}

// tag
//
// 示例值：button button
func (builder *MyAiCardActionBuilder) Tag(tag string) *MyAiCardActionBuilder {
	builder.tag = tag
	builder.tagFlag = true
	return builder
}

// value
//
// 示例值：
func (builder *MyAiCardActionBuilder) Value(value *MyAiCardValue) *MyAiCardActionBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *MyAiCardActionBuilder) Build() *MyAiCardAction {
	req := &MyAiCardAction{}
	if builder.tagFlag {
		req.Tag = &builder.tag

	}
	if builder.valueFlag {
		req.Value = builder.value
	}
	return req
}

type MyAiCardValue struct {
	Body *string `json:"body,omitempty"` // body

	Handle *string `json:"handle,omitempty"` // handle
}

type MyAiCardValueBuilder struct {
	body     string // body
	bodyFlag bool

	handle     string // handle
	handleFlag bool
}

func NewMyAiCardValueBuilder() *MyAiCardValueBuilder {
	builder := &MyAiCardValueBuilder{}
	return builder
}

// body
//
// 示例值：value body
func (builder *MyAiCardValueBuilder) Body(body string) *MyAiCardValueBuilder {
	builder.body = body
	builder.bodyFlag = true
	return builder
}

// handle
//
// 示例值：handle
func (builder *MyAiCardValueBuilder) Handle(handle string) *MyAiCardValueBuilder {
	builder.handle = handle
	builder.handleFlag = true
	return builder
}

func (builder *MyAiCardValueBuilder) Build() *MyAiCardValue {
	req := &MyAiCardValue{}
	if builder.bodyFlag {
		req.Body = &builder.body

	}
	if builder.handleFlag {
		req.Handle = &builder.handle

	}
	return req
}

type MyAiComment struct {
	UserName *string `json:"user_name,omitempty"` // 用户姓名

	Comment *string `json:"comment,omitempty"` // 评论
}

type MyAiCommentBuilder struct {
	userName     string // 用户姓名
	userNameFlag bool

	comment     string // 评论
	commentFlag bool
}

func NewMyAiCommentBuilder() *MyAiCommentBuilder {
	builder := &MyAiCommentBuilder{}
	return builder
}

// 用户姓名
//
// 示例值：张三
func (builder *MyAiCommentBuilder) UserName(userName string) *MyAiCommentBuilder {
	builder.userName = userName
	builder.userNameFlag = true
	return builder
}

// 评论
//
// 示例值：同意
func (builder *MyAiCommentBuilder) Comment(comment string) *MyAiCommentBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

func (builder *MyAiCommentBuilder) Build() *MyAiComment {
	req := &MyAiComment{}
	if builder.userNameFlag {
		req.UserName = &builder.userName

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	return req
}

type MyAiInstance struct {
	Name *string `json:"name,omitempty"` // 审批名称

	Form *string `json:"form,omitempty"` // 表单

	Tasks []*MyAiTask `json:"tasks,omitempty"` // 审批记录

	Comments []*MyAiComment `json:"comments,omitempty"` // 审批评论
}

type MyAiInstanceBuilder struct {
	name     string // 审批名称
	nameFlag bool

	form     string // 表单
	formFlag bool

	tasks     []*MyAiTask // 审批记录
	tasksFlag bool

	comments     []*MyAiComment // 审批评论
	commentsFlag bool
}

func NewMyAiInstanceBuilder() *MyAiInstanceBuilder {
	builder := &MyAiInstanceBuilder{}
	return builder
}

// 审批名称
//
// 示例值：合同申请
func (builder *MyAiInstanceBuilder) Name(name string) *MyAiInstanceBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 表单
//
// 示例值：金额500元
func (builder *MyAiInstanceBuilder) Form(form string) *MyAiInstanceBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批记录
//
// 示例值：
func (builder *MyAiInstanceBuilder) Tasks(tasks []*MyAiTask) *MyAiInstanceBuilder {
	builder.tasks = tasks
	builder.tasksFlag = true
	return builder
}

// 审批评论
//
// 示例值：
func (builder *MyAiInstanceBuilder) Comments(comments []*MyAiComment) *MyAiInstanceBuilder {
	builder.comments = comments
	builder.commentsFlag = true
	return builder
}

func (builder *MyAiInstanceBuilder) Build() *MyAiInstance {
	req := &MyAiInstance{}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.formFlag {
		req.Form = &builder.form

	}
	if builder.tasksFlag {
		req.Tasks = builder.tasks
	}
	if builder.commentsFlag {
		req.Comments = builder.comments
	}
	return req
}

type MyAiInstanceDetailExtra struct {
	InstanceId *string `json:"instance_id,omitempty"` // 审批实例ID
}

type MyAiInstanceDetailExtraBuilder struct {
	instanceId     string // 审批实例ID
	instanceIdFlag bool
}

func NewMyAiInstanceDetailExtraBuilder() *MyAiInstanceDetailExtraBuilder {
	builder := &MyAiInstanceDetailExtraBuilder{}
	return builder
}

// 审批实例ID
//
// 示例值：281946120421094712
func (builder *MyAiInstanceDetailExtraBuilder) InstanceId(instanceId string) *MyAiInstanceDetailExtraBuilder {
	builder.instanceId = instanceId
	builder.instanceIdFlag = true
	return builder
}

func (builder *MyAiInstanceDetailExtraBuilder) Build() *MyAiInstanceDetailExtra {
	req := &MyAiInstanceDetailExtra{}
	if builder.instanceIdFlag {
		req.InstanceId = &builder.instanceId

	}
	return req
}

type MyAiMessageCallbackRequest struct {
	MessageId *string `json:"message_id,omitempty"` // message ID

	CallbackInfo *string `json:"callback_info,omitempty"` // context
}

type MyAiMessageCallbackRequestBuilder struct {
	messageId     string // message ID
	messageIdFlag bool

	callbackInfo     string // context
	callbackInfoFlag bool
}

func NewMyAiMessageCallbackRequestBuilder() *MyAiMessageCallbackRequestBuilder {
	builder := &MyAiMessageCallbackRequestBuilder{}
	return builder
}

// message ID
//
// 示例值：om_xxxxxxxx
func (builder *MyAiMessageCallbackRequestBuilder) MessageId(messageId string) *MyAiMessageCallbackRequestBuilder {
	builder.messageId = messageId
	builder.messageIdFlag = true
	return builder
}

// context
//
// 示例值："{\"biz_id\":\"xxx\"}"
func (builder *MyAiMessageCallbackRequestBuilder) CallbackInfo(callbackInfo string) *MyAiMessageCallbackRequestBuilder {
	builder.callbackInfo = callbackInfo
	builder.callbackInfoFlag = true
	return builder
}

func (builder *MyAiMessageCallbackRequestBuilder) Build() *MyAiMessageCallbackRequest {
	req := &MyAiMessageCallbackRequest{}
	if builder.messageIdFlag {
		req.MessageId = &builder.messageId

	}
	if builder.callbackInfoFlag {
		req.CallbackInfo = &builder.callbackInfo

	}
	return req
}

type MyAiObjectScenarioContext struct {
	Object *ObjectContext `json:"object,omitempty"` // object
}

type MyAiObjectScenarioContextBuilder struct {
	object     *ObjectContext // object
	objectFlag bool
}

func NewMyAiObjectScenarioContextBuilder() *MyAiObjectScenarioContextBuilder {
	builder := &MyAiObjectScenarioContextBuilder{}
	return builder
}

// object
//
// 示例值：
func (builder *MyAiObjectScenarioContextBuilder) Object(object *ObjectContext) *MyAiObjectScenarioContextBuilder {
	builder.object = object
	builder.objectFlag = true
	return builder
}

func (builder *MyAiObjectScenarioContextBuilder) Build() *MyAiObjectScenarioContext {
	req := &MyAiObjectScenarioContext{}
	if builder.objectFlag {
		req.Object = builder.object
	}
	return req
}

type MyAiPresent struct {
	Type *string `json:"type,omitempty"` // present type

	Body *string `json:"body,omitempty"` // response body

	CallbackUrl *string `json:"callback_url,omitempty"` // msg callback url

	CallbackInfo *string `json:"callback_info,omitempty"` // approval context

	CardTemplateId *string `json:"card_template_id,omitempty"` // template ID

	CardVariables *MyAiPresentCardVariables `json:"card_variables,omitempty"` // 卡片变量

	Interactable *bool `json:"interactable,omitempty"` // interactable

	OperationType *string `json:"operation_type,omitempty"` // operation_type

	OperationUrl *string `json:"operation_url,omitempty"` // operation_url
}

type MyAiPresentBuilder struct {
	type_    string // present type
	typeFlag bool

	body     string // response body
	bodyFlag bool

	callbackUrl     string // msg callback url
	callbackUrlFlag bool

	callbackInfo     string // approval context
	callbackInfoFlag bool

	cardTemplateId     string // template ID
	cardTemplateIdFlag bool

	cardVariables     *MyAiPresentCardVariables // 卡片变量
	cardVariablesFlag bool

	interactable     bool // interactable
	interactableFlag bool

	operationType     string // operation_type
	operationTypeFlag bool

	operationUrl     string // operation_url
	operationUrlFlag bool
}

func NewMyAiPresentBuilder() *MyAiPresentBuilder {
	builder := &MyAiPresentBuilder{}
	return builder
}

// present type
//
// 示例值：rich_text
func (builder *MyAiPresentBuilder) Type(type_ string) *MyAiPresentBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// response body
//
// 示例值：{}
func (builder *MyAiPresentBuilder) Body(body string) *MyAiPresentBuilder {
	builder.body = body
	builder.bodyFlag = true
	return builder
}

// msg callback url
//
// 示例值：https://open......./myai/message_callback
func (builder *MyAiPresentBuilder) CallbackUrl(callbackUrl string) *MyAiPresentBuilder {
	builder.callbackUrl = callbackUrl
	builder.callbackUrlFlag = true
	return builder
}

// approval context
//
// 示例值："{\"session_id\":\"11111\"}"
func (builder *MyAiPresentBuilder) CallbackInfo(callbackInfo string) *MyAiPresentBuilder {
	builder.callbackInfo = callbackInfo
	builder.callbackInfoFlag = true
	return builder
}

// template ID
//
// 示例值：default
func (builder *MyAiPresentBuilder) CardTemplateId(cardTemplateId string) *MyAiPresentBuilder {
	builder.cardTemplateId = cardTemplateId
	builder.cardTemplateIdFlag = true
	return builder
}

// 卡片变量
//
// 示例值：
func (builder *MyAiPresentBuilder) CardVariables(cardVariables *MyAiPresentCardVariables) *MyAiPresentBuilder {
	builder.cardVariables = cardVariables
	builder.cardVariablesFlag = true
	return builder
}

// interactable
//
// 示例值：true false
func (builder *MyAiPresentBuilder) Interactable(interactable bool) *MyAiPresentBuilder {
	builder.interactable = interactable
	builder.interactableFlag = true
	return builder
}

// operation_type
//
// 示例值：operation_type
func (builder *MyAiPresentBuilder) OperationType(operationType string) *MyAiPresentBuilder {
	builder.operationType = operationType
	builder.operationTypeFlag = true
	return builder
}

// operation_url
//
// 示例值：https://open-boe.feichu.com
func (builder *MyAiPresentBuilder) OperationUrl(operationUrl string) *MyAiPresentBuilder {
	builder.operationUrl = operationUrl
	builder.operationUrlFlag = true
	return builder
}

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

	}
	if builder.bodyFlag {
		req.Body = &builder.body

	}
	if builder.callbackUrlFlag {
		req.CallbackUrl = &builder.callbackUrl

	}
	if builder.callbackInfoFlag {
		req.CallbackInfo = &builder.callbackInfo

	}
	if builder.cardTemplateIdFlag {
		req.CardTemplateId = &builder.cardTemplateId

	}
	if builder.cardVariablesFlag {
		req.CardVariables = builder.cardVariables
	}
	if builder.interactableFlag {
		req.Interactable = &builder.interactable

	}
	if builder.operationTypeFlag {
		req.OperationType = &builder.operationType

	}
	if builder.operationUrlFlag {
		req.OperationUrl = &builder.operationUrl

	}
	return req
}

type MyAiPresentCardVariables struct {
	Prologue *string `json:"prologue,omitempty"` // 文字

	QuickActions *string `json:"quick_actions,omitempty"` // 快捷指令
}

type MyAiPresentCardVariablesBuilder struct {
	prologue     string // 文字
	prologueFlag bool

	quickActions     string // 快捷指令
	quickActionsFlag bool
}

func NewMyAiPresentCardVariablesBuilder() *MyAiPresentCardVariablesBuilder {
	builder := &MyAiPresentCardVariablesBuilder{}
	return builder
}

// 文字
//
// 示例值：text
func (builder *MyAiPresentCardVariablesBuilder) Prologue(prologue string) *MyAiPresentCardVariablesBuilder {
	builder.prologue = prologue
	builder.prologueFlag = true
	return builder
}

// 快捷指令
//
// 示例值：{}
func (builder *MyAiPresentCardVariablesBuilder) QuickActions(quickActions string) *MyAiPresentCardVariablesBuilder {
	builder.quickActions = quickActions
	builder.quickActionsFlag = true
	return builder
}

func (builder *MyAiPresentCardVariablesBuilder) Build() *MyAiPresentCardVariables {
	req := &MyAiPresentCardVariables{}
	if builder.prologueFlag {
		req.Prologue = &builder.prologue

	}
	if builder.quickActionsFlag {
		req.QuickActions = &builder.quickActions

	}
	return req
}

type MyAiSearchDefinitionScenarioContext struct {
	ToolRawInstruction *string `json:"tool_raw_instruction,omitempty"` // 用户的原始输入
}

type MyAiSearchDefinitionScenarioContextBuilder struct {
	toolRawInstruction     string // 用户的原始输入
	toolRawInstructionFlag bool
}

func NewMyAiSearchDefinitionScenarioContextBuilder() *MyAiSearchDefinitionScenarioContextBuilder {
	builder := &MyAiSearchDefinitionScenarioContextBuilder{}
	return builder
}

// 用户的原始输入
//
// 示例值：帮我发起报销申请
func (builder *MyAiSearchDefinitionScenarioContextBuilder) ToolRawInstruction(toolRawInstruction string) *MyAiSearchDefinitionScenarioContextBuilder {
	builder.toolRawInstruction = toolRawInstruction
	builder.toolRawInstructionFlag = true
	return builder
}

func (builder *MyAiSearchDefinitionScenarioContextBuilder) Build() *MyAiSearchDefinitionScenarioContext {
	req := &MyAiSearchDefinitionScenarioContext{}
	if builder.toolRawInstructionFlag {
		req.ToolRawInstruction = &builder.toolRawInstruction

	}
	return req
}

type MyAiSimpleCommandResult struct {
	Content *string `json:"content,omitempty"` // result_content
}

type MyAiSimpleCommandResultBuilder struct {
	content     string // result_content
	contentFlag bool
}

func NewMyAiSimpleCommandResultBuilder() *MyAiSimpleCommandResultBuilder {
	builder := &MyAiSimpleCommandResultBuilder{}
	return builder
}

// result_content
//
// 示例值：hi
func (builder *MyAiSimpleCommandResultBuilder) Content(content string) *MyAiSimpleCommandResultBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

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

	}
	return req
}

type MyAiTask struct {
	UserName *string `json:"user_name,omitempty"` // 用户姓名

	Type *string `json:"type,omitempty"` // 操作类型

	NodeName *string `json:"node_name,omitempty"` // 节点名称
}

type MyAiTaskBuilder struct {
	userName     string // 用户姓名
	userNameFlag bool

	type_    string // 操作类型
	typeFlag bool

	nodeName     string // 节点名称
	nodeNameFlag bool
}

func NewMyAiTaskBuilder() *MyAiTaskBuilder {
	builder := &MyAiTaskBuilder{}
	return builder
}

// 用户姓名
//
// 示例值：张三
func (builder *MyAiTaskBuilder) UserName(userName string) *MyAiTaskBuilder {
	builder.userName = userName
	builder.userNameFlag = true
	return builder
}

// 操作类型
//
// 示例值：同意
func (builder *MyAiTaskBuilder) Type(type_ string) *MyAiTaskBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 节点名称
//
// 示例值：财务审批
func (builder *MyAiTaskBuilder) NodeName(nodeName string) *MyAiTaskBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

func (builder *MyAiTaskBuilder) Build() *MyAiTask {
	req := &MyAiTask{}
	if builder.userNameFlag {
		req.UserName = &builder.userName

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

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	return req
}

type NodeApprover struct {
	Key *string `json:"key,omitempty"` // node id 或 custom node id，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取

	Value []string `json:"value,omitempty"` // value: 审批人列表
}

type NodeApproverBuilder struct {
	key     string // node id 或 custom node id，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取
	keyFlag bool

	value     []string // value: 审批人列表
	valueFlag bool
}

func NewNodeApproverBuilder() *NodeApproverBuilder {
	builder := &NodeApproverBuilder{}
	return builder
}

// node id 或 custom node id，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取
//
// 示例值：46e6d96cfa756980907209209ec03b64
func (builder *NodeApproverBuilder) Key(key string) *NodeApproverBuilder {
	builder.key = key
	builder.keyFlag = true
	return builder
}

// value: 审批人列表
//
// 示例值：["f7cb567e"]
func (builder *NodeApproverBuilder) Value(value []string) *NodeApproverBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *NodeApproverBuilder) Build() *NodeApprover {
	req := &NodeApprover{}
	if builder.keyFlag {
		req.Key = &builder.key

	}
	if builder.valueFlag {
		req.Value = builder.value
	}
	return req
}

type NodeAutoApproval struct {
	NodeIdType *string `json:"node_id_type,omitempty"` // 节点id的类型

	NodeId *string `json:"node_id,omitempty"` // 节点id
}

type NodeAutoApprovalBuilder struct {
	nodeIdType     string // 节点id的类型
	nodeIdTypeFlag bool

	nodeId     string // 节点id
	nodeIdFlag bool
}

func NewNodeAutoApprovalBuilder() *NodeAutoApprovalBuilder {
	builder := &NodeAutoApprovalBuilder{}
	return builder
}

// 节点id的类型
//
// 示例值：NON_CUSTOM
func (builder *NodeAutoApprovalBuilder) NodeIdType(nodeIdType string) *NodeAutoApprovalBuilder {
	builder.nodeIdType = nodeIdType
	builder.nodeIdTypeFlag = true
	return builder
}

// 节点id
//
// 示例值：manager_node_id
func (builder *NodeAutoApprovalBuilder) NodeId(nodeId string) *NodeAutoApprovalBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

func (builder *NodeAutoApprovalBuilder) Build() *NodeAutoApproval {
	req := &NodeAutoApproval{}
	if builder.nodeIdTypeFlag {
		req.NodeIdType = &builder.nodeIdType

	}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	return req
}

type NodeCc struct {
	Key *string `json:"key,omitempty"` // node id ，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取

	Value []string `json:"value,omitempty"` // value: 审批人列表
}

type NodeCcBuilder struct {
	key     string // node id ，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取
	keyFlag bool

	value     []string // value: 审批人列表
	valueFlag bool
}

func NewNodeCcBuilder() *NodeCcBuilder {
	builder := &NodeCcBuilder{}
	return builder
}

// node id ，通过 [查看审批定义](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/get) 获取
//
// 示例值：46e6d96cfa756980907209209ec03b75
func (builder *NodeCcBuilder) Key(key string) *NodeCcBuilder {
	builder.key = key
	builder.keyFlag = true
	return builder
}

// value: 审批人列表
//
// 示例值：["f7cb567e"]
func (builder *NodeCcBuilder) Value(value []string) *NodeCcBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *NodeCcBuilder) Build() *NodeCc {
	req := &NodeCc{}
	if builder.keyFlag {
		req.Key = &builder.key

	}
	if builder.valueFlag {
		req.Value = builder.value
	}
	return req
}

type ObjectContext struct {
	Type *string `json:"type,omitempty"` // 业务类型

	BizId *string `json:"biz_id,omitempty"` // 业务ID
}

type ObjectContextBuilder struct {
	type_    string // 业务类型
	typeFlag bool

	bizId     string // 业务ID
	bizIdFlag bool
}

func NewObjectContextBuilder() *ObjectContextBuilder {
	builder := &ObjectContextBuilder{}
	return builder
}

// 业务类型
//
// 示例值：Approval
func (builder *ObjectContextBuilder) Type(type_ string) *ObjectContextBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 业务ID
//
// 示例值：72741982461846214
func (builder *ObjectContextBuilder) BizId(bizId string) *ObjectContextBuilder {
	builder.bizId = bizId
	builder.bizIdFlag = true
	return builder
}

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

	}
	if builder.bizIdFlag {
		req.BizId = &builder.bizId

	}
	return req
}

type OpenWidgetInstance struct {
	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例唯一标识

	Status *string `json:"status,omitempty"` // 审批单当前状态

	CreateTime *int `json:"create_time,omitempty"` // 审批单创建时间，毫秒时间戳

	UpdateTime *int `json:"update_time,omitempty"` // 审批实例更新时间，毫秒时间戳

	FormContent *string `json:"form_content,omitempty"` // 审批表单数据，仅包含自定义控件内的数据
}

type OpenWidgetInstanceBuilder struct {
	instanceCode     string // 审批实例唯一标识
	instanceCodeFlag bool

	status     string // 审批单当前状态
	statusFlag bool

	createTime     int // 审批单创建时间，毫秒时间戳
	createTimeFlag bool

	updateTime     int // 审批实例更新时间，毫秒时间戳
	updateTimeFlag bool

	formContent     string // 审批表单数据，仅包含自定义控件内的数据
	formContentFlag bool
}

func NewOpenWidgetInstanceBuilder() *OpenWidgetInstanceBuilder {
	builder := &OpenWidgetInstanceBuilder{}
	return builder
}

// 审批实例唯一标识
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *OpenWidgetInstanceBuilder) InstanceCode(instanceCode string) *OpenWidgetInstanceBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 审批单当前状态
//
// 示例值：PENDING
func (builder *OpenWidgetInstanceBuilder) Status(status string) *OpenWidgetInstanceBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批单创建时间，毫秒时间戳
//
// 示例值：1666079207003
func (builder *OpenWidgetInstanceBuilder) CreateTime(createTime int) *OpenWidgetInstanceBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 审批实例更新时间，毫秒时间戳
//
// 示例值：1666079207003
func (builder *OpenWidgetInstanceBuilder) UpdateTime(updateTime int) *OpenWidgetInstanceBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 审批表单数据，仅包含自定义控件内的数据
//
// 示例值：[{\"id\": \"widget1\",\"custom_id\": \"user_info\",\"name\": \"Item application\",\"type\": \"textarea\"}]
func (builder *OpenWidgetInstanceBuilder) FormContent(formContent string) *OpenWidgetInstanceBuilder {
	builder.formContent = formContent
	builder.formContentFlag = true
	return builder
}

func (builder *OpenWidgetInstanceBuilder) Build() *OpenWidgetInstance {
	req := &OpenWidgetInstance{}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

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

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

	}
	if builder.formContentFlag {
		req.FormContent = &builder.formContent

	}
	return req
}

type PreviewNode struct {
	NodeId *string `json:"node_id,omitempty"` // 节点id

	NodeName *string `json:"node_name,omitempty"` // 节点名称

	NodeType *string `json:"node_type,omitempty"` // 节点类型 “AND":会签  “OR”:或签

	Comments []string `json:"comments,omitempty"` // 节点描述

	CustomNodeId *string `json:"custom_node_id,omitempty"` // 租户节点id

	UserIdList []string `json:"user_id_list,omitempty"` // 审批人id列表

	EndCcIdList []string `json:"end_cc_id_list,omitempty"` // 节点结束抄送人id列表

	IsEmptyLogic *bool `json:"is_empty_logic,omitempty"` // 审批人是否为空

	IsApproverTypeFree *bool `json:"is_approver_type_free,omitempty"` // 是否是发起人自选类型

	HasCcTypeFree *bool `json:"has_cc_type_free,omitempty"` // 是否包含抄送人自选类型
}

type PreviewNodeBuilder struct {
	nodeId     string // 节点id
	nodeIdFlag bool

	nodeName     string // 节点名称
	nodeNameFlag bool

	nodeType     string // 节点类型 “AND":会签  “OR”:或签
	nodeTypeFlag bool

	comments     []string // 节点描述
	commentsFlag bool

	customNodeId     string // 租户节点id
	customNodeIdFlag bool

	userIdList     []string // 审批人id列表
	userIdListFlag bool

	endCcIdList     []string // 节点结束抄送人id列表
	endCcIdListFlag bool

	isEmptyLogic     bool // 审批人是否为空
	isEmptyLogicFlag bool

	isApproverTypeFree     bool // 是否是发起人自选类型
	isApproverTypeFreeFlag bool

	hasCcTypeFree     bool // 是否包含抄送人自选类型
	hasCcTypeFreeFlag bool
}

func NewPreviewNodeBuilder() *PreviewNodeBuilder {
	builder := &PreviewNodeBuilder{}
	return builder
}

// 节点id
//
// 示例值：
func (builder *PreviewNodeBuilder) NodeId(nodeId string) *PreviewNodeBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// 节点名称
//
// 示例值：
func (builder *PreviewNodeBuilder) NodeName(nodeName string) *PreviewNodeBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

// 节点类型 “AND":会签  “OR”:或签
//
// 示例值：
func (builder *PreviewNodeBuilder) NodeType(nodeType string) *PreviewNodeBuilder {
	builder.nodeType = nodeType
	builder.nodeTypeFlag = true
	return builder
}

// 节点描述
//
// 示例值：
func (builder *PreviewNodeBuilder) Comments(comments []string) *PreviewNodeBuilder {
	builder.comments = comments
	builder.commentsFlag = true
	return builder
}

// 租户节点id
//
// 示例值：
func (builder *PreviewNodeBuilder) CustomNodeId(customNodeId string) *PreviewNodeBuilder {
	builder.customNodeId = customNodeId
	builder.customNodeIdFlag = true
	return builder
}

// 审批人id列表
//
// 示例值：
func (builder *PreviewNodeBuilder) UserIdList(userIdList []string) *PreviewNodeBuilder {
	builder.userIdList = userIdList
	builder.userIdListFlag = true
	return builder
}

// 节点结束抄送人id列表
//
// 示例值：
func (builder *PreviewNodeBuilder) EndCcIdList(endCcIdList []string) *PreviewNodeBuilder {
	builder.endCcIdList = endCcIdList
	builder.endCcIdListFlag = true
	return builder
}

// 审批人是否为空
//
// 示例值：
func (builder *PreviewNodeBuilder) IsEmptyLogic(isEmptyLogic bool) *PreviewNodeBuilder {
	builder.isEmptyLogic = isEmptyLogic
	builder.isEmptyLogicFlag = true
	return builder
}

// 是否是发起人自选类型
//
// 示例值：
func (builder *PreviewNodeBuilder) IsApproverTypeFree(isApproverTypeFree bool) *PreviewNodeBuilder {
	builder.isApproverTypeFree = isApproverTypeFree
	builder.isApproverTypeFreeFlag = true
	return builder
}

// 是否包含抄送人自选类型
//
// 示例值：
func (builder *PreviewNodeBuilder) HasCcTypeFree(hasCcTypeFree bool) *PreviewNodeBuilder {
	builder.hasCcTypeFree = hasCcTypeFree
	builder.hasCcTypeFreeFlag = true
	return builder
}

func (builder *PreviewNodeBuilder) Build() *PreviewNode {
	req := &PreviewNode{}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	if builder.nodeTypeFlag {
		req.NodeType = &builder.nodeType

	}
	if builder.commentsFlag {
		req.Comments = builder.comments
	}
	if builder.customNodeIdFlag {
		req.CustomNodeId = &builder.customNodeId

	}
	if builder.userIdListFlag {
		req.UserIdList = builder.userIdList
	}
	if builder.endCcIdListFlag {
		req.EndCcIdList = builder.endCcIdList
	}
	if builder.isEmptyLogicFlag {
		req.IsEmptyLogic = &builder.isEmptyLogic

	}
	if builder.isApproverTypeFreeFlag {
		req.IsApproverTypeFree = &builder.isApproverTypeFree

	}
	if builder.hasCcTypeFreeFlag {
		req.HasCcTypeFree = &builder.hasCcTypeFree

	}
	return req
}

type ProcessRecord struct {
	Instance *EntityProcessRecord `json:"instance,omitempty"` // 发生变更的实例

	Task *EntityProcessRecord `json:"task,omitempty"` // 发生变更的待办

	Cc *EntityProcessRecord `json:"cc,omitempty"` // 发生变更的抄送
}

type ProcessRecordBuilder struct {
	instance     *EntityProcessRecord // 发生变更的实例
	instanceFlag bool

	task     *EntityProcessRecord // 发生变更的待办
	taskFlag bool

	cc     *EntityProcessRecord // 发生变更的抄送
	ccFlag bool
}

func NewProcessRecordBuilder() *ProcessRecordBuilder {
	builder := &ProcessRecordBuilder{}
	return builder
}

// 发生变更的实例
//
// 示例值：
func (builder *ProcessRecordBuilder) Instance(instance *EntityProcessRecord) *ProcessRecordBuilder {
	builder.instance = instance
	builder.instanceFlag = true
	return builder
}

// 发生变更的待办
//
// 示例值：
func (builder *ProcessRecordBuilder) Task(task *EntityProcessRecord) *ProcessRecordBuilder {
	builder.task = task
	builder.taskFlag = true
	return builder
}

// 发生变更的抄送
//
// 示例值：
func (builder *ProcessRecordBuilder) Cc(cc *EntityProcessRecord) *ProcessRecordBuilder {
	builder.cc = cc
	builder.ccFlag = true
	return builder
}

func (builder *ProcessRecordBuilder) Build() *ProcessRecord {
	req := &ProcessRecord{}
	if builder.instanceFlag {
		req.Instance = builder.instance
	}
	if builder.taskFlag {
		req.Task = builder.task
	}
	if builder.ccFlag {
		req.Cc = builder.cc
	}
	return req
}

type Reason struct {
	Text *string `json:"text,omitempty"` // 原因说明

	Files []*File `json:"files,omitempty"` // 附件集合
}

type ReasonBuilder struct {
	text     string // 原因说明
	textFlag bool

	files     []*File // 附件集合
	filesFlag bool
}

func NewReasonBuilder() *ReasonBuilder {
	builder := &ReasonBuilder{}
	return builder
}

// 原因说明
//
// 示例值：
func (builder *ReasonBuilder) Text(text string) *ReasonBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 附件集合
//
// 示例值：
func (builder *ReasonBuilder) Files(files []*File) *ReasonBuilder {
	builder.files = files
	builder.filesFlag = true
	return builder
}

func (builder *ReasonBuilder) Build() *Reason {
	req := &Reason{}
	if builder.textFlag {
		req.Text = &builder.text

	}
	if builder.filesFlag {
		req.Files = builder.files
	}
	return req
}

type RemedyGroup struct {
	Type *string `json:"type,omitempty"` //

	InstanceCode *string `json:"instance_code,omitempty"` //

	EmployeeId *string `json:"employee_id,omitempty"` //

	StartTime *int `json:"start_time,omitempty"` //

	EndTime *int `json:"end_time,omitempty"` //

	RemedyTime *int `json:"remedy_time,omitempty"` //

	RemedyReason *string `json:"remedy_reason,omitempty"` //

	Status *string `json:"status,omitempty"` //
}

type RemedyGroupBuilder struct {
	type_    string //
	typeFlag bool

	instanceCode     string //
	instanceCodeFlag bool

	employeeId     string //
	employeeIdFlag bool

	startTime     int //
	startTimeFlag bool

	endTime     int //
	endTimeFlag bool

	remedyTime     int //
	remedyTimeFlag bool

	remedyReason     string //
	remedyReasonFlag bool

	status     string //
	statusFlag bool
}

func NewRemedyGroupBuilder() *RemedyGroupBuilder {
	builder := &RemedyGroupBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) Type(type_ string) *RemedyGroupBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) InstanceCode(instanceCode string) *RemedyGroupBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) EmployeeId(employeeId string) *RemedyGroupBuilder {
	builder.employeeId = employeeId
	builder.employeeIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) StartTime(startTime int) *RemedyGroupBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) EndTime(endTime int) *RemedyGroupBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) RemedyTime(remedyTime int) *RemedyGroupBuilder {
	builder.remedyTime = remedyTime
	builder.remedyTimeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *RemedyGroupBuilder) RemedyReason(remedyReason string) *RemedyGroupBuilder {
	builder.remedyReason = remedyReason
	builder.remedyReasonFlag = true
	return builder
}

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

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

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.employeeIdFlag {
		req.EmployeeId = &builder.employeeId

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	if builder.remedyTimeFlag {
		req.RemedyTime = &builder.remedyTime

	}
	if builder.remedyReasonFlag {
		req.RemedyReason = &builder.remedyReason

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

	}
	return req
}

type RevertEvent struct {
	Type *string `json:"type,omitempty"` // 类型

	InstanceCode *string `json:"instance_code,omitempty"` // 实例code

	OperateTime *string `json:"operate_time,omitempty"` // 操作时间

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

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code
}

type RevertEventBuilder struct {
	type_    string // 类型
	typeFlag bool

	instanceCode     string // 实例code
	instanceCodeFlag bool

	operateTime     string // 操作时间
	operateTimeFlag bool

	status     string // 状态
	statusFlag bool

	approvalCode     string // 审批定义 Code
	approvalCodeFlag bool
}

func NewRevertEventBuilder() *RevertEventBuilder {
	builder := &RevertEventBuilder{}
	return builder
}

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

// 实例code
//
// 示例值：C04A783E-D0BB-4036-BADC-31BECC6DDA29
func (builder *RevertEventBuilder) InstanceCode(instanceCode string) *RevertEventBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 操作时间
//
// 示例值：1675758455
func (builder *RevertEventBuilder) OperateTime(operateTime string) *RevertEventBuilder {
	builder.operateTime = operateTime
	builder.operateTimeFlag = true
	return builder
}

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

// 审批定义 Code
//
// 示例值：D0CA783E-F0BB-4U36-LADC-91BECS6DDA29
func (builder *RevertEventBuilder) ApprovalCode(approvalCode string) *RevertEventBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

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

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.operateTimeFlag {
		req.OperateTime = &builder.operateTime

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

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	return req
}

type RollbackNode struct {
	NodeId *string `json:"node_id,omitempty"` // 节点id

	NodeName *string `json:"node_name,omitempty"` // 节点名称

	CustomNodeId *string `json:"custom_node_id,omitempty"` // 节点自定义 id

	NodeKey *string `json:"node_key,omitempty"` // 节点key
}

type RollbackNodeBuilder struct {
	nodeId     string // 节点id
	nodeIdFlag bool

	nodeName     string // 节点名称
	nodeNameFlag bool

	customNodeId     string // 节点自定义 id
	customNodeIdFlag bool

	nodeKey     string // 节点key
	nodeKeyFlag bool
}

func NewRollbackNodeBuilder() *RollbackNodeBuilder {
	builder := &RollbackNodeBuilder{}
	return builder
}

// 节点id
//
// 示例值：46e6d96cfa756980907209209ec03b64
func (builder *RollbackNodeBuilder) NodeId(nodeId string) *RollbackNodeBuilder {
	builder.nodeId = nodeId
	builder.nodeIdFlag = true
	return builder
}

// 节点名称
//
// 示例值：开始
func (builder *RollbackNodeBuilder) NodeName(nodeName string) *RollbackNodeBuilder {
	builder.nodeName = nodeName
	builder.nodeNameFlag = true
	return builder
}

// 节点自定义 id
//
// 示例值：manager
func (builder *RollbackNodeBuilder) CustomNodeId(customNodeId string) *RollbackNodeBuilder {
	builder.customNodeId = customNodeId
	builder.customNodeIdFlag = true
	return builder
}

// 节点key
//
// 示例值：APPROVAL_240330_4058663
func (builder *RollbackNodeBuilder) NodeKey(nodeKey string) *RollbackNodeBuilder {
	builder.nodeKey = nodeKey
	builder.nodeKeyFlag = true
	return builder
}

func (builder *RollbackNodeBuilder) Build() *RollbackNode {
	req := &RollbackNode{}
	if builder.nodeIdFlag {
		req.NodeId = &builder.nodeId

	}
	if builder.nodeNameFlag {
		req.NodeName = &builder.nodeName

	}
	if builder.customNodeIdFlag {
		req.CustomNodeId = &builder.customNodeId

	}
	if builder.nodeKeyFlag {
		req.NodeKey = &builder.nodeKey

	}
	return req
}

type ShiftGroup struct {
	Type *string `json:"type,omitempty"` // 事件类型

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例code

	UserId *string `json:"user_id,omitempty"` // 发起人用户ID

	SwapShiftUserId *string `json:"swap_shift_user_id,omitempty"` // 换班人用户ID

	StartTime *int `json:"start_time,omitempty"` // 开始时间

	EndTime *int `json:"end_time,omitempty"` // 结束时间

	ShiftReason *string `json:"shift_reason,omitempty"` // 换班原因

	SwapShiftDetails []*SwapShiftDetail `json:"swap_shift_details,omitempty"` // 换班详情
}

type ShiftGroupBuilder struct {
	type_    string // 事件类型
	typeFlag bool

	instanceCode     string // 审批实例code
	instanceCodeFlag bool

	userId     string // 发起人用户ID
	userIdFlag bool

	swapShiftUserId     string // 换班人用户ID
	swapShiftUserIdFlag bool

	startTime     int // 开始时间
	startTimeFlag bool

	endTime     int // 结束时间
	endTimeFlag bool

	shiftReason     string // 换班原因
	shiftReasonFlag bool

	swapShiftDetails     []*SwapShiftDetail // 换班详情
	swapShiftDetailsFlag bool
}

func NewShiftGroupBuilder() *ShiftGroupBuilder {
	builder := &ShiftGroupBuilder{}
	return builder
}

// 事件类型
//
// 示例值：shift_approval_v2
func (builder *ShiftGroupBuilder) Type(type_ string) *ShiftGroupBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 审批实例code
//
// 示例值：4EAA9FD6-71E6-4661-A2C8-92CF68D2A0A0
func (builder *ShiftGroupBuilder) InstanceCode(instanceCode string) *ShiftGroupBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 发起人用户ID
//
// 示例值：xxx
func (builder *ShiftGroupBuilder) UserId(userId string) *ShiftGroupBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 换班人用户ID
//
// 示例值：xxx
func (builder *ShiftGroupBuilder) SwapShiftUserId(swapShiftUserId string) *ShiftGroupBuilder {
	builder.swapShiftUserId = swapShiftUserId
	builder.swapShiftUserIdFlag = true
	return builder
}

// 开始时间
//
// 示例值：1695643504
func (builder *ShiftGroupBuilder) StartTime(startTime int) *ShiftGroupBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 结束时间
//
// 示例值：1695643504
func (builder *ShiftGroupBuilder) EndTime(endTime int) *ShiftGroupBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 换班原因
//
// 示例值：临时有事申请换班
func (builder *ShiftGroupBuilder) ShiftReason(shiftReason string) *ShiftGroupBuilder {
	builder.shiftReason = shiftReason
	builder.shiftReasonFlag = true
	return builder
}

// 换班详情
//
// 示例值：""
func (builder *ShiftGroupBuilder) SwapShiftDetails(swapShiftDetails []*SwapShiftDetail) *ShiftGroupBuilder {
	builder.swapShiftDetails = swapShiftDetails
	builder.swapShiftDetailsFlag = true
	return builder
}

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

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.swapShiftUserIdFlag {
		req.SwapShiftUserId = &builder.swapShiftUserId

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	if builder.shiftReasonFlag {
		req.ShiftReason = &builder.shiftReason

	}
	if builder.swapShiftDetailsFlag {
		req.SwapShiftDetails = builder.swapShiftDetails
	}
	return req
}

type SignGroup struct {
	InstanceCode *string `json:"instance_code,omitempty"` //

	UserId *UserId `json:"user_id,omitempty"` //

	AccountCode *string `json:"account_code,omitempty"` //

	BoilerplateUniqueCode *string `json:"boilerplate_unique_code,omitempty"` //

	StartTime *int `json:"start_time,omitempty"` //

	EndTime *int `json:"end_time,omitempty"` //

	Type *string `json:"type,omitempty"` //
}

type SignGroupBuilder struct {
	instanceCode     string //
	instanceCodeFlag bool

	userId     *UserId //
	userIdFlag bool

	accountCode     string //
	accountCodeFlag bool

	boilerplateUniqueCode     string //
	boilerplateUniqueCodeFlag bool

	startTime     int //
	startTimeFlag bool

	endTime     int //
	endTimeFlag bool

	type_    string //
	typeFlag bool
}

func NewSignGroupBuilder() *SignGroupBuilder {
	builder := &SignGroupBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) InstanceCode(instanceCode string) *SignGroupBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) UserId(userId *UserId) *SignGroupBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) AccountCode(accountCode string) *SignGroupBuilder {
	builder.accountCode = accountCode
	builder.accountCodeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) BoilerplateUniqueCode(boilerplateUniqueCode string) *SignGroupBuilder {
	builder.boilerplateUniqueCode = boilerplateUniqueCode
	builder.boilerplateUniqueCodeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) StartTime(startTime int) *SignGroupBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) EndTime(endTime int) *SignGroupBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *SignGroupBuilder) Type(type_ string) *SignGroupBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *SignGroupBuilder) Build() *SignGroup {
	req := &SignGroup{}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.userIdFlag {
		req.UserId = builder.userId
	}
	if builder.accountCodeFlag {
		req.AccountCode = &builder.accountCode

	}
	if builder.boilerplateUniqueCodeFlag {
		req.BoilerplateUniqueCode = &builder.boilerplateUniqueCode

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

	}
	return req
}

type SpecifiedRollback struct {
	UserId *string `json:"user_id,omitempty"` // 用户ID

	TaskId *string `json:"task_id,omitempty"` // 回退的任务ID

	Reason *string `json:"reason,omitempty"` // 退回原因

	Extra *string `json:"extra,omitempty"` // 扩展字段

	TaskDefKeyList []string `json:"task_def_key_list,omitempty"` // 指定退回的任务node_key，从实例详情中获取timeline中获取，必须是PASS的任务node_key
}

type SpecifiedRollbackBuilder struct {
	userId     string // 用户ID
	userIdFlag bool

	taskId     string // 回退的任务ID
	taskIdFlag bool

	reason     string // 退回原因
	reasonFlag bool

	extra     string // 扩展字段
	extraFlag bool

	taskDefKeyList     []string // 指定退回的任务node_key，从实例详情中获取timeline中获取，必须是PASS的任务node_key
	taskDefKeyListFlag bool
}

func NewSpecifiedRollbackBuilder() *SpecifiedRollbackBuilder {
	builder := &SpecifiedRollbackBuilder{}
	return builder
}

// 用户ID
//
// 示例值：893g4c45
func (builder *SpecifiedRollbackBuilder) UserId(userId string) *SpecifiedRollbackBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 回退的任务ID
//
// 示例值：7026591166355210260
func (builder *SpecifiedRollbackBuilder) TaskId(taskId string) *SpecifiedRollbackBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 退回原因
//
// 示例值：申请事项填写不具体，请重新填写
func (builder *SpecifiedRollbackBuilder) Reason(reason string) *SpecifiedRollbackBuilder {
	builder.reason = reason
	builder.reasonFlag = true
	return builder
}

// 扩展字段
//
// 示例值：暂不填写
func (builder *SpecifiedRollbackBuilder) Extra(extra string) *SpecifiedRollbackBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 指定退回的任务node_key，从实例详情中获取timeline中获取，必须是PASS的任务node_key
//
// 示例值：["START","APPROVAL_27997_285502","APPROVAL_462205_2734554"]
func (builder *SpecifiedRollbackBuilder) TaskDefKeyList(taskDefKeyList []string) *SpecifiedRollbackBuilder {
	builder.taskDefKeyList = taskDefKeyList
	builder.taskDefKeyListFlag = true
	return builder
}

func (builder *SpecifiedRollbackBuilder) Build() *SpecifiedRollback {
	req := &SpecifiedRollback{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.reasonFlag {
		req.Reason = &builder.reason

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

	}
	if builder.taskDefKeyListFlag {
		req.TaskDefKeyList = builder.taskDefKeyList
	}
	return req
}

type SwapShiftDetail struct {
	Date *string `json:"date,omitempty"` // 换班日期

	ReturnDate *string `json:"return_date,omitempty"` // 还班日期

	ShfitId *string `json:"shfit_id,omitempty"` // 班次ID
}

type SwapShiftDetailBuilder struct {
	date     string // 换班日期
	dateFlag bool

	returnDate     string // 还班日期
	returnDateFlag bool

	shfitId     string // 班次ID
	shfitIdFlag bool
}

func NewSwapShiftDetailBuilder() *SwapShiftDetailBuilder {
	builder := &SwapShiftDetailBuilder{}
	return builder
}

// 换班日期
//
// 示例值：2023-09-11
func (builder *SwapShiftDetailBuilder) Date(date string) *SwapShiftDetailBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 还班日期
//
// 示例值：2023-09-12
func (builder *SwapShiftDetailBuilder) ReturnDate(returnDate string) *SwapShiftDetailBuilder {
	builder.returnDate = returnDate
	builder.returnDateFlag = true
	return builder
}

// 班次ID
//
// 示例值：xxx
func (builder *SwapShiftDetailBuilder) ShfitId(shfitId string) *SwapShiftDetailBuilder {
	builder.shfitId = shfitId
	builder.shfitIdFlag = true
	return builder
}

func (builder *SwapShiftDetailBuilder) Build() *SwapShiftDetail {
	req := &SwapShiftDetail{}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.returnDateFlag {
		req.ReturnDate = &builder.returnDate

	}
	if builder.shfitIdFlag {
		req.ShfitId = &builder.shfitId

	}
	return req
}

type Task struct {
	Topic *string `json:"topic,omitempty"` // 任务所属的任务分组，如「待办」、「已办」等

	UserId *string `json:"user_id,omitempty"` // 任务所属的用户 ID

	Title *string `json:"title,omitempty"` // 任务题目

	Urls *TaskUrls `json:"urls,omitempty"` // 任务相关 URL

	ProcessExternalId *string `json:"process_external_id,omitempty"` // 流程三方 ID，仅第三方流程，需要在当前租户、当前 APP 内唯一

	TaskExternalId *string `json:"task_external_id,omitempty"` // 任务三方 ID，仅第三方流程，需要在当前流程实例内唯一

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

	ProcessStatus *string `json:"process_status,omitempty"` // 流程实例状态

	DefinitionCode *string `json:"definition_code,omitempty"` // 流程定义 Code

	Initiators []string `json:"initiators,omitempty"` // 发起人 ID 列表

	InitiatorNames []string `json:"initiator_names,omitempty"` // 发起人姓名列表

	TaskId *string `json:"task_id,omitempty"` // 任务 ID，全局唯一

	ProcessId *string `json:"process_id,omitempty"` // 流程 ID，全局唯一

	ProcessCode *string `json:"process_code,omitempty"` // 流程 Code

	DefinitionGroupId *string `json:"definition_group_id,omitempty"` // 流程定义分组 ID

	DefinitionGroupName *string `json:"definition_group_name,omitempty"` // 流程定义分组名称

	DefinitionId *string `json:"definition_id,omitempty"` // 流程定义 ID

	DefinitionName *string `json:"definition_name,omitempty"` // 流程定义名称
}

type TaskBuilder struct {
	topic     string // 任务所属的任务分组，如「待办」、「已办」等
	topicFlag bool

	userId     string // 任务所属的用户 ID
	userIdFlag bool

	title     string // 任务题目
	titleFlag bool

	urls     *TaskUrls // 任务相关 URL
	urlsFlag bool

	processExternalId     string // 流程三方 ID，仅第三方流程，需要在当前租户、当前 APP 内唯一
	processExternalIdFlag bool

	taskExternalId     string // 任务三方 ID，仅第三方流程，需要在当前流程实例内唯一
	taskExternalIdFlag bool

	status     string // 任务状态
	statusFlag bool

	processStatus     string // 流程实例状态
	processStatusFlag bool

	definitionCode     string // 流程定义 Code
	definitionCodeFlag bool

	initiators     []string // 发起人 ID 列表
	initiatorsFlag bool

	initiatorNames     []string // 发起人姓名列表
	initiatorNamesFlag bool

	taskId     string // 任务 ID，全局唯一
	taskIdFlag bool

	processId     string // 流程 ID，全局唯一
	processIdFlag bool

	processCode     string // 流程 Code
	processCodeFlag bool

	definitionGroupId     string // 流程定义分组 ID
	definitionGroupIdFlag bool

	definitionGroupName     string // 流程定义分组名称
	definitionGroupNameFlag bool

	definitionId     string // 流程定义 ID
	definitionIdFlag bool

	definitionName     string // 流程定义名称
	definitionNameFlag bool
}

func NewTaskBuilder() *TaskBuilder {
	builder := &TaskBuilder{}
	return builder
}

// 任务所属的任务分组，如「待办」、「已办」等
//
// 示例值：1
func (builder *TaskBuilder) Topic(topic string) *TaskBuilder {
	builder.topic = topic
	builder.topicFlag = true
	return builder
}

// 任务所属的用户 ID
//
// 示例值：example_user_id
func (builder *TaskBuilder) UserId(userId string) *TaskBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 任务题目
//
// 示例值：任务题目示例
func (builder *TaskBuilder) Title(title string) *TaskBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 任务相关 URL
//
// 示例值：
func (builder *TaskBuilder) Urls(urls *TaskUrls) *TaskBuilder {
	builder.urls = urls
	builder.urlsFlag = true
	return builder
}

// 流程三方 ID，仅第三方流程，需要在当前租户、当前 APP 内唯一
//
// 示例值：example_instance_id
func (builder *TaskBuilder) ProcessExternalId(processExternalId string) *TaskBuilder {
	builder.processExternalId = processExternalId
	builder.processExternalIdFlag = true
	return builder
}

// 任务三方 ID，仅第三方流程，需要在当前流程实例内唯一
//
// 示例值：example_task_id
func (builder *TaskBuilder) TaskExternalId(taskExternalId string) *TaskBuilder {
	builder.taskExternalId = taskExternalId
	builder.taskExternalIdFlag = true
	return builder
}

// 任务状态
//
// 示例值：Todo
func (builder *TaskBuilder) Status(status string) *TaskBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 流程实例状态
//
// 示例值：Running
func (builder *TaskBuilder) ProcessStatus(processStatus string) *TaskBuilder {
	builder.processStatus = processStatus
	builder.processStatusFlag = true
	return builder
}

// 流程定义 Code
//
// 示例值：000000-00000000000000-0example
func (builder *TaskBuilder) DefinitionCode(definitionCode string) *TaskBuilder {
	builder.definitionCode = definitionCode
	builder.definitionCodeFlag = true
	return builder
}

// 发起人 ID 列表
//
// 示例值：
func (builder *TaskBuilder) Initiators(initiators []string) *TaskBuilder {
	builder.initiators = initiators
	builder.initiatorsFlag = true
	return builder
}

// 发起人姓名列表
//
// 示例值：
func (builder *TaskBuilder) InitiatorNames(initiatorNames []string) *TaskBuilder {
	builder.initiatorNames = initiatorNames
	builder.initiatorNamesFlag = true
	return builder
}

// 任务 ID，全局唯一
//
// 示例值：1212564555454
func (builder *TaskBuilder) TaskId(taskId string) *TaskBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 流程 ID，全局唯一
//
// 示例值：1214564545474
func (builder *TaskBuilder) ProcessId(processId string) *TaskBuilder {
	builder.processId = processId
	builder.processIdFlag = true
	return builder
}

// 流程 Code
//
// 示例值：123e4567-e89b-12d3-a456-426655440000
func (builder *TaskBuilder) ProcessCode(processCode string) *TaskBuilder {
	builder.processCode = processCode
	builder.processCodeFlag = true
	return builder
}

// 流程定义分组 ID
//
// 示例值：1212564555454
func (builder *TaskBuilder) DefinitionGroupId(definitionGroupId string) *TaskBuilder {
	builder.definitionGroupId = definitionGroupId
	builder.definitionGroupIdFlag = true
	return builder
}

// 流程定义分组名称
//
// 示例值：流程定义名称
func (builder *TaskBuilder) DefinitionGroupName(definitionGroupName string) *TaskBuilder {
	builder.definitionGroupName = definitionGroupName
	builder.definitionGroupNameFlag = true
	return builder
}

// 流程定义 ID
//
// 示例值：1212564555454
func (builder *TaskBuilder) DefinitionId(definitionId string) *TaskBuilder {
	builder.definitionId = definitionId
	builder.definitionIdFlag = true
	return builder
}

// 流程定义名称
//
// 示例值：流程定义组名称
func (builder *TaskBuilder) DefinitionName(definitionName string) *TaskBuilder {
	builder.definitionName = definitionName
	builder.definitionNameFlag = true
	return builder
}

func (builder *TaskBuilder) Build() *Task {
	req := &Task{}
	if builder.topicFlag {
		req.Topic = &builder.topic

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

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

	}
	if builder.urlsFlag {
		req.Urls = builder.urls
	}
	if builder.processExternalIdFlag {
		req.ProcessExternalId = &builder.processExternalId

	}
	if builder.taskExternalIdFlag {
		req.TaskExternalId = &builder.taskExternalId

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

	}
	if builder.processStatusFlag {
		req.ProcessStatus = &builder.processStatus

	}
	if builder.definitionCodeFlag {
		req.DefinitionCode = &builder.definitionCode

	}
	if builder.initiatorsFlag {
		req.Initiators = builder.initiators
	}
	if builder.initiatorNamesFlag {
		req.InitiatorNames = builder.initiatorNames
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.processIdFlag {
		req.ProcessId = &builder.processId

	}
	if builder.processCodeFlag {
		req.ProcessCode = &builder.processCode

	}
	if builder.definitionGroupIdFlag {
		req.DefinitionGroupId = &builder.definitionGroupId

	}
	if builder.definitionGroupNameFlag {
		req.DefinitionGroupName = &builder.definitionGroupName

	}
	if builder.definitionIdFlag {
		req.DefinitionId = &builder.definitionId

	}
	if builder.definitionNameFlag {
		req.DefinitionName = &builder.definitionName

	}
	return req
}

type TaskApprove struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 Code

	UserId *string `json:"user_id,omitempty"` // 根据user_id_type填写操作用户id

	Comment *string `json:"comment,omitempty"` // 意见

	TaskId *string `json:"task_id,omitempty"` // 任务 ID， 审批实例详情task_list中id

	Form *string `json:"form,omitempty"` // json 数组，控件值
}

type TaskApproveBuilder struct {
	approvalCode     string // 审批定义 Code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 Code
	instanceCodeFlag bool

	userId     string // 根据user_id_type填写操作用户id
	userIdFlag bool

	comment     string // 意见
	commentFlag bool

	taskId     string // 任务 ID， 审批实例详情task_list中id
	taskIdFlag bool

	form     string // json 数组，控件值
	formFlag bool
}

func NewTaskApproveBuilder() *TaskApproveBuilder {
	builder := &TaskApproveBuilder{}
	return builder
}

// 审批定义 Code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *TaskApproveBuilder) ApprovalCode(approvalCode string) *TaskApproveBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 Code
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *TaskApproveBuilder) InstanceCode(instanceCode string) *TaskApproveBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 根据user_id_type填写操作用户id
//
// 示例值：f7cb567e
func (builder *TaskApproveBuilder) UserId(userId string) *TaskApproveBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 意见
//
// 示例值：OK
func (builder *TaskApproveBuilder) Comment(comment string) *TaskApproveBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 任务 ID， 审批实例详情task_list中id
//
// 示例值：12345
func (builder *TaskApproveBuilder) TaskId(taskId string) *TaskApproveBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// json 数组，控件值
//
// 示例值：[{\"id\":\"111\", \"type\": \"input\", \"value\":\"test\"}]
func (builder *TaskApproveBuilder) Form(form string) *TaskApproveBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

func (builder *TaskApproveBuilder) Build() *TaskApprove {
	req := &TaskApprove{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.formFlag {
		req.Form = &builder.form

	}
	return req
}

type TaskResubmit struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 Code

	UserId *string `json:"user_id,omitempty"` // 根据user_id_type填写操作用户id

	Comment *string `json:"comment,omitempty"` // 意见

	TaskId *string `json:"task_id,omitempty"` // 任务 ID， 审批实例详情task_list中id

	Form *string `json:"form,omitempty"` // json 数组，控件值，同创建审批实例接口中form字段
}

type TaskResubmitBuilder struct {
	approvalCode     string // 审批定义 Code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 Code
	instanceCodeFlag bool

	userId     string // 根据user_id_type填写操作用户id
	userIdFlag bool

	comment     string // 意见
	commentFlag bool

	taskId     string // 任务 ID， 审批实例详情task_list中id
	taskIdFlag bool

	form     string // json 数组，控件值，同创建审批实例接口中form字段
	formFlag bool
}

func NewTaskResubmitBuilder() *TaskResubmitBuilder {
	builder := &TaskResubmitBuilder{}
	return builder
}

// 审批定义 Code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *TaskResubmitBuilder) ApprovalCode(approvalCode string) *TaskResubmitBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 Code
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *TaskResubmitBuilder) InstanceCode(instanceCode string) *TaskResubmitBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 根据user_id_type填写操作用户id
//
// 示例值：f7cb567e
func (builder *TaskResubmitBuilder) UserId(userId string) *TaskResubmitBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 意见
//
// 示例值：{\"text\":\"评论\",\"file_codes\":[\"ABCD1232s\",\"ABC12334d22\"]}
func (builder *TaskResubmitBuilder) Comment(comment string) *TaskResubmitBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 任务 ID， 审批实例详情task_list中id
//
// 示例值：12345
func (builder *TaskResubmitBuilder) TaskId(taskId string) *TaskResubmitBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// json 数组，控件值，同创建审批实例接口中form字段
//
// 示例值：[{\"id\":\"user_name\", \"type\": \"input\", \"value\":\"test\"}]
func (builder *TaskResubmitBuilder) Form(form string) *TaskResubmitBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

func (builder *TaskResubmitBuilder) Build() *TaskResubmit {
	req := &TaskResubmit{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.formFlag {
		req.Form = &builder.form

	}
	return req
}

type TaskRollback struct {
	UserId *string `json:"user_id,omitempty"` // 用户ID

	TaskId *string `json:"task_id,omitempty"` // 回退的任务ID

	Reason *string `json:"reason,omitempty"` // 退回原因

	Extra *string `json:"extra,omitempty"` // 扩展字段

	TaskDefKey *string `json:"task_def_key,omitempty"` // 退回节点对应的标识
}

type TaskRollbackBuilder struct {
	userId     string // 用户ID
	userIdFlag bool

	taskId     string // 回退的任务ID
	taskIdFlag bool

	reason     string // 退回原因
	reasonFlag bool

	extra     string // 扩展字段
	extraFlag bool

	taskDefKey     string // 退回节点对应的标识
	taskDefKeyFlag bool
}

func NewTaskRollbackBuilder() *TaskRollbackBuilder {
	builder := &TaskRollbackBuilder{}
	return builder
}

// 用户ID
//
// 示例值：893g4c45
func (builder *TaskRollbackBuilder) UserId(userId string) *TaskRollbackBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 回退的任务ID
//
// 示例值：7026591166355210260
func (builder *TaskRollbackBuilder) TaskId(taskId string) *TaskRollbackBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 退回原因
//
// 示例值：申请事项填写不具体，请重新填写
func (builder *TaskRollbackBuilder) Reason(reason string) *TaskRollbackBuilder {
	builder.reason = reason
	builder.reasonFlag = true
	return builder
}

// 扩展字段
//
// 示例值：暂不填写
func (builder *TaskRollbackBuilder) Extra(extra string) *TaskRollbackBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 退回节点对应的标识
//
// 示例值：APPROVAL_27997_285502
func (builder *TaskRollbackBuilder) TaskDefKey(taskDefKey string) *TaskRollbackBuilder {
	builder.taskDefKey = taskDefKey
	builder.taskDefKeyFlag = true
	return builder
}

func (builder *TaskRollbackBuilder) Build() *TaskRollback {
	req := &TaskRollback{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	if builder.reasonFlag {
		req.Reason = &builder.reason

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

	}
	if builder.taskDefKeyFlag {
		req.TaskDefKey = &builder.taskDefKey

	}
	return req
}

type TaskSearch struct {
	UserId *string `json:"user_id,omitempty"` // 根据x_user_type填写审批人id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 code

	InstanceExternalId *string `json:"instance_external_id,omitempty"` // 审批实例第三方 id 注：和 approval_code 取并集

	GroupExternalId *string `json:"group_external_id,omitempty"` // 审批定义分组第三方 id 注：和 instance_code 取并集

	TaskTitle *string `json:"task_title,omitempty"` // 审批任务标题（只有第三方审批有）

	TaskStatus *string `json:"task_status,omitempty"` // 审批任务状态，注：若不设置，查询全部状态 若不在集合中，报错

	TaskStartTimeFrom *string `json:"task_start_time_from,omitempty"` // 任务查询开始时间（unix毫秒时间戳）

	TaskStartTimeTo *string `json:"task_start_time_to,omitempty"` // 任务查询结束时间 (unix毫秒时间戳)

	Locale *string `json:"locale,omitempty"` // 地区

	TaskStatusList []string `json:"task_status_list,omitempty"` // 可选择task_status中的多个状态，当填写此参数时，task_status失效

	Order *int `json:"order,omitempty"` // 按任务时间排序

	WithRevokedInstance *bool `json:"with_revoked_instance,omitempty"` // 是否包含撤销申请对应的审批单
}

type TaskSearchBuilder struct {
	userId     string // 根据x_user_type填写审批人id
	userIdFlag bool

	approvalCode     string // 审批定义 code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 code
	instanceCodeFlag bool

	instanceExternalId     string // 审批实例第三方 id 注：和 approval_code 取并集
	instanceExternalIdFlag bool

	groupExternalId     string // 审批定义分组第三方 id 注：和 instance_code 取并集
	groupExternalIdFlag bool

	taskTitle     string // 审批任务标题（只有第三方审批有）
	taskTitleFlag bool

	taskStatus     string // 审批任务状态，注：若不设置，查询全部状态 若不在集合中，报错
	taskStatusFlag bool

	taskStartTimeFrom     string // 任务查询开始时间（unix毫秒时间戳）
	taskStartTimeFromFlag bool

	taskStartTimeTo     string // 任务查询结束时间 (unix毫秒时间戳)
	taskStartTimeToFlag bool

	locale     string // 地区
	localeFlag bool

	taskStatusList     []string // 可选择task_status中的多个状态，当填写此参数时，task_status失效
	taskStatusListFlag bool

	order     int // 按任务时间排序
	orderFlag bool

	withRevokedInstance     bool // 是否包含撤销申请对应的审批单
	withRevokedInstanceFlag bool
}

func NewTaskSearchBuilder() *TaskSearchBuilder {
	builder := &TaskSearchBuilder{}
	return builder
}

// 根据x_user_type填写审批人id
//
// 示例值：lwiu098wj
func (builder *TaskSearchBuilder) UserId(userId string) *TaskSearchBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED942
func (builder *TaskSearchBuilder) ApprovalCode(approvalCode string) *TaskSearchBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 code
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED943
func (builder *TaskSearchBuilder) InstanceCode(instanceCode string) *TaskSearchBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 审批实例第三方 id 注：和 approval_code 取并集
//
// 示例值：EB828003-9FFE-4B3F-AA50-2E199E2ED976
func (builder *TaskSearchBuilder) InstanceExternalId(instanceExternalId string) *TaskSearchBuilder {
	builder.instanceExternalId = instanceExternalId
	builder.instanceExternalIdFlag = true
	return builder
}

// 审批定义分组第三方 id 注：和 instance_code 取并集
//
// 示例值：1234567
func (builder *TaskSearchBuilder) GroupExternalId(groupExternalId string) *TaskSearchBuilder {
	builder.groupExternalId = groupExternalId
	builder.groupExternalIdFlag = true
	return builder
}

// 审批任务标题（只有第三方审批有）
//
// 示例值：test
func (builder *TaskSearchBuilder) TaskTitle(taskTitle string) *TaskSearchBuilder {
	builder.taskTitle = taskTitle
	builder.taskTitleFlag = true
	return builder
}

// 审批任务状态，注：若不设置，查询全部状态 若不在集合中，报错
//
// 示例值：PENDING
func (builder *TaskSearchBuilder) TaskStatus(taskStatus string) *TaskSearchBuilder {
	builder.taskStatus = taskStatus
	builder.taskStatusFlag = true
	return builder
}

// 任务查询开始时间（unix毫秒时间戳）
//
// 示例值：1547654251506
func (builder *TaskSearchBuilder) TaskStartTimeFrom(taskStartTimeFrom string) *TaskSearchBuilder {
	builder.taskStartTimeFrom = taskStartTimeFrom
	builder.taskStartTimeFromFlag = true
	return builder
}

// 任务查询结束时间 (unix毫秒时间戳)
//
// 示例值：1547654251506
func (builder *TaskSearchBuilder) TaskStartTimeTo(taskStartTimeTo string) *TaskSearchBuilder {
	builder.taskStartTimeTo = taskStartTimeTo
	builder.taskStartTimeToFlag = true
	return builder
}

// 地区
//
// 示例值：zh-CN
func (builder *TaskSearchBuilder) Locale(locale string) *TaskSearchBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 可选择task_status中的多个状态，当填写此参数时，task_status失效
//
// 示例值：PENDING
func (builder *TaskSearchBuilder) TaskStatusList(taskStatusList []string) *TaskSearchBuilder {
	builder.taskStatusList = taskStatusList
	builder.taskStatusListFlag = true
	return builder
}

// 按任务时间排序
//
// 示例值：2
func (builder *TaskSearchBuilder) Order(order int) *TaskSearchBuilder {
	builder.order = order
	builder.orderFlag = true
	return builder
}

// 是否包含撤销申请对应的审批单
//
// 示例值：false
func (builder *TaskSearchBuilder) WithRevokedInstance(withRevokedInstance bool) *TaskSearchBuilder {
	builder.withRevokedInstance = withRevokedInstance
	builder.withRevokedInstanceFlag = true
	return builder
}

func (builder *TaskSearchBuilder) Build() *TaskSearch {
	req := &TaskSearch{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.instanceExternalIdFlag {
		req.InstanceExternalId = &builder.instanceExternalId

	}
	if builder.groupExternalIdFlag {
		req.GroupExternalId = &builder.groupExternalId

	}
	if builder.taskTitleFlag {
		req.TaskTitle = &builder.taskTitle

	}
	if builder.taskStatusFlag {
		req.TaskStatus = &builder.taskStatus

	}
	if builder.taskStartTimeFromFlag {
		req.TaskStartTimeFrom = &builder.taskStartTimeFrom

	}
	if builder.taskStartTimeToFlag {
		req.TaskStartTimeTo = &builder.taskStartTimeTo

	}
	if builder.localeFlag {
		req.Locale = &builder.locale

	}
	if builder.taskStatusListFlag {
		req.TaskStatusList = builder.taskStatusList
	}
	if builder.orderFlag {
		req.Order = &builder.order

	}
	if builder.withRevokedInstanceFlag {
		req.WithRevokedInstance = &builder.withRevokedInstance

	}
	return req
}

type TaskSearchItem struct {
	Approval *InstanceSearchApproval `json:"approval,omitempty"` // 审批定义

	Group *InstanceSearchGroup `json:"group,omitempty"` // 审批定义分组

	Instance *InstanceSearchNode `json:"instance,omitempty"` // 审批实例信息

	Task *TaskSearchNode `json:"task,omitempty"` // 审批任务
}

type TaskSearchItemBuilder struct {
	approval     *InstanceSearchApproval // 审批定义
	approvalFlag bool

	group     *InstanceSearchGroup // 审批定义分组
	groupFlag bool

	instance     *InstanceSearchNode // 审批实例信息
	instanceFlag bool

	task     *TaskSearchNode // 审批任务
	taskFlag bool
}

func NewTaskSearchItemBuilder() *TaskSearchItemBuilder {
	builder := &TaskSearchItemBuilder{}
	return builder
}

// 审批定义
//
// 示例值：
func (builder *TaskSearchItemBuilder) Approval(approval *InstanceSearchApproval) *TaskSearchItemBuilder {
	builder.approval = approval
	builder.approvalFlag = true
	return builder
}

// 审批定义分组
//
// 示例值：
func (builder *TaskSearchItemBuilder) Group(group *InstanceSearchGroup) *TaskSearchItemBuilder {
	builder.group = group
	builder.groupFlag = true
	return builder
}

// 审批实例信息
//
// 示例值：
func (builder *TaskSearchItemBuilder) Instance(instance *InstanceSearchNode) *TaskSearchItemBuilder {
	builder.instance = instance
	builder.instanceFlag = true
	return builder
}

// 审批任务
//
// 示例值：
func (builder *TaskSearchItemBuilder) Task(task *TaskSearchNode) *TaskSearchItemBuilder {
	builder.task = task
	builder.taskFlag = true
	return builder
}

func (builder *TaskSearchItemBuilder) Build() *TaskSearchItem {
	req := &TaskSearchItem{}
	if builder.approvalFlag {
		req.Approval = builder.approval
	}
	if builder.groupFlag {
		req.Group = builder.group
	}
	if builder.instanceFlag {
		req.Instance = builder.instance
	}
	if builder.taskFlag {
		req.Task = builder.task
	}
	return req
}

type TaskSearchNode struct {
	UserId *string `json:"user_id,omitempty"` // 审批任务审批人 id

	StartTime *string `json:"start_time,omitempty"` // 审批任务开始时间

	EndTime *string `json:"end_time,omitempty"` // 审批任务结束时间

	Status *string `json:"status,omitempty"` // 审批任务状态

	Title *string `json:"title,omitempty"` // 审批任务名称（只有第三方审批有）

	Extra *string `json:"extra,omitempty"` // 审批任务扩展字段，string型json

	Link *InstanceSearchLink `json:"link,omitempty"` // 审批任务链接（只有第三方审批有）

	TaskId *string `json:"task_id,omitempty"` // 任务id

	UpdateTime *string `json:"update_time,omitempty"` // 审批任务更新时间

	TaskExternalId *string `json:"task_external_id,omitempty"` // 三方审批扩展 ID
}

type TaskSearchNodeBuilder struct {
	userId     string // 审批任务审批人 id
	userIdFlag bool

	startTime     string // 审批任务开始时间
	startTimeFlag bool

	endTime     string // 审批任务结束时间
	endTimeFlag bool

	status     string // 审批任务状态
	statusFlag bool

	title     string // 审批任务名称（只有第三方审批有）
	titleFlag bool

	extra     string // 审批任务扩展字段，string型json
	extraFlag bool

	link     *InstanceSearchLink // 审批任务链接（只有第三方审批有）
	linkFlag bool

	taskId     string // 任务id
	taskIdFlag bool

	updateTime     string // 审批任务更新时间
	updateTimeFlag bool

	taskExternalId     string // 三方审批扩展 ID
	taskExternalIdFlag bool
}

func NewTaskSearchNodeBuilder() *TaskSearchNodeBuilder {
	builder := &TaskSearchNodeBuilder{}
	return builder
}

// 审批任务审批人 id
//
// 示例值：lwiu098wj
func (builder *TaskSearchNodeBuilder) UserId(userId string) *TaskSearchNodeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批任务开始时间
//
// 示例值：1547654251506
func (builder *TaskSearchNodeBuilder) StartTime(startTime string) *TaskSearchNodeBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 审批任务结束时间
//
// 示例值：1547654251506
func (builder *TaskSearchNodeBuilder) EndTime(endTime string) *TaskSearchNodeBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 审批任务状态
//
// 示例值：pending
func (builder *TaskSearchNodeBuilder) Status(status string) *TaskSearchNodeBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 审批任务名称（只有第三方审批有）
//
// 示例值：test
func (builder *TaskSearchNodeBuilder) Title(title string) *TaskSearchNodeBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 审批任务扩展字段，string型json
//
// 示例值：{}
func (builder *TaskSearchNodeBuilder) Extra(extra string) *TaskSearchNodeBuilder {
	builder.extra = extra
	builder.extraFlag = true
	return builder
}

// 审批任务链接（只有第三方审批有）
//
// 示例值：
func (builder *TaskSearchNodeBuilder) Link(link *InstanceSearchLink) *TaskSearchNodeBuilder {
	builder.link = link
	builder.linkFlag = true
	return builder
}

// 任务id
//
// 示例值：7110153401253494803
func (builder *TaskSearchNodeBuilder) TaskId(taskId string) *TaskSearchNodeBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 审批任务更新时间
//
// 示例值：1547654251506
func (builder *TaskSearchNodeBuilder) UpdateTime(updateTime string) *TaskSearchNodeBuilder {
	builder.updateTime = updateTime
	builder.updateTimeFlag = true
	return builder
}

// 三方审批扩展 ID
//
// 示例值：123123daddf21313
func (builder *TaskSearchNodeBuilder) TaskExternalId(taskExternalId string) *TaskSearchNodeBuilder {
	builder.taskExternalId = taskExternalId
	builder.taskExternalIdFlag = true
	return builder
}

func (builder *TaskSearchNodeBuilder) Build() *TaskSearchNode {
	req := &TaskSearchNode{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

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

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

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

	}
	if builder.linkFlag {
		req.Link = builder.link
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

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

	}
	if builder.taskExternalIdFlag {
		req.TaskExternalId = &builder.taskExternalId

	}
	return req
}

type TaskTransfer struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 Code

	UserId *string `json:"user_id,omitempty"` // 根据user_id_type填写操作用户id

	Comment *string `json:"comment,omitempty"` // 意见

	TransferUserId *string `json:"transfer_user_id,omitempty"` // 根据user_id_type填写被转交人唯一 ID

	TaskId *string `json:"task_id,omitempty"` // 任务 ID， 审批实例详情task_list中id
}

type TaskTransferBuilder struct {
	approvalCode     string // 审批定义 Code
	approvalCodeFlag bool

	instanceCode     string // 审批实例 Code
	instanceCodeFlag bool

	userId     string // 根据user_id_type填写操作用户id
	userIdFlag bool

	comment     string // 意见
	commentFlag bool

	transferUserId     string // 根据user_id_type填写被转交人唯一 ID
	transferUserIdFlag bool

	taskId     string // 任务 ID， 审批实例详情task_list中id
	taskIdFlag bool
}

func NewTaskTransferBuilder() *TaskTransferBuilder {
	builder := &TaskTransferBuilder{}
	return builder
}

// 审批定义 Code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *TaskTransferBuilder) ApprovalCode(approvalCode string) *TaskTransferBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例 Code
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *TaskTransferBuilder) InstanceCode(instanceCode string) *TaskTransferBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 根据user_id_type填写操作用户id
//
// 示例值：f7cb567e
func (builder *TaskTransferBuilder) UserId(userId string) *TaskTransferBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 意见
//
// 示例值：OK
func (builder *TaskTransferBuilder) Comment(comment string) *TaskTransferBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 根据user_id_type填写被转交人唯一 ID
//
// 示例值：f4ip317q
func (builder *TaskTransferBuilder) TransferUserId(transferUserId string) *TaskTransferBuilder {
	builder.transferUserId = transferUserId
	builder.transferUserIdFlag = true
	return builder
}

// 任务 ID， 审批实例详情task_list中id
//
// 示例值：12345
func (builder *TaskTransferBuilder) TaskId(taskId string) *TaskTransferBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

func (builder *TaskTransferBuilder) Build() *TaskTransfer {
	req := &TaskTransfer{}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.commentFlag {
		req.Comment = &builder.comment

	}
	if builder.transferUserIdFlag {
		req.TransferUserId = &builder.transferUserId

	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId

	}
	return req
}

type TaskUrls struct {
	Helpdesk *string `json:"helpdesk,omitempty"` // 帮助服务台 URL

	Mobile *string `json:"mobile,omitempty"` // 移动端 URL

	Pc *string `json:"pc,omitempty"` // PC 端 URL
}

type TaskUrlsBuilder struct {
	helpdesk     string // 帮助服务台 URL
	helpdeskFlag bool

	mobile     string // 移动端 URL
	mobileFlag bool

	pc     string // PC 端 URL
	pcFlag bool
}

func NewTaskUrlsBuilder() *TaskUrlsBuilder {
	builder := &TaskUrlsBuilder{}
	return builder
}

// 帮助服务台 URL
//
// 示例值：https://blabla
func (builder *TaskUrlsBuilder) Helpdesk(helpdesk string) *TaskUrlsBuilder {
	builder.helpdesk = helpdesk
	builder.helpdeskFlag = true
	return builder
}

// 移动端 URL
//
// 示例值：https://blabla
func (builder *TaskUrlsBuilder) Mobile(mobile string) *TaskUrlsBuilder {
	builder.mobile = mobile
	builder.mobileFlag = true
	return builder
}

// PC 端 URL
//
// 示例值：https://blabla
func (builder *TaskUrlsBuilder) Pc(pc string) *TaskUrlsBuilder {
	builder.pc = pc
	builder.pcFlag = true
	return builder
}

func (builder *TaskUrlsBuilder) Build() *TaskUrls {
	req := &TaskUrls{}
	if builder.helpdeskFlag {
		req.Helpdesk = &builder.helpdesk

	}
	if builder.mobileFlag {
		req.Mobile = &builder.mobile

	}
	if builder.pcFlag {
		req.Pc = &builder.pc

	}
	return req
}

type TripGroup struct {
	Type *string `json:"type,omitempty"` // 出差类型

	InstanceCode *string `json:"instance_code,omitempty"` // 实例code

	StartUser *User `json:"start_user,omitempty"` // 发起人

	StartTime *string `json:"start_time,omitempty"` // 开始时间

	EndTime *string `json:"end_time,omitempty"` // 结束时间

	TripInterval *string `json:"trip_interval,omitempty"` // 出差时间

	TripReason *string `json:"trip_reason,omitempty"` // 出差理由

	Schedules []*TripGroupSchedule `json:"schedules,omitempty"` // 出差计划

	TripPeers []*User `json:"trip_peers,omitempty"` // 同行人
}

type TripGroupBuilder struct {
	type_    string // 出差类型
	typeFlag bool

	instanceCode     string // 实例code
	instanceCodeFlag bool

	startUser     *User // 发起人
	startUserFlag bool

	startTime     string // 开始时间
	startTimeFlag bool

	endTime     string // 结束时间
	endTimeFlag bool

	tripInterval     string // 出差时间
	tripIntervalFlag bool

	tripReason     string // 出差理由
	tripReasonFlag bool

	schedules     []*TripGroupSchedule // 出差计划
	schedulesFlag bool

	tripPeers     []*User // 同行人
	tripPeersFlag bool
}

func NewTripGroupBuilder() *TripGroupBuilder {
	builder := &TripGroupBuilder{}
	return builder
}

// 出差类型
//
// 示例值：
func (builder *TripGroupBuilder) Type(type_ string) *TripGroupBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 实例code
//
// 示例值：
func (builder *TripGroupBuilder) InstanceCode(instanceCode string) *TripGroupBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 发起人
//
// 示例值：
func (builder *TripGroupBuilder) StartUser(startUser *User) *TripGroupBuilder {
	builder.startUser = startUser
	builder.startUserFlag = true
	return builder
}

// 开始时间
//
// 示例值：
func (builder *TripGroupBuilder) StartTime(startTime string) *TripGroupBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 结束时间
//
// 示例值：
func (builder *TripGroupBuilder) EndTime(endTime string) *TripGroupBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 出差时间
//
// 示例值：
func (builder *TripGroupBuilder) TripInterval(tripInterval string) *TripGroupBuilder {
	builder.tripInterval = tripInterval
	builder.tripIntervalFlag = true
	return builder
}

// 出差理由
//
// 示例值：
func (builder *TripGroupBuilder) TripReason(tripReason string) *TripGroupBuilder {
	builder.tripReason = tripReason
	builder.tripReasonFlag = true
	return builder
}

// 出差计划
//
// 示例值：
func (builder *TripGroupBuilder) Schedules(schedules []*TripGroupSchedule) *TripGroupBuilder {
	builder.schedules = schedules
	builder.schedulesFlag = true
	return builder
}

// 同行人
//
// 示例值：
func (builder *TripGroupBuilder) TripPeers(tripPeers []*User) *TripGroupBuilder {
	builder.tripPeers = tripPeers
	builder.tripPeersFlag = true
	return builder
}

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

	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

	}
	if builder.startUserFlag {
		req.StartUser = builder.startUser
	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	if builder.tripIntervalFlag {
		req.TripInterval = &builder.tripInterval

	}
	if builder.tripReasonFlag {
		req.TripReason = &builder.tripReason

	}
	if builder.schedulesFlag {
		req.Schedules = builder.schedules
	}
	if builder.tripPeersFlag {
		req.TripPeers = builder.tripPeers
	}
	return req
}

type TripGroupSchedule struct {
	TripStartTime *string `json:"trip_start_time,omitempty"` // 开始时间

	TripEndTime *string `json:"trip_end_time,omitempty"` // 结束时间

	TripInterval *string `json:"trip_interval,omitempty"` // 周期

	Departure *string `json:"departure,omitempty"` // 出发地

	Destination *string `json:"destination,omitempty"` // 目的地

	Transportation *string `json:"transportation,omitempty"` // 交通工具

	TripType *string `json:"trip_type,omitempty"` // 出差类型

	Remark *string `json:"remark,omitempty"` // 备注

	DepartureId *string `json:"departure_id,omitempty"` // 出发地id

	DestinationIds []string `json:"destination_ids,omitempty"` // 目的地id列表
}

type TripGroupScheduleBuilder struct {
	tripStartTime     string // 开始时间
	tripStartTimeFlag bool

	tripEndTime     string // 结束时间
	tripEndTimeFlag bool

	tripInterval     string // 周期
	tripIntervalFlag bool

	departure     string // 出发地
	departureFlag bool

	destination     string // 目的地
	destinationFlag bool

	transportation     string // 交通工具
	transportationFlag bool

	tripType     string // 出差类型
	tripTypeFlag bool

	remark     string // 备注
	remarkFlag bool

	departureId     string // 出发地id
	departureIdFlag bool

	destinationIds     []string // 目的地id列表
	destinationIdsFlag bool
}

func NewTripGroupScheduleBuilder() *TripGroupScheduleBuilder {
	builder := &TripGroupScheduleBuilder{}
	return builder
}

// 开始时间
//
// 示例值：2022-08-25 12:00:00
func (builder *TripGroupScheduleBuilder) TripStartTime(tripStartTime string) *TripGroupScheduleBuilder {
	builder.tripStartTime = tripStartTime
	builder.tripStartTimeFlag = true
	return builder
}

// 结束时间
//
// 示例值：2022-09-01 00:00:00
func (builder *TripGroupScheduleBuilder) TripEndTime(tripEndTime string) *TripGroupScheduleBuilder {
	builder.tripEndTime = tripEndTime
	builder.tripEndTimeFlag = true
	return builder
}

// 周期
//
// 示例值：561600
func (builder *TripGroupScheduleBuilder) TripInterval(tripInterval string) *TripGroupScheduleBuilder {
	builder.tripInterval = tripInterval
	builder.tripIntervalFlag = true
	return builder
}

// 出发地
//
// 示例值：中国
func (builder *TripGroupScheduleBuilder) Departure(departure string) *TripGroupScheduleBuilder {
	builder.departure = departure
	builder.departureFlag = true
	return builder
}

// 目的地
//
// 示例值：中国
func (builder *TripGroupScheduleBuilder) Destination(destination string) *TripGroupScheduleBuilder {
	builder.destination = destination
	builder.destinationFlag = true
	return builder
}

// 交通工具
//
// 示例值：飞机
func (builder *TripGroupScheduleBuilder) Transportation(transportation string) *TripGroupScheduleBuilder {
	builder.transportation = transportation
	builder.transportationFlag = true
	return builder
}

// 出差类型
//
// 示例值：往返
func (builder *TripGroupScheduleBuilder) TripType(tripType string) *TripGroupScheduleBuilder {
	builder.tripType = tripType
	builder.tripTypeFlag = true
	return builder
}

// 备注
//
// 示例值：备注内容
func (builder *TripGroupScheduleBuilder) Remark(remark string) *TripGroupScheduleBuilder {
	builder.remark = remark
	builder.remarkFlag = true
	return builder
}

// 出发地id
//
// 示例值：6c758b5dc54930abc7a454c7477d3496cfca0a62fd941e0093b2d819e0e263a6
func (builder *TripGroupScheduleBuilder) DepartureId(departureId string) *TripGroupScheduleBuilder {
	builder.departureId = departureId
	builder.departureIdFlag = true
	return builder
}

// 目的地id列表
//
// 示例值：
func (builder *TripGroupScheduleBuilder) DestinationIds(destinationIds []string) *TripGroupScheduleBuilder {
	builder.destinationIds = destinationIds
	builder.destinationIdsFlag = true
	return builder
}

func (builder *TripGroupScheduleBuilder) Build() *TripGroupSchedule {
	req := &TripGroupSchedule{}
	if builder.tripStartTimeFlag {
		req.TripStartTime = &builder.tripStartTime

	}
	if builder.tripEndTimeFlag {
		req.TripEndTime = &builder.tripEndTime

	}
	if builder.tripIntervalFlag {
		req.TripInterval = &builder.tripInterval

	}
	if builder.departureFlag {
		req.Departure = &builder.departure

	}
	if builder.destinationFlag {
		req.Destination = &builder.destination

	}
	if builder.transportationFlag {
		req.Transportation = &builder.transportation

	}
	if builder.tripTypeFlag {
		req.TripType = &builder.tripType

	}
	if builder.remarkFlag {
		req.Remark = &builder.remark

	}
	if builder.departureIdFlag {
		req.DepartureId = &builder.departureId

	}
	if builder.destinationIdsFlag {
		req.DestinationIds = builder.destinationIds
	}
	return req
}

type TrusteeshipInstanceCacheConfig struct {
	FormPolicy *string `json:"form_policy,omitempty"` // 托管预缓存策略

	FormVaryWithLocale *bool `json:"form_vary_with_locale,omitempty"` // 表单是否随国际化改变

	FormVersion *string `json:"form_version,omitempty"` // 当前使用的表单版本号，保证表单改变后，版本号增加，实际值为int64整数
}

type TrusteeshipInstanceCacheConfigBuilder struct {
	formPolicy     string // 托管预缓存策略
	formPolicyFlag bool

	formVaryWithLocale     bool // 表单是否随国际化改变
	formVaryWithLocaleFlag bool

	formVersion     string // 当前使用的表单版本号，保证表单改变后，版本号增加，实际值为int64整数
	formVersionFlag bool
}

func NewTrusteeshipInstanceCacheConfigBuilder() *TrusteeshipInstanceCacheConfigBuilder {
	builder := &TrusteeshipInstanceCacheConfigBuilder{}
	return builder
}

// 托管预缓存策略
//
// 示例值：DISABLE
func (builder *TrusteeshipInstanceCacheConfigBuilder) FormPolicy(formPolicy string) *TrusteeshipInstanceCacheConfigBuilder {
	builder.formPolicy = formPolicy
	builder.formPolicyFlag = true
	return builder
}

// 表单是否随国际化改变
//
// 示例值：false
func (builder *TrusteeshipInstanceCacheConfigBuilder) FormVaryWithLocale(formVaryWithLocale bool) *TrusteeshipInstanceCacheConfigBuilder {
	builder.formVaryWithLocale = formVaryWithLocale
	builder.formVaryWithLocaleFlag = true
	return builder
}

// 当前使用的表单版本号，保证表单改变后，版本号增加，实际值为int64整数
//
// 示例值："1"
func (builder *TrusteeshipInstanceCacheConfigBuilder) FormVersion(formVersion string) *TrusteeshipInstanceCacheConfigBuilder {
	builder.formVersion = formVersion
	builder.formVersionFlag = true
	return builder
}

func (builder *TrusteeshipInstanceCacheConfigBuilder) Build() *TrusteeshipInstanceCacheConfig {
	req := &TrusteeshipInstanceCacheConfig{}
	if builder.formPolicyFlag {
		req.FormPolicy = &builder.formPolicy

	}
	if builder.formVaryWithLocaleFlag {
		req.FormVaryWithLocale = &builder.formVaryWithLocale

	}
	if builder.formVersionFlag {
		req.FormVersion = &builder.formVersion

	}
	return req
}

type TrusteeshipUrls struct {
	FormDetailUrl *string `json:"form_detail_url,omitempty"` // 获取表单schema相关数据的url地址

	ActionDefinitionUrl *string `json:"action_definition_url,omitempty"` // 表示获取审批操作区数据的url地址

	ApprovalNodeUrl *string `json:"approval_node_url,omitempty"` // 获取审批记录相关数据的url地址

	ActionCallbackUrl *string `json:"action_callback_url,omitempty"` // 进行审批操作时回调的url地址

	PullBusinessDataUrl *string `json:"pull_business_data_url,omitempty"` // 获取托管动态数据URL,使用该接口时必须要保证历史托管单据的数据中都同步了该接口地址,如果历史单据中没有该接口需要重新同步历史托管单据的数据来更新该URL
}

type TrusteeshipUrlsBuilder struct {
	formDetailUrl     string // 获取表单schema相关数据的url地址
	formDetailUrlFlag bool

	actionDefinitionUrl     string // 表示获取审批操作区数据的url地址
	actionDefinitionUrlFlag bool

	approvalNodeUrl     string // 获取审批记录相关数据的url地址
	approvalNodeUrlFlag bool

	actionCallbackUrl     string // 进行审批操作时回调的url地址
	actionCallbackUrlFlag bool

	pullBusinessDataUrl     string // 获取托管动态数据URL,使用该接口时必须要保证历史托管单据的数据中都同步了该接口地址,如果历史单据中没有该接口需要重新同步历史托管单据的数据来更新该URL
	pullBusinessDataUrlFlag bool
}

func NewTrusteeshipUrlsBuilder() *TrusteeshipUrlsBuilder {
	builder := &TrusteeshipUrlsBuilder{}
	return builder
}

// 获取表单schema相关数据的url地址
//
// 示例值：https://#{your_domain}/api/form_detail
func (builder *TrusteeshipUrlsBuilder) FormDetailUrl(formDetailUrl string) *TrusteeshipUrlsBuilder {
	builder.formDetailUrl = formDetailUrl
	builder.formDetailUrlFlag = true
	return builder
}

// 表示获取审批操作区数据的url地址
//
// 示例值：https://#{your_domain}/api/action_definition
func (builder *TrusteeshipUrlsBuilder) ActionDefinitionUrl(actionDefinitionUrl string) *TrusteeshipUrlsBuilder {
	builder.actionDefinitionUrl = actionDefinitionUrl
	builder.actionDefinitionUrlFlag = true
	return builder
}

// 获取审批记录相关数据的url地址
//
// 示例值：https://#{your_domain}/api/approval_node
func (builder *TrusteeshipUrlsBuilder) ApprovalNodeUrl(approvalNodeUrl string) *TrusteeshipUrlsBuilder {
	builder.approvalNodeUrl = approvalNodeUrl
	builder.approvalNodeUrlFlag = true
	return builder
}

// 进行审批操作时回调的url地址
//
// 示例值：https://#{your_domain}/api/approval_node
func (builder *TrusteeshipUrlsBuilder) ActionCallbackUrl(actionCallbackUrl string) *TrusteeshipUrlsBuilder {
	builder.actionCallbackUrl = actionCallbackUrl
	builder.actionCallbackUrlFlag = true
	return builder
}

// 获取托管动态数据URL,使用该接口时必须要保证历史托管单据的数据中都同步了该接口地址,如果历史单据中没有该接口需要重新同步历史托管单据的数据来更新该URL
//
// 示例值：https://#{your_domain}/api/pull_business_data
func (builder *TrusteeshipUrlsBuilder) PullBusinessDataUrl(pullBusinessDataUrl string) *TrusteeshipUrlsBuilder {
	builder.pullBusinessDataUrl = pullBusinessDataUrl
	builder.pullBusinessDataUrlFlag = true
	return builder
}

func (builder *TrusteeshipUrlsBuilder) Build() *TrusteeshipUrls {
	req := &TrusteeshipUrls{}
	if builder.formDetailUrlFlag {
		req.FormDetailUrl = &builder.formDetailUrl

	}
	if builder.actionDefinitionUrlFlag {
		req.ActionDefinitionUrl = &builder.actionDefinitionUrl

	}
	if builder.approvalNodeUrlFlag {
		req.ApprovalNodeUrl = &builder.approvalNodeUrl

	}
	if builder.actionCallbackUrlFlag {
		req.ActionCallbackUrl = &builder.actionCallbackUrl

	}
	if builder.pullBusinessDataUrlFlag {
		req.PullBusinessDataUrl = &builder.pullBusinessDataUrl

	}
	return req
}

type UrlDetail struct {
	OriginUrl *string `json:"origin_url,omitempty"` // 文件为空，使用url则是原url

	Url *string `json:"url,omitempty"` // 文件 url

	Code *string `json:"code,omitempty"` // 文件标识码

	Message *string `json:"message,omitempty"` // 错误信息，没有则为空
}

type UrlDetailBuilder struct {
	originUrl     string // 文件为空，使用url则是原url
	originUrlFlag bool

	url     string // 文件 url
	urlFlag bool

	code     string // 文件标识码
	codeFlag bool

	message     string // 错误信息，没有则为空
	messageFlag bool
}

func NewUrlDetailBuilder() *UrlDetailBuilder {
	builder := &UrlDetailBuilder{}
	return builder
}

// 文件为空，使用url则是原url
//
// 示例值：https://xxxxx.com/i/2022/06/08/xxxxx.png
func (builder *UrlDetailBuilder) OriginUrl(originUrl string) *UrlDetailBuilder {
	builder.originUrl = originUrl
	builder.originUrlFlag = true
	return builder
}

// 文件 url
//
// 示例值：https://p3-approval-sign.byteimg.com/lark-approval-attachment/image/20210819/a8c1a1f1-47ae-4147-9deb-a8bf2cd833b1.jpg~tplv-ottatrvjsm-image.image?x-expires=1634941752&x-signature=oaZ6Tfv50ryUesNwKTUTnBlJivY%3D#.jpg
func (builder *UrlDetailBuilder) Url(url string) *UrlDetailBuilder {
	builder.url = url
	builder.urlFlag = true
	return builder
}

// 文件标识码
//
// 示例值：D93653C3-2609-4EE0-8041-61DC1D84F0B5
func (builder *UrlDetailBuilder) Code(code string) *UrlDetailBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 错误信息，没有则为空
//
// 示例值：https://xxxxx.com/i/2022/06/08/xxxxx.png:cannot find filetype
func (builder *UrlDetailBuilder) Message(message string) *UrlDetailBuilder {
	builder.message = message
	builder.messageFlag = true
	return builder
}

func (builder *UrlDetailBuilder) Build() *UrlDetail {
	req := &UrlDetail{}
	if builder.originUrlFlag {
		req.OriginUrl = &builder.originUrl

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

	}
	if builder.codeFlag {
		req.Code = &builder.code

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

	}
	return req
}

type User struct {
	Id *UserId `json:"id,omitempty"` // 用户id

	Name *string `json:"name,omitempty"` // 用户名
}

type UserBuilder struct {
	id     *UserId // 用户id
	idFlag bool

	name     string // 用户名
	nameFlag bool
}

func NewUserBuilder() *UserBuilder {
	builder := &UserBuilder{}
	return builder
}

// 用户id
//
// 示例值：
func (builder *UserBuilder) Id(id *UserId) *UserBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 用户名
//
// 示例值：
func (builder *UserBuilder) Name(name string) *UserBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

func (builder *UserBuilder) Build() *User {
	req := &User{}
	if builder.idFlag {
		req.Id = builder.id
	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	return req
}

type UserId struct {
	UserId *string `json:"user_id,omitempty"` //

	OpenId *string `json:"open_id,omitempty"` //

	UnionId *string `json:"union_id,omitempty"` //
}

type UserIdBuilder struct {
	userId     string //
	userIdFlag bool

	openId     string //
	openIdFlag bool

	unionId     string //
	unionIdFlag bool
}

func NewUserIdBuilder() *UserIdBuilder {
	builder := &UserIdBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *UserIdBuilder) UserId(userId string) *UserIdBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *UserIdBuilder) OpenId(openId string) *UserIdBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *UserIdBuilder) UnionId(unionId string) *UserIdBuilder {
	builder.unionId = unionId
	builder.unionIdFlag = true
	return builder
}

func (builder *UserIdBuilder) Build() *UserId {
	req := &UserId{}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.unionIdFlag {
		req.UnionId = &builder.unionId

	}
	return req
}

type WidgetInstance struct {
	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例唯一标识

	Status *string `json:"status,omitempty"` // 实例当前状态

	InstanceOperateTime *string `json:"instance_operate_time,omitempty"` // 实例变更时间，毫秒时间戳

	IsRevertApproval *bool `json:"is_revert_approval,omitempty"` // 是否是撤销已通过审批的流程

	FormContent *string `json:"form_content,omitempty"` // 表单数据，仅包含自定义控件内的数据

	SerialId *string `json:"serial_id,omitempty"` // 审批编号
}

type WidgetInstanceBuilder struct {
	instanceCode     string // 审批实例唯一标识
	instanceCodeFlag bool

	status     string // 实例当前状态
	statusFlag bool

	instanceOperateTime     string // 实例变更时间，毫秒时间戳
	instanceOperateTimeFlag bool

	isRevertApproval     bool // 是否是撤销已通过审批的流程
	isRevertApprovalFlag bool

	formContent     string // 表单数据，仅包含自定义控件内的数据
	formContentFlag bool

	serialId     string // 审批编号
	serialIdFlag bool
}

func NewWidgetInstanceBuilder() *WidgetInstanceBuilder {
	builder := &WidgetInstanceBuilder{}
	return builder
}

// 审批实例唯一标识
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *WidgetInstanceBuilder) InstanceCode(instanceCode string) *WidgetInstanceBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 实例当前状态
//
// 示例值：PENDING
func (builder *WidgetInstanceBuilder) Status(status string) *WidgetInstanceBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 实例变更时间，毫秒时间戳
//
// 示例值：1666079207003
func (builder *WidgetInstanceBuilder) InstanceOperateTime(instanceOperateTime string) *WidgetInstanceBuilder {
	builder.instanceOperateTime = instanceOperateTime
	builder.instanceOperateTimeFlag = true
	return builder
}

// 是否是撤销已通过审批的流程
//
// 示例值：false
func (builder *WidgetInstanceBuilder) IsRevertApproval(isRevertApproval bool) *WidgetInstanceBuilder {
	builder.isRevertApproval = isRevertApproval
	builder.isRevertApprovalFlag = true
	return builder
}

// 表单数据，仅包含自定义控件内的数据
//
// 示例值：[{\"id\": \"widget1\",\"custom_id\": \"user_info\",\"name\": \"Item application\",\"type\": \"textarea\"}]
func (builder *WidgetInstanceBuilder) FormContent(formContent string) *WidgetInstanceBuilder {
	builder.formContent = formContent
	builder.formContentFlag = true
	return builder
}

// 审批编号
//
// 示例值：2024082614387
func (builder *WidgetInstanceBuilder) SerialId(serialId string) *WidgetInstanceBuilder {
	builder.serialId = serialId
	builder.serialIdFlag = true
	return builder
}

func (builder *WidgetInstanceBuilder) Build() *WidgetInstance {
	req := &WidgetInstance{}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode

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

	}
	if builder.instanceOperateTimeFlag {
		req.InstanceOperateTime = &builder.instanceOperateTime

	}
	if builder.isRevertApprovalFlag {
		req.IsRevertApproval = &builder.isRevertApproval

	}
	if builder.formContentFlag {
		req.FormContent = &builder.formContent

	}
	if builder.serialIdFlag {
		req.SerialId = &builder.serialId

	}
	return req
}

type CreateApprovalReqBuilder struct {
	apiReq         *larkcore.ApiReq
	approvalCreate *ApprovalCreate
}

func NewCreateApprovalReqBuilder() *CreateApprovalReqBuilder {
	builder := &CreateApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *CreateApprovalReqBuilder) DepartmentIdType(departmentIdType string) *CreateApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *CreateApprovalReqBuilder) UserIdType(userIdType string) *CreateApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 用于通过接口创建简单的审批定义，可以灵活指定定义的基础信息、表单和流程等。创建成功后，不支持从审批管理后台删除该定义。不推荐企业自建应用使用，如有需要尽量联系管理员在审批管理后台创建定义。
func (builder *CreateApprovalReqBuilder) ApprovalCreate(approvalCreate *ApprovalCreate) *CreateApprovalReqBuilder {
	builder.approvalCreate = approvalCreate
	return builder
}

func (builder *CreateApprovalReqBuilder) Build() *CreateApprovalReq {
	req := &CreateApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.approvalCreate
	return req
}

type CreateApprovalReq struct {
	apiReq         *larkcore.ApiReq
	ApprovalCreate *ApprovalCreate `body:""`
}

type CreateApprovalRespData struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code

	ApprovalId *string `json:"approval_id,omitempty"` // 审批定义 id
}

type CreateApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateApprovalRespData `json:"data"` // 业务数据
}

func (resp *CreateApprovalResp) Success() bool {
	return resp.Code == 0
}

type GetApprovalReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetApprovalReqBuilder() *GetApprovalReqBuilder {
	builder := &GetApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批定义 Code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *GetApprovalReqBuilder) ApprovalCode(approvalCode string) *GetApprovalReqBuilder {
	builder.apiReq.PathParams.Set("approval_code", fmt.Sprint(approvalCode))
	return builder
}

// 语言可选值
//
// 示例值：zh-CN
func (builder *GetApprovalReqBuilder) Locale(locale string) *GetApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("locale", fmt.Sprint(locale))
	return builder
}

// 可选是否返回有数据权限审批流程管理员ID列表
//
// 示例值：false
func (builder *GetApprovalReqBuilder) WithAdminId(withAdminId bool) *GetApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("with_admin_id", fmt.Sprint(withAdminId))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *GetApprovalReqBuilder) UserIdType(userIdType string) *GetApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 可选是否返回外部数据源和假勤控件选项
//
// 示例值：false
func (builder *GetApprovalReqBuilder) WithOption(withOption bool) *GetApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("with_option", fmt.Sprint(withOption))
	return builder
}

// 用户id
//
// 示例值：ou_7a4aaac5650dc0b77e85e96e7476ff1d
func (builder *GetApprovalReqBuilder) UserId(userId string) *GetApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

func (builder *GetApprovalReqBuilder) Build() *GetApprovalReq {
	req := &GetApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type GetApprovalReq struct {
	apiReq *larkcore.ApiReq
}

type GetApprovalRespData struct {
	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称

	Status *string `json:"status,omitempty"` // 审批定义状态

	Form *string `json:"form,omitempty"` // 控件信息，见下方form字段说明

	NodeList []*ApprovalNodeInfo `json:"node_list,omitempty"` // 节点信息

	Viewers []*ApprovalViewerInfo `json:"viewers,omitempty"` // 可见人列表

	ApprovalAdminIds []string `json:"approval_admin_ids,omitempty"` // 有数据管理权限的审批流程管理员ID

	FormWidgetRelation *string `json:"form_widget_relation,omitempty"` // 组件之间值关联关系
}

type GetApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetApprovalRespData `json:"data"` // 业务数据
}

func (resp *GetApprovalResp) Success() bool {
	return resp.Code == 0
}

type SubscribeApprovalReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewSubscribeApprovalReqBuilder() *SubscribeApprovalReqBuilder {
	builder := &SubscribeApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批定义唯一标识
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *SubscribeApprovalReqBuilder) ApprovalCode(approvalCode string) *SubscribeApprovalReqBuilder {
	builder.apiReq.PathParams.Set("approval_code", fmt.Sprint(approvalCode))
	return builder
}

func (builder *SubscribeApprovalReqBuilder) Build() *SubscribeApprovalReq {
	req := &SubscribeApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type SubscribeApprovalReq struct {
	apiReq *larkcore.ApiReq
}

type SubscribeApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *SubscribeApprovalResp) Success() bool {
	return resp.Code == 0
}

type UnsubscribeApprovalReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewUnsubscribeApprovalReqBuilder() *UnsubscribeApprovalReqBuilder {
	builder := &UnsubscribeApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批定义唯一标识
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *UnsubscribeApprovalReqBuilder) ApprovalCode(approvalCode string) *UnsubscribeApprovalReqBuilder {
	builder.apiReq.PathParams.Set("approval_code", fmt.Sprint(approvalCode))
	return builder
}

func (builder *UnsubscribeApprovalReqBuilder) Build() *UnsubscribeApprovalReq {
	req := &UnsubscribeApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type UnsubscribeApprovalReq struct {
	apiReq *larkcore.ApiReq
}

type UnsubscribeApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *UnsubscribeApprovalResp) Success() bool {
	return resp.Code == 0
}

type CreateExternalApprovalReqBuilder struct {
	apiReq           *larkcore.ApiReq
	externalApproval *ExternalApproval
}

func NewCreateExternalApprovalReqBuilder() *CreateExternalApprovalReqBuilder {
	builder := &CreateExternalApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *CreateExternalApprovalReqBuilder) DepartmentIdType(departmentIdType string) *CreateExternalApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *CreateExternalApprovalReqBuilder) UserIdType(userIdType string) *CreateExternalApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 审批定义是审批的描述，包括审批名称、图标、描述等基础信息。创建好审批定义，用户就可以在审批应用的发起页中看到审批，如果用户点击发起，则会跳转到配置的发起三方系统地址去发起审批。;;另外，审批定义还配置了审批操作时的回调地址：审批人在待审批列表中进行【同意】【拒绝】操作时，审批中心会调用回调地址通知三方系统。
func (builder *CreateExternalApprovalReqBuilder) ExternalApproval(externalApproval *ExternalApproval) *CreateExternalApprovalReqBuilder {
	builder.externalApproval = externalApproval
	return builder
}

func (builder *CreateExternalApprovalReqBuilder) Build() *CreateExternalApprovalReq {
	req := &CreateExternalApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.externalApproval
	return req
}

type CreateExternalApprovalReq struct {
	apiReq           *larkcore.ApiReq
	ExternalApproval *ExternalApproval `body:""`
}

type CreateExternalApprovalRespData struct {
	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code，审批生成的唯一标识，用于三方审批实例同步时使用
}

type CreateExternalApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateExternalApprovalRespData `json:"data"` // 业务数据
}

func (resp *CreateExternalApprovalResp) Success() bool {
	return resp.Code == 0
}

type GetExternalApprovalReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetExternalApprovalReqBuilder() *GetExternalApprovalReqBuilder {
	builder := &GetExternalApprovalReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批定义code
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *GetExternalApprovalReqBuilder) ApprovalCode(approvalCode string) *GetExternalApprovalReqBuilder {
	builder.apiReq.PathParams.Set("approval_code", fmt.Sprint(approvalCode))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *GetExternalApprovalReqBuilder) UserIdType(userIdType string) *GetExternalApprovalReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

func (builder *GetExternalApprovalReqBuilder) Build() *GetExternalApprovalReq {
	req := &GetExternalApprovalReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type GetExternalApprovalReq struct {
	apiReq *larkcore.ApiReq
}

type GetExternalApprovalRespData struct {
	ApprovalName *string `json:"approval_name,omitempty"` // 审批定义名称

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code

	GroupCode *string `json:"group_code,omitempty"` // 审批定义所属分组

	GroupName *string `json:"group_name,omitempty"` // 分组名称

	Description *string `json:"description,omitempty"` // 审批定义的说明

	External *ApprovalCreateExternal `json:"external,omitempty"` // 三方审批定义相关

	Viewers []*ApprovalCreateViewers `json:"viewers,omitempty"` // 可见人列表

	I18nResources []*I18nResource `json:"i18n_resources,omitempty"` // 国际化文案

	Managers []string `json:"managers,omitempty"` // 流程管理员
}

type GetExternalApprovalResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetExternalApprovalRespData `json:"data"` // 业务数据
}

func (resp *GetExternalApprovalResp) Success() bool {
	return resp.Code == 0
}

type CheckExternalInstanceReqBodyBuilder struct {
	instances     []*ExteranlInstanceCheck // 校验的实例信息
	instancesFlag bool
}

func NewCheckExternalInstanceReqBodyBuilder() *CheckExternalInstanceReqBodyBuilder {
	builder := &CheckExternalInstanceReqBodyBuilder{}
	return builder
}

// 校验的实例信息
//
//示例值：
func (builder *CheckExternalInstanceReqBodyBuilder) Instances(instances []*ExteranlInstanceCheck) *CheckExternalInstanceReqBodyBuilder {
	builder.instances = instances
	builder.instancesFlag = true
	return builder
}

func (builder *CheckExternalInstanceReqBodyBuilder) Build() *CheckExternalInstanceReqBody {
	req := &CheckExternalInstanceReqBody{}
	if builder.instancesFlag {
		req.Instances = builder.instances
	}
	return req
}

type CheckExternalInstancePathReqBodyBuilder struct {
	instances     []*ExteranlInstanceCheck
	instancesFlag bool
}

func NewCheckExternalInstancePathReqBodyBuilder() *CheckExternalInstancePathReqBodyBuilder {
	builder := &CheckExternalInstancePathReqBodyBuilder{}
	return builder
}

// 校验的实例信息
//
// 示例值：
func (builder *CheckExternalInstancePathReqBodyBuilder) Instances(instances []*ExteranlInstanceCheck) *CheckExternalInstancePathReqBodyBuilder {
	builder.instances = instances
	builder.instancesFlag = true
	return builder
}

func (builder *CheckExternalInstancePathReqBodyBuilder) Build() (*CheckExternalInstanceReqBody, error) {
	req := &CheckExternalInstanceReqBody{}
	if builder.instancesFlag {
		req.Instances = builder.instances
	}
	return req, nil
}

type CheckExternalInstanceReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CheckExternalInstanceReqBody
}

func NewCheckExternalInstanceReqBuilder() *CheckExternalInstanceReqBuilder {
	builder := &CheckExternalInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 校验三方审批实例数据，用于判断服务端数据是否为最新的。用户提交实例最新更新时间，如果服务端不存在该实例，或者服务端实例更新时间不是最新的，则返回对应实例 id。;;例如，用户可以每隔5分钟，将最近5分钟产生的实例使用该接口进行对比。
func (builder *CheckExternalInstanceReqBuilder) Body(body *CheckExternalInstanceReqBody) *CheckExternalInstanceReqBuilder {
	builder.body = body
	return builder
}

func (builder *CheckExternalInstanceReqBuilder) Build() *CheckExternalInstanceReq {
	req := &CheckExternalInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type CheckExternalInstanceReqBody struct {
	Instances []*ExteranlInstanceCheck `json:"instances,omitempty"` // 校验的实例信息
}

type CheckExternalInstanceReq struct {
	apiReq *larkcore.ApiReq
	Body   *CheckExternalInstanceReqBody `body:""`
}

type CheckExternalInstanceRespData struct {
	DiffInstances []*ExteranlInstanceCheckResponse `json:"diff_instances,omitempty"` // 更新时间不一致的实例信息
}

type CheckExternalInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CheckExternalInstanceRespData `json:"data"` // 业务数据
}

func (resp *CheckExternalInstanceResp) Success() bool {
	return resp.Code == 0
}

type CreateExternalInstanceReqBuilder struct {
	apiReq           *larkcore.ApiReq
	externalInstance *ExternalInstance
}

func NewCreateExternalInstanceReqBuilder() *CreateExternalInstanceReqBuilder {
	builder := &CreateExternalInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批中心不负责审批的流转，审批的流转在三方系统，三方系统在审批流转后生成的审批实例、审批任务、审批抄送数据同步到审批中心。;;用户可以在审批中心中浏览三方系统同步过来的实例、任务、抄送信息，并且可以跳转回三方系统进行更详细的查看和操作，其中实例信息在【已发起】列表，任务信息在【待审批】和【已审批】列表，抄送信息在【抄送我】列表;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/9dff4434afbeb0ef69de7f36b9a6e995_z5iwmTzEgg.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/ca6e0e984a7a6d64e1b16a0bac4bf868_tfqjCiaJQM.png" alt="" style="zoom:17%;" />;;;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/529377e238df78d391bbd22e962ad195_T7eefLI1GA.png" alt="" style="zoom:17%;" />;:::;;对于审批任务，三方系统也可以配置审批任务的回调接口，这样审批人可以在审批中心中直接进行审批操作，审批中心会回调三方系统，三方系统收到回调后更新任务信息，并将新的任务信息同步回审批中心，形成闭环。;;:::html;<img src="//sf3-cn.feishucdn.com/obj/open-platform-opendoc/721c35428bc1187db3318c572f9979ad_je75QpElcg.png" alt=""  style="zoom:25%;" />;:::;<br>
func (builder *CreateExternalInstanceReqBuilder) ExternalInstance(externalInstance *ExternalInstance) *CreateExternalInstanceReqBuilder {
	builder.externalInstance = externalInstance
	return builder
}

func (builder *CreateExternalInstanceReqBuilder) Build() *CreateExternalInstanceReq {
	req := &CreateExternalInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.externalInstance
	return req
}

type CreateExternalInstanceReq struct {
	apiReq           *larkcore.ApiReq
	ExternalInstance *ExternalInstance `body:""`
}

type CreateExternalInstanceRespData struct {
	Data *ExternalInstance `json:"data,omitempty"` // 同步的实例数据

	ProcessRecord *ProcessRecord `json:"process_record,omitempty"` // 本次变更信息
}

type CreateExternalInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateExternalInstanceRespData `json:"data"` // 业务数据
}

func (resp *CreateExternalInstanceResp) Success() bool {
	return resp.Code == 0
}

type ListExternalTaskReqBodyBuilder struct {
	approvalCodes     []string // 审批定义 Code，用于指定只获取这些定义下的数据
	approvalCodesFlag bool

	instanceIds     []string // 审批实例 ID, 用于指定只获取这些实例下的数据，最多支持 20 个
	instanceIdsFlag bool

	userIds     []string // 审批人 user_id，用于指定只获取这些用户的数据
	userIdsFlag bool

	status     string // 审批任务状态，用于指定获取该状态下的数据
	statusFlag bool
}

func NewListExternalTaskReqBodyBuilder() *ListExternalTaskReqBodyBuilder {
	builder := &ListExternalTaskReqBodyBuilder{}
	return builder
}

// 审批定义 Code，用于指定只获取这些定义下的数据
//
//示例值：B7B65FFE-C2GC-452F-9F0F-9AA8352363D6
func (builder *ListExternalTaskReqBodyBuilder) ApprovalCodes(approvalCodes []string) *ListExternalTaskReqBodyBuilder {
	builder.approvalCodes = approvalCodes
	builder.approvalCodesFlag = true
	return builder
}

// 审批实例 ID, 用于指定只获取这些实例下的数据，最多支持 20 个
//
//示例值：oa_159160304
func (builder *ListExternalTaskReqBodyBuilder) InstanceIds(instanceIds []string) *ListExternalTaskReqBodyBuilder {
	builder.instanceIds = instanceIds
	builder.instanceIdsFlag = true
	return builder
}

// 审批人 user_id，用于指定只获取这些用户的数据
//
//示例值：112321
func (builder *ListExternalTaskReqBodyBuilder) UserIds(userIds []string) *ListExternalTaskReqBodyBuilder {
	builder.userIds = userIds
	builder.userIdsFlag = true
	return builder
}

// 审批任务状态，用于指定获取该状态下的数据
//
//示例值：PENDING
func (builder *ListExternalTaskReqBodyBuilder) Status(status string) *ListExternalTaskReqBodyBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

func (builder *ListExternalTaskReqBodyBuilder) Build() *ListExternalTaskReqBody {
	req := &ListExternalTaskReqBody{}
	if builder.approvalCodesFlag {
		req.ApprovalCodes = builder.approvalCodes
	}
	if builder.instanceIdsFlag {
		req.InstanceIds = builder.instanceIds
	}
	if builder.userIdsFlag {
		req.UserIds = builder.userIds
	}
	if builder.statusFlag {
		req.Status = &builder.status
	}
	return req
}

type ListExternalTaskPathReqBodyBuilder struct {
	approvalCodes     []string
	approvalCodesFlag bool
	instanceIds       []string
	instanceIdsFlag   bool
	userIds           []string
	userIdsFlag       bool
	status            string
	statusFlag        bool
}

func NewListExternalTaskPathReqBodyBuilder() *ListExternalTaskPathReqBodyBuilder {
	builder := &ListExternalTaskPathReqBodyBuilder{}
	return builder
}

// 审批定义 Code，用于指定只获取这些定义下的数据
//
// 示例值：B7B65FFE-C2GC-452F-9F0F-9AA8352363D6
func (builder *ListExternalTaskPathReqBodyBuilder) ApprovalCodes(approvalCodes []string) *ListExternalTaskPathReqBodyBuilder {
	builder.approvalCodes = approvalCodes
	builder.approvalCodesFlag = true
	return builder
}

// 审批实例 ID, 用于指定只获取这些实例下的数据，最多支持 20 个
//
// 示例值：oa_159160304
func (builder *ListExternalTaskPathReqBodyBuilder) InstanceIds(instanceIds []string) *ListExternalTaskPathReqBodyBuilder {
	builder.instanceIds = instanceIds
	builder.instanceIdsFlag = true
	return builder
}

// 审批人 user_id，用于指定只获取这些用户的数据
//
// 示例值：112321
func (builder *ListExternalTaskPathReqBodyBuilder) UserIds(userIds []string) *ListExternalTaskPathReqBodyBuilder {
	builder.userIds = userIds
	builder.userIdsFlag = true
	return builder
}

// 审批任务状态，用于指定获取该状态下的数据
//
// 示例值：PENDING
func (builder *ListExternalTaskPathReqBodyBuilder) Status(status string) *ListExternalTaskPathReqBodyBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

func (builder *ListExternalTaskPathReqBodyBuilder) Build() (*ListExternalTaskReqBody, error) {
	req := &ListExternalTaskReqBody{}
	if builder.approvalCodesFlag {
		req.ApprovalCodes = builder.approvalCodes
	}
	if builder.instanceIdsFlag {
		req.InstanceIds = builder.instanceIds
	}
	if builder.userIdsFlag {
		req.UserIds = builder.userIds
	}
	if builder.statusFlag {
		req.Status = &builder.status
	}
	return req, nil
}

type ListExternalTaskReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *ListExternalTaskReqBody
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListExternalTaskReqBuilder() *ListExternalTaskReqBuilder {
	builder := &ListExternalTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListExternalTaskReqBuilder) Limit(limit int) *ListExternalTaskReqBuilder {
	builder.limit = limit
	return builder
}

// 分页大小
//
// 示例值：100
func (builder *ListExternalTaskReqBuilder) PageSize(pageSize int) *ListExternalTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *ListExternalTaskReqBuilder) PageToken(pageToken string) *ListExternalTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 该接口用于获取三方审批的状态。用户传入查询条件，接口返回满足条件的审批实例的状态。该接口支持多种参数的组合，包括如下组合：;;1.通过 instance_ids 获取指定实例的任务状态;;2.通过 user_ids 获取指定用户的任务状态;;3.通过 status 获取指定状态的所有任务;;4.通过page_token获取下一批数据
func (builder *ListExternalTaskReqBuilder) Body(body *ListExternalTaskReqBody) *ListExternalTaskReqBuilder {
	builder.body = body
	return builder
}

func (builder *ListExternalTaskReqBuilder) Build() *ListExternalTaskReq {
	req := &ListExternalTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.body
	return req
}

type ListExternalTaskReqBody struct {
	ApprovalCodes []string `json:"approval_codes,omitempty"` // 审批定义 Code，用于指定只获取这些定义下的数据

	InstanceIds []string `json:"instance_ids,omitempty"` // 审批实例 ID, 用于指定只获取这些实例下的数据，最多支持 20 个

	UserIds []string `json:"user_ids,omitempty"` // 审批人 user_id，用于指定只获取这些用户的数据

	Status *string `json:"status,omitempty"` // 审批任务状态，用于指定获取该状态下的数据
}

type ListExternalTaskReq struct {
	apiReq *larkcore.ApiReq
	Body   *ListExternalTaskReqBody `body:""`
	Limit  int                      // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListExternalTaskRespData struct {
	Data []*ExternalTaskList `json:"data,omitempty"` // 返回数据

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取
}

type ListExternalTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListExternalTaskRespData `json:"data"` // 业务数据
}

func (resp *ListExternalTaskResp) Success() bool {
	return resp.Code == 0
}

type AddSignInstanceReqBodyBuilder struct {
	userId     string // 操作用户id
	userIdFlag bool

	approvalCode     string // 审批定义code
	approvalCodeFlag bool

	instanceCode     string // 审批实例code
	instanceCodeFlag bool

	taskId     string // 任务id
	taskIdFlag bool

	comment     string // 意见
	commentFlag bool

	addSignUserIds     []string // 被加签人id
	addSignUserIdsFlag bool

	addSignType     int // 1/2/3分别代表前加签/后加签/并加签
	addSignTypeFlag bool

	approvalMethod     int // 仅在前加签、后加签时需要填写，1/2 分别代表或签/会签
	approvalMethodFlag bool
}

func NewAddSignInstanceReqBodyBuilder() *AddSignInstanceReqBodyBuilder {
	builder := &AddSignInstanceReqBodyBuilder{}
	return builder
}

// 操作用户id
//
//示例值：b16g66e3
func (builder *AddSignInstanceReqBodyBuilder) UserId(userId string) *AddSignInstanceReqBodyBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义code
//
//示例值：3B68E280-CF10-4198-B4CD-2E3BB97981D8
func (builder *AddSignInstanceReqBodyBuilder) ApprovalCode(approvalCode string) *AddSignInstanceReqBodyBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例code
//
//示例值：289330DE-FBF1-4A47-91F9-9EFCCF11BCAE
func (builder *AddSignInstanceReqBodyBuilder) InstanceCode(instanceCode string) *AddSignInstanceReqBodyBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 任务id
//
//示例值：6955096766400167956
func (builder *AddSignInstanceReqBodyBuilder) TaskId(taskId string) *AddSignInstanceReqBodyBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 意见
//
//示例值：addSignComment
func (builder *AddSignInstanceReqBodyBuilder) Comment(comment string) *AddSignInstanceReqBodyBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 被加签人id
//
//示例值：
func (builder *AddSignInstanceReqBodyBuilder) AddSignUserIds(addSignUserIds []string) *AddSignInstanceReqBodyBuilder {
	builder.addSignUserIds = addSignUserIds
	builder.addSignUserIdsFlag = true
	return builder
}

// 1/2/3分别代表前加签/后加签/并加签
//
//示例值：1
func (builder *AddSignInstanceReqBodyBuilder) AddSignType(addSignType int) *AddSignInstanceReqBodyBuilder {
	builder.addSignType = addSignType
	builder.addSignTypeFlag = true
	return builder
}

// 仅在前加签、后加签时需要填写，1/2 分别代表或签/会签
//
//示例值：1
func (builder *AddSignInstanceReqBodyBuilder) ApprovalMethod(approvalMethod int) *AddSignInstanceReqBodyBuilder {
	builder.approvalMethod = approvalMethod
	builder.approvalMethodFlag = true
	return builder
}

func (builder *AddSignInstanceReqBodyBuilder) Build() *AddSignInstanceReqBody {
	req := &AddSignInstanceReqBody{}
	if builder.userIdFlag {
		req.UserId = &builder.userId
	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode
	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId
	}
	if builder.commentFlag {
		req.Comment = &builder.comment
	}
	if builder.addSignUserIdsFlag {
		req.AddSignUserIds = builder.addSignUserIds
	}
	if builder.addSignTypeFlag {
		req.AddSignType = &builder.addSignType
	}
	if builder.approvalMethodFlag {
		req.ApprovalMethod = &builder.approvalMethod
	}
	return req
}

type AddSignInstancePathReqBodyBuilder struct {
	userId             string
	userIdFlag         bool
	approvalCode       string
	approvalCodeFlag   bool
	instanceCode       string
	instanceCodeFlag   bool
	taskId             string
	taskIdFlag         bool
	comment            string
	commentFlag        bool
	addSignUserIds     []string
	addSignUserIdsFlag bool
	addSignType        int
	addSignTypeFlag    bool
	approvalMethod     int
	approvalMethodFlag bool
}

func NewAddSignInstancePathReqBodyBuilder() *AddSignInstancePathReqBodyBuilder {
	builder := &AddSignInstancePathReqBodyBuilder{}
	return builder
}

// 操作用户id
//
// 示例值：b16g66e3
func (builder *AddSignInstancePathReqBodyBuilder) UserId(userId string) *AddSignInstancePathReqBodyBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义code
//
// 示例值：3B68E280-CF10-4198-B4CD-2E3BB97981D8
func (builder *AddSignInstancePathReqBodyBuilder) ApprovalCode(approvalCode string) *AddSignInstancePathReqBodyBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 审批实例code
//
// 示例值：289330DE-FBF1-4A47-91F9-9EFCCF11BCAE
func (builder *AddSignInstancePathReqBodyBuilder) InstanceCode(instanceCode string) *AddSignInstancePathReqBodyBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 任务id
//
// 示例值：6955096766400167956
func (builder *AddSignInstancePathReqBodyBuilder) TaskId(taskId string) *AddSignInstancePathReqBodyBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

// 意见
//
// 示例值：addSignComment
func (builder *AddSignInstancePathReqBodyBuilder) Comment(comment string) *AddSignInstancePathReqBodyBuilder {
	builder.comment = comment
	builder.commentFlag = true
	return builder
}

// 被加签人id
//
// 示例值：
func (builder *AddSignInstancePathReqBodyBuilder) AddSignUserIds(addSignUserIds []string) *AddSignInstancePathReqBodyBuilder {
	builder.addSignUserIds = addSignUserIds
	builder.addSignUserIdsFlag = true
	return builder
}

// 1/2/3分别代表前加签/后加签/并加签
//
// 示例值：1
func (builder *AddSignInstancePathReqBodyBuilder) AddSignType(addSignType int) *AddSignInstancePathReqBodyBuilder {
	builder.addSignType = addSignType
	builder.addSignTypeFlag = true
	return builder
}

// 仅在前加签、后加签时需要填写，1/2 分别代表或签/会签
//
// 示例值：1
func (builder *AddSignInstancePathReqBodyBuilder) ApprovalMethod(approvalMethod int) *AddSignInstancePathReqBodyBuilder {
	builder.approvalMethod = approvalMethod
	builder.approvalMethodFlag = true
	return builder
}

func (builder *AddSignInstancePathReqBodyBuilder) Build() (*AddSignInstanceReqBody, error) {
	req := &AddSignInstanceReqBody{}
	if builder.userIdFlag {
		req.UserId = &builder.userId
	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode
	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId
	}
	if builder.commentFlag {
		req.Comment = &builder.comment
	}
	if builder.addSignUserIdsFlag {
		req.AddSignUserIds = builder.addSignUserIds
	}
	if builder.addSignTypeFlag {
		req.AddSignType = &builder.addSignType
	}
	if builder.approvalMethodFlag {
		req.ApprovalMethod = &builder.approvalMethod
	}
	return req, nil
}

type AddSignInstanceReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *AddSignInstanceReqBody
}

func NewAddSignInstanceReqBuilder() *AddSignInstanceReqBuilder {
	builder := &AddSignInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

//
func (builder *AddSignInstanceReqBuilder) Body(body *AddSignInstanceReqBody) *AddSignInstanceReqBuilder {
	builder.body = body
	return builder
}

func (builder *AddSignInstanceReqBuilder) Build() *AddSignInstanceReq {
	req := &AddSignInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type AddSignInstanceReqBody struct {
	UserId *string `json:"user_id,omitempty"` // 操作用户id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例code

	TaskId *string `json:"task_id,omitempty"` // 任务id

	Comment *string `json:"comment,omitempty"` // 意见

	AddSignUserIds []string `json:"add_sign_user_ids,omitempty"` // 被加签人id

	AddSignType *int `json:"add_sign_type,omitempty"` // 1/2/3分别代表前加签/后加签/并加签

	ApprovalMethod *int `json:"approval_method,omitempty"` // 仅在前加签、后加签时需要填写，1/2 分别代表或签/会签
}

type AddSignInstanceReq struct {
	apiReq *larkcore.ApiReq
	Body   *AddSignInstanceReqBody `body:""`
}

type AddSignInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *AddSignInstanceResp) Success() bool {
	return resp.Code == 0
}

type CancelInstanceReqBuilder struct {
	apiReq         *larkcore.ApiReq
	instanceCancel *InstanceCancel
}

func NewCancelInstanceReqBuilder() *CancelInstanceReqBuilder {
	builder := &CancelInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *CancelInstanceReqBuilder) UserIdType(userIdType string) *CancelInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 对于状态为“审批中”的单个审批实例进行撤销操作，撤销后审批流程结束
func (builder *CancelInstanceReqBuilder) InstanceCancel(instanceCancel *InstanceCancel) *CancelInstanceReqBuilder {
	builder.instanceCancel = instanceCancel
	return builder
}

func (builder *CancelInstanceReqBuilder) Build() *CancelInstanceReq {
	req := &CancelInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.instanceCancel
	return req
}

type CancelInstanceReq struct {
	apiReq         *larkcore.ApiReq
	InstanceCancel *InstanceCancel `body:""`
}

type CancelInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *CancelInstanceResp) Success() bool {
	return resp.Code == 0
}

type CcInstanceReqBuilder struct {
	apiReq     *larkcore.ApiReq
	instanceCc *InstanceCc
}

func NewCcInstanceReqBuilder() *CcInstanceReqBuilder {
	builder := &CcInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *CcInstanceReqBuilder) UserIdType(userIdType string) *CcInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 通过接口可以将当前审批实例抄送给其他人。
func (builder *CcInstanceReqBuilder) InstanceCc(instanceCc *InstanceCc) *CcInstanceReqBuilder {
	builder.instanceCc = instanceCc
	return builder
}

func (builder *CcInstanceReqBuilder) Build() *CcInstanceReq {
	req := &CcInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.instanceCc
	return req
}

type CcInstanceReq struct {
	apiReq     *larkcore.ApiReq
	InstanceCc *InstanceCc `body:""`
}

type CcInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *CcInstanceResp) Success() bool {
	return resp.Code == 0
}

type CreateInstanceReqBuilder struct {
	apiReq         *larkcore.ApiReq
	instanceCreate *InstanceCreate
}

func NewCreateInstanceReqBuilder() *CreateInstanceReqBuilder {
	builder := &CreateInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 创建一个审批实例，调用方需对审批定义的表单有详细了解，将按照定义的表单结构，将表单 Value 通过接口传入
func (builder *CreateInstanceReqBuilder) InstanceCreate(instanceCreate *InstanceCreate) *CreateInstanceReqBuilder {
	builder.instanceCreate = instanceCreate
	return builder
}

func (builder *CreateInstanceReqBuilder) Build() *CreateInstanceReq {
	req := &CreateInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.instanceCreate
	return req
}

type CreateInstanceReq struct {
	apiReq         *larkcore.ApiReq
	InstanceCreate *InstanceCreate `body:""`
}

type CreateInstanceRespData struct {
	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 Code

	InstanceLink *string `json:"instance_link,omitempty"` // 审批实例链接
}

type CreateInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateInstanceRespData `json:"data"` // 业务数据
}

func (resp *CreateInstanceResp) Success() bool {
	return resp.Code == 0
}

type GetInstanceReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetInstanceReqBuilder() *GetInstanceReqBuilder {
	builder := &GetInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批实例 Code, 若在创建的时候传了uuid, 也可以通过传uuid获取
//
// 示例值：81D31358-93AF-92D6-7425-01A5D67C4E71
func (builder *GetInstanceReqBuilder) InstanceId(instanceId string) *GetInstanceReqBuilder {
	builder.apiReq.PathParams.Set("instance_id", fmt.Sprint(instanceId))
	return builder
}

// 语言
//
// 示例值：zh-CN
func (builder *GetInstanceReqBuilder) Locale(locale string) *GetInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("locale", fmt.Sprint(locale))
	return builder
}

// 发起审批用户id，仅自建应用可返回
//
// 示例值：f7cb567e
func (builder *GetInstanceReqBuilder) UserId(userId string) *GetInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：user_id
func (builder *GetInstanceReqBuilder) UserIdType(userIdType string) *GetInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

func (builder *GetInstanceReqBuilder) Build() *GetInstanceReq {
	req := &GetInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type GetInstanceReq struct {
	apiReq *larkcore.ApiReq
}

type GetInstanceRespData struct {
	ApprovalName *string `json:"approval_name,omitempty"` // 审批名称

	StartTime *string `json:"start_time,omitempty"` // 审批创建时间

	EndTime *string `json:"end_time,omitempty"` // 审批完成时间，未完成为 0

	UserId *string `json:"user_id,omitempty"` // 发起审批用户

	OpenId *string `json:"open_id,omitempty"` // 发起审批用户 open id

	SerialNumber *string `json:"serial_number,omitempty"` // 审批单编号

	DepartmentId *string `json:"department_id,omitempty"` // 发起审批用户所在部门

	Status *string `json:"status,omitempty"` // 审批实例状态

	Uuid *string `json:"uuid,omitempty"` // 用户的唯一标识id

	Form *string `json:"form,omitempty"` // json字符串，控件值详情见下方

	TaskList []*InstanceTask `json:"task_list,omitempty"` // 审批任务列表

	CommentList []*InstanceComment `json:"comment_list,omitempty"` // 评论列表

	Timeline []*InstanceTimeline `json:"timeline,omitempty"` // 审批动态

	ModifiedInstanceCode *string `json:"modified_instance_code,omitempty"` // 修改的原实例 code,仅在查询修改实例时显示该字段

	RevertedInstanceCode *string `json:"reverted_instance_code,omitempty"` // 撤销的原实例 code,仅在查询撤销实例时显示该字段

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义 Code

	Reverted *bool `json:"reverted,omitempty"` // 单据是否被撤销

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例 Code
}

type GetInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetInstanceRespData `json:"data"` // 业务数据
}

func (resp *GetInstanceResp) Success() bool {
	return resp.Code == 0
}

type ListInstanceReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewListInstanceReqBuilder() *ListInstanceReqBuilder {
	builder := &ListInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListInstanceReqBuilder) Limit(limit int) *ListInstanceReqBuilder {
	builder.limit = limit
	return builder
}

// 分页大小
//
// 示例值：100
func (builder *ListInstanceReqBuilder) PageSize(pageSize int) *ListInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *ListInstanceReqBuilder) PageToken(pageToken string) *ListInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 审批定义唯一标识
//
// 示例值：7C468A54-8745-2245-9675-08B7C63E7A85
func (builder *ListInstanceReqBuilder) ApprovalCode(approvalCode string) *ListInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("approval_code", fmt.Sprint(approvalCode))
	return builder
}

// 审批实例创建时间区间（毫秒）
//
// 示例值：1567690398020
func (builder *ListInstanceReqBuilder) StartTime(startTime string) *ListInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("start_time", fmt.Sprint(startTime))
	return builder
}

// 审批实例创建时间区间（毫秒）
//
// 示例值：1567690398020
func (builder *ListInstanceReqBuilder) EndTime(endTime string) *ListInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("end_time", fmt.Sprint(endTime))
	return builder
}

func (builder *ListInstanceReqBuilder) Build() *ListInstanceReq {
	req := &ListInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListInstanceReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListInstanceRespData struct {
	InstanceCodeList []string `json:"instance_code_list,omitempty"` // 审批实例 Code

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取
}

type ListInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListInstanceRespData `json:"data"` // 业务数据
}

func (resp *ListInstanceResp) Success() bool {
	return resp.Code == 0
}

type PreviewInstanceReqBodyBuilder struct {
	userId     string // 用户id
	userIdFlag bool

	approvalCode     string // 审批定义code
	approvalCodeFlag bool

	departmentId     string // 部门id
	departmentIdFlag bool

	form     string // 表单数据
	formFlag bool

	instanceCode     string // 审批实例code
	instanceCodeFlag bool

	locale     string // 语言类型
	localeFlag bool

	taskId     string // 任务id
	taskIdFlag bool
}

func NewPreviewInstanceReqBodyBuilder() *PreviewInstanceReqBodyBuilder {
	builder := &PreviewInstanceReqBodyBuilder{}
	return builder
}

// 用户id
//
//示例值：发起审批用户id，按照user_id_type类型填写
func (builder *PreviewInstanceReqBodyBuilder) UserId(userId string) *PreviewInstanceReqBodyBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义code
//
//示例值：C2CAAA90-70D9-3214-906B-B6FFF947F00D
func (builder *PreviewInstanceReqBodyBuilder) ApprovalCode(approvalCode string) *PreviewInstanceReqBodyBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 部门id
//
//示例值：6982332863116876308
func (builder *PreviewInstanceReqBodyBuilder) DepartmentId(departmentId string) *PreviewInstanceReqBodyBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 表单数据
//
//示例值：[{\"id\":\"widget16256287451710001\", \"type\": \"number\", \"value\":\"43\"}]
func (builder *PreviewInstanceReqBodyBuilder) Form(form string) *PreviewInstanceReqBodyBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批实例code
//
//示例值：12345CA6-97AC-32BB-8231-47C33FFFCCFD
func (builder *PreviewInstanceReqBodyBuilder) InstanceCode(instanceCode string) *PreviewInstanceReqBodyBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 语言类型
//
//示例值：zh-CN: 中文 en-US: 英文
func (builder *PreviewInstanceReqBodyBuilder) Locale(locale string) *PreviewInstanceReqBodyBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 任务id
//
//示例值：6982332863116876308
func (builder *PreviewInstanceReqBodyBuilder) TaskId(taskId string) *PreviewInstanceReqBodyBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

func (builder *PreviewInstanceReqBodyBuilder) Build() *PreviewInstanceReqBody {
	req := &PreviewInstanceReqBody{}
	if builder.userIdFlag {
		req.UserId = &builder.userId
	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode
	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId
	}
	if builder.formFlag {
		req.Form = &builder.form
	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode
	}
	if builder.localeFlag {
		req.Locale = &builder.locale
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId
	}
	return req
}

type PreviewInstancePathReqBodyBuilder struct {
	userId           string
	userIdFlag       bool
	approvalCode     string
	approvalCodeFlag bool
	departmentId     string
	departmentIdFlag bool
	form             string
	formFlag         bool
	instanceCode     string
	instanceCodeFlag bool
	locale           string
	localeFlag       bool
	taskId           string
	taskIdFlag       bool
}

func NewPreviewInstancePathReqBodyBuilder() *PreviewInstancePathReqBodyBuilder {
	builder := &PreviewInstancePathReqBodyBuilder{}
	return builder
}

// 用户id
//
// 示例值：发起审批用户id，按照user_id_type类型填写
func (builder *PreviewInstancePathReqBodyBuilder) UserId(userId string) *PreviewInstancePathReqBodyBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 审批定义code
//
// 示例值：C2CAAA90-70D9-3214-906B-B6FFF947F00D
func (builder *PreviewInstancePathReqBodyBuilder) ApprovalCode(approvalCode string) *PreviewInstancePathReqBodyBuilder {
	builder.approvalCode = approvalCode
	builder.approvalCodeFlag = true
	return builder
}

// 部门id
//
// 示例值：6982332863116876308
func (builder *PreviewInstancePathReqBodyBuilder) DepartmentId(departmentId string) *PreviewInstancePathReqBodyBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 表单数据
//
// 示例值：[{\"id\":\"widget16256287451710001\", \"type\": \"number\", \"value\":\"43\"}]
func (builder *PreviewInstancePathReqBodyBuilder) Form(form string) *PreviewInstancePathReqBodyBuilder {
	builder.form = form
	builder.formFlag = true
	return builder
}

// 审批实例code
//
// 示例值：12345CA6-97AC-32BB-8231-47C33FFFCCFD
func (builder *PreviewInstancePathReqBodyBuilder) InstanceCode(instanceCode string) *PreviewInstancePathReqBodyBuilder {
	builder.instanceCode = instanceCode
	builder.instanceCodeFlag = true
	return builder
}

// 语言类型
//
// 示例值：zh-CN: 中文 en-US: 英文
func (builder *PreviewInstancePathReqBodyBuilder) Locale(locale string) *PreviewInstancePathReqBodyBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// 任务id
//
// 示例值：6982332863116876308
func (builder *PreviewInstancePathReqBodyBuilder) TaskId(taskId string) *PreviewInstancePathReqBodyBuilder {
	builder.taskId = taskId
	builder.taskIdFlag = true
	return builder
}

func (builder *PreviewInstancePathReqBodyBuilder) Build() (*PreviewInstanceReqBody, error) {
	req := &PreviewInstanceReqBody{}
	if builder.userIdFlag {
		req.UserId = &builder.userId
	}
	if builder.approvalCodeFlag {
		req.ApprovalCode = &builder.approvalCode
	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId
	}
	if builder.formFlag {
		req.Form = &builder.form
	}
	if builder.instanceCodeFlag {
		req.InstanceCode = &builder.instanceCode
	}
	if builder.localeFlag {
		req.Locale = &builder.locale
	}
	if builder.taskIdFlag {
		req.TaskId = &builder.taskId
	}
	return req, nil
}

type PreviewInstanceReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *PreviewInstanceReqBody
}

func NewPreviewInstanceReqBuilder() *PreviewInstanceReqBuilder {
	builder := &PreviewInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// open_id(ou_开头)，union_id(on_开头)，user_id(字符串)。user_id_type不填默认为open_id
//
// 示例值：open_id
func (builder *PreviewInstanceReqBuilder) UserIdType(userIdType string) *PreviewInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

//
func (builder *PreviewInstanceReqBuilder) Body(body *PreviewInstanceReqBody) *PreviewInstanceReqBuilder {
	builder.body = body
	return builder
}

func (builder *PreviewInstanceReqBuilder) Build() *PreviewInstanceReq {
	req := &PreviewInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.body
	return req
}

type PreviewInstanceReqBody struct {
	UserId *string `json:"user_id,omitempty"` // 用户id

	ApprovalCode *string `json:"approval_code,omitempty"` // 审批定义code

	DepartmentId *string `json:"department_id,omitempty"` // 部门id

	Form *string `json:"form,omitempty"` // 表单数据

	InstanceCode *string `json:"instance_code,omitempty"` // 审批实例code

	Locale *string `json:"locale,omitempty"` // 语言类型

	TaskId *string `json:"task_id,omitempty"` // 任务id
}

type PreviewInstanceReq struct {
	apiReq *larkcore.ApiReq
	Body   *PreviewInstanceReqBody `body:""`
}

type PreviewInstanceRespData struct {
	PreviewNodes []*PreviewNode `json:"preview_nodes,omitempty"` // 预览节点信息
}

type PreviewInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *PreviewInstanceRespData `json:"data"` // 业务数据
}

func (resp *PreviewInstanceResp) Success() bool {
	return resp.Code == 0
}

type QueryInstanceReqBuilder struct {
	apiReq         *larkcore.ApiReq
	instanceSearch *InstanceSearch
	limit          int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewQueryInstanceReqBuilder() *QueryInstanceReqBuilder {
	builder := &QueryInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *QueryInstanceReqBuilder) Limit(limit int) *QueryInstanceReqBuilder {
	builder.limit = limit
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *QueryInstanceReqBuilder) PageSize(pageSize int) *QueryInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *QueryInstanceReqBuilder) PageToken(pageToken string) *QueryInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *QueryInstanceReqBuilder) UserIdType(userIdType string) *QueryInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 该接口通过不同条件查询审批系统中符合条件的审批实例列表。
func (builder *QueryInstanceReqBuilder) InstanceSearch(instanceSearch *InstanceSearch) *QueryInstanceReqBuilder {
	builder.instanceSearch = instanceSearch
	return builder
}

func (builder *QueryInstanceReqBuilder) Build() *QueryInstanceReq {
	req := &QueryInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.instanceSearch
	return req
}

type QueryInstanceReq struct {
	apiReq         *larkcore.ApiReq
	InstanceSearch *InstanceSearch `body:""`
	Limit          int             // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type QueryInstanceRespData struct {
	Count *int `json:"count,omitempty"` // 查询返回条数

	InstanceList []*InstanceSearchItem `json:"instance_list,omitempty"` // 审批实例列表

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取
}

type QueryInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *QueryInstanceRespData `json:"data"` // 业务数据
}

func (resp *QueryInstanceResp) Success() bool {
	return resp.Code == 0
}

type SearchCcInstanceReqBuilder struct {
	apiReq   *larkcore.ApiReq
	ccSearch *CcSearch
}

func NewSearchCcInstanceReqBuilder() *SearchCcInstanceReqBuilder {
	builder := &SearchCcInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *SearchCcInstanceReqBuilder) PageSize(pageSize int) *SearchCcInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *SearchCcInstanceReqBuilder) PageToken(pageToken string) *SearchCcInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *SearchCcInstanceReqBuilder) UserIdType(userIdType string) *SearchCcInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 该接口通过不同条件查询审批系统中符合条件的审批抄送列表。
func (builder *SearchCcInstanceReqBuilder) CcSearch(ccSearch *CcSearch) *SearchCcInstanceReqBuilder {
	builder.ccSearch = ccSearch
	return builder
}

func (builder *SearchCcInstanceReqBuilder) Build() *SearchCcInstanceReq {
	req := &SearchCcInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.ccSearch
	return req
}

type SearchCcInstanceReq struct {
	apiReq   *larkcore.ApiReq
	CcSearch *CcSearch `body:""`
}

type SearchCcInstanceRespData struct {
	Count *int `json:"count,omitempty"` // 查询返回条数

	CcList []*CcSearchItem `json:"cc_list,omitempty"` // 审批实例列表

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取
}

type SearchCcInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *SearchCcInstanceRespData `json:"data"` // 业务数据
}

func (resp *SearchCcInstanceResp) Success() bool {
	return resp.Code == 0
}

type SpecifiedRollbackInstanceReqBuilder struct {
	apiReq            *larkcore.ApiReq
	specifiedRollback *SpecifiedRollback
}

func NewSpecifiedRollbackInstanceReqBuilder() *SpecifiedRollbackInstanceReqBuilder {
	builder := &SpecifiedRollbackInstanceReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *SpecifiedRollbackInstanceReqBuilder) UserIdType(userIdType string) *SpecifiedRollbackInstanceReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 从当前审批任务，退回到已审批的一个或多个任务节点。退回后，已审批节点重新生成审批任务
func (builder *SpecifiedRollbackInstanceReqBuilder) SpecifiedRollback(specifiedRollback *SpecifiedRollback) *SpecifiedRollbackInstanceReqBuilder {
	builder.specifiedRollback = specifiedRollback
	return builder
}

func (builder *SpecifiedRollbackInstanceReqBuilder) Build() *SpecifiedRollbackInstanceReq {
	req := &SpecifiedRollbackInstanceReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.specifiedRollback
	return req
}

type SpecifiedRollbackInstanceReq struct {
	apiReq            *larkcore.ApiReq
	SpecifiedRollback *SpecifiedRollback `body:""`
}

type SpecifiedRollbackInstanceResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *SpecifiedRollbackInstanceResp) Success() bool {
	return resp.Code == 0
}

type CreateInstanceCommentReqBuilder struct {
	apiReq         *larkcore.ApiReq
	commentRequest *CommentRequest
}

func NewCreateInstanceCommentReqBuilder() *CreateInstanceCommentReqBuilder {
	builder := &CreateInstanceCommentReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批实例code（或租户自定义审批实例ID）
//
// 示例值：6A123516-FB88-470D-A428-9AF58B71B3C0
func (builder *CreateInstanceCommentReqBuilder) InstanceId(instanceId string) *CreateInstanceCommentReqBuilder {
	builder.apiReq.PathParams.Set("instance_id", fmt.Sprint(instanceId))
	return builder
}

// 用户ID类型，不填默认为open_id
//
// 示例值：user_id
func (builder *CreateInstanceCommentReqBuilder) UserIdType(userIdType string) *CreateInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 用户ID
//
// 示例值：e5286g26
func (builder *CreateInstanceCommentReqBuilder) UserId(userId string) *CreateInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

// 在某审批实例下创建、修改评论或评论回复（不包含审批同意、拒绝、转交等附加的理由或意见）。
func (builder *CreateInstanceCommentReqBuilder) CommentRequest(commentRequest *CommentRequest) *CreateInstanceCommentReqBuilder {
	builder.commentRequest = commentRequest
	return builder
}

func (builder *CreateInstanceCommentReqBuilder) Build() *CreateInstanceCommentReq {
	req := &CreateInstanceCommentReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.commentRequest
	return req
}

type CreateInstanceCommentReq struct {
	apiReq         *larkcore.ApiReq
	CommentRequest *CommentRequest `body:""`
}

type CreateInstanceCommentRespData struct {
	CommentId *string `json:"comment_id,omitempty"` // 保存成功的comment_id
}

type CreateInstanceCommentResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateInstanceCommentRespData `json:"data"` // 业务数据
}

func (resp *CreateInstanceCommentResp) Success() bool {
	return resp.Code == 0
}

type DeleteInstanceCommentReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewDeleteInstanceCommentReqBuilder() *DeleteInstanceCommentReqBuilder {
	builder := &DeleteInstanceCommentReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批实例code（或者租户自定义审批实例ID）
//
// 示例值：6A123516-FB88-470D-A428-9AF58B71B3C0
func (builder *DeleteInstanceCommentReqBuilder) InstanceId(instanceId string) *DeleteInstanceCommentReqBuilder {
	builder.apiReq.PathParams.Set("instance_id", fmt.Sprint(instanceId))
	return builder
}

// 评论ID
//
// 示例值：7081516627711606803
func (builder *DeleteInstanceCommentReqBuilder) CommentId(commentId string) *DeleteInstanceCommentReqBuilder {
	builder.apiReq.PathParams.Set("comment_id", fmt.Sprint(commentId))
	return builder
}

// 用户ID类型，不填默认为open_id
//
// 示例值：user_id
func (builder *DeleteInstanceCommentReqBuilder) UserIdType(userIdType string) *DeleteInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 根据user_id_type填写用户ID
//
// 示例值：ou_806a18fb5bdf525e38ba219733bdbd73
func (builder *DeleteInstanceCommentReqBuilder) UserId(userId string) *DeleteInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

func (builder *DeleteInstanceCommentReqBuilder) Build() *DeleteInstanceCommentReq {
	req := &DeleteInstanceCommentReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type DeleteInstanceCommentReq struct {
	apiReq *larkcore.ApiReq
}

type DeleteInstanceCommentRespData struct {
	CommentId *string `json:"comment_id,omitempty"` // 删除的评论ID
}

type DeleteInstanceCommentResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *DeleteInstanceCommentRespData `json:"data"` // 业务数据
}

func (resp *DeleteInstanceCommentResp) Success() bool {
	return resp.Code == 0
}

type ListInstanceCommentReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewListInstanceCommentReqBuilder() *ListInstanceCommentReqBuilder {
	builder := &ListInstanceCommentReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批实例code（或者租户自定义审批实例ID）
//
// 示例值：6A123516-FB88-470D-A428-9AF58B71B3C0
func (builder *ListInstanceCommentReqBuilder) InstanceId(instanceId string) *ListInstanceCommentReqBuilder {
	builder.apiReq.PathParams.Set("instance_id", fmt.Sprint(instanceId))
	return builder
}

// 用户ID类型，不填默认为open_id
//
// 示例值：user_id
func (builder *ListInstanceCommentReqBuilder) UserIdType(userIdType string) *ListInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 用户ID
//
// 示例值：e5286g26
func (builder *ListInstanceCommentReqBuilder) UserId(userId string) *ListInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *ListInstanceCommentReqBuilder) PageToken(pageToken string) *ListInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListInstanceCommentReqBuilder) PageSize(pageSize int) *ListInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListInstanceCommentReqBuilder) Build() *ListInstanceCommentReq {
	req := &ListInstanceCommentReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListInstanceCommentReq struct {
	apiReq *larkcore.ApiReq
}

type ListInstanceCommentRespData struct {
	Comments []*Comment `json:"comments,omitempty"` // 评论数据列表
}

type ListInstanceCommentResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListInstanceCommentRespData `json:"data"` // 业务数据
}

func (resp *ListInstanceCommentResp) Success() bool {
	return resp.Code == 0
}

type RemoveInstanceCommentReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewRemoveInstanceCommentReqBuilder() *RemoveInstanceCommentReqBuilder {
	builder := &RemoveInstanceCommentReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 审批实例code（或者租户自定义审批实例ID）
//
// 示例值：6A123516-FB88-470D-A428-9AF58B71B3C0
func (builder *RemoveInstanceCommentReqBuilder) InstanceId(instanceId string) *RemoveInstanceCommentReqBuilder {
	builder.apiReq.PathParams.Set("instance_id", fmt.Sprint(instanceId))
	return builder
}

// 用户ID类型，不填默认为open_id
//
// 示例值：user_id
func (builder *RemoveInstanceCommentReqBuilder) UserIdType(userIdType string) *RemoveInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 根据user_id_type填写用户ID
//
// 示例值：ou_806a18fb5bdf525e38ba219733bdbd73
func (builder *RemoveInstanceCommentReqBuilder) UserId(userId string) *RemoveInstanceCommentReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

func (builder *RemoveInstanceCommentReqBuilder) Build() *RemoveInstanceCommentReq {
	req := &RemoveInstanceCommentReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type RemoveInstanceCommentReq struct {
	apiReq *larkcore.ApiReq
}

type RemoveInstanceCommentRespData struct {
	InstanceId *string `json:"instance_id,omitempty"` // 审批实例code

	ExternalId *string `json:"external_id,omitempty"` // 租户自定义审批实例ID
}

type RemoveInstanceCommentResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *RemoveInstanceCommentRespData `json:"data"` // 业务数据
}

func (resp *RemoveInstanceCommentResp) Success() bool {
	return resp.Code == 0
}

type ApproveTaskReqBuilder struct {
	apiReq      *larkcore.ApiReq
	taskApprove *TaskApprove
}

func NewApproveTaskReqBuilder() *ApproveTaskReqBuilder {
	builder := &ApproveTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *ApproveTaskReqBuilder) UserIdType(userIdType string) *ApproveTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 对于单个审批任务进行同意操作。同意后审批流程会流转到下一个审批人。
func (builder *ApproveTaskReqBuilder) TaskApprove(taskApprove *TaskApprove) *ApproveTaskReqBuilder {
	builder.taskApprove = taskApprove
	return builder
}

func (builder *ApproveTaskReqBuilder) Build() *ApproveTaskReq {
	req := &ApproveTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.taskApprove
	return req
}

type ApproveTaskReq struct {
	apiReq      *larkcore.ApiReq
	TaskApprove *TaskApprove `body:""`
}

type ApproveTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *ApproveTaskResp) Success() bool {
	return resp.Code == 0
}

type QueryTaskReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

func NewQueryTaskReqBuilder() *QueryTaskReqBuilder {
	builder := &QueryTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *QueryTaskReqBuilder) Limit(limit int) *QueryTaskReqBuilder {
	builder.limit = limit
	return builder
}

// 分页大小
//
// 示例值：100
func (builder *QueryTaskReqBuilder) PageSize(pageSize int) *QueryTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：1
func (builder *QueryTaskReqBuilder) PageToken(pageToken string) *QueryTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 需要查询的 User ID
//
// 示例值：example_user_id
func (builder *QueryTaskReqBuilder) UserId(userId string) *QueryTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

// 需要查询的任务分组主题，如「待办」、「已办」等
//
// 示例值：1
func (builder *QueryTaskReqBuilder) Topic(topic string) *QueryTaskReqBuilder {
	builder.apiReq.QueryParams.Set("topic", fmt.Sprint(topic))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *QueryTaskReqBuilder) UserIdType(userIdType string) *QueryTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

func (builder *QueryTaskReqBuilder) Build() *QueryTaskReq {
	req := &QueryTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type QueryTaskReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type QueryTaskRespData struct {
	Tasks []*Task `json:"tasks,omitempty"` // 任务列表

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取

	Count *Count `json:"count,omitempty"` // 列表计数，只在分页第一页返回
}

type QueryTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *QueryTaskRespData `json:"data"` // 业务数据
}

func (resp *QueryTaskResp) Success() bool {
	return resp.Code == 0
}

type RejectTaskReqBuilder struct {
	apiReq      *larkcore.ApiReq
	taskApprove *TaskApprove
}

func NewRejectTaskReqBuilder() *RejectTaskReqBuilder {
	builder := &RejectTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *RejectTaskReqBuilder) UserIdType(userIdType string) *RejectTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 对于单个审批任务进行拒绝操作。拒绝后审批流程结束。
func (builder *RejectTaskReqBuilder) TaskApprove(taskApprove *TaskApprove) *RejectTaskReqBuilder {
	builder.taskApprove = taskApprove
	return builder
}

func (builder *RejectTaskReqBuilder) Build() *RejectTaskReq {
	req := &RejectTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.taskApprove
	return req
}

type RejectTaskReq struct {
	apiReq      *larkcore.ApiReq
	TaskApprove *TaskApprove `body:""`
}

type RejectTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *RejectTaskResp) Success() bool {
	return resp.Code == 0
}

type ResubmitTaskReqBuilder struct {
	apiReq       *larkcore.ApiReq
	taskResubmit *TaskResubmit
}

func NewResubmitTaskReqBuilder() *ResubmitTaskReqBuilder {
	builder := &ResubmitTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *ResubmitTaskReqBuilder) UserIdType(userIdType string) *ResubmitTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 对于单个退回到发起人的审批任务进行重新发起操作。发起后审批流程会流转到下一个审批人。
func (builder *ResubmitTaskReqBuilder) TaskResubmit(taskResubmit *TaskResubmit) *ResubmitTaskReqBuilder {
	builder.taskResubmit = taskResubmit
	return builder
}

func (builder *ResubmitTaskReqBuilder) Build() *ResubmitTaskReq {
	req := &ResubmitTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.taskResubmit
	return req
}

type ResubmitTaskReq struct {
	apiReq       *larkcore.ApiReq
	TaskResubmit *TaskResubmit `body:""`
}

type ResubmitTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *ResubmitTaskResp) Success() bool {
	return resp.Code == 0
}

type SearchTaskReqBuilder struct {
	apiReq     *larkcore.ApiReq
	taskSearch *TaskSearch
}

func NewSearchTaskReqBuilder() *SearchTaskReqBuilder {
	builder := &SearchTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *SearchTaskReqBuilder) PageSize(pageSize int) *SearchTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：nF1ZXJ5VGhlbkZldGNoCgAAAAAA6PZwFmUzSldvTC1yU
func (builder *SearchTaskReqBuilder) PageToken(pageToken string) *SearchTaskReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *SearchTaskReqBuilder) UserIdType(userIdType string) *SearchTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 该接口通过不同条件查询审批系统中符合条件的审批任务列表
func (builder *SearchTaskReqBuilder) TaskSearch(taskSearch *TaskSearch) *SearchTaskReqBuilder {
	builder.taskSearch = taskSearch
	return builder
}

func (builder *SearchTaskReqBuilder) Build() *SearchTaskReq {
	req := &SearchTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.taskSearch
	return req
}

type SearchTaskReq struct {
	apiReq     *larkcore.ApiReq
	TaskSearch *TaskSearch `body:""`
}

type SearchTaskRespData struct {
	Count *int `json:"count,omitempty"` // 查询返回条数

	TaskList []*TaskSearchItem `json:"task_list,omitempty"` // 审批任务列表

	PageToken *string `json:"page_token,omitempty"` // 翻页 Token

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多任务可供拉取
}

type SearchTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *SearchTaskRespData `json:"data"` // 业务数据
}

func (resp *SearchTaskResp) Success() bool {
	return resp.Code == 0
}

type TransferTaskReqBuilder struct {
	apiReq       *larkcore.ApiReq
	taskTransfer *TaskTransfer
}

func NewTransferTaskReqBuilder() *TransferTaskReqBuilder {
	builder := &TransferTaskReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *TransferTaskReqBuilder) UserIdType(userIdType string) *TransferTaskReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 对于单个审批任务进行转交操作。转交后审批流程流转给被转交人。
func (builder *TransferTaskReqBuilder) TaskTransfer(taskTransfer *TaskTransfer) *TransferTaskReqBuilder {
	builder.taskTransfer = taskTransfer
	return builder
}

func (builder *TransferTaskReqBuilder) Build() *TransferTaskReq {
	req := &TransferTaskReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.taskTransfer
	return req
}

type TransferTaskReq struct {
	apiReq       *larkcore.ApiReq
	TaskTransfer *TaskTransfer `body:""`
}

type TransferTaskResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *TransferTaskResp) Success() bool {
	return resp.Code == 0
}

type P2ApprovalUpdatedV4Data struct {
	Object *ApprovalEvent `json:"object,omitempty"` // 事件详情数据
}

type P2ApprovalUpdatedV4 struct {
	*larkevent.EventV2Base                          // 事件基础数据
	*larkevent.EventReq                             // 请求原生数据
	Event                  *P2ApprovalUpdatedV4Data `json:"event"` // 事件内容
}

func (m *P2ApprovalUpdatedV4) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type ListExternalTaskIterator struct {
	nextPageToken *string
	items         []*ExternalTaskList
	index         int
	limit         int
	ctx           context.Context
	req           *ListExternalTaskReq
	listFunc      func(ctx context.Context, req *ListExternalTaskReq, options ...larkcore.RequestOptionFunc) (*ListExternalTaskResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListExternalTaskIterator) Next() (bool, *ExternalTaskList, 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.Data) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Data
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListExternalTaskIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListInstanceIterator struct {
	nextPageToken *string
	items         []string
	index         int
	limit         int
	ctx           context.Context
	req           *ListInstanceReq
	listFunc      func(ctx context.Context, req *ListInstanceReq, options ...larkcore.RequestOptionFunc) (*ListInstanceResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListInstanceIterator) Next() (bool, string, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, "", nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, "", 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, "", err
		}

		if resp.Code != 0 {
			return false, "", errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.InstanceCodeList) == 0 {
			return false, "", nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.InstanceCodeList
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListInstanceIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type QueryInstanceIterator struct {
	nextPageToken *string
	items         []*InstanceSearchItem
	index         int
	limit         int
	ctx           context.Context
	req           *QueryInstanceReq
	listFunc      func(ctx context.Context, req *QueryInstanceReq, options ...larkcore.RequestOptionFunc) (*QueryInstanceResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *QueryInstanceIterator) Next() (bool, *InstanceSearchItem, 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.InstanceList) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.InstanceList
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *QueryInstanceIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type QueryTaskIterator struct {
	nextPageToken *string
	items         []*Task
	index         int
	limit         int
	ctx           context.Context
	req           *QueryTaskReq
	listFunc      func(ctx context.Context, req *QueryTaskReq, options ...larkcore.RequestOptionFunc) (*QueryTaskResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *QueryTaskIterator) Next() (bool, *Task, 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.Tasks) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Tasks
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *QueryTaskIterator) NextPageToken() *string {
	return iterator.nextPageToken
}
