// Package moments 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 larkmoments

import (
	"fmt"

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

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

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

type Category struct {
	Id *string `json:"id,omitempty"` // 板块的ID

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

	Description *string `json:"description,omitempty"` // 板块描述

	CreateTime *string `json:"create_time,omitempty"` // 板块创建时间

	PostCount *int `json:"post_count,omitempty"` // 板块下帖子总数

	ParticipantCount *int `json:"participant_count,omitempty"` // 板块参与人数
}

type CategoryBuilder struct {
	id     string // 板块的ID
	idFlag bool

	name     string // 板块名
	nameFlag bool

	description     string // 板块描述
	descriptionFlag bool

	createTime     string // 板块创建时间
	createTimeFlag bool

	postCount     int // 板块下帖子总数
	postCountFlag bool

	participantCount     int // 板块参与人数
	participantCountFlag bool
}

func NewCategoryBuilder() *CategoryBuilder {
	builder := &CategoryBuilder{}
	return builder
}

// 板块的ID
//
// 示例值：6560906191909683220
func (builder *CategoryBuilder) Id(id string) *CategoryBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 板块名
//
// 示例值：示例板块
func (builder *CategoryBuilder) Name(name string) *CategoryBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 板块描述
//
// 示例值：一个有趣的板块描述
func (builder *CategoryBuilder) Description(description string) *CategoryBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 板块创建时间
//
// 示例值：2022-05-23T00:00:00+08:00
func (builder *CategoryBuilder) CreateTime(createTime string) *CategoryBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 板块下帖子总数
//
// 示例值：5
func (builder *CategoryBuilder) PostCount(postCount int) *CategoryBuilder {
	builder.postCount = postCount
	builder.postCountFlag = true
	return builder
}

// 板块参与人数
//
// 示例值：10
func (builder *CategoryBuilder) ParticipantCount(participantCount int) *CategoryBuilder {
	builder.participantCount = participantCount
	builder.participantCountFlag = true
	return builder
}

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

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

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

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

	}
	if builder.postCountFlag {
		req.PostCount = &builder.postCount

	}
	if builder.participantCountFlag {
		req.ParticipantCount = &builder.participantCount

	}
	return req
}

type Comment struct {
	UserId *string `json:"user_id,omitempty"` // 评论所属用户ID

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

	ImageKey *string `json:"image_key,omitempty"` // 评论图片的key

	IsHot *bool `json:"is_hot,omitempty"` // 是否热评

	ReactionSet *ReactionSet `json:"reaction_set,omitempty"` // 评论 reactions

	Id *string `json:"id,omitempty"` // 评论 ID

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

	PostId *string `json:"post_id,omitempty"` // 评论所属实体的ID

	ReplyCommentId *string `json:"reply_comment_id,omitempty"` // 回复的评论ID

	RootCommentId *string `json:"root_comment_id,omitempty"` // 根评论ID

	Cid *string `json:"cid,omitempty"` // 创建评论时去重

	UserType *int `json:"user_type,omitempty"` // 表情回复人类型
}

type CommentBuilder struct {
	userId     string // 评论所属用户ID
	userIdFlag bool

	content     string // 评论内容
	contentFlag bool

	imageKey     string // 评论图片的key
	imageKeyFlag bool

	isHot     bool // 是否热评
	isHotFlag bool

	reactionSet     *ReactionSet // 评论 reactions
	reactionSetFlag bool

	id     string // 评论 ID
	idFlag bool

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

	postId     string // 评论所属实体的ID
	postIdFlag bool

	replyCommentId     string // 回复的评论ID
	replyCommentIdFlag bool

	rootCommentId     string // 根评论ID
	rootCommentIdFlag bool

	cid     string // 创建评论时去重
	cidFlag bool

	userType     int // 表情回复人类型
	userTypeFlag bool
}

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

