// Package board 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 larkboard

import (
	"io"

	"io/ioutil"

	"fmt"

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

const (
	UserIdTypeUserId  = "user_id"  // 以user_id来识别用户
	UserIdTypeUnionId = "union_id" // 以union_id来识别用户
	UserIdTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	StyleTypeBoard   = 1 // 画板样式
	StyleTypeClassic = 2 // 经典样式

)

const (
	SyntaxTypeUNKNOWN  = 0 // 未知
	SyntaxTypePLANTUML = 1 // Plantuml解析
	SyntaxTypeMERMAID  = 2 // Mermaid解析
	SyntaxTypeSVG      = 3 // SVG 语法解析

)

const (
	DiagramTypeUNKNOWN           = 0   // 未知
	DiagramTypeMINDMAP           = 1   // 思维导图
	DiagramTypeSEQUENCE          = 2   // 时序图
	DiagramTypeACTIVITY          = 3   // 活动图
	DiagramTypeCLASS             = 4   // 类图
	DiagramTypeER                = 5   // ER
	DiagramTypeFLOWCHART         = 6   // 流程图
	DiagramTypeSTATE             = 7   // 用例图
	DiagramTypeCOMPONENTDIAGRAM  = 8   // 组件图
	DiagramTypeSTREAMINGACTIVITY = 101 // ai流式生成流程图
	DiagramTypeSTREAMINGSEQUENCE = 102 // ai流式生成时序图
	DiagramTypeTIMELINEGML       = 201 // plantUML语法补充超集GML

)

const (
	ParseModeSimple   = 0 // 直接解析成画板节点
	ParseModeEditable = 1 // 解析成画板节点并且保留PlantUml语法，可以对语法进行二次编辑（会将所有节点放到一个Section节点下）（当前只支持PlantUml）

)

const (
	UserIdTypeListWhiteboardNodeUserId  = "user_id"  // 以user_id来识别用户
	UserIdTypeListWhiteboardNodeUnionId = "union_id" // 以union_id来识别用户
	UserIdTypeListWhiteboardNodeOpenId  = "open_id"  // 以open_id来识别用户
)

type AuthInfo struct {
	SessionKey *string `json:"session_key,omitempty"` // $ session key

	UserId *string `json:"user_id,omitempty"` // $ feishu id for internal app.

	OpenAppId *string `json:"open_app_id,omitempty"` // $ app id of open platform.

	Region *string `json:"region,omitempty"` // $ user account region. cn for china; va for oversea

	OpenBotId *string `json:"open_bot_id,omitempty"` // $ open bot id

	BotId *string `json:"bot_id,omitempty"` // $ bot id

	AuthType *string `json:"auth_type,omitempty"` // $ 鉴权类型: LarkSession, TenantAccessToken, UserAccessToken, OpenSession等

	Extra map[string]string `json:"extra,omitempty"` //
}

type AuthInfoBuilder struct {
	sessionKey     string // $ session key
	sessionKeyFlag bool

	userId     string // $ feishu id for internal app.
	userIdFlag bool

	openAppId     string // $ app id of open platform.
	openAppIdFlag bool

	region     string // $ user account region. cn for china; va for oversea
	regionFlag bool

	openBotId     string // $ open bot id
	openBotIdFlag bool

	botId     string // $ bot id
	botIdFlag bool

	authType     string // $ 鉴权类型: LarkSession, TenantAccessToken, UserAccessToken, OpenSession等
	authTypeFlag bool

	extra     map[string]string //
	extraFlag bool
}

func NewAuthInfoBuilder() *AuthInfoBuilder {
	builder := &AuthInfoBuilder{}
	return builder
}

// $ session key
//
// 示例值：
func (builder *AuthInfoBuilder) SessionKey(sessionKey string) *AuthInfoBuilder {
	builder.sessionKey = sessionKey
	builder.sessionKeyFlag = true
	return builder
}

// $ feishu id for internal app.
//
// 示例值：
func (builder *AuthInfoBuilder) UserId(userId string) *AuthInfoBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// $ app id of open platform.
//
// 示例值：
func (builder *AuthInfoBuilder) OpenAppId(openAppId string) *AuthInfoBuilder {
	builder.openAppId = openAppId
	builder.openAppIdFlag = true
	return builder
}

// $ user account region. cn for china; va for oversea
//
// 示例值：
func (builder *AuthInfoBuilder) Region(region string) *AuthInfoBuilder {
	builder.region = region
	builder.regionFlag = true
	return builder
}

// $ open bot id
//
// 示例值：
func (builder *AuthInfoBuilder) OpenBotId(openBotId string) *AuthInfoBuilder {
	builder.openBotId = openBotId
	builder.openBotIdFlag = true
	return builder
}

// $ bot id
//
// 示例值：
func (builder *AuthInfoBuilder) BotId(botId string) *AuthInfoBuilder {
	builder.botId = botId
	builder.botIdFlag = true
	return builder
}

// $ 鉴权类型: LarkSession, TenantAccessToken, UserAccessToken, OpenSession等
//
// 示例值：
func (builder *AuthInfoBuilder) AuthType(authType string) *AuthInfoBuilder {
	builder.authType = authType
	builder.authTypeFlag = true
	return builder
}

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

func (builder *AuthInfoBuilder) Build() *AuthInfo {
	req := &AuthInfo{}
	if builder.sessionKeyFlag {
		req.SessionKey = &builder.sessionKey

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

	}
	if builder.openAppIdFlag {
		req.OpenAppId = &builder.openAppId

	}
	if builder.regionFlag {
		req.Region = &builder.region

	}
	if builder.openBotIdFlag {
		req.OpenBotId = &builder.openBotId

	}
	if builder.botIdFlag {
		req.BotId = &builder.botId

	}
	if builder.authTypeFlag {
		req.AuthType = &builder.authType

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

type ClientInfo struct {
	ClientIp *string `json:"client_ip,omitempty"` // 1: optional string Platform (gw.ctx="mw_platform"); //$ depracated 请求的平台\n2: optional string LarkVersion (gw.ctx="mw_lark_version"); //$ depracated 如果是来自Feisu, 这里是飞书的Version\n3: optional AppForm AppForm (gw.ctx="mw_app_form");   //$ depracated 应用形态 1-小程序\n4: optional string AppVersion (gw.ctx="mw_app_version"); //$ depracated 应用版本\n5: optional string OS (gw.ctx="mw_os"); //$ depracated 操作系统\n$ 客户端IP
}

type ClientInfoBuilder struct {
	clientIp     string // 1: optional string Platform (gw.ctx="mw_platform"); //$ depracated 请求的平台\n2: optional string LarkVersion (gw.ctx="mw_lark_version"); //$ depracated 如果是来自Feisu, 这里是飞书的Version\n3: optional AppForm AppForm (gw.ctx="mw_app_form");   //$ depracated 应用形态 1-小程序\n4: optional string AppVersion (gw.ctx="mw_app_version"); //$ depracated 应用版本\n5: optional string OS (gw.ctx="mw_os"); //$ depracated 操作系统\n$ 客户端IP
	clientIpFlag bool
}

func NewClientInfoBuilder() *ClientInfoBuilder {
	builder := &ClientInfoBuilder{}
	return builder
}

// 1: optional string Platform (gw.ctx="mw_platform"); //$ depracated 请求的平台\n2: optional string LarkVersion (gw.ctx="mw_lark_version"); //$ depracated 如果是来自Feisu, 这里是飞书的Version\n3: optional AppForm AppForm (gw.ctx="mw_app_form");   //$ depracated 应用形态 1-小程序\n4: optional string AppVersion (gw.ctx="mw_app_version"); //$ depracated 应用版本\n5: optional string OS (gw.ctx="mw_os"); //$ depracated 操作系统\n$ 客户端IP
//
// 示例值：
func (builder *ClientInfoBuilder) ClientIp(clientIp string) *ClientInfoBuilder {
	builder.clientIp = clientIp
	builder.clientIpFlag = true
	return builder
}

func (builder *ClientInfoBuilder) Build() *ClientInfo {
	req := &ClientInfo{}
	if builder.clientIpFlag {
		req.ClientIp = &builder.clientIp

	}
	return req
}

type CompositeShape struct {
	Type *string `json:"type,omitempty"` // 基础图形的具体类型

	Pie *Pie `json:"pie,omitempty"` // 饼图属性，type=pie时需要设置

	CircularRing *Pie `json:"circular_ring,omitempty"` // 圆环属性，type=circular_ring时需要设置

	Trapezoid *Trapezoid `json:"trapezoid,omitempty"` // 梯形属性，type=trapezoid时可以设置

	Cube *Cube `json:"cube,omitempty"` // 六面体属性，type=cube时可以设置
}

type CompositeShapeBuilder struct {
	type_    string // 基础图形的具体类型
	typeFlag bool

	pie     *Pie // 饼图属性，type=pie时需要设置
	pieFlag bool

	circularRing     *Pie // 圆环属性，type=circular_ring时需要设置
	circularRingFlag bool

	trapezoid     *Trapezoid // 梯形属性，type=trapezoid时可以设置
	trapezoidFlag bool

	cube     *Cube // 六面体属性，type=cube时可以设置
	cubeFlag bool
}

func NewCompositeShapeBuilder() *CompositeShapeBuilder {
	builder := &CompositeShapeBuilder{}
	return builder
}

// 基础图形的具体类型
//
// 示例值：
func (builder *CompositeShapeBuilder) Type(type_ string) *CompositeShapeBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 饼图属性，type=pie时需要设置
//
// 示例值：
func (builder *CompositeShapeBuilder) Pie(pie *Pie) *CompositeShapeBuilder {
	builder.pie = pie
	builder.pieFlag = true
	return builder
}

// 圆环属性，type=circular_ring时需要设置
//
// 示例值：
func (builder *CompositeShapeBuilder) CircularRing(circularRing *Pie) *CompositeShapeBuilder {
	builder.circularRing = circularRing
	builder.circularRingFlag = true
	return builder
}

// 梯形属性，type=trapezoid时可以设置
//
// 示例值：
func (builder *CompositeShapeBuilder) Trapezoid(trapezoid *Trapezoid) *CompositeShapeBuilder {
	builder.trapezoid = trapezoid
	builder.trapezoidFlag = true
	return builder
}

// 六面体属性，type=cube时可以设置
//
// 示例值：
func (builder *CompositeShapeBuilder) Cube(cube *Cube) *CompositeShapeBuilder {
	builder.cube = cube
	builder.cubeFlag = true
	return builder
}

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

	}
	if builder.pieFlag {
		req.Pie = builder.pie
	}
	if builder.circularRingFlag {
		req.CircularRing = builder.circularRing
	}
	if builder.trapezoidFlag {
		req.Trapezoid = builder.trapezoid
	}
	if builder.cubeFlag {
		req.Cube = builder.cube
	}
	return req
}

type Connector struct {
	StartObject *ConnectorAttachedObject `json:"start_object,omitempty"` // 开始连接节点信息（兼容线上数据，只读，写操作使用 start 字段）

	EndObject *ConnectorAttachedObject `json:"end_object,omitempty"` // 结束连接点信息（兼容线上数据， 只读，写操作使用 end 字段）

	Start *ConnectorInfo `json:"start,omitempty"` // 连线端点信息

	End *ConnectorInfo `json:"end,omitempty"` // 连线端点信息

	Captions *ConnectorCaption `json:"captions,omitempty"` // 连线文本

	Shape *string `json:"shape,omitempty"` // 连线类型

	TurningPoints []*Point `json:"turning_points,omitempty"` // 连线转向点

	CaptionAutoDirection *bool `json:"caption_auto_direction,omitempty"` // 连线上的文本方向是否自动跟随连线方向

	CaptionPosition *float64 `json:"caption_position,omitempty"` // 文本在连线上的相对位置，范围0-1，0表示在连线的起始点，1表示在连线的终点

	SpecifiedCoordinate *bool `json:"specified_coordinate,omitempty"` // 指定连线坐标及长宽。为 true 时需要用户设置连线的坐标及长宽信息。为 false 时会根据连线的开始、结束端点自动计算连线的坐标及长宽信息

	CaptionPositionType *int `json:"caption_position_type,omitempty"` // 文字相对连线的位置类型，0=OnLine，表示文字在连线那不；1=AboveLine，文字在连线的上方，文字在线的上方，连线走向的上边或左边；2=BellowLine，文字在连线的下方，文字在线的上方，连线走向的下边或右边
}

type ConnectorBuilder struct {
	startObject     *ConnectorAttachedObject // 开始连接节点信息（兼容线上数据，只读，写操作使用 start 字段）
	startObjectFlag bool

	endObject     *ConnectorAttachedObject // 结束连接点信息（兼容线上数据， 只读，写操作使用 end 字段）
	endObjectFlag bool

	start     *ConnectorInfo // 连线端点信息
	startFlag bool

	end     *ConnectorInfo // 连线端点信息
	endFlag bool

	captions     *ConnectorCaption // 连线文本
	captionsFlag bool

	shape     string // 连线类型
	shapeFlag bool

	turningPoints     []*Point // 连线转向点
	turningPointsFlag bool

	captionAutoDirection     bool // 连线上的文本方向是否自动跟随连线方向
	captionAutoDirectionFlag bool

	captionPosition     float64 // 文本在连线上的相对位置，范围0-1，0表示在连线的起始点，1表示在连线的终点
	captionPositionFlag bool

	specifiedCoordinate     bool // 指定连线坐标及长宽。为 true 时需要用户设置连线的坐标及长宽信息。为 false 时会根据连线的开始、结束端点自动计算连线的坐标及长宽信息
	specifiedCoordinateFlag bool

	captionPositionType     int // 文字相对连线的位置类型，0=OnLine，表示文字在连线那不；1=AboveLine，文字在连线的上方，文字在线的上方，连线走向的上边或左边；2=BellowLine，文字在连线的下方，文字在线的上方，连线走向的下边或右边
	captionPositionTypeFlag bool
}

func NewConnectorBuilder() *ConnectorBuilder {
	builder := &ConnectorBuilder{}
	return builder
}

// 开始连接节点信息（兼容线上数据，只读，写操作使用 start 字段）
//
// 示例值：
func (builder *ConnectorBuilder) StartObject(startObject *ConnectorAttachedObject) *ConnectorBuilder {
	builder.startObject = startObject
	builder.startObjectFlag = true
	return builder
}

// 结束连接点信息（兼容线上数据， 只读，写操作使用 end 字段）
//
// 示例值：
func (builder *ConnectorBuilder) EndObject(endObject *ConnectorAttachedObject) *ConnectorBuilder {
	builder.endObject = endObject
	builder.endObjectFlag = true
	return builder
}

// 连线端点信息
//
// 示例值：
func (builder *ConnectorBuilder) Start(start *ConnectorInfo) *ConnectorBuilder {
	builder.start = start
	builder.startFlag = true
	return builder
}

// 连线端点信息
//
// 示例值：
func (builder *ConnectorBuilder) End(end *ConnectorInfo) *ConnectorBuilder {
	builder.end = end
	builder.endFlag = true
	return builder
}

// 连线文本
//
// 示例值：
func (builder *ConnectorBuilder) Captions(captions *ConnectorCaption) *ConnectorBuilder {
	builder.captions = captions
	builder.captionsFlag = true
	return builder
}

// 连线类型
//
// 示例值：straight
func (builder *ConnectorBuilder) Shape(shape string) *ConnectorBuilder {
	builder.shape = shape
	builder.shapeFlag = true
	return builder
}

// 连线转向点
//
// 示例值：
func (builder *ConnectorBuilder) TurningPoints(turningPoints []*Point) *ConnectorBuilder {
	builder.turningPoints = turningPoints
	builder.turningPointsFlag = true
	return builder
}

// 连线上的文本方向是否自动跟随连线方向
//
// 示例值：true
func (builder *ConnectorBuilder) CaptionAutoDirection(captionAutoDirection bool) *ConnectorBuilder {
	builder.captionAutoDirection = captionAutoDirection
	builder.captionAutoDirectionFlag = true
	return builder
}

// 文本在连线上的相对位置，范围0-1，0表示在连线的起始点，1表示在连线的终点
//
// 示例值：0.5
func (builder *ConnectorBuilder) CaptionPosition(captionPosition float64) *ConnectorBuilder {
	builder.captionPosition = captionPosition
	builder.captionPositionFlag = true
	return builder
}

// 指定连线坐标及长宽。为 true 时需要用户设置连线的坐标及长宽信息。为 false 时会根据连线的开始、结束端点自动计算连线的坐标及长宽信息
//
// 示例值：
func (builder *ConnectorBuilder) SpecifiedCoordinate(specifiedCoordinate bool) *ConnectorBuilder {
	builder.specifiedCoordinate = specifiedCoordinate
	builder.specifiedCoordinateFlag = true
	return builder
}

// 文字相对连线的位置类型，0=OnLine，表示文字在连线那不；1=AboveLine，文字在连线的上方，文字在线的上方，连线走向的上边或左边；2=BellowLine，文字在连线的下方，文字在线的上方，连线走向的下边或右边
//
// 示例值：
func (builder *ConnectorBuilder) CaptionPositionType(captionPositionType int) *ConnectorBuilder {
	builder.captionPositionType = captionPositionType
	builder.captionPositionTypeFlag = true
	return builder
}

func (builder *ConnectorBuilder) Build() *Connector {
	req := &Connector{}
	if builder.startObjectFlag {
		req.StartObject = builder.startObject
	}
	if builder.endObjectFlag {
		req.EndObject = builder.endObject
	}
	if builder.startFlag {
		req.Start = builder.start
	}
	if builder.endFlag {
		req.End = builder.end
	}
	if builder.captionsFlag {
		req.Captions = builder.captions
	}
	if builder.shapeFlag {
		req.Shape = &builder.shape

	}
	if builder.turningPointsFlag {
		req.TurningPoints = builder.turningPoints
	}
	if builder.captionAutoDirectionFlag {
		req.CaptionAutoDirection = &builder.captionAutoDirection

	}
	if builder.captionPositionFlag {
		req.CaptionPosition = &builder.captionPosition

	}
	if builder.specifiedCoordinateFlag {
		req.SpecifiedCoordinate = &builder.specifiedCoordinate

	}
	if builder.captionPositionTypeFlag {
		req.CaptionPositionType = &builder.captionPositionType

	}
	return req
}

type ConnectorAttachedObject struct {
	Id *string `json:"id,omitempty"` // 连接图形的 id

	SnapTo *string `json:"snap_to,omitempty"` // 连接图形的方向

	Position *Point `json:"position,omitempty"` // 连接图形的相对坐标，0-1
}

type ConnectorAttachedObjectBuilder struct {
	id     string // 连接图形的 id
	idFlag bool

	snapTo     string // 连接图形的方向
	snapToFlag bool

	position     *Point // 连接图形的相对坐标，0-1
	positionFlag bool
}

func NewConnectorAttachedObjectBuilder() *ConnectorAttachedObjectBuilder {
	builder := &ConnectorAttachedObjectBuilder{}
	return builder
}

// 连接图形的 id
//
// 示例值：o1:1
func (builder *ConnectorAttachedObjectBuilder) Id(id string) *ConnectorAttachedObjectBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 连接图形的方向
//
// 示例值：auto
func (builder *ConnectorAttachedObjectBuilder) SnapTo(snapTo string) *ConnectorAttachedObjectBuilder {
	builder.snapTo = snapTo
	builder.snapToFlag = true
	return builder
}

// 连接图形的相对坐标，0-1
//
// 示例值：
func (builder *ConnectorAttachedObjectBuilder) Position(position *Point) *ConnectorAttachedObjectBuilder {
	builder.position = position
	builder.positionFlag = true
	return builder
}

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

	}
	if builder.snapToFlag {
		req.SnapTo = &builder.snapTo

	}
	if builder.positionFlag {
		req.Position = builder.position
	}
	return req
}