// 评论所属用户ID
//
// 示例值："ou_xxxxx"
func (builder *CommentBuilder) UserId(userId string) *CommentBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 评论内容
//
// 示例值："[[{\"tag\":\"text\",\"text\":\"豪华中型车…………\"},{\"tag\":\"a\",\"text\":\"查看原文\",\"href\":\"https://www.autohome.com.cn/advice/202204/1244455.html\"}]]"
func (builder *CommentBuilder) Content(content string) *CommentBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 评论图片的key
//
// 示例值："img_v2_xxxxxx"
func (builder *CommentBuilder) ImageKey(imageKey string) *CommentBuilder {
	builder.imageKey = imageKey
	builder.imageKeyFlag = true
	return builder
}

// 是否热评
//
// 示例值：false
func (builder *CommentBuilder) IsHot(isHot bool) *CommentBuilder {
	builder.isHot = isHot
	builder.isHotFlag = true
	return builder
}

// 评论 reactions
//
// 示例值：
func (builder *CommentBuilder) ReactionSet(reactionSet *ReactionSet) *CommentBuilder {
	builder.reactionSet = reactionSet
	builder.reactionSetFlag = true
	return builder
}

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

// 评论创建时间
//
// 示例值："2022-05-23T00:00:00+08:00"
func (builder *CommentBuilder) CreateTime(createTime string) *CommentBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 评论所属实体的ID
//
// 示例值："248381241"
func (builder *CommentBuilder) PostId(postId string) *CommentBuilder {
	builder.postId = postId
	builder.postIdFlag = true
	return builder
}

// 回复的评论ID
//
// 示例值：""
func (builder *CommentBuilder) ReplyCommentId(replyCommentId string) *CommentBuilder {
	builder.replyCommentId = replyCommentId
	builder.replyCommentIdFlag = true
	return builder
}

// 根评论ID
//
// 示例值：""
func (builder *CommentBuilder) RootCommentId(rootCommentId string) *CommentBuilder {
	builder.rootCommentId = rootCommentId
	builder.rootCommentIdFlag = true
	return builder
}

// 创建评论时去重
//
// 示例值："generate-a-uuid-here"
func (builder *CommentBuilder) Cid(cid string) *CommentBuilder {
	builder.cid = cid
	builder.cidFlag = true
	return builder
}

// 表情回复人类型
//
// 示例值：1
func (builder *CommentBuilder) UserType(userType int) *CommentBuilder {
	builder.userType = userType
	builder.userTypeFlag = true
	return builder
}

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

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

	}
	if builder.imageKeyFlag {
		req.ImageKey = &builder.imageKey

	}
	if builder.isHotFlag {
		req.IsHot = &builder.isHot

	}
	if builder.reactionSetFlag {
		req.ReactionSet = builder.reactionSet
	}
	if builder.idFlag {
		req.Id = &builder.id

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

	}
	if builder.postIdFlag {
		req.PostId = &builder.postId

	}
	if builder.replyCommentIdFlag {
		req.ReplyCommentId = &builder.replyCommentId

	}
	if builder.rootCommentIdFlag {
		req.RootCommentId = &builder.rootCommentId

	}
	if builder.cidFlag {
		req.Cid = &builder.cid

	}
	if builder.userTypeFlag {
		req.UserType = &builder.userType

	}
	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 Dislike struct {
	EntityType *int `json:"entity_type,omitempty"` // 点踩所属实体类型

	EntityId *string `json:"entity_id,omitempty"` // 点踩所属实体ID

	CreateTime *string `json:"create_time,omitempty"` // 点踩时间

	UserId *string `json:"user_id,omitempty"` // 点踩人ID

	Id *string `json:"id,omitempty"` // Dislike的ID
}

type DislikeBuilder struct {
	entityType     int // 点踩所属实体类型
	entityTypeFlag bool

	entityId     string // 点踩所属实体ID
	entityIdFlag bool

	createTime     string // 点踩时间
	createTimeFlag bool

	userId     string // 点踩人ID
	userIdFlag bool

	id     string // Dislike的ID
	idFlag bool
}

func NewDislikeBuilder() *DislikeBuilder {
	builder := &DislikeBuilder{}
	return builder
}

// 点踩所属实体类型
//
// 示例值：1
func (builder *DislikeBuilder) EntityType(entityType int) *DislikeBuilder {
	builder.entityType = entityType
	builder.entityTypeFlag = true
	return builder
}

// 点踩所属实体ID
//
// 示例值："111111"
func (builder *DislikeBuilder) EntityId(entityId string) *DislikeBuilder {
	builder.entityId = entityId
	builder.entityIdFlag = true
	return builder
}

// 点踩时间
//
// 示例值："2022-05-23T00:00:00+08:00"
func (builder *DislikeBuilder) CreateTime(createTime string) *DislikeBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 点踩人ID
//
// 示例值："ou_xxxxx"
func (builder *DislikeBuilder) UserId(userId string) *DislikeBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// Dislike的ID
//
// 示例值："2222222"
func (builder *DislikeBuilder) Id(id string) *DislikeBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

func (builder *DislikeBuilder) Build() *Dislike {
	req := &Dislike{}
	if builder.entityTypeFlag {
		req.EntityType = &builder.entityType

	}
	if builder.entityIdFlag {
		req.EntityId = &builder.entityId

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

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

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

	}
	return req
}

type Post struct {
	UserId *string `json:"user_id,omitempty"` // 发帖用户ID

	Content *string `json:"content,omitempty"` // 帖子内容

	ImageKeyList []string `json:"image_key_list,omitempty"` // 图片的key 列表

	MediaFileToken *string `json:"media_file_token,omitempty"` // 媒体文件的 token

	CommentCount *int `json:"comment_count,omitempty"` // 评论数

	ReactionSet *ReactionSet `json:"reaction_set,omitempty"` // 帖子的reaction及其数量

	Id *string `json:"id,omitempty"` // 帖子ID

	CreateTime *string `json:"create_time,omitempty"` // 帖子创建时间

	MediaCoverImageKey *string `json:"media_cover_image_key,omitempty"` // 视频封面图片

	Cid *string `json:"cid,omitempty"` // 创建帖子时去重用

	CategoryIds []string `json:"category_ids,omitempty"` // 帖子所属板块

	Link *string `json:"link,omitempty"` // 帖子链接

	UserType *int `json:"user_type,omitempty"` // 发帖人类型

	DislikeCount *int `json:"dislike_count,omitempty"` // 点踩数量
}

type PostBuilder struct {
	userId     string // 发帖用户ID
	userIdFlag bool

	content     string // 帖子内容
	contentFlag bool

	imageKeyList     []string // 图片的key 列表
	imageKeyListFlag bool

	mediaFileToken     string // 媒体文件的 token
	mediaFileTokenFlag bool

	commentCount     int // 评论数
	commentCountFlag bool

	reactionSet     *ReactionSet // 帖子的reaction及其数量
	reactionSetFlag bool

	id     string // 帖子ID
	idFlag bool

	createTime     string // 帖子创建时间
	createTimeFlag bool

	mediaCoverImageKey     string // 视频封面图片
	mediaCoverImageKeyFlag bool

	cid     string // 创建帖子时去重用
	cidFlag bool

	categoryIds     []string // 帖子所属板块
	categoryIdsFlag bool

	link     string // 帖子链接
	linkFlag bool

	userType     int // 发帖人类型
	userTypeFlag bool

	dislikeCount     int // 点踩数量
	dislikeCountFlag bool
}

func NewPostBuilder() *PostBuilder {
	builder := &PostBuilder{}
	return builder
}