type ConnectorCaption struct {
	Data []*Text `json:"data,omitempty"` // 文本
}

type ConnectorCaptionBuilder struct {
	data     []*Text // 文本
	dataFlag bool
}

func NewConnectorCaptionBuilder() *ConnectorCaptionBuilder {
	builder := &ConnectorCaptionBuilder{}
	return builder
}

// 文本
//
// 示例值：
func (builder *ConnectorCaptionBuilder) Data(data []*Text) *ConnectorCaptionBuilder {
	builder.data = data
	builder.dataFlag = true
	return builder
}

func (builder *ConnectorCaptionBuilder) Build() *ConnectorCaption {
	req := &ConnectorCaption{}
	if builder.dataFlag {
		req.Data = builder.data
	}
	return req
}

type ConnectorInfo struct {
	AttachedObject *ConnectorAttachedObject `json:"attached_object,omitempty"` // 连接图形信息

	Position *Point `json:"position,omitempty"` // 连线端点在画布内的坐标，position与attached_object二选一

	ArrowStyle *string `json:"arrow_style,omitempty"` // 连线端点箭头样式
}

type ConnectorInfoBuilder struct {
	attachedObject     *ConnectorAttachedObject // 连接图形信息
	attachedObjectFlag bool

	position     *Point // 连线端点在画布内的坐标，position与attached_object二选一
	positionFlag bool

	arrowStyle     string // 连线端点箭头样式
	arrowStyleFlag bool
}

func NewConnectorInfoBuilder() *ConnectorInfoBuilder {
	builder := &ConnectorInfoBuilder{}
	return builder
}

// 连接图形信息
//
// 示例值：
func (builder *ConnectorInfoBuilder) AttachedObject(attachedObject *ConnectorAttachedObject) *ConnectorInfoBuilder {
	builder.attachedObject = attachedObject
	builder.attachedObjectFlag = true
	return builder
}

// 连线端点在画布内的坐标，position与attached_object二选一
//
// 示例值：
func (builder *ConnectorInfoBuilder) Position(position *Point) *ConnectorInfoBuilder {
	builder.position = position
	builder.positionFlag = true
	return builder
}

// 连线端点箭头样式
//
// 示例值：line_arrow
func (builder *ConnectorInfoBuilder) ArrowStyle(arrowStyle string) *ConnectorInfoBuilder {
	builder.arrowStyle = arrowStyle
	builder.arrowStyleFlag = true
	return builder
}

func (builder *ConnectorInfoBuilder) Build() *ConnectorInfo {
	req := &ConnectorInfo{}
	if builder.attachedObjectFlag {
		req.AttachedObject = builder.attachedObject
	}
	if builder.positionFlag {
		req.Position = builder.position
	}
	if builder.arrowStyleFlag {
		req.ArrowStyle = &builder.arrowStyle

	}
	return req
}

type Cube struct {
	ControlPoint *Point `json:"control_point,omitempty"` // 六面体控制点，相对六面体外接矩形的相对坐标。默认控制点为外接矩形长的0.8，宽的0.25
}

type CubeBuilder struct {
	controlPoint     *Point // 六面体控制点，相对六面体外接矩形的相对坐标。默认控制点为外接矩形长的0.8，宽的0.25
	controlPointFlag bool
}

func NewCubeBuilder() *CubeBuilder {
	builder := &CubeBuilder{}
	return builder
}

// 六面体控制点，相对六面体外接矩形的相对坐标。默认控制点为外接矩形长的0.8，宽的0.25
//
// 示例值：
func (builder *CubeBuilder) ControlPoint(controlPoint *Point) *CubeBuilder {
	builder.controlPoint = controlPoint
	builder.controlPointFlag = true
	return builder
}

func (builder *CubeBuilder) Build() *Cube {
	req := &Cube{}
	if builder.controlPointFlag {
		req.ControlPoint = builder.controlPoint
	}
	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 Head struct {
	Id *string `json:"id,omitempty"` // 请求方的id deprecated

	TenantId *string `json:"tenant_id,omitempty"` // 请求方的组织，在多租户业务中使用

	AppId *string `json:"app_id,omitempty"` // 请求方的appid

	OpenId *string `json:"open_id,omitempty"` // 开放平台的OpenID

	TenantKey *string `json:"tenant_key,omitempty"` // 如果小程序登录，这个是原始的信息，和OpenID是一个意思

	Auth *AuthInfo `json:"auth,omitempty"` // thrift --gen go idl/common.thrift

	Fields map[string]string `json:"fields,omitempty"` // $ plugin output

	Env *string `json:"env,omitempty"` // Header的环境

	Resource *string `json:"resource,omitempty"` // 资源

	Locale *string `json:"locale,omitempty"` // 200: optional HttpHeader HttpHeader (api.json="HttpHeader"), //$ 从HttpHeader透传的HttpHeader\n$ 所在区域，参考:https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9F%9F%E8%AE%BE%E7%BD%AE的简称

	Client *ClientInfo `json:"client,omitempty"` // $ 客户端信息
}

type HeadBuilder struct {
	id     string // 请求方的id deprecated
	idFlag bool

	tenantId     string // 请求方的组织，在多租户业务中使用
	tenantIdFlag bool

	appId     string // 请求方的appid
	appIdFlag bool

	openId     string // 开放平台的OpenID
	openIdFlag bool

	tenantKey     string // 如果小程序登录，这个是原始的信息，和OpenID是一个意思
	tenantKeyFlag bool

	auth     *AuthInfo // thrift --gen go idl/common.thrift
	authFlag bool

	fields     map[string]string // $ plugin output
	fieldsFlag bool

	env     string // Header的环境
	envFlag bool

	resource     string // 资源
	resourceFlag bool

	locale     string // 200: optional HttpHeader HttpHeader (api.json="HttpHeader"), //$ 从HttpHeader透传的HttpHeader\n$ 所在区域，参考:https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9F%9F%E8%AE%BE%E7%BD%AE的简称
	localeFlag bool

	client     *ClientInfo // $ 客户端信息
	clientFlag bool
}

func NewHeadBuilder() *HeadBuilder {
	builder := &HeadBuilder{}
	return builder
}

// 请求方的id deprecated
//
// 示例值：
func (builder *HeadBuilder) Id(id string) *HeadBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 请求方的组织，在多租户业务中使用
//
// 示例值：
func (builder *HeadBuilder) TenantId(tenantId string) *HeadBuilder {
	builder.tenantId = tenantId
	builder.tenantIdFlag = true
	return builder
}

// 请求方的appid
//
// 示例值：
func (builder *HeadBuilder) AppId(appId string) *HeadBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 开放平台的OpenID
//
// 示例值：
func (builder *HeadBuilder) OpenId(openId string) *HeadBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 如果小程序登录，这个是原始的信息，和OpenID是一个意思
//
// 示例值：
func (builder *HeadBuilder) TenantKey(tenantKey string) *HeadBuilder {
	builder.tenantKey = tenantKey
	builder.tenantKeyFlag = true
	return builder
}

// thrift --gen go idl/common.thrift
//
// 示例值：
func (builder *HeadBuilder) Auth(auth *AuthInfo) *HeadBuilder {
	builder.auth = auth
	builder.authFlag = true
	return builder
}

// $ plugin output
//
// 示例值：
func (builder *HeadBuilder) Fields(fields map[string]string) *HeadBuilder {
	builder.fields = fields
	builder.fieldsFlag = true
	return builder
}

// Header的环境
//
// 示例值：
func (builder *HeadBuilder) Env(env string) *HeadBuilder {
	builder.env = env
	builder.envFlag = true
	return builder
}

// 资源
//
// 示例值：
func (builder *HeadBuilder) Resource(resource string) *HeadBuilder {
	builder.resource = resource
	builder.resourceFlag = true
	return builder
}

// 200: optional HttpHeader HttpHeader (api.json="HttpHeader"), //$ 从HttpHeader透传的HttpHeader\n$ 所在区域，参考:https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9F%9F%E8%AE%BE%E7%BD%AE的简称
//
// 示例值：
func (builder *HeadBuilder) Locale(locale string) *HeadBuilder {
	builder.locale = locale
	builder.localeFlag = true
	return builder
}

// $ 客户端信息
//
// 示例值：
func (builder *HeadBuilder) Client(client *ClientInfo) *HeadBuilder {
	builder.client = client
	builder.clientFlag = true
	return builder
}

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

	}
	if builder.tenantIdFlag {
		req.TenantId = &builder.tenantId

	}
	if builder.appIdFlag {
		req.AppId = &builder.appId

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

	}
	if builder.tenantKeyFlag {
		req.TenantKey = &builder.tenantKey

	}
	if builder.authFlag {
		req.Auth = builder.auth
	}
	if builder.fieldsFlag {
		req.Fields = builder.fields
	}
	if builder.envFlag {
		req.Env = &builder.env

	}
	if builder.resourceFlag {
		req.Resource = &builder.resource

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

	}
	if builder.clientFlag {
		req.Client = builder.client
	}
	return req
}