// 发帖用户ID
//
// 示例值："ou_xxxxx"
func (builder *PostBuilder) UserId(userId string) *PostBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 帖子内容
//
// 示例值："[[{\"tag\":\"text\",\"text\":\"豪华中型车…………\"},{\"tag\":\"a\",\"text\":\"查看原文\",\"href\":\"https://www.autohome.com.cn/advice/202204/1244455.html\"}]]"
func (builder *PostBuilder) Content(content string) *PostBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 图片的key 列表
//
// 示例值：
func (builder *PostBuilder) ImageKeyList(imageKeyList []string) *PostBuilder {
	builder.imageKeyList = imageKeyList
	builder.imageKeyListFlag = true
	return builder
}

// 媒体文件的 token
//
// 示例值：""
func (builder *PostBuilder) MediaFileToken(mediaFileToken string) *PostBuilder {
	builder.mediaFileToken = mediaFileToken
	builder.mediaFileTokenFlag = true
	return builder
}

// 评论数
//
// 示例值：1
func (builder *PostBuilder) CommentCount(commentCount int) *PostBuilder {
	builder.commentCount = commentCount
	builder.commentCountFlag = true
	return builder
}

// 帖子的reaction及其数量
//
// 示例值：
func (builder *PostBuilder) ReactionSet(reactionSet *ReactionSet) *PostBuilder {
	builder.reactionSet = reactionSet
	builder.reactionSetFlag = true
	return builder
}

// 帖子ID
//
// 示例值："248381241"
func (builder *PostBuilder) Id(id string) *PostBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 帖子创建时间
//
// 示例值："2022-05-23T00:00:00+08:00"
func (builder *PostBuilder) CreateTime(createTime string) *PostBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 视频封面图片
//
// 示例值：""
func (builder *PostBuilder) MediaCoverImageKey(mediaCoverImageKey string) *PostBuilder {
	builder.mediaCoverImageKey = mediaCoverImageKey
	builder.mediaCoverImageKeyFlag = true
	return builder
}

// 创建帖子时去重用
//
// 示例值："generate-a-uuid-here"
func (builder *PostBuilder) Cid(cid string) *PostBuilder {
	builder.cid = cid
	builder.cidFlag = true
	return builder
}

// 帖子所属板块
//
// 示例值：
func (builder *PostBuilder) CategoryIds(categoryIds []string) *PostBuilder {
	builder.categoryIds = categoryIds
	builder.categoryIdsFlag = true
	return builder
}

// 帖子链接
//
// 示例值："https://applink.feishu.cn/client/moments/detail?postId=7254"
func (builder *PostBuilder) Link(link string) *PostBuilder {
	builder.link = link
	builder.linkFlag = true
	return builder
}

// 发帖人类型
//
// 示例值：1
func (builder *PostBuilder) UserType(userType int) *PostBuilder {
	builder.userType = userType
	builder.userTypeFlag = true
	return builder
}

// 点踩数量
//
// 示例值：0
func (builder *PostBuilder) DislikeCount(dislikeCount int) *PostBuilder {
	builder.dislikeCount = dislikeCount
	builder.dislikeCountFlag = true
	return builder
}

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

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

	}
	if builder.imageKeyListFlag {
		req.ImageKeyList = builder.imageKeyList
	}
	if builder.mediaFileTokenFlag {
		req.MediaFileToken = &builder.mediaFileToken

	}
	if builder.commentCountFlag {
		req.CommentCount = &builder.commentCount

	}
	if builder.reactionSetFlag {
		req.ReactionSet = builder.reactionSet
	}
	if builder.idFlag {
		req.Id = &builder.id

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

	}
	if builder.mediaCoverImageKeyFlag {
		req.MediaCoverImageKey = &builder.mediaCoverImageKey

	}
	if builder.cidFlag {
		req.Cid = &builder.cid

	}
	if builder.categoryIdsFlag {
		req.CategoryIds = builder.categoryIds
	}
	if builder.linkFlag {
		req.Link = &builder.link

	}
	if builder.userTypeFlag {
		req.UserType = &builder.userType

	}
	if builder.dislikeCountFlag {
		req.DislikeCount = &builder.dislikeCount

	}
	return req
}