type Image struct {
	Token *string `json:"token,omitempty"` // 图片 token
}

type ImageBuilder struct {
	token     string // 图片 token
	tokenFlag bool
}

func NewImageBuilder() *ImageBuilder {
	builder := &ImageBuilder{}
	return builder
}

// 图片 token
//
// 示例值：EeSHb3qs9oSBXoxvw33bqtOsczb
func (builder *ImageBuilder) Token(token string) *ImageBuilder {
	builder.token = token
	builder.tokenFlag = true
	return builder
}

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

	}
	return req
}

type Lifeline struct {
	Size *float64 `json:"size,omitempty"` // 生命线长度

	Type *string `json:"type,omitempty"` // 生命线类型
}

type LifelineBuilder struct {
	size     float64 // 生命线长度
	sizeFlag bool

	type_    string // 生命线类型
	typeFlag bool
}

func NewLifelineBuilder() *LifelineBuilder {
	builder := &LifelineBuilder{}
	return builder
}

// 生命线长度
//
// 示例值：10
func (builder *LifelineBuilder) Size(size float64) *LifelineBuilder {
	builder.size = size
	builder.sizeFlag = true
	return builder
}

// 生命线类型
//
// 示例值：actor_lifeline
func (builder *LifelineBuilder) Type(type_ string) *LifelineBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *LifelineBuilder) Build() *Lifeline {
	req := &Lifeline{}
	if builder.sizeFlag {
		req.Size = &builder.size

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

	}
	return req
}

type MindMap struct {
	ParentId *string `json:"parent_id,omitempty"` // 父节点id
}

type MindMapBuilder struct {
	parentId     string // 父节点id
	parentIdFlag bool
}

func NewMindMapBuilder() *MindMapBuilder {
	builder := &MindMapBuilder{}
	return builder
}

// 父节点id
//
// 示例值：z1:1
func (builder *MindMapBuilder) ParentId(parentId string) *MindMapBuilder {
	builder.parentId = parentId
	builder.parentIdFlag = true
	return builder
}

func (builder *MindMapBuilder) Build() *MindMap {
	req := &MindMap{}
	if builder.parentIdFlag {
		req.ParentId = &builder.parentId

	}
	return req
}

type MindMapNode struct {
	ParentId *string `json:"parent_id,omitempty"` // 思维导图节点的父节点，必须为思维导图节点

	Type *string `json:"type,omitempty"` // 思维导图节点图形类型

	ZIndex *int `json:"z_index,omitempty"` // 思维导图节点在兄弟节点中的位置index

	LayoutPosition *string `json:"layout_position,omitempty"` // 子节点相对根节点的方向（根节点下的子节点设置才生效）

	Children []string `json:"children,omitempty"` // 子节点列表

	Collapsed *bool `json:"collapsed,omitempty"` // 是否收起子节点
}

type MindMapNodeBuilder struct {
	parentId     string // 思维导图节点的父节点，必须为思维导图节点
	parentIdFlag bool

	type_    string // 思维导图节点图形类型
	typeFlag bool

	zIndex     int // 思维导图节点在兄弟节点中的位置index
	zIndexFlag bool

	layoutPosition     string // 子节点相对根节点的方向（根节点下的子节点设置才生效）
	layoutPositionFlag bool

	children     []string // 子节点列表
	childrenFlag bool

	collapsed     bool // 是否收起子节点
	collapsedFlag bool
}

func NewMindMapNodeBuilder() *MindMapNodeBuilder {
	builder := &MindMapNodeBuilder{}
	return builder
}

// 思维导图节点的父节点，必须为思维导图节点
//
// 示例值：z1:1
func (builder *MindMapNodeBuilder) ParentId(parentId string) *MindMapNodeBuilder {
	builder.parentId = parentId
	builder.parentIdFlag = true
	return builder
}

// 思维导图节点图形类型
//
// 示例值：
func (builder *MindMapNodeBuilder) Type(type_ string) *MindMapNodeBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 思维导图节点在兄弟节点中的位置index
//
// 示例值：2
func (builder *MindMapNodeBuilder) ZIndex(zIndex int) *MindMapNodeBuilder {
	builder.zIndex = zIndex
	builder.zIndexFlag = true
	return builder
}

// 子节点相对根节点的方向（根节点下的子节点设置才生效）
//
// 示例值：left
func (builder *MindMapNodeBuilder) LayoutPosition(layoutPosition string) *MindMapNodeBuilder {
	builder.layoutPosition = layoutPosition
	builder.layoutPositionFlag = true
	return builder
}

// 子节点列表
//
// 示例值：
func (builder *MindMapNodeBuilder) Children(children []string) *MindMapNodeBuilder {
	builder.children = children
	builder.childrenFlag = true
	return builder
}

// 是否收起子节点
//
// 示例值：
func (builder *MindMapNodeBuilder) Collapsed(collapsed bool) *MindMapNodeBuilder {
	builder.collapsed = collapsed
	builder.collapsedFlag = true
	return builder
}

func (builder *MindMapNodeBuilder) Build() *MindMapNode {
	req := &MindMapNode{}
	if builder.parentIdFlag {
		req.ParentId = &builder.parentId

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

	}
	if builder.zIndexFlag {
		req.ZIndex = &builder.zIndex

	}
	if builder.layoutPositionFlag {
		req.LayoutPosition = &builder.layoutPosition

	}
	if builder.childrenFlag {
		req.Children = builder.children
	}
	if builder.collapsedFlag {
		req.Collapsed = &builder.collapsed

	}
	return req
}

type MindMapRoot struct {
	Layout *string `json:"layout,omitempty"` // 思维导图布局方式

	Type *string `json:"type,omitempty"` // 思维导图根节点图形类型

	LineStyle *string `json:"line_style,omitempty"` // 思维导图图形连接线样式

	UpChildren []string `json:"up_children,omitempty"` // 思维导图上布局子节点关系树

	DownChildren []string `json:"down_children,omitempty"` // 思维导图下布局子节点关系树

	LeftChildren []string `json:"left_children,omitempty"` // 思维导图左布局子节点关系树

	RightChildren []string `json:"right_children,omitempty"` // 思维导图右布局子节点关系树
}

type MindMapRootBuilder struct {
	layout     string // 思维导图布局方式
	layoutFlag bool

	type_    string // 思维导图根节点图形类型
	typeFlag bool

	lineStyle     string // 思维导图图形连接线样式
	lineStyleFlag bool

	upChildren     []string // 思维导图上布局子节点关系树
	upChildrenFlag bool

	downChildren     []string // 思维导图下布局子节点关系树
	downChildrenFlag bool

	leftChildren     []string // 思维导图左布局子节点关系树
	leftChildrenFlag bool

	rightChildren     []string // 思维导图右布局子节点关系树
	rightChildrenFlag bool
}

func NewMindMapRootBuilder() *MindMapRootBuilder {
	builder := &MindMapRootBuilder{}
	return builder
}

// 思维导图布局方式
//
// 示例值：
func (builder *MindMapRootBuilder) Layout(layout string) *MindMapRootBuilder {
	builder.layout = layout
	builder.layoutFlag = true
	return builder
}

// 思维导图根节点图形类型
//
// 示例值：
func (builder *MindMapRootBuilder) Type(type_ string) *MindMapRootBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 思维导图图形连接线样式
//
// 示例值：
func (builder *MindMapRootBuilder) LineStyle(lineStyle string) *MindMapRootBuilder {
	builder.lineStyle = lineStyle
	builder.lineStyleFlag = true
	return builder
}

// 思维导图上布局子节点关系树
//
// 示例值：
func (builder *MindMapRootBuilder) UpChildren(upChildren []string) *MindMapRootBuilder {
	builder.upChildren = upChildren
	builder.upChildrenFlag = true
	return builder
}

// 思维导图下布局子节点关系树
//
// 示例值：
func (builder *MindMapRootBuilder) DownChildren(downChildren []string) *MindMapRootBuilder {
	builder.downChildren = downChildren
	builder.downChildrenFlag = true
	return builder
}

// 思维导图左布局子节点关系树
//
// 示例值：
func (builder *MindMapRootBuilder) LeftChildren(leftChildren []string) *MindMapRootBuilder {
	builder.leftChildren = leftChildren
	builder.leftChildrenFlag = true
	return builder
}

// 思维导图右布局子节点关系树
//
// 示例值：
func (builder *MindMapRootBuilder) RightChildren(rightChildren []string) *MindMapRootBuilder {
	builder.rightChildren = rightChildren
	builder.rightChildrenFlag = true
	return builder
}

func (builder *MindMapRootBuilder) Build() *MindMapRoot {
	req := &MindMapRoot{}
	if builder.layoutFlag {
		req.Layout = &builder.layout

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

	}
	if builder.lineStyleFlag {
		req.LineStyle = &builder.lineStyle

	}
	if builder.upChildrenFlag {
		req.UpChildren = builder.upChildren
	}
	if builder.downChildrenFlag {
		req.DownChildren = builder.downChildren
	}
	if builder.leftChildrenFlag {
		req.LeftChildren = builder.leftChildren
	}
	if builder.rightChildrenFlag {
		req.RightChildren = builder.rightChildren
	}
	return req
}

type Paint struct {
	Type *string `json:"type,omitempty"` // 画笔类型

	Lines []*Point `json:"lines,omitempty"` // 画板线段，由系列坐标点表示

	Width *int `json:"width,omitempty"` // 画笔粗细，单位px

	Color *string `json:"color,omitempty"` // 画笔颜色
}

type PaintBuilder struct {
	type_    string // 画笔类型
	typeFlag bool

	lines     []*Point // 画板线段，由系列坐标点表示
	linesFlag bool

	width     int // 画笔粗细，单位px
	widthFlag bool

	color     string // 画笔颜色
	colorFlag bool
}

func NewPaintBuilder() *PaintBuilder {
	builder := &PaintBuilder{}
	return builder
}

// 画笔类型
//
// 示例值：marker
func (builder *PaintBuilder) Type(type_ string) *PaintBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 画板线段，由系列坐标点表示
//
// 示例值：
func (builder *PaintBuilder) Lines(lines []*Point) *PaintBuilder {
	builder.lines = lines
	builder.linesFlag = true
	return builder
}

// 画笔粗细，单位px
//
// 示例值：7
func (builder *PaintBuilder) Width(width int) *PaintBuilder {
	builder.width = width
	builder.widthFlag = true
	return builder
}

// 画笔颜色
//
// 示例值：#ffffff
func (builder *PaintBuilder) Color(color string) *PaintBuilder {
	builder.color = color
	builder.colorFlag = true
	return builder
}

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

	}
	if builder.linesFlag {
		req.Lines = builder.lines
	}
	if builder.widthFlag {
		req.Width = &builder.width

	}
	if builder.colorFlag {
		req.Color = &builder.color

	}
	return req
}

type Pie struct {
	StartRadialLineAngle *float64 `json:"start_radial_line_angle,omitempty"` // 开始径向边角度，水平向右x轴正方向为0度，顺时针方向角度值递增

	CentralAngle *float64 `json:"central_angle,omitempty"` // 圆心角角度，角度方向为始径向边逆时针方向

	Radius *float64 `json:"radius,omitempty"` // 半径长度

	SectorRatio *float64 `json:"sector_ratio,omitempty"` // 扇区占比，0为一个圆周线，1为一个圆盘
}

type PieBuilder struct {
	startRadialLineAngle     float64 // 开始径向边角度，水平向右x轴正方向为0度，顺时针方向角度值递增
	startRadialLineAngleFlag bool

	centralAngle     float64 // 圆心角角度，角度方向为始径向边逆时针方向
	centralAngleFlag bool

	radius     float64 // 半径长度
	radiusFlag bool

	sectorRatio     float64 // 扇区占比，0为一个圆周线，1为一个圆盘
	sectorRatioFlag bool
}

func NewPieBuilder() *PieBuilder {
	builder := &PieBuilder{}
	return builder
}

// 开始径向边角度，水平向右x轴正方向为0度，顺时针方向角度值递增
//
// 示例值：30.0
func (builder *PieBuilder) StartRadialLineAngle(startRadialLineAngle float64) *PieBuilder {
	builder.startRadialLineAngle = startRadialLineAngle
	builder.startRadialLineAngleFlag = true
	return builder
}

// 圆心角角度，角度方向为始径向边逆时针方向
//
// 示例值：40.0
func (builder *PieBuilder) CentralAngle(centralAngle float64) *PieBuilder {
	builder.centralAngle = centralAngle
	builder.centralAngleFlag = true
	return builder
}

// 半径长度
//
// 示例值：10
func (builder *PieBuilder) Radius(radius float64) *PieBuilder {
	builder.radius = radius
	builder.radiusFlag = true
	return builder
}

// 扇区占比，0为一个圆周线，1为一个圆盘
//
// 示例值：1
func (builder *PieBuilder) SectorRatio(sectorRatio float64) *PieBuilder {
	builder.sectorRatio = sectorRatio
	builder.sectorRatioFlag = true
	return builder
}

func (builder *PieBuilder) Build() *Pie {
	req := &Pie{}
	if builder.startRadialLineAngleFlag {
		req.StartRadialLineAngle = &builder.startRadialLineAngle

	}
	if builder.centralAngleFlag {
		req.CentralAngle = &builder.centralAngle

	}
	if builder.radiusFlag {
		req.Radius = &builder.radius

	}
	if builder.sectorRatioFlag {
		req.SectorRatio = &builder.sectorRatio

	}
	return req
}

type Point struct {
	X *float64 `json:"x,omitempty"` // 点位置x坐标

	Y *float64 `json:"y,omitempty"` // 点位置y坐标
}

type PointBuilder struct {
	x     float64 // 点位置x坐标
	xFlag bool

	y     float64 // 点位置y坐标
	yFlag bool
}

func NewPointBuilder() *PointBuilder {
	builder := &PointBuilder{}
	return builder
}

// 点位置x坐标
//
// 示例值：10
func (builder *PointBuilder) X(x float64) *PointBuilder {
	builder.x = x
	builder.xFlag = true
	return builder
}

// 点位置y坐标
//
// 示例值：10
func (builder *PointBuilder) Y(y float64) *PointBuilder {
	builder.y = y
	builder.yFlag = true
	return builder
}

func (builder *PointBuilder) Build() *Point {
	req := &Point{}
	if builder.xFlag {
		req.X = &builder.x

	}
	if builder.yFlag {
		req.Y = &builder.y

	}
	return req
}

type RichText struct {
	Paragraphs []*RichTextParagraph `json:"paragraphs,omitempty"` // 段落列表
}

type RichTextBuilder struct {
	paragraphs     []*RichTextParagraph // 段落列表
	paragraphsFlag bool
}

func NewRichTextBuilder() *RichTextBuilder {
	builder := &RichTextBuilder{}
	return builder
}

// 段落列表
//
// 示例值：
func (builder *RichTextBuilder) Paragraphs(paragraphs []*RichTextParagraph) *RichTextBuilder {
	builder.paragraphs = paragraphs
	builder.paragraphsFlag = true
	return builder
}

func (builder *RichTextBuilder) Build() *RichText {
	req := &RichText{}
	if builder.paragraphsFlag {
		req.Paragraphs = builder.paragraphs
	}
	return req
}

type RichTextElement struct {
	ElementType *int `json:"element_type,omitempty"` // 元素类别

	TextElement *RichTextElementText `json:"text_element,omitempty"` // 文本类别信息

	LinkElement *RichTextElementLink `json:"link_element,omitempty"` // 超链接类别信息

	MentionUserElement *RichTextElementMentionUser `json:"mention_user_element,omitempty"` // @用户类别信息

	MentionDocElement *RichTextElementMentionDoc `json:"mention_doc_element,omitempty"` // 文档类别信息
}

type RichTextElementBuilder struct {
	elementType     int // 元素类别
	elementTypeFlag bool

	textElement     *RichTextElementText // 文本类别信息
	textElementFlag bool

	linkElement     *RichTextElementLink // 超链接类别信息
	linkElementFlag bool

	mentionUserElement     *RichTextElementMentionUser // @用户类别信息
	mentionUserElementFlag bool

	mentionDocElement     *RichTextElementMentionDoc // 文档类别信息
	mentionDocElementFlag bool
}

func NewRichTextElementBuilder() *RichTextElementBuilder {
	builder := &RichTextElementBuilder{}
	return builder
}

// 元素类别
//
// 示例值：
func (builder *RichTextElementBuilder) ElementType(elementType int) *RichTextElementBuilder {
	builder.elementType = elementType
	builder.elementTypeFlag = true
	return builder
}

// 文本类别信息
//
// 示例值：
func (builder *RichTextElementBuilder) TextElement(textElement *RichTextElementText) *RichTextElementBuilder {
	builder.textElement = textElement
	builder.textElementFlag = true
	return builder
}

// 超链接类别信息
//
// 示例值：
func (builder *RichTextElementBuilder) LinkElement(linkElement *RichTextElementLink) *RichTextElementBuilder {
	builder.linkElement = linkElement
	builder.linkElementFlag = true
	return builder
}

// @用户类别信息
//
// 示例值：
func (builder *RichTextElementBuilder) MentionUserElement(mentionUserElement *RichTextElementMentionUser) *RichTextElementBuilder {
	builder.mentionUserElement = mentionUserElement
	builder.mentionUserElementFlag = true
	return builder
}

// 文档类别信息
//
// 示例值：
func (builder *RichTextElementBuilder) MentionDocElement(mentionDocElement *RichTextElementMentionDoc) *RichTextElementBuilder {
	builder.mentionDocElement = mentionDocElement
	builder.mentionDocElementFlag = true
	return builder
}

func (builder *RichTextElementBuilder) Build() *RichTextElement {
	req := &RichTextElement{}
	if builder.elementTypeFlag {
		req.ElementType = &builder.elementType

	}
	if builder.textElementFlag {
		req.TextElement = builder.textElement
	}
	if builder.linkElementFlag {
		req.LinkElement = builder.linkElement
	}
	if builder.mentionUserElementFlag {
		req.MentionUserElement = builder.mentionUserElement
	}
	if builder.mentionDocElementFlag {
		req.MentionDocElement = builder.mentionDocElement
	}
	return req
}

type RichTextElementLink struct {
	Herf *string `json:"herf,omitempty"` // 链接

	Text *string `json:"text,omitempty"` // 文字

	TextStyle *RichTextElementTextStyle `json:"text_style,omitempty"` // 文字样式
}

type RichTextElementLinkBuilder struct {
	herf     string // 链接
	herfFlag bool

	text     string // 文字
	textFlag bool

	textStyle     *RichTextElementTextStyle // 文字样式
	textStyleFlag bool
}

func NewRichTextElementLinkBuilder() *RichTextElementLinkBuilder {
	builder := &RichTextElementLinkBuilder{}
	return builder
}

// 链接
//
// 示例值：https://bytedance.larkoffice.com
func (builder *RichTextElementLinkBuilder) Herf(herf string) *RichTextElementLinkBuilder {
	builder.herf = herf
	builder.herfFlag = true
	return builder
}

// 文字
//
// 示例值：示例文案
func (builder *RichTextElementLinkBuilder) Text(text string) *RichTextElementLinkBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 文字样式
//
// 示例值：
func (builder *RichTextElementLinkBuilder) TextStyle(textStyle *RichTextElementTextStyle) *RichTextElementLinkBuilder {
	builder.textStyle = textStyle
	builder.textStyleFlag = true
	return builder
}

func (builder *RichTextElementLinkBuilder) Build() *RichTextElementLink {
	req := &RichTextElementLink{}
	if builder.herfFlag {
		req.Herf = &builder.herf

	}
	if builder.textFlag {
		req.Text = &builder.text

	}
	if builder.textStyleFlag {
		req.TextStyle = builder.textStyle
	}
	return req
}

type RichTextElementMentionDoc struct {
	DocUrl *string `json:"doc_url,omitempty"` // 文档超链接

	TextStyle *RichTextElementTextStyle `json:"text_style,omitempty"` // 文字样式
}

type RichTextElementMentionDocBuilder struct {
	docUrl     string // 文档超链接
	docUrlFlag bool

	textStyle     *RichTextElementTextStyle // 文字样式
	textStyleFlag bool
}

func NewRichTextElementMentionDocBuilder() *RichTextElementMentionDocBuilder {
	builder := &RichTextElementMentionDocBuilder{}
	return builder
}

// 文档超链接
//
// 示例值：https://bytedance.larkoffice.com/wiki/xxxxx
func (builder *RichTextElementMentionDocBuilder) DocUrl(docUrl string) *RichTextElementMentionDocBuilder {
	builder.docUrl = docUrl
	builder.docUrlFlag = true
	return builder
}

// 文字样式
//
// 示例值：
func (builder *RichTextElementMentionDocBuilder) TextStyle(textStyle *RichTextElementTextStyle) *RichTextElementMentionDocBuilder {
	builder.textStyle = textStyle
	builder.textStyleFlag = true
	return builder
}

func (builder *RichTextElementMentionDocBuilder) Build() *RichTextElementMentionDoc {
	req := &RichTextElementMentionDoc{}
	if builder.docUrlFlag {
		req.DocUrl = &builder.docUrl

	}
	if builder.textStyleFlag {
		req.TextStyle = builder.textStyle
	}
	return req
}

type RichTextElementMentionUser struct {
	UserId *string `json:"user_id,omitempty"` // 用户id

	TextStyle *RichTextElementTextStyle `json:"text_style,omitempty"` // 文字属性
}

type RichTextElementMentionUserBuilder struct {
	userId     string // 用户id
	userIdFlag bool

	textStyle     *RichTextElementTextStyle // 文字属性
	textStyleFlag bool
}

func NewRichTextElementMentionUserBuilder() *RichTextElementMentionUserBuilder {
	builder := &RichTextElementMentionUserBuilder{}
	return builder
}

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

// 文字属性
//
// 示例值：
func (builder *RichTextElementMentionUserBuilder) TextStyle(textStyle *RichTextElementTextStyle) *RichTextElementMentionUserBuilder {
	builder.textStyle = textStyle
	builder.textStyleFlag = true
	return builder
}

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

	}
	if builder.textStyleFlag {
		req.TextStyle = builder.textStyle
	}
	return req
}

type RichTextElementText struct {
	Text *string `json:"text,omitempty"` // 文字

	TextStyle *RichTextElementTextStyle `json:"text_style,omitempty"` // 文字样式
}

type RichTextElementTextBuilder struct {
	text     string // 文字
	textFlag bool

	textStyle     *RichTextElementTextStyle // 文字样式
	textStyleFlag bool
}

func NewRichTextElementTextBuilder() *RichTextElementTextBuilder {
	builder := &RichTextElementTextBuilder{}
	return builder
}

// 文字
//
// 示例值：示例文案
func (builder *RichTextElementTextBuilder) Text(text string) *RichTextElementTextBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 文字样式
//
// 示例值：
func (builder *RichTextElementTextBuilder) TextStyle(textStyle *RichTextElementTextStyle) *RichTextElementTextBuilder {
	builder.textStyle = textStyle
	builder.textStyleFlag = true
	return builder
}

func (builder *RichTextElementTextBuilder) Build() *RichTextElementText {
	req := &RichTextElementText{}
	if builder.textFlag {
		req.Text = &builder.text

	}
	if builder.textStyleFlag {
		req.TextStyle = builder.textStyle
	}
	return req
}

type RichTextElementTextStyle struct {
	FontWeight *string `json:"font_weight,omitempty"` // 文字字重

	FontSize *int `json:"font_size,omitempty"` // 文字大小

	TextColor *string `json:"text_color,omitempty"` // 文字颜色，16 进制 rgb 值

	TextBackgroundColor *string `json:"text_background_color,omitempty"` // 文字背景色，16 进制 rgb 值

	LineThrough *bool `json:"line_through,omitempty"` // 是否存在删除线

	Underline *bool `json:"underline,omitempty"` // 是否存在下划线

	Italic *bool `json:"italic,omitempty"` // 是否斜体
}

type RichTextElementTextStyleBuilder struct {
	fontWeight     string // 文字字重
	fontWeightFlag bool

	fontSize     int // 文字大小
	fontSizeFlag bool

	textColor     string // 文字颜色，16 进制 rgb 值
	textColorFlag bool

	textBackgroundColor     string // 文字背景色，16 进制 rgb 值
	textBackgroundColorFlag bool

	lineThrough     bool // 是否存在删除线
	lineThroughFlag bool

	underline     bool // 是否存在下划线
	underlineFlag bool

	italic     bool // 是否斜体
	italicFlag bool
}

func NewRichTextElementTextStyleBuilder() *RichTextElementTextStyleBuilder {
	builder := &RichTextElementTextStyleBuilder{}
	return builder
}

// 文字字重
//
// 示例值：bold
func (builder *RichTextElementTextStyleBuilder) FontWeight(fontWeight string) *RichTextElementTextStyleBuilder {
	builder.fontWeight = fontWeight
	builder.fontWeightFlag = true
	return builder
}

// 文字大小
//
// 示例值：14
func (builder *RichTextElementTextStyleBuilder) FontSize(fontSize int) *RichTextElementTextStyleBuilder {
	builder.fontSize = fontSize
	builder.fontSizeFlag = true
	return builder
}

// 文字颜色，16 进制 rgb 值
//
// 示例值：#000000
func (builder *RichTextElementTextStyleBuilder) TextColor(textColor string) *RichTextElementTextStyleBuilder {
	builder.textColor = textColor
	builder.textColorFlag = true
	return builder
}

// 文字背景色，16 进制 rgb 值
//
// 示例值：#000000
func (builder *RichTextElementTextStyleBuilder) TextBackgroundColor(textBackgroundColor string) *RichTextElementTextStyleBuilder {
	builder.textBackgroundColor = textBackgroundColor
	builder.textBackgroundColorFlag = true
	return builder
}

// 是否存在删除线
//
// 示例值：
func (builder *RichTextElementTextStyleBuilder) LineThrough(lineThrough bool) *RichTextElementTextStyleBuilder {
	builder.lineThrough = lineThrough
	builder.lineThroughFlag = true
	return builder
}

// 是否存在下划线
//
// 示例值：
func (builder *RichTextElementTextStyleBuilder) Underline(underline bool) *RichTextElementTextStyleBuilder {
	builder.underline = underline
	builder.underlineFlag = true
	return builder
}

// 是否斜体
//
// 示例值：
func (builder *RichTextElementTextStyleBuilder) Italic(italic bool) *RichTextElementTextStyleBuilder {
	builder.italic = italic
	builder.italicFlag = true
	return builder
}

func (builder *RichTextElementTextStyleBuilder) Build() *RichTextElementTextStyle {
	req := &RichTextElementTextStyle{}
	if builder.fontWeightFlag {
		req.FontWeight = &builder.fontWeight

	}
	if builder.fontSizeFlag {
		req.FontSize = &builder.fontSize

	}
	if builder.textColorFlag {
		req.TextColor = &builder.textColor

	}
	if builder.textBackgroundColorFlag {
		req.TextBackgroundColor = &builder.textBackgroundColor

	}
	if builder.lineThroughFlag {
		req.LineThrough = &builder.lineThrough

	}
	if builder.underlineFlag {
		req.Underline = &builder.underline

	}
	if builder.italicFlag {
		req.Italic = &builder.italic

	}
	return req
}

type RichTextParagraph struct {
	ParagraphType *int `json:"paragraph_type,omitempty"` // 段落类别

	Elements []*RichTextElement `json:"elements,omitempty"` // 元素列表

	Indent *int `json:"indent,omitempty"` // 缩进

	ListBeginIndex *int `json:"list_begin_index,omitempty"` // 有序列表开始序号

	Quote *bool `json:"quote,omitempty"` // 引用
}

type RichTextParagraphBuilder struct {
	paragraphType     int // 段落类别
	paragraphTypeFlag bool

	elements     []*RichTextElement // 元素列表
	elementsFlag bool

	indent     int // 缩进
	indentFlag bool

	listBeginIndex     int // 有序列表开始序号
	listBeginIndexFlag bool

	quote     bool // 引用
	quoteFlag bool
}

func NewRichTextParagraphBuilder() *RichTextParagraphBuilder {
	builder := &RichTextParagraphBuilder{}
	return builder
}

// 段落类别
//
// 示例值：
func (builder *RichTextParagraphBuilder) ParagraphType(paragraphType int) *RichTextParagraphBuilder {
	builder.paragraphType = paragraphType
	builder.paragraphTypeFlag = true
	return builder
}