type PostStatistics struct {
	ShareCount *int `json:"share_count,omitempty"` // 分享次数
}

type PostStatisticsBuilder struct {
	shareCount     int // 分享次数
	shareCountFlag bool
}

func NewPostStatisticsBuilder() *PostStatisticsBuilder {
	builder := &PostStatisticsBuilder{}
	return builder
}

// 分享次数
//
// 示例值：1
func (builder *PostStatisticsBuilder) ShareCount(shareCount int) *PostStatisticsBuilder {
	builder.shareCount = shareCount
	builder.shareCountFlag = true
	return builder
}

func (builder *PostStatisticsBuilder) Build() *PostStatistics {
	req := &PostStatistics{}
	if builder.shareCountFlag {
		req.ShareCount = &builder.shareCount

	}
	return req
}

type Reaction struct {
	Type *string `json:"type,omitempty"` // reaction 类型

	UserId *string `json:"user_id,omitempty"` // reaction 所属用户ID

	EntityId *string `json:"entity_id,omitempty"` // reaction 所属实体ID

	Id *string `json:"id,omitempty"` // Reaction的ID

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

	EntityType *int `json:"entity_type,omitempty"` // 表情回复所属实体类型

	UserType *int `json:"user_type,omitempty"` // 表情回复人类型
}

type ReactionBuilder struct {
	type_    string // reaction 类型
	typeFlag bool

	userId     string // reaction 所属用户ID
	userIdFlag bool

	entityId     string // reaction 所属实体ID
	entityIdFlag bool

	id     string // Reaction的ID
	idFlag bool

	createTime     string // reaction创建时间
	createTimeFlag bool

	entityType     int // 表情回复所属实体类型
	entityTypeFlag bool

	userType     int // 表情回复人类型
	userTypeFlag bool
}

func NewReactionBuilder() *ReactionBuilder {
	builder := &ReactionBuilder{}
	return builder
}

// reaction 类型
//
// 示例值："OK"
func (builder *ReactionBuilder) Type(type_ string) *ReactionBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// reaction 所属用户ID
//
// 示例值："ou_xxxxx"
func (builder *ReactionBuilder) UserId(userId string) *ReactionBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// reaction 所属实体ID
//
// 示例值："248381241"
func (builder *ReactionBuilder) EntityId(entityId string) *ReactionBuilder {
	builder.entityId = entityId
	builder.entityIdFlag = true
	return builder
}

// Reaction的ID
//
// 示例值："MS8yL1NPQg=="
func (builder *ReactionBuilder) Id(id string) *ReactionBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// reaction创建时间
//
// 示例值："2022-05-23T00:00:00+08:00"
func (builder *ReactionBuilder) CreateTime(createTime string) *ReactionBuilder {
	builder.createTime = createTime
	builder.createTimeFlag = true
	return builder
}

// 表情回复所属实体类型
//
// 示例值：1
func (builder *ReactionBuilder) EntityType(entityType int) *ReactionBuilder {
	builder.entityType = entityType
	builder.entityTypeFlag = true
	return builder
}

// 表情回复人类型
//
// 示例值：1
func (builder *ReactionBuilder) UserType(userType int) *ReactionBuilder {
	builder.userType = userType
	builder.userTypeFlag = true
	return builder
}

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

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

	}
	if builder.entityIdFlag {
		req.EntityId = &builder.entityId

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

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

	}
	if builder.entityTypeFlag {
		req.EntityType = &builder.entityType

	}
	if builder.userTypeFlag {
		req.UserType = &builder.userType

	}
	return req
}

type ReactionList struct {
	Type *string `json:"type,omitempty"` // 表情类型

	Count *int `json:"count,omitempty"` // 回复该表情的人数
}

type ReactionListBuilder struct {
	type_    string // 表情类型
	typeFlag bool

	count     int // 回复该表情的人数
	countFlag bool
}