// 元素列表
//
// 示例值：
func (builder *RichTextParagraphBuilder) Elements(elements []*RichTextElement) *RichTextParagraphBuilder {
	builder.elements = elements
	builder.elementsFlag = true
	return builder
}

// 缩进
//
// 示例值：0
func (builder *RichTextParagraphBuilder) Indent(indent int) *RichTextParagraphBuilder {
	builder.indent = indent
	builder.indentFlag = true
	return builder
}

// 有序列表开始序号
//
// 示例值：0
func (builder *RichTextParagraphBuilder) ListBeginIndex(listBeginIndex int) *RichTextParagraphBuilder {
	builder.listBeginIndex = listBeginIndex
	builder.listBeginIndexFlag = true
	return builder
}

// 引用
//
// 示例值：
func (builder *RichTextParagraphBuilder) Quote(quote bool) *RichTextParagraphBuilder {
	builder.quote = quote
	builder.quoteFlag = true
	return builder
}

func (builder *RichTextParagraphBuilder) Build() *RichTextParagraph {
	req := &RichTextParagraph{}
	if builder.paragraphTypeFlag {
		req.ParagraphType = &builder.paragraphType

	}
	if builder.elementsFlag {
		req.Elements = builder.elements
	}
	if builder.indentFlag {
		req.Indent = &builder.indent

	}
	if builder.listBeginIndexFlag {
		req.ListBeginIndex = &builder.listBeginIndex

	}
	if builder.quoteFlag {
		req.Quote = &builder.quote

	}
	return req
}

type Section struct {
	Title *string `json:"title,omitempty"` // 分区标题
}

type SectionBuilder struct {
	title     string // 分区标题
	titleFlag bool
}

func NewSectionBuilder() *SectionBuilder {
	builder := &SectionBuilder{}
	return builder
}

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

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

	}
	return req
}

type StickyNote struct {
	UserId *string `json:"user_id,omitempty"` // 用户id

	ShowAuthorInfo *bool `json:"show_author_info,omitempty"` // 是否展示用户信息
}

type StickyNoteBuilder struct {
	userId     string // 用户id
	userIdFlag bool

	showAuthorInfo     bool // 是否展示用户信息
	showAuthorInfoFlag bool
}

func NewStickyNoteBuilder() *StickyNoteBuilder {
	builder := &StickyNoteBuilder{}
	return builder
}

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

// 是否展示用户信息
//
// 示例值：
func (builder *StickyNoteBuilder) ShowAuthorInfo(showAuthorInfo bool) *StickyNoteBuilder {
	builder.showAuthorInfo = showAuthorInfo
	builder.showAuthorInfoFlag = true
	return builder
}

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

	}
	if builder.showAuthorInfoFlag {
		req.ShowAuthorInfo = &builder.showAuthorInfo

	}
	return req
}

type Style struct {
	FillColor *string `json:"fill_color,omitempty"` // 填充颜色，16 进制 rbg 值

	FillOpacity *float64 `json:"fill_opacity,omitempty"` // 填充透明度

	BorderStyle *string `json:"border_style,omitempty"` // 边框样式

	BorderWidth *string `json:"border_width,omitempty"` // 边框宽度

	BorderOpacity *float64 `json:"border_opacity,omitempty"` // 边框透明度

	HFlip *bool `json:"h_flip,omitempty"` // 水平翻折

	VFlip *bool `json:"v_flip,omitempty"` // 垂直翻折

	BorderColor *string `json:"border_color,omitempty"` // 边框颜色，16 进制 rgb 值

	ThemeFillColorCode *int `json:"theme_fill_color_code,omitempty"` // 填充颜色主题配色编码值

	ThemeBorderColorCode *int `json:"theme_border_color_code,omitempty"` // 边框颜色主题配色编码值

	FillColorType *int `json:"fill_color_type,omitempty"` // 填充颜色类型：0=系统颜色，取theme_fill_color_code，1=自定义颜色，取fill_color

	BorderColorType *int `json:"border_color_type,omitempty"` // 边框颜色类型：0=系统颜色，取theme_border_color_code，1=自定义颜色，取border_color
}

type StyleBuilder struct {
	fillColor     string // 填充颜色，16 进制 rbg 值
	fillColorFlag bool

	fillOpacity     float64 // 填充透明度
	fillOpacityFlag bool

	borderStyle     string // 边框样式
	borderStyleFlag bool

	borderWidth     string // 边框宽度
	borderWidthFlag bool

	borderOpacity     float64 // 边框透明度
	borderOpacityFlag bool

	hFlip     bool // 水平翻折
	hFlipFlag bool

	vFlip     bool // 垂直翻折
	vFlipFlag bool

	borderColor     string // 边框颜色，16 进制 rgb 值
	borderColorFlag bool

	themeFillColorCode     int // 填充颜色主题配色编码值
	themeFillColorCodeFlag bool

	themeBorderColorCode     int // 边框颜色主题配色编码值
	themeBorderColorCodeFlag bool

	fillColorType     int // 填充颜色类型：0=系统颜色，取theme_fill_color_code，1=自定义颜色，取fill_color
	fillColorTypeFlag bool

	borderColorType     int // 边框颜色类型：0=系统颜色，取theme_border_color_code，1=自定义颜色，取border_color
	borderColorTypeFlag bool
}

func NewStyleBuilder() *StyleBuilder {
	builder := &StyleBuilder{}
	return builder
}

// 填充颜色，16 进制 rbg 值
//
// 示例值：#6db5a3
func (builder *StyleBuilder) FillColor(fillColor string) *StyleBuilder {
	builder.fillColor = fillColor
	builder.fillColorFlag = true
	return builder
}

// 填充透明度
//
// 示例值：50
func (builder *StyleBuilder) FillOpacity(fillOpacity float64) *StyleBuilder {
	builder.fillOpacity = fillOpacity
	builder.fillOpacityFlag = true
	return builder
}

// 边框样式
//
// 示例值：
func (builder *StyleBuilder) BorderStyle(borderStyle string) *StyleBuilder {
	builder.borderStyle = borderStyle
	builder.borderStyleFlag = true
	return builder
}

// 边框宽度
//
// 示例值：
func (builder *StyleBuilder) BorderWidth(borderWidth string) *StyleBuilder {
	builder.borderWidth = borderWidth
	builder.borderWidthFlag = true
	return builder
}

// 边框透明度
//
// 示例值：50
func (builder *StyleBuilder) BorderOpacity(borderOpacity float64) *StyleBuilder {
	builder.borderOpacity = borderOpacity
	builder.borderOpacityFlag = true
	return builder
}

// 水平翻折
//
// 示例值：false
func (builder *StyleBuilder) HFlip(hFlip bool) *StyleBuilder {
	builder.hFlip = hFlip
	builder.hFlipFlag = true
	return builder
}

// 垂直翻折
//
// 示例值：false
func (builder *StyleBuilder) VFlip(vFlip bool) *StyleBuilder {
	builder.vFlip = vFlip
	builder.vFlipFlag = true
	return builder
}

// 边框颜色，16 进制 rgb 值
//
// 示例值：#6db5a3
func (builder *StyleBuilder) BorderColor(borderColor string) *StyleBuilder {
	builder.borderColor = borderColor
	builder.borderColorFlag = true
	return builder
}

// 填充颜色主题配色编码值
//
// 示例值：3
func (builder *StyleBuilder) ThemeFillColorCode(themeFillColorCode int) *StyleBuilder {
	builder.themeFillColorCode = themeFillColorCode
	builder.themeFillColorCodeFlag = true
	return builder
}

// 边框颜色主题配色编码值
//
// 示例值：4
func (builder *StyleBuilder) ThemeBorderColorCode(themeBorderColorCode int) *StyleBuilder {
	builder.themeBorderColorCode = themeBorderColorCode
	builder.themeBorderColorCodeFlag = true
	return builder
}

// 填充颜色类型：0=系统颜色，取theme_fill_color_code，1=自定义颜色，取fill_color
//
// 示例值：
func (builder *StyleBuilder) FillColorType(fillColorType int) *StyleBuilder {
	builder.fillColorType = fillColorType
	builder.fillColorTypeFlag = true
	return builder
}

// 边框颜色类型：0=系统颜色，取theme_border_color_code，1=自定义颜色，取border_color
//
// 示例值：
func (builder *StyleBuilder) BorderColorType(borderColorType int) *StyleBuilder {
	builder.borderColorType = borderColorType
	builder.borderColorTypeFlag = true
	return builder
}

func (builder *StyleBuilder) Build() *Style {
	req := &Style{}
	if builder.fillColorFlag {
		req.FillColor = &builder.fillColor

	}
	if builder.fillOpacityFlag {
		req.FillOpacity = &builder.fillOpacity

	}
	if builder.borderStyleFlag {
		req.BorderStyle = &builder.borderStyle

	}
	if builder.borderWidthFlag {
		req.BorderWidth = &builder.borderWidth

	}
	if builder.borderOpacityFlag {
		req.BorderOpacity = &builder.borderOpacity

	}
	if builder.hFlipFlag {
		req.HFlip = &builder.hFlip

	}
	if builder.vFlipFlag {
		req.VFlip = &builder.vFlip

	}
	if builder.borderColorFlag {
		req.BorderColor = &builder.borderColor

	}
	if builder.themeFillColorCodeFlag {
		req.ThemeFillColorCode = &builder.themeFillColorCode

	}
	if builder.themeBorderColorCodeFlag {
		req.ThemeBorderColorCode = &builder.themeBorderColorCode

	}
	if builder.fillColorTypeFlag {
		req.FillColorType = &builder.fillColorType

	}
	if builder.borderColorTypeFlag {
		req.BorderColorType = &builder.borderColorType

	}
	return req
}

type Svg struct {
	SvgCode *string `json:"svg_code,omitempty"` // svg code
}

type SvgBuilder struct {
	svgCode     string // svg code
	svgCodeFlag bool
}

func NewSvgBuilder() *SvgBuilder {
	builder := &SvgBuilder{}
	return builder
}

// svg code
//
// 示例值：code
func (builder *SvgBuilder) SvgCode(svgCode string) *SvgBuilder {
	builder.svgCode = svgCode
	builder.svgCodeFlag = true
	return builder
}

func (builder *SvgBuilder) Build() *Svg {
	req := &Svg{}
	if builder.svgCodeFlag {
		req.SvgCode = &builder.svgCode

	}
	return req
}

type Table struct {
	Meta *TableMeta `json:"meta,omitempty"` // 元信息

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

	Cells []*TableCell `json:"cells,omitempty"` // 单元格列表
}

type TableBuilder struct {
	meta     *TableMeta // 元信息
	metaFlag bool

	title     string // 标题
	titleFlag bool

	cells     []*TableCell // 单元格列表
	cellsFlag bool
}

func NewTableBuilder() *TableBuilder {
	builder := &TableBuilder{}
	return builder
}

// 元信息
//
// 示例值：
func (builder *TableBuilder) Meta(meta *TableMeta) *TableBuilder {
	builder.meta = meta
	builder.metaFlag = true
	return builder
}

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

// 单元格列表
//
// 示例值：
func (builder *TableBuilder) Cells(cells []*TableCell) *TableBuilder {
	builder.cells = cells
	builder.cellsFlag = true
	return builder
}

func (builder *TableBuilder) Build() *Table {
	req := &Table{}
	if builder.metaFlag {
		req.Meta = builder.meta
	}
	if builder.titleFlag {
		req.Title = &builder.title

	}
	if builder.cellsFlag {
		req.Cells = builder.cells
	}
	return req
}

type TableCell struct {
	RowIndex *int `json:"row_index,omitempty"` // 行下标，从 1 开始

	ColIndex *int `json:"col_index,omitempty"` // 列下标，从 1 开始

	MergeInfo *TableCellMergeInfo `json:"merge_info,omitempty"` // 单元格合并信息

	Children []string `json:"children,omitempty"` // 单元格包含的子节点 id

	Text *Text `json:"text,omitempty"` // 单元格内文字

	Style *Style `json:"style,omitempty"` // 单元格样式，设置后会覆盖表格样式
}

type TableCellBuilder struct {
	rowIndex     int // 行下标，从 1 开始
	rowIndexFlag bool

	colIndex     int // 列下标，从 1 开始
	colIndexFlag bool

	mergeInfo     *TableCellMergeInfo // 单元格合并信息
	mergeInfoFlag bool

	children     []string // 单元格包含的子节点 id
	childrenFlag bool

	text     *Text // 单元格内文字
	textFlag bool

	style     *Style // 单元格样式，设置后会覆盖表格样式
	styleFlag bool
}

func NewTableCellBuilder() *TableCellBuilder {
	builder := &TableCellBuilder{}
	return builder
}

// 行下标，从 1 开始
//
// 示例值：1
func (builder *TableCellBuilder) RowIndex(rowIndex int) *TableCellBuilder {
	builder.rowIndex = rowIndex
	builder.rowIndexFlag = true
	return builder
}

// 列下标，从 1 开始
//
// 示例值：1
func (builder *TableCellBuilder) ColIndex(colIndex int) *TableCellBuilder {
	builder.colIndex = colIndex
	builder.colIndexFlag = true
	return builder
}

// 单元格合并信息
//
// 示例值：
func (builder *TableCellBuilder) MergeInfo(mergeInfo *TableCellMergeInfo) *TableCellBuilder {
	builder.mergeInfo = mergeInfo
	builder.mergeInfoFlag = true
	return builder
}

// 单元格包含的子节点 id
//
// 示例值：
func (builder *TableCellBuilder) Children(children []string) *TableCellBuilder {
	builder.children = children
	builder.childrenFlag = true
	return builder
}

// 单元格内文字
//
// 示例值：
func (builder *TableCellBuilder) Text(text *Text) *TableCellBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 单元格样式，设置后会覆盖表格样式
//
// 示例值：
func (builder *TableCellBuilder) Style(style *Style) *TableCellBuilder {
	builder.style = style
	builder.styleFlag = true
	return builder
}

func (builder *TableCellBuilder) Build() *TableCell {
	req := &TableCell{}
	if builder.rowIndexFlag {
		req.RowIndex = &builder.rowIndex

	}
	if builder.colIndexFlag {
		req.ColIndex = &builder.colIndex

	}
	if builder.mergeInfoFlag {
		req.MergeInfo = builder.mergeInfo
	}
	if builder.childrenFlag {
		req.Children = builder.children
	}
	if builder.textFlag {
		req.Text = builder.text
	}
	if builder.styleFlag {
		req.Style = builder.style
	}
	return req
}

type TableCellMergeInfo struct {
	RowSpan *int `json:"row_span,omitempty"` // 从当前行索引起被合并的连续行数

	ColSpan *int `json:"col_span,omitempty"` // 从当前列索引起被合并的连续列数
}

type TableCellMergeInfoBuilder struct {
	rowSpan     int // 从当前行索引起被合并的连续行数
	rowSpanFlag bool

	colSpan     int // 从当前列索引起被合并的连续列数
	colSpanFlag bool
}

func NewTableCellMergeInfoBuilder() *TableCellMergeInfoBuilder {
	builder := &TableCellMergeInfoBuilder{}
	return builder
}

// 从当前行索引起被合并的连续行数
//
// 示例值：2
func (builder *TableCellMergeInfoBuilder) RowSpan(rowSpan int) *TableCellMergeInfoBuilder {
	builder.rowSpan = rowSpan
	builder.rowSpanFlag = true
	return builder
}

// 从当前列索引起被合并的连续列数
//
// 示例值：2
func (builder *TableCellMergeInfoBuilder) ColSpan(colSpan int) *TableCellMergeInfoBuilder {
	builder.colSpan = colSpan
	builder.colSpanFlag = true
	return builder
}

func (builder *TableCellMergeInfoBuilder) Build() *TableCellMergeInfo {
	req := &TableCellMergeInfo{}
	if builder.rowSpanFlag {
		req.RowSpan = &builder.rowSpan

	}
	if builder.colSpanFlag {
		req.ColSpan = &builder.colSpan

	}
	return req
}

type TableMeta struct {
	RowNum *int `json:"row_num,omitempty"` // 行数

	ColNum *int `json:"col_num,omitempty"` // 列数

	RowSizes []float64 `json:"row_sizes,omitempty"` // 行高

	ColSizes []float64 `json:"col_sizes,omitempty"` // 列宽

	Style *Style `json:"style,omitempty"` // 整个表格的样式

	Text *Text `json:"text,omitempty"` // 整个表格的文字样式
}

type TableMetaBuilder struct {
	rowNum     int // 行数
	rowNumFlag bool

	colNum     int // 列数
	colNumFlag bool

	rowSizes     []float64 // 行高
	rowSizesFlag bool

	colSizes     []float64 // 列宽
	colSizesFlag bool

	style     *Style // 整个表格的样式
	styleFlag bool

	text     *Text // 整个表格的文字样式
	textFlag bool
}

func NewTableMetaBuilder() *TableMetaBuilder {
	builder := &TableMetaBuilder{}
	return builder
}

// 行数
//
// 示例值：3
func (builder *TableMetaBuilder) RowNum(rowNum int) *TableMetaBuilder {
	builder.rowNum = rowNum
	builder.rowNumFlag = true
	return builder
}

// 列数
//
// 示例值：2
func (builder *TableMetaBuilder) ColNum(colNum int) *TableMetaBuilder {
	builder.colNum = colNum
	builder.colNumFlag = true
	return builder
}

// 行高
//
// 示例值：
func (builder *TableMetaBuilder) RowSizes(rowSizes []float64) *TableMetaBuilder {
	builder.rowSizes = rowSizes
	builder.rowSizesFlag = true
	return builder
}

// 列宽
//
// 示例值：
func (builder *TableMetaBuilder) ColSizes(colSizes []float64) *TableMetaBuilder {
	builder.colSizes = colSizes
	builder.colSizesFlag = true
	return builder
}

// 整个表格的样式
//
// 示例值：
func (builder *TableMetaBuilder) Style(style *Style) *TableMetaBuilder {
	builder.style = style
	builder.styleFlag = true
	return builder
}

// 整个表格的文字样式
//
// 示例值：
func (builder *TableMetaBuilder) Text(text *Text) *TableMetaBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

func (builder *TableMetaBuilder) Build() *TableMeta {
	req := &TableMeta{}
	if builder.rowNumFlag {
		req.RowNum = &builder.rowNum

	}
	if builder.colNumFlag {
		req.ColNum = &builder.colNum

	}
	if builder.rowSizesFlag {
		req.RowSizes = builder.rowSizes
	}
	if builder.colSizesFlag {
		req.ColSizes = builder.colSizes
	}
	if builder.styleFlag {
		req.Style = builder.style
	}
	if builder.textFlag {
		req.Text = builder.text
	}
	return req
}

type Text struct {
	Text *string `json:"text,omitempty"` // 文字内容

	FontWeight *string `json:"font_weight,omitempty"` // 文字字重

	FontSize *int `json:"font_size,omitempty"` // 文字大小

	HorizontalAlign *string `json:"horizontal_align,omitempty"` // 水平对齐

	VerticalAlign *string `json:"vertical_align,omitempty"` // 垂直对齐

	TextColor *string `json:"text_color,omitempty"` // 文字颜色，16 进制 rgb 值

	TextBackgroundColor *string `json:"text_background_color,omitempty"` // 文字背景色，16 进制 rgb 值

	LineThrough *bool `json:"line_through,omitempty"` // 是否存在删除线

	Underline *bool `json:"underline,omitempty"` // 是否存在下划线

	Italic *bool `json:"italic,omitempty"` // 是否斜体

	Angle *int `json:"angle,omitempty"` // 文字旋转角度

	ThemeTextColorCode *int `json:"theme_text_color_code,omitempty"` // 文字颜色主题配色编码值

	ThemeTextBackgroundColorCode *int `json:"theme_text_background_color_code,omitempty"` // 文字背景颜色主题配色编码值

	RichText *RichText `json:"rich_text,omitempty"` // 富文本

	TextColorType *int `json:"text_color_type,omitempty"` // 文字颜色类型，0=系统颜色，1=自定义颜色

	TextBackgroundColorType *int `json:"text_background_color_type,omitempty"` // 文字背景颜色类型，0=系统颜色，1=自定义颜色
}

type TextBuilder struct {
	text     string // 文字内容
	textFlag bool

	fontWeight     string // 文字字重
	fontWeightFlag bool

	fontSize     int // 文字大小
	fontSizeFlag bool

	horizontalAlign     string // 水平对齐
	horizontalAlignFlag bool

	verticalAlign     string // 垂直对齐
	verticalAlignFlag bool

	textColor     string // 文字颜色，16 进制 rgb 值
	textColorFlag bool

	textBackgroundColor     string // 文字背景色，16 进制 rgb 值
	textBackgroundColorFlag bool

	lineThrough     bool // 是否存在删除线
	lineThroughFlag bool

	underline     bool // 是否存在下划线
	underlineFlag bool

	italic     bool // 是否斜体
	italicFlag bool

	angle     int // 文字旋转角度
	angleFlag bool

	themeTextColorCode     int // 文字颜色主题配色编码值
	themeTextColorCodeFlag bool

	themeTextBackgroundColorCode     int // 文字背景颜色主题配色编码值
	themeTextBackgroundColorCodeFlag bool

	richText     *RichText // 富文本
	richTextFlag bool

	textColorType     int // 文字颜色类型，0=系统颜色，1=自定义颜色
	textColorTypeFlag bool

	textBackgroundColorType     int // 文字背景颜色类型，0=系统颜色，1=自定义颜色
	textBackgroundColorTypeFlag bool
}

func NewTextBuilder() *TextBuilder {
	builder := &TextBuilder{}
	return builder
}

// 文字内容
//
// 示例值：文字内容
func (builder *TextBuilder) Text(text string) *TextBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 文字字重
//
// 示例值：regular
func (builder *TextBuilder) FontWeight(fontWeight string) *TextBuilder {
	builder.fontWeight = fontWeight
	builder.fontWeightFlag = true
	return builder
}

// 文字大小
//
// 示例值：14
func (builder *TextBuilder) FontSize(fontSize int) *TextBuilder {
	builder.fontSize = fontSize
	builder.fontSizeFlag = true
	return builder
}

// 水平对齐
//
// 示例值：
func (builder *TextBuilder) HorizontalAlign(horizontalAlign string) *TextBuilder {
	builder.horizontalAlign = horizontalAlign
	builder.horizontalAlignFlag = true
	return builder
}

// 垂直对齐
//
// 示例值：
func (builder *TextBuilder) VerticalAlign(verticalAlign string) *TextBuilder {
	builder.verticalAlign = verticalAlign
	builder.verticalAlignFlag = true
	return builder
}

// 文字颜色，16 进制 rgb 值
//
// 示例值：#6db5a3
func (builder *TextBuilder) TextColor(textColor string) *TextBuilder {
	builder.textColor = textColor
	builder.textColorFlag = true
	return builder
}

// 文字背景色，16 进制 rgb 值
//
// 示例值：#6db5a3
func (builder *TextBuilder) TextBackgroundColor(textBackgroundColor string) *TextBuilder {
	builder.textBackgroundColor = textBackgroundColor
	builder.textBackgroundColorFlag = true
	return builder
}

// 是否存在删除线
//
// 示例值：true
func (builder *TextBuilder) LineThrough(lineThrough bool) *TextBuilder {
	builder.lineThrough = lineThrough
	builder.lineThroughFlag = true
	return builder
}

// 是否存在下划线
//
// 示例值：true
func (builder *TextBuilder) Underline(underline bool) *TextBuilder {
	builder.underline = underline
	builder.underlineFlag = true
	return builder
}

// 是否斜体
//
// 示例值：true
func (builder *TextBuilder) Italic(italic bool) *TextBuilder {
	builder.italic = italic
	builder.italicFlag = true
	return builder
}

// 文字旋转角度
//
// 示例值：90
func (builder *TextBuilder) Angle(angle int) *TextBuilder {
	builder.angle = angle
	builder.angleFlag = true
	return builder
}

// 文字颜色主题配色编码值
//
// 示例值：0
func (builder *TextBuilder) ThemeTextColorCode(themeTextColorCode int) *TextBuilder {
	builder.themeTextColorCode = themeTextColorCode
	builder.themeTextColorCodeFlag = true
	return builder
}

// 文字背景颜色主题配色编码值
//
// 示例值：-1
func (builder *TextBuilder) ThemeTextBackgroundColorCode(themeTextBackgroundColorCode int) *TextBuilder {
	builder.themeTextBackgroundColorCode = themeTextBackgroundColorCode
	builder.themeTextBackgroundColorCodeFlag = true
	return builder
}

// 富文本
//
// 示例值：
func (builder *TextBuilder) RichText(richText *RichText) *TextBuilder {
	builder.richText = richText
	builder.richTextFlag = true
	return builder
}

// 文字颜色类型，0=系统颜色，1=自定义颜色
//
// 示例值：
func (builder *TextBuilder) TextColorType(textColorType int) *TextBuilder {
	builder.textColorType = textColorType
	builder.textColorTypeFlag = true
	return builder
}

// 文字背景颜色类型，0=系统颜色，1=自定义颜色
//
// 示例值：
func (builder *TextBuilder) TextBackgroundColorType(textBackgroundColorType int) *TextBuilder {
	builder.textBackgroundColorType = textBackgroundColorType
	builder.textBackgroundColorTypeFlag = true
	return builder
}

func (builder *TextBuilder) Build() *Text {
	req := &Text{}
	if builder.textFlag {
		req.Text = &builder.text

	}
	if builder.fontWeightFlag {
		req.FontWeight = &builder.fontWeight

	}
	if builder.fontSizeFlag {
		req.FontSize = &builder.fontSize

	}
	if builder.horizontalAlignFlag {
		req.HorizontalAlign = &builder.horizontalAlign

	}
	if builder.verticalAlignFlag {
		req.VerticalAlign = &builder.verticalAlign

	}
	if builder.textColorFlag {
		req.TextColor = &builder.textColor

	}
	if builder.textBackgroundColorFlag {
		req.TextBackgroundColor = &builder.textBackgroundColor

	}
	if builder.lineThroughFlag {
		req.LineThrough = &builder.lineThrough

	}
	if builder.underlineFlag {
		req.Underline = &builder.underline

	}
	if builder.italicFlag {
		req.Italic = &builder.italic

	}
	if builder.angleFlag {
		req.Angle = &builder.angle

	}
	if builder.themeTextColorCodeFlag {
		req.ThemeTextColorCode = &builder.themeTextColorCode

	}
	if builder.themeTextBackgroundColorCodeFlag {
		req.ThemeTextBackgroundColorCode = &builder.themeTextBackgroundColorCode

	}
	if builder.richTextFlag {
		req.RichText = builder.richText
	}
	if builder.textColorTypeFlag {
		req.TextColorType = &builder.textColorType

	}
	if builder.textBackgroundColorTypeFlag {
		req.TextBackgroundColorType = &builder.textBackgroundColorType

	}
	return req
}

type Trapezoid struct {
	TopLength *float64 `json:"top_length,omitempty"` // 梯形上底长（短边）。默认为下底边长度的2/3，不能超过下底边长度。
}

type TrapezoidBuilder struct {
	topLength     float64 // 梯形上底长（短边）。默认为下底边长度的2/3，不能超过下底边长度。
	topLengthFlag bool
}

func NewTrapezoidBuilder() *TrapezoidBuilder {
	builder := &TrapezoidBuilder{}
	return builder
}

// 梯形上底长（短边）。默认为下底边长度的2/3，不能超过下底边长度。
//
// 示例值：10
func (builder *TrapezoidBuilder) TopLength(topLength float64) *TrapezoidBuilder {
	builder.topLength = topLength
	builder.topLengthFlag = true
	return builder
}

func (builder *TrapezoidBuilder) Build() *Trapezoid {
	req := &Trapezoid{}
	if builder.topLengthFlag {
		req.TopLength = &builder.topLength

	}
	return req
}