func NewReactionListBuilder() *ReactionListBuilder {
	builder := &ReactionListBuilder{}
	return builder
}

// 表情类型
//
// 示例值：OK
func (builder *ReactionListBuilder) Type(type_ string) *ReactionListBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 回复该表情的人数
//
// 示例值：3
func (builder *ReactionListBuilder) Count(count int) *ReactionListBuilder {
	builder.count = count
	builder.countFlag = true
	return builder
}

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

	}
	if builder.countFlag {
		req.Count = &builder.count

	}
	return req
}

type ReactionSet struct {
	Reactions []*ReactionList `json:"reactions,omitempty"` // 表情列表

	TotalCount *int `json:"total_count,omitempty"` // 全部表情计数
}

type ReactionSetBuilder struct {
	reactions     []*ReactionList // 表情列表
	reactionsFlag bool

	totalCount     int // 全部表情计数
	totalCountFlag bool
}

func NewReactionSetBuilder() *ReactionSetBuilder {
	builder := &ReactionSetBuilder{}
	return builder
}

// 表情列表
//
// 示例值：
func (builder *ReactionSetBuilder) Reactions(reactions []*ReactionList) *ReactionSetBuilder {
	builder.reactions = reactions
	builder.reactionsFlag = true
	return builder
}

// 全部表情计数
//
// 示例值：20
func (builder *ReactionSetBuilder) TotalCount(totalCount int) *ReactionSetBuilder {
	builder.totalCount = totalCount
	builder.totalCountFlag = true
	return builder
}

func (builder *ReactionSetBuilder) Build() *ReactionSet {
	req := &ReactionSet{}
	if builder.reactionsFlag {
		req.Reactions = builder.reactions
	}
	if builder.totalCountFlag {
		req.TotalCount = &builder.totalCount

	}
	return req
}

type UserId struct {
	UserId *string `json:"user_id,omitempty"` //

	OpenId *string `json:"open_id,omitempty"` //

	UnionId *string `json:"union_id,omitempty"` //
}

type UserIdBuilder struct {
	userId     string //
	userIdFlag bool

	openId     string //
	openIdFlag bool

	unionId     string //
	unionIdFlag bool
}

func NewUserIdBuilder() *UserIdBuilder {
	builder := &UserIdBuilder{}
	return builder
}

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

//
//
// 示例值：
func (builder *UserIdBuilder) OpenId(openId string) *UserIdBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *UserIdBuilder) UnionId(unionId string) *UserIdBuilder {
	builder.unionId = unionId
	builder.unionIdFlag = true
	return builder
}

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

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

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

	}
	return req
}

type GetPostReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// post的id
//
// 示例值：6934510454161014804
func (builder *GetPostReqBuilder) PostId(postId string) *GetPostReqBuilder {
	builder.apiReq.PathParams.Set("post_id", fmt.Sprint(postId))
	return builder
}

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

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

type GetPostReq struct {
	apiReq *larkcore.ApiReq
}

type GetPostRespData struct {
	Post *Post `json:"post,omitempty"` // 帖子实体
}

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

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

type P2CommentCreatedV1Data struct {
	UserId *UserId `json:"user_id,omitempty"` // 评论所属用户ID

	Id *string `json:"id,omitempty"` // 评论 ID

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

	PostId *string `json:"post_id,omitempty"` // 评论所属帖子的ID

	ReplyCommentId *string `json:"reply_comment_id,omitempty"` // 回复的评论ID

	RootCommentId *string `json:"root_comment_id,omitempty"` // 根评论ID

	UserType *int `json:"user_type,omitempty"` // 表情回复人类型
}

type P2CommentCreatedV1 struct {
	*larkevent.EventV2Base                         // 事件基础数据
	*larkevent.EventReq                            // 请求原生数据
	Event                  *P2CommentCreatedV1Data `json:"event"` // 事件内容
}