type WhiteboardNode struct {
	Id *string `json:"id,omitempty"` // 节点 id

	Type *string `json:"type,omitempty"` // 节点图形类型，目前创建节点仅支持创建图片、文本、基础图形等类型

	ParentId *string `json:"parent_id,omitempty"` // 父节点 id

	Children []string `json:"children,omitempty"` // 子节点

	X *float64 `json:"x,omitempty"` // 图形相对画布的 x 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px

	Y *float64 `json:"y,omitempty"` // 图形相对画布的 y 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px

	Angle *float64 `json:"angle,omitempty"` // 图形旋转角度

	Height *float64 `json:"height,omitempty"` // 图形高度，单位为 px

	Text *Text `json:"text,omitempty"` // 图形内文字

	Style *Style `json:"style,omitempty"` // 图形样式

	Image *Image `json:"image,omitempty"` // 图片

	CompositeShape *CompositeShape `json:"composite_shape,omitempty"` // 基础图形属性

	Connector *Connector `json:"connector,omitempty"` // 连线属性

	Width *float64 `json:"width,omitempty"` // 图形宽度，单位为 px

	Section *Section `json:"section,omitempty"` // 分区属性

	Table *Table `json:"table,omitempty"` // 表格属性

	Locked *bool `json:"locked,omitempty"` // 图形是否锁定

	ZIndex *int `json:"z_index,omitempty"` // 图形在兄弟节点中的层级，层级大的会覆盖层级小的

	Lifeline *Lifeline `json:"lifeline,omitempty"` // 生命对象属性

	Paint *Paint `json:"paint,omitempty"` // 画笔属性

	Svg *Svg `json:"svg,omitempty"` // svg图形属性

	StickyNote *StickyNote `json:"sticky_note,omitempty"` // 便签图形属性

	MindMapNode *MindMapNode `json:"mind_map_node,omitempty"` // 思维导图节点属性

	MindMapRoot *MindMapRoot `json:"mind_map_root,omitempty"` // 思维导图根节点属性

	MindMap *MindMap `json:"mind_map,omitempty"` // 思维导图节点（v1版本，只读，写操作请使用mind_map_root/mind_map_node结构）
}

type WhiteboardNodeBuilder struct {
	id     string // 节点 id
	idFlag bool

	type_    string // 节点图形类型，目前创建节点仅支持创建图片、文本、基础图形等类型
	typeFlag bool

	parentId     string // 父节点 id
	parentIdFlag bool

	children     []string // 子节点
	childrenFlag bool

	x     float64 // 图形相对画布的 x 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px
	xFlag bool

	y     float64 // 图形相对画布的 y 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px
	yFlag bool

	angle     float64 // 图形旋转角度
	angleFlag bool

	height     float64 // 图形高度，单位为 px
	heightFlag bool

	text     *Text // 图形内文字
	textFlag bool

	style     *Style // 图形样式
	styleFlag bool

	image     *Image // 图片
	imageFlag bool

	compositeShape     *CompositeShape // 基础图形属性
	compositeShapeFlag bool

	connector     *Connector // 连线属性
	connectorFlag bool

	width     float64 // 图形宽度，单位为 px
	widthFlag bool

	section     *Section // 分区属性
	sectionFlag bool

	table     *Table // 表格属性
	tableFlag bool

	locked     bool // 图形是否锁定
	lockedFlag bool

	zIndex     int // 图形在兄弟节点中的层级，层级大的会覆盖层级小的
	zIndexFlag bool

	lifeline     *Lifeline // 生命对象属性
	lifelineFlag bool

	paint     *Paint // 画笔属性
	paintFlag bool

	svg     *Svg // svg图形属性
	svgFlag bool

	stickyNote     *StickyNote // 便签图形属性
	stickyNoteFlag bool

	mindMapNode     *MindMapNode // 思维导图节点属性
	mindMapNodeFlag bool

	mindMapRoot     *MindMapRoot // 思维导图根节点属性
	mindMapRootFlag bool

	mindMap     *MindMap // 思维导图节点（v1版本，只读，写操作请使用mind_map_root/mind_map_node结构）
	mindMapFlag bool
}

func NewWhiteboardNodeBuilder() *WhiteboardNodeBuilder {
	builder := &WhiteboardNodeBuilder{}
	return builder
}

// 节点 id
//
// 示例值：o1:1
func (builder *WhiteboardNodeBuilder) Id(id string) *WhiteboardNodeBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 节点图形类型，目前创建节点仅支持创建图片、文本、基础图形等类型
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Type(type_ string) *WhiteboardNodeBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 父节点 id
//
// 示例值：o1:1
func (builder *WhiteboardNodeBuilder) ParentId(parentId string) *WhiteboardNodeBuilder {
	builder.parentId = parentId
	builder.parentIdFlag = true
	return builder
}

// 子节点
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Children(children []string) *WhiteboardNodeBuilder {
	builder.children = children
	builder.childrenFlag = true
	return builder
}

// 图形相对画布的 x 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px
//
// 示例值：100
func (builder *WhiteboardNodeBuilder) X(x float64) *WhiteboardNodeBuilder {
	builder.x = x
	builder.xFlag = true
	return builder
}

// 图形相对画布的 y 轴位置信息（存在父容器时为相对父容器的坐标，父容器为组合图形 group 时，坐标是穿透的），单位为 px
//
// 示例值：100
func (builder *WhiteboardNodeBuilder) Y(y float64) *WhiteboardNodeBuilder {
	builder.y = y
	builder.yFlag = true
	return builder
}

// 图形旋转角度
//
// 示例值：100
func (builder *WhiteboardNodeBuilder) Angle(angle float64) *WhiteboardNodeBuilder {
	builder.angle = angle
	builder.angleFlag = true
	return builder
}

// 图形高度，单位为 px
//
// 示例值：100
func (builder *WhiteboardNodeBuilder) Height(height float64) *WhiteboardNodeBuilder {
	builder.height = height
	builder.heightFlag = true
	return builder
}

// 图形内文字
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Text(text *Text) *WhiteboardNodeBuilder {
	builder.text = text
	builder.textFlag = true
	return builder
}

// 图形样式
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Style(style *Style) *WhiteboardNodeBuilder {
	builder.style = style
	builder.styleFlag = true
	return builder
}

// 图片
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Image(image *Image) *WhiteboardNodeBuilder {
	builder.image = image
	builder.imageFlag = true
	return builder
}

// 基础图形属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) CompositeShape(compositeShape *CompositeShape) *WhiteboardNodeBuilder {
	builder.compositeShape = compositeShape
	builder.compositeShapeFlag = true
	return builder
}

// 连线属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Connector(connector *Connector) *WhiteboardNodeBuilder {
	builder.connector = connector
	builder.connectorFlag = true
	return builder
}

// 图形宽度，单位为 px
//
// 示例值：100
func (builder *WhiteboardNodeBuilder) Width(width float64) *WhiteboardNodeBuilder {
	builder.width = width
	builder.widthFlag = true
	return builder
}

// 分区属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Section(section *Section) *WhiteboardNodeBuilder {
	builder.section = section
	builder.sectionFlag = true
	return builder
}

// 表格属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Table(table *Table) *WhiteboardNodeBuilder {
	builder.table = table
	builder.tableFlag = true
	return builder
}

// 图形是否锁定
//
// 示例值：true
func (builder *WhiteboardNodeBuilder) Locked(locked bool) *WhiteboardNodeBuilder {
	builder.locked = locked
	builder.lockedFlag = true
	return builder
}

// 图形在兄弟节点中的层级，层级大的会覆盖层级小的
//
// 示例值：1
func (builder *WhiteboardNodeBuilder) ZIndex(zIndex int) *WhiteboardNodeBuilder {
	builder.zIndex = zIndex
	builder.zIndexFlag = true
	return builder
}

// 生命对象属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Lifeline(lifeline *Lifeline) *WhiteboardNodeBuilder {
	builder.lifeline = lifeline
	builder.lifelineFlag = true
	return builder
}

// 画笔属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Paint(paint *Paint) *WhiteboardNodeBuilder {
	builder.paint = paint
	builder.paintFlag = true
	return builder
}

// svg图形属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) Svg(svg *Svg) *WhiteboardNodeBuilder {
	builder.svg = svg
	builder.svgFlag = true
	return builder
}

// 便签图形属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) StickyNote(stickyNote *StickyNote) *WhiteboardNodeBuilder {
	builder.stickyNote = stickyNote
	builder.stickyNoteFlag = true
	return builder
}

// 思维导图节点属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) MindMapNode(mindMapNode *MindMapNode) *WhiteboardNodeBuilder {
	builder.mindMapNode = mindMapNode
	builder.mindMapNodeFlag = true
	return builder
}

// 思维导图根节点属性
//
// 示例值：
func (builder *WhiteboardNodeBuilder) MindMapRoot(mindMapRoot *MindMapRoot) *WhiteboardNodeBuilder {
	builder.mindMapRoot = mindMapRoot
	builder.mindMapRootFlag = true
	return builder
}

// 思维导图节点（v1版本，只读，写操作请使用mind_map_root/mind_map_node结构）
//
// 示例值：
func (builder *WhiteboardNodeBuilder) MindMap(mindMap *MindMap) *WhiteboardNodeBuilder {
	builder.mindMap = mindMap
	builder.mindMapFlag = true
	return builder
}

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

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

	}
	if builder.parentIdFlag {
		req.ParentId = &builder.parentId

	}
	if builder.childrenFlag {
		req.Children = builder.children
	}
	if builder.xFlag {
		req.X = &builder.x

	}
	if builder.yFlag {
		req.Y = &builder.y

	}
	if builder.angleFlag {
		req.Angle = &builder.angle

	}
	if builder.heightFlag {
		req.Height = &builder.height

	}
	if builder.textFlag {
		req.Text = builder.text
	}
	if builder.styleFlag {
		req.Style = builder.style
	}
	if builder.imageFlag {
		req.Image = builder.image
	}
	if builder.compositeShapeFlag {
		req.CompositeShape = builder.compositeShape
	}
	if builder.connectorFlag {
		req.Connector = builder.connector
	}
	if builder.widthFlag {
		req.Width = &builder.width

	}
	if builder.sectionFlag {
		req.Section = builder.section
	}
	if builder.tableFlag {
		req.Table = builder.table
	}
	if builder.lockedFlag {
		req.Locked = &builder.locked

	}
	if builder.zIndexFlag {
		req.ZIndex = &builder.zIndex

	}
	if builder.lifelineFlag {
		req.Lifeline = builder.lifeline
	}
	if builder.paintFlag {
		req.Paint = builder.paint
	}
	if builder.svgFlag {
		req.Svg = builder.svg
	}
	if builder.stickyNoteFlag {
		req.StickyNote = builder.stickyNote
	}
	if builder.mindMapNodeFlag {
		req.MindMapNode = builder.mindMapNode
	}
	if builder.mindMapRootFlag {
		req.MindMapRoot = builder.mindMapRoot
	}
	if builder.mindMapFlag {
		req.MindMap = builder.mindMap
	}
	return req
}

type DownloadAsImageWhiteboardReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewDownloadAsImageWhiteboardReqBuilder() *DownloadAsImageWhiteboardReqBuilder {
	builder := &DownloadAsImageWhiteboardReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板唯一标识
//
// 示例值：Ru8nwrWFOhEmaFbEU2VbPRsHcxb
func (builder *DownloadAsImageWhiteboardReqBuilder) WhiteboardId(whiteboardId string) *DownloadAsImageWhiteboardReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

func (builder *DownloadAsImageWhiteboardReqBuilder) Build() *DownloadAsImageWhiteboardReq {
	req := &DownloadAsImageWhiteboardReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type DownloadAsImageWhiteboardReq struct {
	apiReq *larkcore.ApiReq
}

type DownloadAsImageWhiteboardResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	File     io.Reader `json:"-"`
	FileName string    `json:"-"`
}

func (resp *DownloadAsImageWhiteboardResp) Success() bool {
	return resp.Code == 0
}

func (resp *DownloadAsImageWhiteboardResp) WriteFile(fileName string) error {
	bs, err := ioutil.ReadAll(resp.File)
	if err != nil {
		return err
	}

	err = ioutil.WriteFile(fileName, bs, 0666)
	if err != nil {
		return err
	}
	return nil
}

type ThemeWhiteboardReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewThemeWhiteboardReqBuilder() *ThemeWhiteboardReqBuilder {
	builder := &ThemeWhiteboardReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板token
//
// 示例值：Ud8xwWH01hO5mwbakqHbHeqmcCI
func (builder *ThemeWhiteboardReqBuilder) WhiteboardId(whiteboardId string) *ThemeWhiteboardReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

func (builder *ThemeWhiteboardReqBuilder) Build() *ThemeWhiteboardReq {
	req := &ThemeWhiteboardReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	return req
}

type ThemeWhiteboardReq struct {
	apiReq *larkcore.ApiReq
}

type ThemeWhiteboardRespData struct {
	Theme *string `json:"theme,omitempty"` // 主题
}

type ThemeWhiteboardResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ThemeWhiteboardRespData `json:"data"` // 业务数据
}

func (resp *ThemeWhiteboardResp) Success() bool {
	return resp.Code == 0
}

type UpdateThemeWhiteboardReqBodyBuilder struct {
	theme     string // 主题名称
	themeFlag bool
}

func NewUpdateThemeWhiteboardReqBodyBuilder() *UpdateThemeWhiteboardReqBodyBuilder {
	builder := &UpdateThemeWhiteboardReqBodyBuilder{}
	return builder
}

// 主题名称
//
//示例值：classic
func (builder *UpdateThemeWhiteboardReqBodyBuilder) Theme(theme string) *UpdateThemeWhiteboardReqBodyBuilder {
	builder.theme = theme
	builder.themeFlag = true
	return builder
}

func (builder *UpdateThemeWhiteboardReqBodyBuilder) Build() *UpdateThemeWhiteboardReqBody {
	req := &UpdateThemeWhiteboardReqBody{}
	if builder.themeFlag {
		req.Theme = &builder.theme
	}
	return req
}

type UpdateThemeWhiteboardPathReqBodyBuilder struct {
	theme     string
	themeFlag bool
}

func NewUpdateThemeWhiteboardPathReqBodyBuilder() *UpdateThemeWhiteboardPathReqBodyBuilder {
	builder := &UpdateThemeWhiteboardPathReqBodyBuilder{}
	return builder
}

// 主题名称
//
// 示例值：classic
func (builder *UpdateThemeWhiteboardPathReqBodyBuilder) Theme(theme string) *UpdateThemeWhiteboardPathReqBodyBuilder {
	builder.theme = theme
	builder.themeFlag = true
	return builder
}

func (builder *UpdateThemeWhiteboardPathReqBodyBuilder) Build() (*UpdateThemeWhiteboardReqBody, error) {
	req := &UpdateThemeWhiteboardReqBody{}
	if builder.themeFlag {
		req.Theme = &builder.theme
	}
	return req, nil
}

type UpdateThemeWhiteboardReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *UpdateThemeWhiteboardReqBody
}

func NewUpdateThemeWhiteboardReqBuilder() *UpdateThemeWhiteboardReqBuilder {
	builder := &UpdateThemeWhiteboardReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板 id，唯一标识
//
// 示例值：KRy1wHU6dhmdWIbgkSIbqikMcQc
func (builder *UpdateThemeWhiteboardReqBuilder) WhiteboardId(whiteboardId string) *UpdateThemeWhiteboardReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

// 更新画板主题
func (builder *UpdateThemeWhiteboardReqBuilder) Body(body *UpdateThemeWhiteboardReqBody) *UpdateThemeWhiteboardReqBuilder {
	builder.body = body
	return builder
}

func (builder *UpdateThemeWhiteboardReqBuilder) Build() *UpdateThemeWhiteboardReq {
	req := &UpdateThemeWhiteboardReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type UpdateThemeWhiteboardReqBody struct {
	Theme *string `json:"theme,omitempty"` // 主题名称
}

type UpdateThemeWhiteboardReq struct {
	apiReq *larkcore.ApiReq
	Body   *UpdateThemeWhiteboardReqBody `body:""`
}

type UpdateThemeWhiteboardResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

func (resp *UpdateThemeWhiteboardResp) Success() bool {
	return resp.Code == 0
}

type CreateWhiteboardNodeReqBodyBuilder struct {
	nodes     []*WhiteboardNode // 子节点数据
	nodesFlag bool
}

func NewCreateWhiteboardNodeReqBodyBuilder() *CreateWhiteboardNodeReqBodyBuilder {
	builder := &CreateWhiteboardNodeReqBodyBuilder{}
	return builder
}

// 子节点数据
//
//示例值：
func (builder *CreateWhiteboardNodeReqBodyBuilder) Nodes(nodes []*WhiteboardNode) *CreateWhiteboardNodeReqBodyBuilder {
	builder.nodes = nodes
	builder.nodesFlag = true
	return builder
}

func (builder *CreateWhiteboardNodeReqBodyBuilder) Build() *CreateWhiteboardNodeReqBody {
	req := &CreateWhiteboardNodeReqBody{}
	if builder.nodesFlag {
		req.Nodes = builder.nodes
	}
	return req
}

type CreateWhiteboardNodePathReqBodyBuilder struct {
	nodes     []*WhiteboardNode
	nodesFlag bool
}

func NewCreateWhiteboardNodePathReqBodyBuilder() *CreateWhiteboardNodePathReqBodyBuilder {
	builder := &CreateWhiteboardNodePathReqBodyBuilder{}
	return builder
}

// 子节点数据
//
// 示例值：
func (builder *CreateWhiteboardNodePathReqBodyBuilder) Nodes(nodes []*WhiteboardNode) *CreateWhiteboardNodePathReqBodyBuilder {
	builder.nodes = nodes
	builder.nodesFlag = true
	return builder
}

func (builder *CreateWhiteboardNodePathReqBodyBuilder) Build() (*CreateWhiteboardNodeReqBody, error) {
	req := &CreateWhiteboardNodeReqBody{}
	if builder.nodesFlag {
		req.Nodes = builder.nodes
	}
	return req, nil
}

type CreateWhiteboardNodeReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateWhiteboardNodeReqBody
}

func NewCreateWhiteboardNodeReqBuilder() *CreateWhiteboardNodeReqBuilder {
	builder := &CreateWhiteboardNodeReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板唯一标识
//
// 示例值：Ru8nwrWFOhEmaFbEU2VbPRsHcxb
func (builder *CreateWhiteboardNodeReqBuilder) WhiteboardId(whiteboardId string) *CreateWhiteboardNodeReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

// 操作的唯一标识，与接口返回值的 client_token 相对应，用于幂等的进行更新操作。此值为空表示将发起一次新的请求，此值非空表示幂等的进行更新操作
//
// 示例值：fe599b60-450f-46ff-b2ef-9f6675625b9
func (builder *CreateWhiteboardNodeReqBuilder) ClientToken(clientToken string) *CreateWhiteboardNodeReqBuilder {
	builder.apiReq.QueryParams.Set("client_token", fmt.Sprint(clientToken))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *CreateWhiteboardNodeReqBuilder) UserIdType(userIdType string) *CreateWhiteboardNodeReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 在画板中创建节点
func (builder *CreateWhiteboardNodeReqBuilder) Body(body *CreateWhiteboardNodeReqBody) *CreateWhiteboardNodeReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateWhiteboardNodeReqBuilder) Build() *CreateWhiteboardNodeReq {
	req := &CreateWhiteboardNodeReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.body
	return req
}

type CreateWhiteboardNodeReqBody struct {
	Nodes []*WhiteboardNode `json:"nodes,omitempty"` // 子节点数据
}

type CreateWhiteboardNodeReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateWhiteboardNodeReqBody `body:""`
}

type CreateWhiteboardNodeRespData struct {
	Ids []string `json:"ids,omitempty"` // 所创建的节点 id 列表

	ClientToken *string `json:"client_token,omitempty"` // 操作的唯一标识，更新请求中使用此值表示幂等的进行此次更新
}

type CreateWhiteboardNodeResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreateWhiteboardNodeRespData `json:"data"` // 业务数据
}

func (resp *CreateWhiteboardNodeResp) Success() bool {
	return resp.Code == 0
}

type CreatePlantumlWhiteboardNodeReqBodyBuilder struct {
	plantUmlCode     string // plant uml 代码
	plantUmlCodeFlag bool

	styleType     int //
	styleTypeFlag bool

	syntaxType     int // 语法类型
	syntaxTypeFlag bool

	diagramType     int //
	diagramTypeFlag bool

	overwrite     bool // 是否覆盖画板内容：true=覆盖，会将画板当前内容清除再写入；false=不覆盖，直接写入画板。默认为 false
	overwriteFlag bool

	parseMode     int // 解析模式
	parseModeFlag bool
}

func NewCreatePlantumlWhiteboardNodeReqBodyBuilder() *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder := &CreatePlantumlWhiteboardNodeReqBodyBuilder{}
	return builder
}

// plant uml 代码
//
//示例值：@startuml\nAlice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n@enduml
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) PlantUmlCode(plantUmlCode string) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.plantUmlCode = plantUmlCode
	builder.plantUmlCodeFlag = true
	return builder
}

//
//
//示例值：1
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) StyleType(styleType int) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.styleType = styleType
	builder.styleTypeFlag = true
	return builder
}

// 语法类型
//
//示例值：
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) SyntaxType(syntaxType int) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.syntaxType = syntaxType
	builder.syntaxTypeFlag = true
	return builder
}

//
//
//示例值：
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) DiagramType(diagramType int) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.diagramType = diagramType
	builder.diagramTypeFlag = true
	return builder
}

// 是否覆盖画板内容：true=覆盖，会将画板当前内容清除再写入；false=不覆盖，直接写入画板。默认为 false
//
//示例值：
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) Overwrite(overwrite bool) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.overwrite = overwrite
	builder.overwriteFlag = true
	return builder
}

// 解析模式
//
//示例值：0
func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) ParseMode(parseMode int) *CreatePlantumlWhiteboardNodeReqBodyBuilder {
	builder.parseMode = parseMode
	builder.parseModeFlag = true
	return builder
}

func (builder *CreatePlantumlWhiteboardNodeReqBodyBuilder) Build() *CreatePlantumlWhiteboardNodeReqBody {
	req := &CreatePlantumlWhiteboardNodeReqBody{}
	if builder.plantUmlCodeFlag {
		req.PlantUmlCode = &builder.plantUmlCode
	}
	if builder.styleTypeFlag {
		req.StyleType = &builder.styleType
	}
	if builder.syntaxTypeFlag {
		req.SyntaxType = &builder.syntaxType
	}
	if builder.diagramTypeFlag {
		req.DiagramType = &builder.diagramType
	}
	if builder.overwriteFlag {
		req.Overwrite = &builder.overwrite
	}
	if builder.parseModeFlag {
		req.ParseMode = &builder.parseMode
	}
	return req
}

type CreatePlantumlWhiteboardNodePathReqBodyBuilder struct {
	plantUmlCode     string
	plantUmlCodeFlag bool
	styleType        int
	styleTypeFlag    bool
	syntaxType       int
	syntaxTypeFlag   bool
	diagramType      int
	diagramTypeFlag  bool
	overwrite        bool
	overwriteFlag    bool
	parseMode        int
	parseModeFlag    bool
}

func NewCreatePlantumlWhiteboardNodePathReqBodyBuilder() *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder := &CreatePlantumlWhiteboardNodePathReqBodyBuilder{}
	return builder
}

// plant uml 代码
//
// 示例值：@startuml\nAlice -> Bob: Authentication Request\nBob --> Alice: Authentication Response\n@enduml
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) PlantUmlCode(plantUmlCode string) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.plantUmlCode = plantUmlCode
	builder.plantUmlCodeFlag = true
	return builder
}

//
//
// 示例值：1
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) StyleType(styleType int) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.styleType = styleType
	builder.styleTypeFlag = true
	return builder
}

// 语法类型
//
// 示例值：
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) SyntaxType(syntaxType int) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.syntaxType = syntaxType
	builder.syntaxTypeFlag = true
	return builder
}

//
//
// 示例值：
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) DiagramType(diagramType int) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.diagramType = diagramType
	builder.diagramTypeFlag = true
	return builder
}

// 是否覆盖画板内容：true=覆盖，会将画板当前内容清除再写入；false=不覆盖，直接写入画板。默认为 false
//
// 示例值：
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) Overwrite(overwrite bool) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.overwrite = overwrite
	builder.overwriteFlag = true
	return builder
}

// 解析模式
//
// 示例值：0
func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) ParseMode(parseMode int) *CreatePlantumlWhiteboardNodePathReqBodyBuilder {
	builder.parseMode = parseMode
	builder.parseModeFlag = true
	return builder
}

func (builder *CreatePlantumlWhiteboardNodePathReqBodyBuilder) Build() (*CreatePlantumlWhiteboardNodeReqBody, error) {
	req := &CreatePlantumlWhiteboardNodeReqBody{}
	if builder.plantUmlCodeFlag {
		req.PlantUmlCode = &builder.plantUmlCode
	}
	if builder.styleTypeFlag {
		req.StyleType = &builder.styleType
	}
	if builder.syntaxTypeFlag {
		req.SyntaxType = &builder.syntaxType
	}
	if builder.diagramTypeFlag {
		req.DiagramType = &builder.diagramType
	}
	if builder.overwriteFlag {
		req.Overwrite = &builder.overwrite
	}
	if builder.parseModeFlag {
		req.ParseMode = &builder.parseMode
	}
	return req, nil
}

type CreatePlantumlWhiteboardNodeReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreatePlantumlWhiteboardNodeReqBody
}

func NewCreatePlantumlWhiteboardNodeReqBuilder() *CreatePlantumlWhiteboardNodeReqBuilder {
	builder := &CreatePlantumlWhiteboardNodeReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板 token
//
// 示例值：VF5Bwo7Z5icC0bk8EWbb57Vbckh
func (builder *CreatePlantumlWhiteboardNodeReqBuilder) WhiteboardId(whiteboardId string) *CreatePlantumlWhiteboardNodeReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

// 创建 plant uml 图形
func (builder *CreatePlantumlWhiteboardNodeReqBuilder) Body(body *CreatePlantumlWhiteboardNodeReqBody) *CreatePlantumlWhiteboardNodeReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreatePlantumlWhiteboardNodeReqBuilder) Build() *CreatePlantumlWhiteboardNodeReq {
	req := &CreatePlantumlWhiteboardNodeReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.body
	return req
}

type CreatePlantumlWhiteboardNodeReqBody struct {
	PlantUmlCode *string `json:"plant_uml_code,omitempty"` // plant uml 代码

	StyleType *int `json:"style_type,omitempty"` //

	SyntaxType *int `json:"syntax_type,omitempty"` // 语法类型

	DiagramType *int `json:"diagram_type,omitempty"` //

	Overwrite *bool `json:"overwrite,omitempty"` // 是否覆盖画板内容：true=覆盖，会将画板当前内容清除再写入；false=不覆盖，直接写入画板。默认为 false

	ParseMode *int `json:"parse_mode,omitempty"` // 解析模式
}

type CreatePlantumlWhiteboardNodeReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreatePlantumlWhiteboardNodeReqBody `body:""`
}

type CreatePlantumlWhiteboardNodeRespData struct {
	NodeId *string `json:"node_id,omitempty"` // 创建生成的plant uml节点id

	Extra map[string][]string `json:"extra,omitempty"` // 额外的解析信息
}

type CreatePlantumlWhiteboardNodeResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *CreatePlantumlWhiteboardNodeRespData `json:"data"` // 业务数据
}

func (resp *CreatePlantumlWhiteboardNodeResp) Success() bool {
	return resp.Code == 0
}

type ListWhiteboardNodeReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewListWhiteboardNodeReqBuilder() *ListWhiteboardNodeReqBuilder {
	builder := &ListWhiteboardNodeReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 画板唯一标识
//
// 示例值：Ru8nwrWFOhEmaFbEU2VbPRsHcxb
func (builder *ListWhiteboardNodeReqBuilder) WhiteboardId(whiteboardId string) *ListWhiteboardNodeReqBuilder {
	builder.apiReq.PathParams.Set("whiteboard_id", fmt.Sprint(whiteboardId))
	return builder
}

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *ListWhiteboardNodeReqBuilder) UserIdType(userIdType string) *ListWhiteboardNodeReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

func (builder *ListWhiteboardNodeReqBuilder) Build() *ListWhiteboardNodeReq {
	req := &ListWhiteboardNodeReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListWhiteboardNodeReq struct {
	apiReq *larkcore.ApiReq
}

type ListWhiteboardNodeRespData struct {
	Nodes []*WhiteboardNode `json:"nodes,omitempty"` // 查询结果
}

type ListWhiteboardNodeResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *ListWhiteboardNodeRespData `json:"data"` // 业务数据
}

func (resp *ListWhiteboardNodeResp) Success() bool {
	return resp.Code == 0
}