func (m *P2CommentCreatedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

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

	PostId *string `json:"post_id,omitempty"` // 评论所属帖子的ID
}

type P2CommentDeletedV1 struct {
	*larkevent.EventV2Base                         // 事件基础数据
	*larkevent.EventReq                            // 请求原生数据
	Event                  *P2CommentDeletedV1Data `json:"event"` // 事件内容
}

func (m *P2CommentDeletedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type P2PostCreatedV1Data struct {
	Id *string `json:"id,omitempty"` // 帖子ID

	UserId *UserId `json:"user_id,omitempty"` // 发帖用户ID

	CreateTime *string `json:"create_time,omitempty"` // 帖子创建时间

	CategoryIds []string `json:"category_ids,omitempty"` // 帖子所属板块

	Link *string `json:"link,omitempty"` // 帖子链接

	UserType *int `json:"user_type,omitempty"` // 发帖人类型
}

type P2PostCreatedV1 struct {
	*larkevent.EventV2Base                      // 事件基础数据
	*larkevent.EventReq                         // 请求原生数据
	Event                  *P2PostCreatedV1Data `json:"event"` // 事件内容
}

func (m *P2PostCreatedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type P2PostDeletedV1Data struct {
	Id *string `json:"id,omitempty"` // 帖子ID
}

type P2PostDeletedV1 struct {
	*larkevent.EventV2Base                      // 事件基础数据
	*larkevent.EventReq                         // 请求原生数据
	Event                  *P2PostDeletedV1Data `json:"event"` // 事件内容
}

func (m *P2PostDeletedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type P2PostStatisticsUpdatedV1Data struct {
	PostId *string `json:"post_id,omitempty"` // 帖子ID

	StatisticsType *int `json:"statistics_type,omitempty"` // 变更统计数据类型

	Statistics *PostStatistics `json:"statistics,omitempty"` // 帖子统计数据
}

type P2PostStatisticsUpdatedV1 struct {
	*larkevent.EventV2Base                                // 事件基础数据
	*larkevent.EventReq                                   // 请求原生数据
	Event                  *P2PostStatisticsUpdatedV1Data `json:"event"` // 事件内容
}

func (m *P2PostStatisticsUpdatedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type P2ReactionCreatedV1Data struct {
	Type *string `json:"type,omitempty"` // reaction 类型

	UserId *UserId `json:"user_id,omitempty"` // reaction 所属用户ID

	EntityId *string `json:"entity_id,omitempty"` // reaction 所属实体ID

	Id *string `json:"id,omitempty"` // Reaction的ID

	EntityType *int `json:"entity_type,omitempty"` // 表情回复所属实体类型

	UserType *int `json:"user_type,omitempty"` // 表情回复人类型

	CreateTime *string `json:"create_time,omitempty"` // reaction创建时间
}

type P2ReactionCreatedV1 struct {
	*larkevent.EventV2Base                          // 事件基础数据
	*larkevent.EventReq                             // 请求原生数据
	Event                  *P2ReactionCreatedV1Data `json:"event"` // 事件内容
}

func (m *P2ReactionCreatedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}

type P2ReactionDeletedV1Data struct {
	Type *string `json:"type,omitempty"` // reaction 类型

	UserId *UserId `json:"user_id,omitempty"` // reaction 所属用户ID

	EntityId *string `json:"entity_id,omitempty"` // reaction 所属实体ID

	Id *string `json:"id,omitempty"` // Reaction的ID

	EntityType *int `json:"entity_type,omitempty"` // 表情回复所属实体类型

	UserType *int `json:"user_type,omitempty"` // 表情回复人类型
}

type P2ReactionDeletedV1 struct {
	*larkevent.EventV2Base                          // 事件基础数据
	*larkevent.EventReq                             // 请求原生数据
	Event                  *P2ReactionDeletedV1Data `json:"event"` // 事件内容
}

func (m *P2ReactionDeletedV1) RawReq(req *larkevent.EventReq) {
	m.EventReq = req
}
