// Package mail 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 larkmail

import (
	"fmt"

	"context"
	"errors"

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

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

const (
	MailgroupWhoCanSendMailANYONE           = "ANYONE"             // Any Internet user can send mail to this mail group
	MailgroupWhoCanSendMailALLINTERNALUSERS = "ALL_INTERNAL_USERS" // Anyone in the team can send mail to this mail group
	MailgroupWhoCanSendMailALLGROUPMEMBERS  = "ALL_GROUP_MEMBERS"  // Any group member can send mail to this mail group
	MailgroupWhoCanSendMailCUSTOMMEMBERS    = "CUSTOM_MEMBERS"     // Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
)

const (
	ListMailGroupUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListMailGroupUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListMailGroupUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	MailgroupWhoCanSendMailPatchMailgroupANYONE           = "ANYONE"             // Any Internet user can send mail to this mail group
	MailgroupWhoCanSendMailPatchMailgroupALLINTERNALUSERS = "ALL_INTERNAL_USERS" // Anyone in the team can send mail to this mail group
	MailgroupWhoCanSendMailPatchMailgroupALLGROUPMEMBERS  = "ALL_GROUP_MEMBERS"  // Any group member can send mail to this mail group
	MailgroupWhoCanSendMailPatchMailgroupCUSTOMMEMBERS    = "CUSTOM_MEMBERS"     // Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
)

const (
	MailgroupWhoCanSendMailUpdateMailgroupANYONE           = "ANYONE"             // Any Internet user can send mail to this mail group
	MailgroupWhoCanSendMailUpdateMailgroupALLINTERNALUSERS = "ALL_INTERNAL_USERS" // Anyone in the team can send mail to this mail group
	MailgroupWhoCanSendMailUpdateMailgroupALLGROUPMEMBERS  = "ALL_GROUP_MEMBERS"  // Any group member can send mail to this mail group
	MailgroupWhoCanSendMailUpdateMailgroupCUSTOMMEMBERS    = "CUSTOM_MEMBERS"     // Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
)

const (
	BatchCreateMailGroupManagerUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	BatchCreateMailGroupManagerUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	BatchCreateMailGroupManagerUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	BatchDeleteMailGroupManagerUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	BatchDeleteMailGroupManagerUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	BatchDeleteMailGroupManagerUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	ListMailGroupManagerUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListMailGroupManagerUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListMailGroupManagerUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	BatchCreateMailGroupMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	BatchCreateMailGroupMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	BatchCreateMailGroupMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	MailgroupMemberTypeUSER          = "USER"           // internal user in the team
	MailgroupMemberTypeDEPARTMENT    = "DEPARTMENT"     // member is a department
	MailgroupMemberTypeCOMPANY       = "COMPANY"        // member is the company
	MailgroupMemberTypeEXTERNALUSER  = "EXTERNAL_USER"  // internet user outside the organization
	MailgroupMemberTypeMAILGROUP     = "MAIL_GROUP"     // member is another mail group
	MailgroupMemberTypePUBLICMAILBOX = "PUBLIC_MAILBOX" // member is a public mailbox
	MailgroupMemberTypeOTHERMEMBER   = "OTHER_MEMBER"   // other internal member
)

const (
	CreateMailGroupMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CreateMailGroupMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CreateMailGroupMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	GetMailGroupMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetMailGroupMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	GetMailGroupMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	ListMailGroupMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListMailGroupMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListMailGroupMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	BatchCreateMailGroupPermissionMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	BatchCreateMailGroupPermissionMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	BatchCreateMailGroupPermissionMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	MailgroupPermissionMemberTypeUSER          = "USER"           // internal user in the team
	MailgroupPermissionMemberTypeDEPARTMENT    = "DEPARTMENT"     // member is a department
	MailgroupPermissionMemberTypeMAILGROUP     = "MAIL_GROUP"     // member is a mail group
	MailgroupPermissionMemberTypePUBLICMAILBOX = "PUBLIC_MAILBOX" // member is a public mailbox
)

const (
	CreateMailGroupPermissionMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CreateMailGroupPermissionMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CreateMailGroupPermissionMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	GetMailGroupPermissionMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetMailGroupPermissionMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	GetMailGroupPermissionMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	ListMailGroupPermissionMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListMailGroupPermissionMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListMailGroupPermissionMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

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

const (
	ListPublicMailboxUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListPublicMailboxUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListPublicMailboxUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	BatchCreatePublicMailboxMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	BatchCreatePublicMailboxMemberUserIDTypeUnionId = "union_id" // 以user_id来识别用户
	BatchCreatePublicMailboxMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	PublicMailboxMemberTypeUSER = "USER" // internal user in the team
)

const (
	CreatePublicMailboxMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	CreatePublicMailboxMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	CreatePublicMailboxMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	GetPublicMailboxMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetPublicMailboxMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	GetPublicMailboxMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	ListPublicMailboxMemberUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	ListPublicMailboxMemberUserIDTypeUnionId = "union_id" // 以union_id来识别用户
	ListPublicMailboxMemberUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	EventTypeMessage = 1 // 邮件相关事件

)

const (
	EventTypeUnsubscribeUserMailboxEventMessage = 1 // 邮件相关事件

)

const (
	FolderTypeSystem = 1 // 系统文件夹
	FolderTypeUser   = 2 // 用户文件夹

)

const (
	GetByCardUserMailboxMessageUserIDTypeOpenId  = "open_id"  // 以open_id来识别用户
	GetByCardUserMailboxMessageUserIDTypeUserId  = "user_id"  // 以user_id来识别用户
	GetByCardUserMailboxMessageUserIDTypeUnionId = "union_id" // 以union_id来识别用户
)

type Attachment struct {
	Body *string `json:"body,omitempty"` // 附件的正文，使用 base64url 编码（支持的文件最大 37MB）

	Filename *string `json:"filename,omitempty"` // 附件文件名

	Id *string `json:"id,omitempty"` // 附件 id

	AttachmentType *int `json:"attachment_type,omitempty"` // 附件类型

	IsInline *bool `json:"is_inline,omitempty"` // 是否为内联图片，true 表示是内联图片

	Cid *string `json:"cid,omitempty"` // 内容 ID，HTML 中通过 cid: 协议引用该图片
}

type AttachmentBuilder struct {
	body     string // 附件的正文，使用 base64url 编码（支持的文件最大 37MB）
	bodyFlag bool

	filename     string // 附件文件名
	filenameFlag bool

	id     string // 附件 id
	idFlag bool

	attachmentType     int // 附件类型
	attachmentTypeFlag bool

	isInline     bool // 是否为内联图片，true 表示是内联图片
	isInlineFlag bool

	cid     string // 内容 ID，HTML 中通过 cid: 协议引用该图片
	cidFlag bool
}

func NewAttachmentBuilder() *AttachmentBuilder {
	builder := &AttachmentBuilder{}
	return builder
}

// 附件的正文，使用 base64url 编码（支持的文件最大 37MB）
//
// 示例值：aGVsbG8gd29ybGQK
func (builder *AttachmentBuilder) Body(body string) *AttachmentBuilder {
	builder.body = body
	builder.bodyFlag = true
	return builder
}

// 附件文件名
//
// 示例值：helloworld.txt
func (builder *AttachmentBuilder) Filename(filename string) *AttachmentBuilder {
	builder.filename = filename
	builder.filenameFlag = true
	return builder
}

// 附件 id
//
// 示例值：YQqYbQHoQoDqXjxWKhJbo8Gicjf
func (builder *AttachmentBuilder) Id(id string) *AttachmentBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 附件类型
//
// 示例值：1
func (builder *AttachmentBuilder) AttachmentType(attachmentType int) *AttachmentBuilder {
	builder.attachmentType = attachmentType
	builder.attachmentTypeFlag = true
	return builder
}

// 是否为内联图片，true 表示是内联图片
//
// 示例值：false
func (builder *AttachmentBuilder) IsInline(isInline bool) *AttachmentBuilder {
	builder.isInline = isInline
	builder.isInlineFlag = true
	return builder
}

// 内容 ID，HTML 中通过 cid: 协议引用该图片
//
// 示例值：image1@example.com
func (builder *AttachmentBuilder) Cid(cid string) *AttachmentBuilder {
	builder.cid = cid
	builder.cidFlag = true
	return builder
}

func (builder *AttachmentBuilder) Build() *Attachment {
	req := &Attachment{}
	if builder.bodyFlag {
		req.Body = &builder.body

	}
	if builder.filenameFlag {
		req.Filename = &builder.filename

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

	}
	if builder.attachmentTypeFlag {
		req.AttachmentType = &builder.attachmentType

	}
	if builder.isInlineFlag {
		req.IsInline = &builder.isInline

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

	}
	return req
}

type AttachmentDownloadUrlItem struct {
	AttachmentId *string `json:"attachment_id,omitempty"` // 附件 id

	DownloadUrl *string `json:"download_url,omitempty"` // 下载链接
}

type AttachmentDownloadUrlItemBuilder struct {
	attachmentId     string // 附件 id
	attachmentIdFlag bool

	downloadUrl     string // 下载链接
	downloadUrlFlag bool
}

func NewAttachmentDownloadUrlItemBuilder() *AttachmentDownloadUrlItemBuilder {
	builder := &AttachmentDownloadUrlItemBuilder{}
	return builder
}

// 附件 id
//
// 示例值：YQqYbQHoQoDqXjxWKhJbo8Gicjf
func (builder *AttachmentDownloadUrlItemBuilder) AttachmentId(attachmentId string) *AttachmentDownloadUrlItemBuilder {
	builder.attachmentId = attachmentId
	builder.attachmentIdFlag = true
	return builder
}

// 下载链接
//
// 示例值：https://api-drive-stream.feishu.cn/space/api/box/stream/download/authcode/?code=YTZiZGViMDg3NzRjMzEwOWRkMGI1MTJlYmQxYTFmYTBfZTA5ZjZiOWU4NDYzMzkxMDUyOTIxMzBmNTVjMjAyZTFfSUQ6NzI4MTE4Nzg1OTE5NTc3Mjk0N18xNjk1ODg4NjQyOjE2OTU4ODg3MDJfVjM
func (builder *AttachmentDownloadUrlItemBuilder) DownloadUrl(downloadUrl string) *AttachmentDownloadUrlItemBuilder {
	builder.downloadUrl = downloadUrl
	builder.downloadUrlFlag = true
	return builder
}

func (builder *AttachmentDownloadUrlItemBuilder) Build() *AttachmentDownloadUrlItem {
	req := &AttachmentDownloadUrlItem{}
	if builder.attachmentIdFlag {
		req.AttachmentId = &builder.attachmentId

	}
	if builder.downloadUrlFlag {
		req.DownloadUrl = &builder.downloadUrl

	}
	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 DomainIncrementalSwitch struct {
	DomainName *string `json:"domain_name,omitempty"` // 域名名称

	Items []*IncrementalSwitchEntity `json:"items,omitempty"` // 实体列表

	UserIdType *string `json:"user_id_type,omitempty"` // 用户 ID 类型

	DepartmentIdType *string `json:"department_id_type,omitempty"` // 部门ID类型
}

type DomainIncrementalSwitchBuilder struct {
	domainName     string // 域名名称
	domainNameFlag bool

	items     []*IncrementalSwitchEntity // 实体列表
	itemsFlag bool

	userIdType     string // 用户 ID 类型
	userIdTypeFlag bool

	departmentIdType     string // 部门ID类型
	departmentIdTypeFlag bool
}

func NewDomainIncrementalSwitchBuilder() *DomainIncrementalSwitchBuilder {
	builder := &DomainIncrementalSwitchBuilder{}
	return builder
}

// 域名名称
//
// 示例值：test.com
func (builder *DomainIncrementalSwitchBuilder) DomainName(domainName string) *DomainIncrementalSwitchBuilder {
	builder.domainName = domainName
	builder.domainNameFlag = true
	return builder
}

// 实体列表
//
// 示例值：
func (builder *DomainIncrementalSwitchBuilder) Items(items []*IncrementalSwitchEntity) *DomainIncrementalSwitchBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

// 用户 ID 类型
//
// 示例值：xxxx
func (builder *DomainIncrementalSwitchBuilder) UserIdType(userIdType string) *DomainIncrementalSwitchBuilder {
	builder.userIdType = userIdType
	builder.userIdTypeFlag = true
	return builder
}

// 部门ID类型
//
// 示例值：xxxx
func (builder *DomainIncrementalSwitchBuilder) DepartmentIdType(departmentIdType string) *DomainIncrementalSwitchBuilder {
	builder.departmentIdType = departmentIdType
	builder.departmentIdTypeFlag = true
	return builder
}

func (builder *DomainIncrementalSwitchBuilder) Build() *DomainIncrementalSwitch {
	req := &DomainIncrementalSwitch{}
	if builder.domainNameFlag {
		req.DomainName = &builder.domainName

	}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	if builder.userIdTypeFlag {
		req.UserIdType = &builder.userIdType

	}
	if builder.departmentIdTypeFlag {
		req.DepartmentIdType = &builder.departmentIdType

	}
	return req
}

type EmailAlias struct {
	PrimaryEmail *string `json:"primary_email,omitempty"` // 主邮箱地址

	EmailAlias *string `json:"email_alias,omitempty"` // 邮箱别名
}

type EmailAliasBuilder struct {
	primaryEmail     string // 主邮箱地址
	primaryEmailFlag bool

	emailAlias     string // 邮箱别名
	emailAliasFlag bool
}

func NewEmailAliasBuilder() *EmailAliasBuilder {
	builder := &EmailAliasBuilder{}
	return builder
}

// 主邮箱地址
//
// 示例值：xxx@xx.xxx
func (builder *EmailAliasBuilder) PrimaryEmail(primaryEmail string) *EmailAliasBuilder {
	builder.primaryEmail = primaryEmail
	builder.primaryEmailFlag = true
	return builder
}

// 邮箱别名
//
// 示例值：xxx@xx.xxx
func (builder *EmailAliasBuilder) EmailAlias(emailAlias string) *EmailAliasBuilder {
	builder.emailAlias = emailAlias
	builder.emailAliasFlag = true
	return builder
}

func (builder *EmailAliasBuilder) Build() *EmailAlias {
	req := &EmailAlias{}
	if builder.primaryEmailFlag {
		req.PrimaryEmail = &builder.primaryEmail

	}
	if builder.emailAliasFlag {
		req.EmailAlias = &builder.emailAlias

	}
	return req
}

type EnterpriseEmailChangeEvent struct {
	OpenId *string `json:"open_id,omitempty"` // 用户ID

	EventId *string `json:"event_id,omitempty"` // 事件ID

	EventType *int `json:"event_type,omitempty"` // 事件类型
}

type EnterpriseEmailChangeEventBuilder struct {
	openId     string // 用户ID
	openIdFlag bool

	eventId     string // 事件ID
	eventIdFlag bool

	eventType     int // 事件类型
	eventTypeFlag bool
}

func NewEnterpriseEmailChangeEventBuilder() *EnterpriseEmailChangeEventBuilder {
	builder := &EnterpriseEmailChangeEventBuilder{}
	return builder
}

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

// 事件ID
//
// 示例值：123_123
func (builder *EnterpriseEmailChangeEventBuilder) EventId(eventId string) *EnterpriseEmailChangeEventBuilder {
	builder.eventId = eventId
	builder.eventIdFlag = true
	return builder
}

// 事件类型
//
// 示例值：1
func (builder *EnterpriseEmailChangeEventBuilder) EventType(eventType int) *EnterpriseEmailChangeEventBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

func (builder *EnterpriseEmailChangeEventBuilder) Build() *EnterpriseEmailChangeEvent {
	req := &EnterpriseEmailChangeEvent{}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.eventIdFlag {
		req.EventId = &builder.eventId

	}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType

	}
	return req
}

type EventLog struct {
	MailFrom *string `json:"mail_from,omitempty"` // 发信人

	RcptTo *string `json:"rcpt_to,omitempty"` // 收信人

	SmtpMessageId *string `json:"smtp_message_id,omitempty"` // 邮件ID

	EventType *int `json:"event_type,omitempty"` // 行为类型

	Timestamp *int `json:"timestamp,omitempty"` // 时间戳
}

type EventLogBuilder struct {
	mailFrom     string // 发信人
	mailFromFlag bool

	rcptTo     string // 收信人
	rcptToFlag bool

	smtpMessageId     string // 邮件ID
	smtpMessageIdFlag bool

	eventType     int // 行为类型
	eventTypeFlag bool

	timestamp     int // 时间戳
	timestampFlag bool
}

func NewEventLogBuilder() *EventLogBuilder {
	builder := &EventLogBuilder{}
	return builder
}

// 发信人
//
// 示例值：abc@example.com
func (builder *EventLogBuilder) MailFrom(mailFrom string) *EventLogBuilder {
	builder.mailFrom = mailFrom
	builder.mailFromFlag = true
	return builder
}

// 收信人
//
// 示例值：abc@example.com
func (builder *EventLogBuilder) RcptTo(rcptTo string) *EventLogBuilder {
	builder.rcptTo = rcptTo
	builder.rcptToFlag = true
	return builder
}

// 邮件ID
//
// 示例值：abc@example.com
func (builder *EventLogBuilder) SmtpMessageId(smtpMessageId string) *EventLogBuilder {
	builder.smtpMessageId = smtpMessageId
	builder.smtpMessageIdFlag = true
	return builder
}

// 行为类型
//
// 示例值：1
func (builder *EventLogBuilder) EventType(eventType int) *EventLogBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

// 时间戳
//
// 示例值：1706882657
func (builder *EventLogBuilder) Timestamp(timestamp int) *EventLogBuilder {
	builder.timestamp = timestamp
	builder.timestampFlag = true
	return builder
}

func (builder *EventLogBuilder) Build() *EventLog {
	req := &EventLog{}
	if builder.mailFromFlag {
		req.MailFrom = &builder.mailFrom

	}
	if builder.rcptToFlag {
		req.RcptTo = &builder.rcptTo

	}
	if builder.smtpMessageIdFlag {
		req.SmtpMessageId = &builder.smtpMessageId

	}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType

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

	}
	return req
}

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

	FilenameHash *string `json:"filename_hash,omitempty"` // 文件名（哈希）

	Size *string `json:"size,omitempty"` // 文件大小（byte）
}

type FileMetaInfoBuilder struct {
	id     string // 文件id
	idFlag bool

	filenameHash     string // 文件名（哈希）
	filenameHashFlag bool

	size     string // 文件大小（byte）
	sizeFlag bool
}

func NewFileMetaInfoBuilder() *FileMetaInfoBuilder {
	builder := &FileMetaInfoBuilder{}
	return builder
}

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

// 文件名（哈希）
//
// 示例值：a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3
func (builder *FileMetaInfoBuilder) FilenameHash(filenameHash string) *FileMetaInfoBuilder {
	builder.filenameHash = filenameHash
	builder.filenameHashFlag = true
	return builder
}

// 文件大小（byte）
//
// 示例值：1024
func (builder *FileMetaInfoBuilder) Size(size string) *FileMetaInfoBuilder {
	builder.size = size
	builder.sizeFlag = true
	return builder
}

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

	}
	if builder.filenameHashFlag {
		req.FilenameHash = &builder.filenameHash

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

	}
	return req
}

type Folder struct {
	Id *string `json:"id,omitempty"` // folder id

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

	ParentFolderId *string `json:"parent_folder_id,omitempty"` // 父文件夹 id，该值为 0 表示根文件夹

	FolderType *int `json:"folder_type,omitempty"` // 文件夹类型

	UnreadMessageCount *int `json:"unread_message_count,omitempty"` // 未读邮件数量

	UnreadThreadCount *int `json:"unread_thread_count,omitempty"` // 未读会话数量
}

type FolderBuilder struct {
	id     string // folder id
	idFlag bool

	name     string // 文件夹名称
	nameFlag bool

	parentFolderId     string // 父文件夹 id，该值为 0 表示根文件夹
	parentFolderIdFlag bool

	folderType     int // 文件夹类型
	folderTypeFlag bool

	unreadMessageCount     int // 未读邮件数量
	unreadMessageCountFlag bool

	unreadThreadCount     int // 未读会话数量
	unreadThreadCountFlag bool
}

func NewFolderBuilder() *FolderBuilder {
	builder := &FolderBuilder{}
	return builder
}

// folder id
//
// 示例值：12314123123123123
func (builder *FolderBuilder) Id(id string) *FolderBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 文件夹名称
//
// 示例值：newsletter 相关
func (builder *FolderBuilder) Name(name string) *FolderBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 父文件夹 id，该值为 0 表示根文件夹
//
// 示例值：725627422334644
func (builder *FolderBuilder) ParentFolderId(parentFolderId string) *FolderBuilder {
	builder.parentFolderId = parentFolderId
	builder.parentFolderIdFlag = true
	return builder
}

// 文件夹类型
//
// 示例值：1
func (builder *FolderBuilder) FolderType(folderType int) *FolderBuilder {
	builder.folderType = folderType
	builder.folderTypeFlag = true
	return builder
}

// 未读邮件数量
//
// 示例值：3
func (builder *FolderBuilder) UnreadMessageCount(unreadMessageCount int) *FolderBuilder {
	builder.unreadMessageCount = unreadMessageCount
	builder.unreadMessageCountFlag = true
	return builder
}

// 未读会话数量
//
// 示例值：4
func (builder *FolderBuilder) UnreadThreadCount(unreadThreadCount int) *FolderBuilder {
	builder.unreadThreadCount = unreadThreadCount
	builder.unreadThreadCountFlag = true
	return builder
}

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

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

	}
	if builder.parentFolderIdFlag {
		req.ParentFolderId = &builder.parentFolderId

	}
	if builder.folderTypeFlag {
		req.FolderType = &builder.folderType

	}
	if builder.unreadMessageCountFlag {
		req.UnreadMessageCount = &builder.unreadMessageCount

	}
	if builder.unreadThreadCountFlag {
		req.UnreadThreadCount = &builder.unreadThreadCount

	}
	return req
}

type IncrementalSwitchEntity struct {
	EntityType *string `json:"entity_type,omitempty"` // 实体类型

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

	Email *string `json:"email,omitempty"` // 邮箱地址

	LarkDepartmentId *string `json:"lark_department_id,omitempty"` // 部门ID

	GroupId *string `json:"group_id,omitempty"` // 用户组ID
}

type IncrementalSwitchEntityBuilder struct {
	entityType     string // 实体类型
	entityTypeFlag bool

	userId     string // 用户ID
	userIdFlag bool

	email     string // 邮箱地址
	emailFlag bool

	larkDepartmentId     string // 部门ID
	larkDepartmentIdFlag bool

	groupId     string // 用户组ID
	groupIdFlag bool
}

func NewIncrementalSwitchEntityBuilder() *IncrementalSwitchEntityBuilder {
	builder := &IncrementalSwitchEntityBuilder{}
	return builder
}

// 实体类型
//
// 示例值：
func (builder *IncrementalSwitchEntityBuilder) EntityType(entityType string) *IncrementalSwitchEntityBuilder {
	builder.entityType = entityType
	builder.entityTypeFlag = true
	return builder
}

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

// 邮箱地址
//
// 示例值：test@test.com
func (builder *IncrementalSwitchEntityBuilder) Email(email string) *IncrementalSwitchEntityBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 部门ID
//
// 示例值：xxxx
func (builder *IncrementalSwitchEntityBuilder) LarkDepartmentId(larkDepartmentId string) *IncrementalSwitchEntityBuilder {
	builder.larkDepartmentId = larkDepartmentId
	builder.larkDepartmentIdFlag = true
	return builder
}

// 用户组ID
//
// 示例值：xxxx
func (builder *IncrementalSwitchEntityBuilder) GroupId(groupId string) *IncrementalSwitchEntityBuilder {
	builder.groupId = groupId
	builder.groupIdFlag = true
	return builder
}

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

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

	}
	if builder.emailFlag {
		req.Email = &builder.email

	}
	if builder.larkDepartmentIdFlag {
		req.LarkDepartmentId = &builder.larkDepartmentId

	}
	if builder.groupIdFlag {
		req.GroupId = &builder.groupId

	}
	return req
}

type MailAddress struct {
	MailAddress *string `json:"mail_address,omitempty"` // 邮件地址

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

type MailAddressBuilder struct {
	mailAddress     string // 邮件地址
	mailAddressFlag bool

	name     string // 名称
	nameFlag bool
}

func NewMailAddressBuilder() *MailAddressBuilder {
	builder := &MailAddressBuilder{}
	return builder
}

// 邮件地址
//
// 示例值：mike@outlook.com
func (builder *MailAddressBuilder) MailAddress(mailAddress string) *MailAddressBuilder {
	builder.mailAddress = mailAddress
	builder.mailAddressFlag = true
	return builder
}

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

func (builder *MailAddressBuilder) Build() *MailAddress {
	req := &MailAddress{}
	if builder.mailAddressFlag {
		req.MailAddress = &builder.mailAddress

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

	}
	return req
}

type MailContact struct {
	Id *string `json:"id,omitempty"` // 联系人 id

	Name *string `json:"name,omitempty"` // 联系人姓名

	Company *string `json:"company,omitempty"` // 联系人公司

	Phone *string `json:"phone,omitempty"` // 联系人手机号

	MailAddress *string `json:"mail_address,omitempty"` // 联系人邮箱

	Tag *string `json:"tag,omitempty"` // 联系人标签

	Remark *string `json:"remark,omitempty"` // 联系人备注

	Avatar *string `json:"avatar,omitempty"` // 联系人头像

	Position *string `json:"position,omitempty"` // 联系人职位
}

type MailContactBuilder struct {
	id     string // 联系人 id
	idFlag bool

	name     string // 联系人姓名
	nameFlag bool

	company     string // 联系人公司
	companyFlag bool

	phone     string // 联系人手机号
	phoneFlag bool

	mailAddress     string // 联系人邮箱
	mailAddressFlag bool

	tag     string // 联系人标签
	tagFlag bool

	remark     string // 联系人备注
	remarkFlag bool

	avatar     string // 联系人头像
	avatarFlag bool

	position     string // 联系人职位
	positionFlag bool
}

func NewMailContactBuilder() *MailContactBuilder {
	builder := &MailContactBuilder{}
	return builder
}

// 联系人 id
//
// 示例值：7256274576546463764
func (builder *MailContactBuilder) Id(id string) *MailContactBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 联系人姓名
//
// 示例值：张三
func (builder *MailContactBuilder) Name(name string) *MailContactBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 联系人公司
//
// 示例值：张三科技有限公司
func (builder *MailContactBuilder) Company(company string) *MailContactBuilder {
	builder.company = company
	builder.companyFlag = true
	return builder
}

// 联系人手机号
//
// 示例值：19912341234
func (builder *MailContactBuilder) Phone(phone string) *MailContactBuilder {
	builder.phone = phone
	builder.phoneFlag = true
	return builder
}

// 联系人邮箱
//
// 示例值：zhangsan@example.com
func (builder *MailContactBuilder) MailAddress(mailAddress string) *MailContactBuilder {
	builder.mailAddress = mailAddress
	builder.mailAddressFlag = true
	return builder
}

// 联系人标签
//
// 示例值：朋友
func (builder *MailContactBuilder) Tag(tag string) *MailContactBuilder {
	builder.tag = tag
	builder.tagFlag = true
	return builder
}

// 联系人备注
//
// 示例值：飞书发布会认识
func (builder *MailContactBuilder) Remark(remark string) *MailContactBuilder {
	builder.remark = remark
	builder.remarkFlag = true
	return builder
}

// 联系人头像
//
// 示例值：https://exampeimg.com/xxxx.jpg
func (builder *MailContactBuilder) Avatar(avatar string) *MailContactBuilder {
	builder.avatar = avatar
	builder.avatarFlag = true
	return builder
}

// 联系人职位
//
// 示例值：CFO
func (builder *MailContactBuilder) Position(position string) *MailContactBuilder {
	builder.position = position
	builder.positionFlag = true
	return builder
}

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

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

	}
	if builder.companyFlag {
		req.Company = &builder.company

	}
	if builder.phoneFlag {
		req.Phone = &builder.phone

	}
	if builder.mailAddressFlag {
		req.MailAddress = &builder.mailAddress

	}
	if builder.tagFlag {
		req.Tag = &builder.tag

	}
	if builder.remarkFlag {
		req.Remark = &builder.remark

	}
	if builder.avatarFlag {
		req.Avatar = &builder.avatar

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

	}
	return req
}

type MailFlowRuleInfo struct {
	Id *string `json:"id,omitempty"` // 邮件流规则ID

	Name *string `json:"name,omitempty"` // 邮件流规则名称

	ActionCategory *int `json:"action_category,omitempty"` // 规则动作类型
}

type MailFlowRuleInfoBuilder struct {
	id     string // 邮件流规则ID
	idFlag bool

	name     string // 邮件流规则名称
	nameFlag bool

	actionCategory     int // 规则动作类型
	actionCategoryFlag bool
}

func NewMailFlowRuleInfoBuilder() *MailFlowRuleInfoBuilder {
	builder := &MailFlowRuleInfoBuilder{}
	return builder
}

// 邮件流规则ID
//
// 示例值：123456789
func (builder *MailFlowRuleInfoBuilder) Id(id string) *MailFlowRuleInfoBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 邮件流规则名称
//
// 示例值：mail flow rule name
func (builder *MailFlowRuleInfoBuilder) Name(name string) *MailFlowRuleInfoBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 规则动作类型
//
// 示例值：1
func (builder *MailFlowRuleInfoBuilder) ActionCategory(actionCategory int) *MailFlowRuleInfoBuilder {
	builder.actionCategory = actionCategory
	builder.actionCategoryFlag = true
	return builder
}

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

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

	}
	if builder.actionCategoryFlag {
		req.ActionCategory = &builder.actionCategory

	}
	return req
}

type MailGroupAsSenderPermissionMember struct {
	UserId *string `json:"user_id,omitempty"` // 租户内用户的唯一标识
}

type MailGroupAsSenderPermissionMemberBuilder struct {
	userId     string // 租户内用户的唯一标识
	userIdFlag bool
}

func NewMailGroupAsSenderPermissionMemberBuilder() *MailGroupAsSenderPermissionMemberBuilder {
	builder := &MailGroupAsSenderPermissionMemberBuilder{}
	return builder
}

// 租户内用户的唯一标识
//
// 示例值：
func (builder *MailGroupAsSenderPermissionMemberBuilder) UserId(userId string) *MailGroupAsSenderPermissionMemberBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

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

	}
	return req
}

type MailLog struct {
	Timestamp *string `json:"timestamp,omitempty"` // 日志时间戳

	Id *string `json:"id,omitempty"` // 日志id

	Initiator *UserMailEntity `json:"initiator,omitempty"` // 邮箱实体信息

	Operator *UserMailEntity `json:"operator,omitempty"` // 邮箱实体信息

	MailInfo *MailLogMailInfo `json:"mail_info,omitempty"` // 邮件信息

	RuleInfos []*MailFlowRuleInfo `json:"rule_infos,omitempty"` // 命中的规则信息

	Tags []string `json:"tags,omitempty"` // 日志的标签
}

type MailLogBuilder struct {
	timestamp     string // 日志时间戳
	timestampFlag bool

	id     string // 日志id
	idFlag bool

	initiator     *UserMailEntity // 邮箱实体信息
	initiatorFlag bool

	operator     *UserMailEntity // 邮箱实体信息
	operatorFlag bool

	mailInfo     *MailLogMailInfo // 邮件信息
	mailInfoFlag bool

	ruleInfos     []*MailFlowRuleInfo // 命中的规则信息
	ruleInfosFlag bool

	tags     []string // 日志的标签
	tagsFlag bool
}

func NewMailLogBuilder() *MailLogBuilder {
	builder := &MailLogBuilder{}
	return builder
}

// 日志时间戳
//
// 示例值：123456780
func (builder *MailLogBuilder) Timestamp(timestamp string) *MailLogBuilder {
	builder.timestamp = timestamp
	builder.timestampFlag = true
	return builder
}

// 日志id
//
// 示例值：123456
func (builder *MailLogBuilder) Id(id string) *MailLogBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 邮箱实体信息
//
// 示例值：
func (builder *MailLogBuilder) Initiator(initiator *UserMailEntity) *MailLogBuilder {
	builder.initiator = initiator
	builder.initiatorFlag = true
	return builder
}

// 邮箱实体信息
//
// 示例值：
func (builder *MailLogBuilder) Operator(operator *UserMailEntity) *MailLogBuilder {
	builder.operator = operator
	builder.operatorFlag = true
	return builder
}

// 邮件信息
//
// 示例值：
func (builder *MailLogBuilder) MailInfo(mailInfo *MailLogMailInfo) *MailLogBuilder {
	builder.mailInfo = mailInfo
	builder.mailInfoFlag = true
	return builder
}

// 命中的规则信息
//
// 示例值：
func (builder *MailLogBuilder) RuleInfos(ruleInfos []*MailFlowRuleInfo) *MailLogBuilder {
	builder.ruleInfos = ruleInfos
	builder.ruleInfosFlag = true
	return builder
}

// 日志的标签
//
// 示例值：
func (builder *MailLogBuilder) Tags(tags []string) *MailLogBuilder {
	builder.tags = tags
	builder.tagsFlag = true
	return builder
}

func (builder *MailLogBuilder) Build() *MailLog {
	req := &MailLog{}
	if builder.timestampFlag {
		req.Timestamp = &builder.timestamp

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

	}
	if builder.initiatorFlag {
		req.Initiator = builder.initiator
	}
	if builder.operatorFlag {
		req.Operator = builder.operator
	}
	if builder.mailInfoFlag {
		req.MailInfo = builder.mailInfo
	}
	if builder.ruleInfosFlag {
		req.RuleInfos = builder.ruleInfos
	}
	if builder.tagsFlag {
		req.Tags = builder.tags
	}
	return req
}

type MailLogMailInfo struct {
	MessageId *string `json:"message_id,omitempty"` // 邮件ID

	Owner *UserMailEntity `json:"owner,omitempty"` // 邮箱实体信息

	EventTypes []string `json:"event_types,omitempty"` // 收发信事件类型

	SmtpMessageId *string `json:"smtp_message_id,omitempty"` // RFC协议id

	Date *string `json:"date,omitempty"` // EML中的事件时间（毫秒）

	Subject *string `json:"subject,omitempty"` // 主题

	HeaderFrom *MailAddress `json:"header_from,omitempty"` // 发件人

	ToRecipients []*MailAddress `json:"to_recipients,omitempty"` // 收件人

	CcRecipients []*MailAddress `json:"cc_recipients,omitempty"` // 抄送

	BccRecipients []*MailAddress `json:"bcc_recipients,omitempty"` // 秘送

	AttachmentNum *string `json:"attachment_num,omitempty"` // 附件数量

	ImageNum *string `json:"image_num,omitempty"` // 图片数量

	Attachments []*FileMetaInfo `json:"attachments,omitempty"` // 附件信息

	Images []*FileMetaInfo `json:"images,omitempty"` // 图片信息
}

type MailLogMailInfoBuilder struct {
	messageId     string // 邮件ID
	messageIdFlag bool

	owner     *UserMailEntity // 邮箱实体信息
	ownerFlag bool

	eventTypes     []string // 收发信事件类型
	eventTypesFlag bool

	smtpMessageId     string // RFC协议id
	smtpMessageIdFlag bool

	date     string // EML中的事件时间（毫秒）
	dateFlag bool

	subject     string // 主题
	subjectFlag bool

	headerFrom     *MailAddress // 发件人
	headerFromFlag bool

	toRecipients     []*MailAddress // 收件人
	toRecipientsFlag bool

	ccRecipients     []*MailAddress // 抄送
	ccRecipientsFlag bool

	bccRecipients     []*MailAddress // 秘送
	bccRecipientsFlag bool

	attachmentNum     string // 附件数量
	attachmentNumFlag bool

	imageNum     string // 图片数量
	imageNumFlag bool

	attachments     []*FileMetaInfo // 附件信息
	attachmentsFlag bool

	images     []*FileMetaInfo // 图片信息
	imagesFlag bool
}

func NewMailLogMailInfoBuilder() *MailLogMailInfoBuilder {
	builder := &MailLogMailInfoBuilder{}
	return builder
}

// 邮件ID
//
// 示例值：abcdefg
func (builder *MailLogMailInfoBuilder) MessageId(messageId string) *MailLogMailInfoBuilder {
	builder.messageId = messageId
	builder.messageIdFlag = true
	return builder
}

// 邮箱实体信息
//
// 示例值：
func (builder *MailLogMailInfoBuilder) Owner(owner *UserMailEntity) *MailLogMailInfoBuilder {
	builder.owner = owner
	builder.ownerFlag = true
	return builder
}

// 收发信事件类型
//
// 示例值：
func (builder *MailLogMailInfoBuilder) EventTypes(eventTypes []string) *MailLogMailInfoBuilder {
	builder.eventTypes = eventTypes
	builder.eventTypesFlag = true
	return builder
}

// RFC协议id
//
// 示例值：ay0azrJDvbs3FJAg@outlook.com
func (builder *MailLogMailInfoBuilder) SmtpMessageId(smtpMessageId string) *MailLogMailInfoBuilder {
	builder.smtpMessageId = smtpMessageId
	builder.smtpMessageIdFlag = true
	return builder
}

// EML中的事件时间（毫秒）
//
// 示例值：1682377086000
func (builder *MailLogMailInfoBuilder) Date(date string) *MailLogMailInfoBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 主题
//
// 示例值：邮件标题
func (builder *MailLogMailInfoBuilder) Subject(subject string) *MailLogMailInfoBuilder {
	builder.subject = subject
	builder.subjectFlag = true
	return builder
}

// 发件人
//
// 示例值：
func (builder *MailLogMailInfoBuilder) HeaderFrom(headerFrom *MailAddress) *MailLogMailInfoBuilder {
	builder.headerFrom = headerFrom
	builder.headerFromFlag = true
	return builder
}

// 收件人
//
// 示例值：
func (builder *MailLogMailInfoBuilder) ToRecipients(toRecipients []*MailAddress) *MailLogMailInfoBuilder {
	builder.toRecipients = toRecipients
	builder.toRecipientsFlag = true
	return builder
}

// 抄送
//
// 示例值：
func (builder *MailLogMailInfoBuilder) CcRecipients(ccRecipients []*MailAddress) *MailLogMailInfoBuilder {
	builder.ccRecipients = ccRecipients
	builder.ccRecipientsFlag = true
	return builder
}

// 秘送
//
// 示例值：
func (builder *MailLogMailInfoBuilder) BccRecipients(bccRecipients []*MailAddress) *MailLogMailInfoBuilder {
	builder.bccRecipients = bccRecipients
	builder.bccRecipientsFlag = true
	return builder
}

// 附件数量
//
// 示例值：1
func (builder *MailLogMailInfoBuilder) AttachmentNum(attachmentNum string) *MailLogMailInfoBuilder {
	builder.attachmentNum = attachmentNum
	builder.attachmentNumFlag = true
	return builder
}

// 图片数量
//
// 示例值：1
func (builder *MailLogMailInfoBuilder) ImageNum(imageNum string) *MailLogMailInfoBuilder {
	builder.imageNum = imageNum
	builder.imageNumFlag = true
	return builder
}

// 附件信息
//
// 示例值：
func (builder *MailLogMailInfoBuilder) Attachments(attachments []*FileMetaInfo) *MailLogMailInfoBuilder {
	builder.attachments = attachments
	builder.attachmentsFlag = true
	return builder
}

// 图片信息
//
// 示例值：
func (builder *MailLogMailInfoBuilder) Images(images []*FileMetaInfo) *MailLogMailInfoBuilder {
	builder.images = images
	builder.imagesFlag = true
	return builder
}

func (builder *MailLogMailInfoBuilder) Build() *MailLogMailInfo {
	req := &MailLogMailInfo{}
	if builder.messageIdFlag {
		req.MessageId = &builder.messageId

	}
	if builder.ownerFlag {
		req.Owner = builder.owner
	}
	if builder.eventTypesFlag {
		req.EventTypes = builder.eventTypes
	}
	if builder.smtpMessageIdFlag {
		req.SmtpMessageId = &builder.smtpMessageId

	}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.subjectFlag {
		req.Subject = &builder.subject

	}
	if builder.headerFromFlag {
		req.HeaderFrom = builder.headerFrom
	}
	if builder.toRecipientsFlag {
		req.ToRecipients = builder.toRecipients
	}
	if builder.ccRecipientsFlag {
		req.CcRecipients = builder.ccRecipients
	}
	if builder.bccRecipientsFlag {
		req.BccRecipients = builder.bccRecipients
	}
	if builder.attachmentNumFlag {
		req.AttachmentNum = &builder.attachmentNum

	}
	if builder.imageNumFlag {
		req.ImageNum = &builder.imageNum

	}
	if builder.attachmentsFlag {
		req.Attachments = builder.attachments
	}
	if builder.imagesFlag {
		req.Images = builder.images
	}
	return req
}

type Mailgroup struct {
	MailgroupId *string `json:"mailgroup_id,omitempty"` // 邮件组ID

	Email *string `json:"email,omitempty"` // 邮件组地址

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

	Description *string `json:"description,omitempty"` // 邮件组描述

	DirectMembersCount *string `json:"direct_members_count,omitempty"` // 邮件组成员数量

	IncludeExternalMember *bool `json:"include_external_member,omitempty"` // 是否包含外部成员

	IncludeAllCompanyMember *bool `json:"include_all_company_member,omitempty"` // 是否是全员邮件组

	WhoCanSendMail *string `json:"who_can_send_mail,omitempty"` // 谁可发送邮件到此邮件组
}

type MailgroupBuilder struct {
	mailgroupId     string // 邮件组ID
	mailgroupIdFlag bool

	email     string // 邮件组地址
	emailFlag bool

	name     string // 邮件组名称
	nameFlag bool

	description     string // 邮件组描述
	descriptionFlag bool

	directMembersCount     string // 邮件组成员数量
	directMembersCountFlag bool

	includeExternalMember     bool // 是否包含外部成员
	includeExternalMemberFlag bool

	includeAllCompanyMember     bool // 是否是全员邮件组
	includeAllCompanyMemberFlag bool

	whoCanSendMail     string // 谁可发送邮件到此邮件组
	whoCanSendMailFlag bool
}

func NewMailgroupBuilder() *MailgroupBuilder {
	builder := &MailgroupBuilder{}
	return builder
}

// 邮件组ID
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *MailgroupBuilder) MailgroupId(mailgroupId string) *MailgroupBuilder {
	builder.mailgroupId = mailgroupId
	builder.mailgroupIdFlag = true
	return builder
}

// 邮件组地址
//
// 示例值：test_mail_group@xxx.xx
func (builder *MailgroupBuilder) Email(email string) *MailgroupBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 邮件组名称
//
// 示例值：test mail group
func (builder *MailgroupBuilder) Name(name string) *MailgroupBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 邮件组描述
//
// 示例值：mail group for testing
func (builder *MailgroupBuilder) Description(description string) *MailgroupBuilder {
	builder.description = description
	builder.descriptionFlag = true
	return builder
}

// 邮件组成员数量
//
// 示例值：10
func (builder *MailgroupBuilder) DirectMembersCount(directMembersCount string) *MailgroupBuilder {
	builder.directMembersCount = directMembersCount
	builder.directMembersCountFlag = true
	return builder
}

// 是否包含外部成员
//
// 示例值：true
func (builder *MailgroupBuilder) IncludeExternalMember(includeExternalMember bool) *MailgroupBuilder {
	builder.includeExternalMember = includeExternalMember
	builder.includeExternalMemberFlag = true
	return builder
}

// 是否是全员邮件组
//
// 示例值：false
func (builder *MailgroupBuilder) IncludeAllCompanyMember(includeAllCompanyMember bool) *MailgroupBuilder {
	builder.includeAllCompanyMember = includeAllCompanyMember
	builder.includeAllCompanyMemberFlag = true
	return builder
}

// 谁可发送邮件到此邮件组
//
// 示例值：ALL_INTERNAL_USERS
func (builder *MailgroupBuilder) WhoCanSendMail(whoCanSendMail string) *MailgroupBuilder {
	builder.whoCanSendMail = whoCanSendMail
	builder.whoCanSendMailFlag = true
	return builder
}

func (builder *MailgroupBuilder) Build() *Mailgroup {
	req := &Mailgroup{}
	if builder.mailgroupIdFlag {
		req.MailgroupId = &builder.mailgroupId

	}
	if builder.emailFlag {
		req.Email = &builder.email

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

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

	}
	if builder.directMembersCountFlag {
		req.DirectMembersCount = &builder.directMembersCount

	}
	if builder.includeExternalMemberFlag {
		req.IncludeExternalMember = &builder.includeExternalMember

	}
	if builder.includeAllCompanyMemberFlag {
		req.IncludeAllCompanyMember = &builder.includeAllCompanyMember

	}
	if builder.whoCanSendMailFlag {
		req.WhoCanSendMail = &builder.whoCanSendMail

	}
	return req
}

type MailgroupManager struct {
	UserId *string `json:"user_id,omitempty"` // 管理员用户ID
}

type MailgroupManagerBuilder struct {
	userId     string // 管理员用户ID
	userIdFlag bool
}

func NewMailgroupManagerBuilder() *MailgroupManagerBuilder {
	builder := &MailgroupManagerBuilder{}
	return builder
}

// 管理员用户ID
//
// 示例值：xxxxxx
func (builder *MailgroupManagerBuilder) UserId(userId string) *MailgroupManagerBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

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

	}
	return req
}

type MailgroupMember struct {
	MemberId *string `json:"member_id,omitempty"` // 邮件组内成员唯一标识

	Email *string `json:"email,omitempty"` // 成员邮箱地址（当成员类型是EXTERNAL_USER/MAIL_GROUP/OTHER_MEMBER时有值）

	UserId *string `json:"user_id,omitempty"` // 租户内用户的唯一标识（当成员类型是USER时有值）

	DepartmentId *string `json:"department_id,omitempty"` // 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）

	Type *string `json:"type,omitempty"` // 成员类型
}

type MailgroupMemberBuilder struct {
	memberId     string // 邮件组内成员唯一标识
	memberIdFlag bool

	email     string // 成员邮箱地址（当成员类型是EXTERNAL_USER/MAIL_GROUP/OTHER_MEMBER时有值）
	emailFlag bool

	userId     string // 租户内用户的唯一标识（当成员类型是USER时有值）
	userIdFlag bool

	departmentId     string // 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）
	departmentIdFlag bool

	type_    string // 成员类型
	typeFlag bool
}

func NewMailgroupMemberBuilder() *MailgroupMemberBuilder {
	builder := &MailgroupMemberBuilder{}
	return builder
}

// 邮件组内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *MailgroupMemberBuilder) MemberId(memberId string) *MailgroupMemberBuilder {
	builder.memberId = memberId
	builder.memberIdFlag = true
	return builder
}

// 成员邮箱地址（当成员类型是EXTERNAL_USER/MAIL_GROUP/OTHER_MEMBER时有值）
//
// 示例值：test_memeber@xxx.xx
func (builder *MailgroupMemberBuilder) Email(email string) *MailgroupMemberBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 租户内用户的唯一标识（当成员类型是USER时有值）
//
// 示例值：xxxxxxxxxx
func (builder *MailgroupMemberBuilder) UserId(userId string) *MailgroupMemberBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）
//
// 示例值：xxxxxxxxxx
func (builder *MailgroupMemberBuilder) DepartmentId(departmentId string) *MailgroupMemberBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 成员类型
//
// 示例值：USER
func (builder *MailgroupMemberBuilder) Type(type_ string) *MailgroupMemberBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *MailgroupMemberBuilder) Build() *MailgroupMember {
	req := &MailgroupMember{}
	if builder.memberIdFlag {
		req.MemberId = &builder.memberId

	}
	if builder.emailFlag {
		req.Email = &builder.email

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

	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

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

	}
	return req
}

type MailgroupPermissionMember struct {
	PermissionMemberId *string `json:"permission_member_id,omitempty"` // 权限组内成员唯一标识

	UserId *string `json:"user_id,omitempty"` // 租户内用户的唯一标识（当成员类型是USER时有值）

	DepartmentId *string `json:"department_id,omitempty"` // 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）

	Email *string `json:"email,omitempty"` // 成员邮箱地址（当成员类型是MAIL_GROUP/PUBLIC_MAILBOX时有值）

	Type *string `json:"type,omitempty"` // 成员类型
}

type MailgroupPermissionMemberBuilder struct {
	permissionMemberId     string // 权限组内成员唯一标识
	permissionMemberIdFlag bool

	userId     string // 租户内用户的唯一标识（当成员类型是USER时有值）
	userIdFlag bool

	departmentId     string // 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）
	departmentIdFlag bool

	email     string // 成员邮箱地址（当成员类型是MAIL_GROUP/PUBLIC_MAILBOX时有值）
	emailFlag bool

	type_    string // 成员类型
	typeFlag bool
}

func NewMailgroupPermissionMemberBuilder() *MailgroupPermissionMemberBuilder {
	builder := &MailgroupPermissionMemberBuilder{}
	return builder
}

// 权限组内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *MailgroupPermissionMemberBuilder) PermissionMemberId(permissionMemberId string) *MailgroupPermissionMemberBuilder {
	builder.permissionMemberId = permissionMemberId
	builder.permissionMemberIdFlag = true
	return builder
}

// 租户内用户的唯一标识（当成员类型是USER时有值）
//
// 示例值：xxxxxxxxxx
func (builder *MailgroupPermissionMemberBuilder) UserId(userId string) *MailgroupPermissionMemberBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 租户内部门的唯一标识（当成员类型是DEPARTMENT时有值）
//
// 示例值：xxxxxxxxxx
func (builder *MailgroupPermissionMemberBuilder) DepartmentId(departmentId string) *MailgroupPermissionMemberBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

// 成员邮箱地址（当成员类型是MAIL_GROUP/PUBLIC_MAILBOX时有值）
//
// 示例值：xxx@xx.x
func (builder *MailgroupPermissionMemberBuilder) Email(email string) *MailgroupPermissionMemberBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 成员类型
//
// 示例值：USER
func (builder *MailgroupPermissionMemberBuilder) Type(type_ string) *MailgroupPermissionMemberBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *MailgroupPermissionMemberBuilder) Build() *MailgroupPermissionMember {
	req := &MailgroupPermissionMember{}
	if builder.permissionMemberIdFlag {
		req.PermissionMemberId = &builder.permissionMemberId

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

	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.emailFlag {
		req.Email = &builder.email

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

	}
	return req
}

type Message struct {
	Raw *string `json:"raw,omitempty"` // MIME邮件数据，基于base64url编码

	Subject *string `json:"subject,omitempty"` // 主题

	To []*MailAddress `json:"to,omitempty"` // 收件人

	Cc []*MailAddress `json:"cc,omitempty"` // 抄送

	Bcc []*MailAddress `json:"bcc,omitempty"` // 秘送

	HeadFrom *MailAddress `json:"head_from,omitempty"` // 发件人

	BodyHtml *string `json:"body_html,omitempty"` // 正文(base64url)

	InternalDate *string `json:"internal_date,omitempty"` // 创建/收/发信时间（毫秒）

	MessageState *int `json:"message_state,omitempty"` // 邮件状态

	SmtpMessageId *string `json:"smtp_message_id,omitempty"` // RFC协议id

	MessageId *string `json:"message_id,omitempty"` // 邮件id

	BodyPlainText *string `json:"body_plain_text,omitempty"` // 正文纯文本(base64url)

	Attachments []*Attachment `json:"attachments,omitempty"` // 邮件附件列表

	ThreadId *string `json:"thread_id,omitempty"` // 会话id
}

type MessageBuilder struct {
	raw     string // MIME邮件数据，基于base64url编码
	rawFlag bool

	subject     string // 主题
	subjectFlag bool

	to     []*MailAddress // 收件人
	toFlag bool

	cc     []*MailAddress // 抄送
	ccFlag bool

	bcc     []*MailAddress // 秘送
	bccFlag bool

	headFrom     *MailAddress // 发件人
	headFromFlag bool

	bodyHtml     string // 正文(base64url)
	bodyHtmlFlag bool

	internalDate     string // 创建/收/发信时间（毫秒）
	internalDateFlag bool

	messageState     int // 邮件状态
	messageStateFlag bool

	smtpMessageId     string // RFC协议id
	smtpMessageIdFlag bool

	messageId     string // 邮件id
	messageIdFlag bool

	bodyPlainText     string // 正文纯文本(base64url)
	bodyPlainTextFlag bool

	attachments     []*Attachment // 邮件附件列表
	attachmentsFlag bool

	threadId     string // 会话id
	threadIdFlag bool
}

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

// MIME邮件数据，基于base64url编码
//
// 示例值：Q29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PSJ1cy1hc2NpaSIKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdAp0bzogdG9AeHh4Lnh4CmZyb206IHNlbmRlckB4eHgueHgKc3ViamVjdDogdGhpcyBpcyBhIHN1YmplY3QKCnRoaXMgaXMgdGhlIG1lc3NhZ2UgYm9keS4=
func (builder *MessageBuilder) Raw(raw string) *MessageBuilder {
	builder.raw = raw
	builder.rawFlag = true
	return builder
}

// 主题
//
// 示例值：邮件标题
func (builder *MessageBuilder) Subject(subject string) *MessageBuilder {
	builder.subject = subject
	builder.subjectFlag = true
	return builder
}

// 收件人
//
// 示例值：
func (builder *MessageBuilder) To(to []*MailAddress) *MessageBuilder {
	builder.to = to
	builder.toFlag = true
	return builder
}

// 抄送
//
// 示例值：
func (builder *MessageBuilder) Cc(cc []*MailAddress) *MessageBuilder {
	builder.cc = cc
	builder.ccFlag = true
	return builder
}

// 秘送
//
// 示例值：
func (builder *MessageBuilder) Bcc(bcc []*MailAddress) *MessageBuilder {
	builder.bcc = bcc
	builder.bccFlag = true
	return builder
}

// 发件人
//
// 示例值：
func (builder *MessageBuilder) HeadFrom(headFrom *MailAddress) *MessageBuilder {
	builder.headFrom = headFrom
	builder.headFromFlag = true
	return builder
}

// 正文(base64url)
//
// 示例值：xxxx
func (builder *MessageBuilder) BodyHtml(bodyHtml string) *MessageBuilder {
	builder.bodyHtml = bodyHtml
	builder.bodyHtmlFlag = true
	return builder
}

// 创建/收/发信时间（毫秒）
//
// 示例值：1682377086000
func (builder *MessageBuilder) InternalDate(internalDate string) *MessageBuilder {
	builder.internalDate = internalDate
	builder.internalDateFlag = true
	return builder
}

// 邮件状态
//
// 示例值：1（收信）2（发信）3（草稿）
func (builder *MessageBuilder) MessageState(messageState int) *MessageBuilder {
	builder.messageState = messageState
	builder.messageStateFlag = true
	return builder
}

// RFC协议id
//
// 示例值：ay0azrJDvbs3FJAg@outlook.com
func (builder *MessageBuilder) SmtpMessageId(smtpMessageId string) *MessageBuilder {
	builder.smtpMessageId = smtpMessageId
	builder.smtpMessageIdFlag = true
	return builder
}

// 邮件id
//
// 示例值：tfuh9N4WnzU6jdDw=
func (builder *MessageBuilder) MessageId(messageId string) *MessageBuilder {
	builder.messageId = messageId
	builder.messageIdFlag = true
	return builder
}

// 正文纯文本(base64url)
//
// 示例值：xxxxx
func (builder *MessageBuilder) BodyPlainText(bodyPlainText string) *MessageBuilder {
	builder.bodyPlainText = bodyPlainText
	builder.bodyPlainTextFlag = true
	return builder
}

// 邮件附件列表
//
// 示例值：
func (builder *MessageBuilder) Attachments(attachments []*Attachment) *MessageBuilder {
	builder.attachments = attachments
	builder.attachmentsFlag = true
	return builder
}

// 会话id
//
// 示例值：tfuh9N4WnzU6jdDw=
func (builder *MessageBuilder) ThreadId(threadId string) *MessageBuilder {
	builder.threadId = threadId
	builder.threadIdFlag = true
	return builder
}

func (builder *MessageBuilder) Build() *Message {
	req := &Message{}
	if builder.rawFlag {
		req.Raw = &builder.raw

	}
	if builder.subjectFlag {
		req.Subject = &builder.subject

	}
	if builder.toFlag {
		req.To = builder.to
	}
	if builder.ccFlag {
		req.Cc = builder.cc
	}
	if builder.bccFlag {
		req.Bcc = builder.bcc
	}
	if builder.headFromFlag {
		req.HeadFrom = builder.headFrom
	}
	if builder.bodyHtmlFlag {
		req.BodyHtml = &builder.bodyHtml

	}
	if builder.internalDateFlag {
		req.InternalDate = &builder.internalDate

	}
	if builder.messageStateFlag {
		req.MessageState = &builder.messageState

	}
	if builder.smtpMessageIdFlag {
		req.SmtpMessageId = &builder.smtpMessageId

	}
	if builder.messageIdFlag {
		req.MessageId = &builder.messageId

	}
	if builder.bodyPlainTextFlag {
		req.BodyPlainText = &builder.bodyPlainText

	}
	if builder.attachmentsFlag {
		req.Attachments = builder.attachments
	}
	if builder.threadIdFlag {
		req.ThreadId = &builder.threadId

	}
	return req
}

type MessageMeta struct {
	MessageId *string `json:"message_id,omitempty"` // 邮件的唯一标识符

	ThreadId *string `json:"thread_id,omitempty"` // 邮件所属会话的唯一标识符

	FolderId *string `json:"folder_id,omitempty"` // 邮件所属文件夹的ID

	SmtpMessageId *string `json:"smtp_message_id,omitempty"` // SMTP协议中使用的邮件ID（符合RFC 2822标准）

	InternalDate *string `json:"internal_date,omitempty"` // 创建/收/发信时间（毫秒）

	MessageState *int `json:"message_state,omitempty"` // 邮件状态
}

type MessageMetaBuilder struct {
	messageId     string // 邮件的唯一标识符
	messageIdFlag bool

	threadId     string // 邮件所属会话的唯一标识符
	threadIdFlag bool

	folderId     string // 邮件所属文件夹的ID
	folderIdFlag bool

	smtpMessageId     string // SMTP协议中使用的邮件ID（符合RFC 2822标准）
	smtpMessageIdFlag bool

	internalDate     string // 创建/收/发信时间（毫秒）
	internalDateFlag bool

	messageState     int // 邮件状态
	messageStateFlag bool
}

func NewMessageMetaBuilder() *MessageMetaBuilder {
	builder := &MessageMetaBuilder{}
	return builder
}

// 邮件的唯一标识符
//
// 示例值：msg_123456
func (builder *MessageMetaBuilder) MessageId(messageId string) *MessageMetaBuilder {
	builder.messageId = messageId
	builder.messageIdFlag = true
	return builder
}

// 邮件所属会话的唯一标识符
//
// 示例值：thread_789
func (builder *MessageMetaBuilder) ThreadId(threadId string) *MessageMetaBuilder {
	builder.threadId = threadId
	builder.threadIdFlag = true
	return builder
}

// 邮件所属文件夹的ID
//
// 示例值："INBOX"
func (builder *MessageMetaBuilder) FolderId(folderId string) *MessageMetaBuilder {
	builder.folderId = folderId
	builder.folderIdFlag = true
	return builder
}

// SMTP协议中使用的邮件ID（符合RFC 2822标准）
//
// 示例值：123456@example.com
func (builder *MessageMetaBuilder) SmtpMessageId(smtpMessageId string) *MessageMetaBuilder {
	builder.smtpMessageId = smtpMessageId
	builder.smtpMessageIdFlag = true
	return builder
}

// 创建/收/发信时间（毫秒）
//
// 示例值：1651234567890
func (builder *MessageMetaBuilder) InternalDate(internalDate string) *MessageMetaBuilder {
	builder.internalDate = internalDate
	builder.internalDateFlag = true
	return builder
}

// 邮件状态
//
// 示例值：1
func (builder *MessageMetaBuilder) MessageState(messageState int) *MessageMetaBuilder {
	builder.messageState = messageState
	builder.messageStateFlag = true
	return builder
}

func (builder *MessageMetaBuilder) Build() *MessageMeta {
	req := &MessageMeta{}
	if builder.messageIdFlag {
		req.MessageId = &builder.messageId

	}
	if builder.threadIdFlag {
		req.ThreadId = &builder.threadId

	}
	if builder.folderIdFlag {
		req.FolderId = &builder.folderId

	}
	if builder.smtpMessageIdFlag {
		req.SmtpMessageId = &builder.smtpMessageId

	}
	if builder.internalDateFlag {
		req.InternalDate = &builder.internalDate

	}
	if builder.messageStateFlag {
		req.MessageState = &builder.messageState

	}
	return req
}

type PublicMailbox struct {
	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // 公共邮箱唯一标识

	Email *string `json:"email,omitempty"` // 公共邮箱地址

	Name *string `json:"name,omitempty"` // 公共邮箱名称

	Geo *string `json:"geo,omitempty"` // 数据驻留地
}

type PublicMailboxBuilder struct {
	publicMailboxId     string // 公共邮箱唯一标识
	publicMailboxIdFlag bool

	email     string // 公共邮箱地址
	emailFlag bool

	name     string // 公共邮箱名称
	nameFlag bool

	geo     string // 数据驻留地
	geoFlag bool
}

func NewPublicMailboxBuilder() *PublicMailboxBuilder {
	builder := &PublicMailboxBuilder{}
	return builder
}

// 公共邮箱唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *PublicMailboxBuilder) PublicMailboxId(publicMailboxId string) *PublicMailboxBuilder {
	builder.publicMailboxId = publicMailboxId
	builder.publicMailboxIdFlag = true
	return builder
}

// 公共邮箱地址
//
// 示例值：test_public_mailbox@xxx.xx
func (builder *PublicMailboxBuilder) Email(email string) *PublicMailboxBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 公共邮箱名称
//
// 示例值：test public mailbox
func (builder *PublicMailboxBuilder) Name(name string) *PublicMailboxBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 数据驻留地
//
// 示例值：cn
func (builder *PublicMailboxBuilder) Geo(geo string) *PublicMailboxBuilder {
	builder.geo = geo
	builder.geoFlag = true
	return builder
}

func (builder *PublicMailboxBuilder) Build() *PublicMailbox {
	req := &PublicMailbox{}
	if builder.publicMailboxIdFlag {
		req.PublicMailboxId = &builder.publicMailboxId

	}
	if builder.emailFlag {
		req.Email = &builder.email

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

	}
	if builder.geoFlag {
		req.Geo = &builder.geo

	}
	return req
}

type PublicMailboxMember struct {
	MemberId *string `json:"member_id,omitempty"` // 公共邮箱内成员唯一标识

	UserId *string `json:"user_id,omitempty"` // 租户内用户的唯一标识（当成员类型是USER时有值）

	Type *string `json:"type,omitempty"` // 成员类型
}

type PublicMailboxMemberBuilder struct {
	memberId     string // 公共邮箱内成员唯一标识
	memberIdFlag bool

	userId     string // 租户内用户的唯一标识（当成员类型是USER时有值）
	userIdFlag bool

	type_    string // 成员类型
	typeFlag bool
}

func NewPublicMailboxMemberBuilder() *PublicMailboxMemberBuilder {
	builder := &PublicMailboxMemberBuilder{}
	return builder
}

// 公共邮箱内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *PublicMailboxMemberBuilder) MemberId(memberId string) *PublicMailboxMemberBuilder {
	builder.memberId = memberId
	builder.memberIdFlag = true
	return builder
}

// 租户内用户的唯一标识（当成员类型是USER时有值）
//
// 示例值：xxxxxxxxxx
func (builder *PublicMailboxMemberBuilder) UserId(userId string) *PublicMailboxMemberBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

// 成员类型
//
// 示例值：USER
func (builder *PublicMailboxMemberBuilder) Type(type_ string) *PublicMailboxMemberBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *PublicMailboxMemberBuilder) Build() *PublicMailboxMember {
	req := &PublicMailboxMember{}
	if builder.memberIdFlag {
		req.MemberId = &builder.memberId

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

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

	}
	return req
}

type Rule struct {
	Id *string `json:"id,omitempty"` // 规则 id

	Condition *RuleCondition `json:"condition,omitempty"` // 匹配条件

	Action *RuleAction `json:"action,omitempty"` // 匹配命中后的操作

	IgnoreTheRestOfRules *bool `json:"ignore_the_rest_of_rules,omitempty"` // 是否终点规则

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

	IsEnable *bool `json:"is_enable,omitempty"` // 是否启用
}

type RuleBuilder struct {
	id     string // 规则 id
	idFlag bool

	condition     *RuleCondition // 匹配条件
	conditionFlag bool

	action     *RuleAction // 匹配命中后的操作
	actionFlag bool

	ignoreTheRestOfRules     bool // 是否终点规则
	ignoreTheRestOfRulesFlag bool

	name     string // 规则名称
	nameFlag bool

	isEnable     bool // 是否启用
	isEnableFlag bool
}

func NewRuleBuilder() *RuleBuilder {
	builder := &RuleBuilder{}
	return builder
}

// 规则 id
//
// 示例值：123124123123
func (builder *RuleBuilder) Id(id string) *RuleBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 匹配条件
//
// 示例值：
func (builder *RuleBuilder) Condition(condition *RuleCondition) *RuleBuilder {
	builder.condition = condition
	builder.conditionFlag = true
	return builder
}

// 匹配命中后的操作
//
// 示例值：
func (builder *RuleBuilder) Action(action *RuleAction) *RuleBuilder {
	builder.action = action
	builder.actionFlag = true
	return builder
}

// 是否终点规则
//
// 示例值：false
func (builder *RuleBuilder) IgnoreTheRestOfRules(ignoreTheRestOfRules bool) *RuleBuilder {
	builder.ignoreTheRestOfRules = ignoreTheRestOfRules
	builder.ignoreTheRestOfRulesFlag = true
	return builder
}

// 规则名称
//
// 示例值：将李三的邮件标记为垃圾邮件
func (builder *RuleBuilder) Name(name string) *RuleBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 是否启用
//
// 示例值：false
func (builder *RuleBuilder) IsEnable(isEnable bool) *RuleBuilder {
	builder.isEnable = isEnable
	builder.isEnableFlag = true
	return builder
}

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

	}
	if builder.conditionFlag {
		req.Condition = builder.condition
	}
	if builder.actionFlag {
		req.Action = builder.action
	}
	if builder.ignoreTheRestOfRulesFlag {
		req.IgnoreTheRestOfRules = &builder.ignoreTheRestOfRules

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

	}
	if builder.isEnableFlag {
		req.IsEnable = &builder.isEnable

	}
	return req
}

type RuleAction struct {
	Items []*RuleActionItem `json:"items,omitempty"` // 匹配中规则后的操作列表
}

type RuleActionBuilder struct {
	items     []*RuleActionItem // 匹配中规则后的操作列表
	itemsFlag bool
}

func NewRuleActionBuilder() *RuleActionBuilder {
	builder := &RuleActionBuilder{}
	return builder
}

// 匹配中规则后的操作列表
//
// 示例值：
func (builder *RuleActionBuilder) Items(items []*RuleActionItem) *RuleActionBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *RuleActionBuilder) Build() *RuleAction {
	req := &RuleAction{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req
}

type RuleActionItem struct {
	Type *int `json:"type,omitempty"` // 操作类型

	Input *string `json:"input,omitempty"` // 当 type 为移动到文件夹时，该字段填文件夹的 id
}

type RuleActionItemBuilder struct {
	type_    int // 操作类型
	typeFlag bool

	input     string // 当 type 为移动到文件夹时，该字段填文件夹的 id
	inputFlag bool
}

func NewRuleActionItemBuilder() *RuleActionItemBuilder {
	builder := &RuleActionItemBuilder{}
	return builder
}

// 操作类型
//
// 示例值：1
func (builder *RuleActionItemBuilder) Type(type_ int) *RuleActionItemBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 当 type 为移动到文件夹时，该字段填文件夹的 id
//
// 示例值：283412371233
func (builder *RuleActionItemBuilder) Input(input string) *RuleActionItemBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

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

	}
	if builder.inputFlag {
		req.Input = &builder.input

	}
	return req
}

type RuleCondition struct {
	MatchType *int `json:"match_type,omitempty"` // 匹配类型

	Items []*RuleConditionItem `json:"items,omitempty"` // 匹配规则列表
}

type RuleConditionBuilder struct {
	matchType     int // 匹配类型
	matchTypeFlag bool

	items     []*RuleConditionItem // 匹配规则列表
	itemsFlag bool
}

func NewRuleConditionBuilder() *RuleConditionBuilder {
	builder := &RuleConditionBuilder{}
	return builder
}

// 匹配类型
//
// 示例值：1
func (builder *RuleConditionBuilder) MatchType(matchType int) *RuleConditionBuilder {
	builder.matchType = matchType
	builder.matchTypeFlag = true
	return builder
}

// 匹配规则列表
//
// 示例值：
func (builder *RuleConditionBuilder) Items(items []*RuleConditionItem) *RuleConditionBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *RuleConditionBuilder) Build() *RuleCondition {
	req := &RuleCondition{}
	if builder.matchTypeFlag {
		req.MatchType = &builder.matchType

	}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req
}

type RuleConditionItem struct {
	Type *int `json:"type,omitempty"` // 匹配条件左值

	Operator *int `json:"operator,omitempty"` // 匹配条件操作符

	Input *string `json:"input,omitempty"` // 匹配条件右值
}

type RuleConditionItemBuilder struct {
	type_    int // 匹配条件左值
	typeFlag bool

	operator     int // 匹配条件操作符
	operatorFlag bool

	input     string // 匹配条件右值
	inputFlag bool
}

func NewRuleConditionItemBuilder() *RuleConditionItemBuilder {
	builder := &RuleConditionItemBuilder{}
	return builder
}

// 匹配条件左值
//
// 示例值：1
func (builder *RuleConditionItemBuilder) Type(type_ int) *RuleConditionItemBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 匹配条件操作符
//
// 示例值：1
func (builder *RuleConditionItemBuilder) Operator(operator int) *RuleConditionItemBuilder {
	builder.operator = operator
	builder.operatorFlag = true
	return builder
}

// 匹配条件右值
//
// 示例值：hello@world.com
func (builder *RuleConditionItemBuilder) Input(input string) *RuleConditionItemBuilder {
	builder.input = input
	builder.inputFlag = true
	return builder
}

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

	}
	if builder.operatorFlag {
		req.Operator = &builder.operator

	}
	if builder.inputFlag {
		req.Input = &builder.input

	}
	return req
}

type Subscriber struct {
	UserIds []*UserId `json:"user_ids,omitempty"` // 收到邮件的用户 id 列表
}

type SubscriberBuilder struct {
	userIds     []*UserId // 收到邮件的用户 id 列表
	userIdsFlag bool
}

func NewSubscriberBuilder() *SubscriberBuilder {
	builder := &SubscriberBuilder{}
	return builder
}

// 收到邮件的用户 id 列表
//
// 示例值：
func (builder *SubscriberBuilder) UserIds(userIds []*UserId) *SubscriberBuilder {
	builder.userIds = userIds
	builder.userIdsFlag = true
	return builder
}

func (builder *SubscriberBuilder) Build() *Subscriber {
	req := &Subscriber{}
	if builder.userIdsFlag {
		req.UserIds = builder.userIds
	}
	return req
}

type User struct {
	Email *string `json:"email,omitempty"` // 邮箱地址

	Status *int `json:"status,omitempty"` // 邮箱地址状态

	Type *int `json:"type,omitempty"` // 邮箱地址类型
}

type UserBuilder struct {
	email     string // 邮箱地址
	emailFlag bool

	status     int // 邮箱地址状态
	statusFlag bool

	type_    int // 邮箱地址类型
	typeFlag bool
}

func NewUserBuilder() *UserBuilder {
	builder := &UserBuilder{}
	return builder
}

// 邮箱地址
//
// 示例值：aaa@lark.com
func (builder *UserBuilder) Email(email string) *UserBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 邮箱地址状态
//
// 示例值：4
func (builder *UserBuilder) Status(status int) *UserBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 邮箱地址类型
//
// 示例值：1
func (builder *UserBuilder) Type(type_ int) *UserBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

func (builder *UserBuilder) Build() *User {
	req := &User{}
	if builder.emailFlag {
		req.Email = &builder.email

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

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

	}
	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 UserInfo struct {
	Type *string `json:"type,omitempty"` // 个人邮箱还是公共邮箱

	OwnerUserId *string `json:"owner_user_id,omitempty"` // 卡片owner的ID，卡片owner为个人邮箱时非空

	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // 公共邮箱唯一标识
}

type UserInfoBuilder struct {
	type_    string // 个人邮箱还是公共邮箱
	typeFlag bool

	ownerUserId     string // 卡片owner的ID，卡片owner为个人邮箱时非空
	ownerUserIdFlag bool

	publicMailboxId     string // 公共邮箱唯一标识
	publicMailboxIdFlag bool
}

func NewUserInfoBuilder() *UserInfoBuilder {
	builder := &UserInfoBuilder{}
	return builder
}

// 个人邮箱还是公共邮箱
//
// 示例值：user 或 public_mailbox
func (builder *UserInfoBuilder) Type(type_ string) *UserInfoBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 卡片owner的ID，卡片owner为个人邮箱时非空
//
// 示例值：ou_7dab8a3d3cdcc9da365777c7ad115d62
func (builder *UserInfoBuilder) OwnerUserId(ownerUserId string) *UserInfoBuilder {
	builder.ownerUserId = ownerUserId
	builder.ownerUserIdFlag = true
	return builder
}

// 公共邮箱唯一标识
//
// 示例值：xxxxxxxxxx
func (builder *UserInfoBuilder) PublicMailboxId(publicMailboxId string) *UserInfoBuilder {
	builder.publicMailboxId = publicMailboxId
	builder.publicMailboxIdFlag = true
	return builder
}

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

	}
	if builder.ownerUserIdFlag {
		req.OwnerUserId = &builder.ownerUserId

	}
	if builder.publicMailboxIdFlag {
		req.PublicMailboxId = &builder.publicMailboxId

	}
	return req
}

type UserMailEntity struct {
	Type *int `json:"type,omitempty"` // 邮箱类型

	EmailAddress *string `json:"email_address,omitempty"` // 邮箱地址

	EntityId *string `json:"entity_id,omitempty"` // 公共邮箱、邮件组实体ID

	UserId *string `json:"user_id,omitempty"` // 个人邮箱，用户ID
}

type UserMailEntityBuilder struct {
	type_    int // 邮箱类型
	typeFlag bool

	emailAddress     string // 邮箱地址
	emailAddressFlag bool

	entityId     string // 公共邮箱、邮件组实体ID
	entityIdFlag bool

	userId     string // 个人邮箱，用户ID
	userIdFlag bool
}

func NewUserMailEntityBuilder() *UserMailEntityBuilder {
	builder := &UserMailEntityBuilder{}
	return builder
}

// 邮箱类型
//
// 示例值：
func (builder *UserMailEntityBuilder) Type(type_ int) *UserMailEntityBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 邮箱地址
//
// 示例值：user@xxx.xx
func (builder *UserMailEntityBuilder) EmailAddress(emailAddress string) *UserMailEntityBuilder {
	builder.emailAddress = emailAddress
	builder.emailAddressFlag = true
	return builder
}

// 公共邮箱、邮件组实体ID
//
// 示例值：xxxxx
func (builder *UserMailEntityBuilder) EntityId(entityId string) *UserMailEntityBuilder {
	builder.entityId = entityId
	builder.entityIdFlag = true
	return builder
}

// 个人邮箱，用户ID
//
// 示例值：ou_7dab8a3d3cdcc9da365777c7ad115d62
func (builder *UserMailEntityBuilder) UserId(userId string) *UserMailEntityBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

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

	}
	if builder.emailAddressFlag {
		req.EmailAddress = &builder.emailAddress

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

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

	}
	return req
}

type CreateMailgroupReqBuilder struct {
	apiReq    *larkcore.ApiReq
	mailgroup *Mailgroup
}

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

// 创建一个邮件组
func (builder *CreateMailgroupReqBuilder) Mailgroup(mailgroup *Mailgroup) *CreateMailgroupReqBuilder {
	builder.mailgroup = mailgroup
	return builder
}

func (builder *CreateMailgroupReqBuilder) Build() *CreateMailgroupReq {
	req := &CreateMailgroupReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.mailgroup
	return req
}

type CreateMailgroupReq struct {
	apiReq    *larkcore.ApiReq
	Mailgroup *Mailgroup `body:""`
}

type CreateMailgroupRespData struct {
	MailgroupId *string `json:"mailgroup_id,omitempty"` // The unique ID of a mail group

	Email *string `json:"email,omitempty"` // The mail group's email address

	Name *string `json:"name,omitempty"` // The mail group's display name

	Description *string `json:"description,omitempty"` // The mail group's description

	DirectMembersCount *string `json:"direct_members_count,omitempty"` // The number of mail group's direct members

	IncludeExternalMember *bool `json:"include_external_member,omitempty"` // Value is true if this mail group has external member

	IncludeAllCompanyMember *bool `json:"include_all_company_member,omitempty"` // Value is true if all company members are in this mail group

	WhoCanSendMail *string `json:"who_can_send_mail,omitempty"` // Who can send mail to this mail group. Possible values are:;- ANYONE: Any Internet user can send mail to this mail group;- ALL_INTERNAL_USERS: Anyone in the team can send mail to this mail group;- ALL_GROUP_MEMBERS: Any group member can send mail to this mail group;- CUSTOM_MEMBERS: Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
}

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

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

type DeleteMailgroupReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *DeleteMailgroupReqBuilder) MailgroupId(mailgroupId string) *DeleteMailgroupReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

type DeleteMailgroupReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type GetMailgroupReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *GetMailgroupReqBuilder) MailgroupId(mailgroupId string) *GetMailgroupReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

type GetMailgroupReq struct {
	apiReq *larkcore.ApiReq
}

type GetMailgroupRespData struct {
	MailgroupId *string `json:"mailgroup_id,omitempty"` // The unique ID of a mail group

	Email *string `json:"email,omitempty"` // The mail group's email address

	Name *string `json:"name,omitempty"` // The mail group's display name

	Description *string `json:"description,omitempty"` // The mail group's description

	DirectMembersCount *string `json:"direct_members_count,omitempty"` // The number of mail group's direct members

	IncludeExternalMember *bool `json:"include_external_member,omitempty"` // Value is true if this mail group has external member

	IncludeAllCompanyMember *bool `json:"include_all_company_member,omitempty"` // Value is true if all company members are in this mail group

	WhoCanSendMail *string `json:"who_can_send_mail,omitempty"` // Who can send mail to this mail group. Possible values are:;- ANYONE: Any Internet user can send mail to this mail group;- ALL_INTERNAL_USERS: Anyone in the team can send mail to this mail group;- ALL_GROUP_MEMBERS: Any group member can send mail to this mail group;- CUSTOM_MEMBERS: Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
}

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

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

type ListMailgroupReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListMailgroupReqBuilder) Limit(limit int) *ListMailgroupReqBuilder {
	builder.limit = limit
	return builder
}

// 邮件组管理员用户ID，用于获取该用户有管理权限的邮件组
//
// 示例值：ou_xxxxxx
func (builder *ListMailgroupReqBuilder) ManagerUserId(managerUserId string) *ListMailgroupReqBuilder {
	builder.apiReq.QueryParams.Set("manager_user_id", fmt.Sprint(managerUserId))
	return builder
}

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

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListMailgroupReqBuilder) PageToken(pageToken string) *ListMailgroupReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListMailgroupReqBuilder) PageSize(pageSize int) *ListMailgroupReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListMailgroupReqBuilder) Build() *ListMailgroupReq {
	req := &ListMailgroupReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListMailgroupReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListMailgroupRespData struct {
	HasMore *bool `json:"has_more,omitempty"` // 是否有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 下一页分页的token

	Items []*Mailgroup `json:"items,omitempty"` // 邮件组列表
}

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

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

type PatchMailgroupReqBuilder struct {
	apiReq    *larkcore.ApiReq
	mailgroup *Mailgroup
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *PatchMailgroupReqBuilder) MailgroupId(mailgroupId string) *PatchMailgroupReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 更新邮件组部分字段，没有填写的字段不会被更新
func (builder *PatchMailgroupReqBuilder) Mailgroup(mailgroup *Mailgroup) *PatchMailgroupReqBuilder {
	builder.mailgroup = mailgroup
	return builder
}

func (builder *PatchMailgroupReqBuilder) Build() *PatchMailgroupReq {
	req := &PatchMailgroupReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.mailgroup
	return req
}

type PatchMailgroupReq struct {
	apiReq    *larkcore.ApiReq
	Mailgroup *Mailgroup `body:""`
}

type PatchMailgroupRespData struct {
	MailgroupId *string `json:"mailgroup_id,omitempty"` // The unique ID of a mail group

	Email *string `json:"email,omitempty"` // The mail group's email address

	Name *string `json:"name,omitempty"` // The mail group's display name

	Description *string `json:"description,omitempty"` // The mail group's description

	DirectMembersCount *string `json:"direct_members_count,omitempty"` // The number of mail group's direct members

	IncludeExternalMember *bool `json:"include_external_member,omitempty"` // Value is true if this mail group has external member

	IncludeAllCompanyMember *bool `json:"include_all_company_member,omitempty"` // Value is true if all company members are in this mail group

	WhoCanSendMail *string `json:"who_can_send_mail,omitempty"` // Who can send mail to this mail group. Possible values are:;- ANYONE: Any Internet user can send mail to this mail group;- ALL_INTERNAL_USERS: Anyone in the team can send mail to this mail group;- ALL_GROUP_MEMBERS: Any group member can send mail to this mail group;- CUSTOM_MEMBERS: Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
}

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

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

type UpdateMailgroupReqBuilder struct {
	apiReq    *larkcore.ApiReq
	mailgroup *Mailgroup
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *UpdateMailgroupReqBuilder) MailgroupId(mailgroupId string) *UpdateMailgroupReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 更新邮件组所有信息
func (builder *UpdateMailgroupReqBuilder) Mailgroup(mailgroup *Mailgroup) *UpdateMailgroupReqBuilder {
	builder.mailgroup = mailgroup
	return builder
}

func (builder *UpdateMailgroupReqBuilder) Build() *UpdateMailgroupReq {
	req := &UpdateMailgroupReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.mailgroup
	return req
}

type UpdateMailgroupReq struct {
	apiReq    *larkcore.ApiReq
	Mailgroup *Mailgroup `body:""`
}

type UpdateMailgroupRespData struct {
	MailgroupId *string `json:"mailgroup_id,omitempty"` // The unique ID of a mail group

	Email *string `json:"email,omitempty"` // The mail group's email address

	Name *string `json:"name,omitempty"` // The mail group's display name

	Description *string `json:"description,omitempty"` // The mail group's description

	DirectMembersCount *string `json:"direct_members_count,omitempty"` // The number of mail group's direct members

	IncludeExternalMember *bool `json:"include_external_member,omitempty"` // Value is true if this mail group has external member

	IncludeAllCompanyMember *bool `json:"include_all_company_member,omitempty"` // Value is true if all company members are in this mail group

	WhoCanSendMail *string `json:"who_can_send_mail,omitempty"` // Who can send mail to this mail group. Possible values are:;- ANYONE: Any Internet user can send mail to this mail group;- ALL_INTERNAL_USERS: Anyone in the team can send mail to this mail group;- ALL_GROUP_MEMBERS: Any group member can send mail to this mail group;- CUSTOM_MEMBERS: Only custom members can send mail to this mail group, define in mailgroup.permission_members resoure
}

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

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

type CreateMailgroupAliasReqBuilder struct {
	apiReq     *larkcore.ApiReq
	emailAlias *EmailAlias
}

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

// 邮件组id或邮件组邮箱地址
//
// 示例值：xxxxxx 或者 xxx@xx.xxx
func (builder *CreateMailgroupAliasReqBuilder) MailgroupId(mailgroupId string) *CreateMailgroupAliasReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 创建邮件组别名
func (builder *CreateMailgroupAliasReqBuilder) EmailAlias(emailAlias *EmailAlias) *CreateMailgroupAliasReqBuilder {
	builder.emailAlias = emailAlias
	return builder
}

func (builder *CreateMailgroupAliasReqBuilder) Build() *CreateMailgroupAliasReq {
	req := &CreateMailgroupAliasReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.emailAlias
	return req
}

type CreateMailgroupAliasReq struct {
	apiReq     *larkcore.ApiReq
	EmailAlias *EmailAlias `body:""`
}

type CreateMailgroupAliasRespData struct {
	MailgroupAlias *EmailAlias `json:"mailgroup_alias,omitempty"` // 邮件组别名
}

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

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

type DeleteMailgroupAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组id或邮件组邮箱地址
//
// 示例值：xxxxxx 或 test_group@xx.xxx
func (builder *DeleteMailgroupAliasReqBuilder) MailgroupId(mailgroupId string) *DeleteMailgroupAliasReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 邮件组别名邮箱地址
//
// 示例值：xxx@xx.xxx
func (builder *DeleteMailgroupAliasReqBuilder) AliasId(aliasId string) *DeleteMailgroupAliasReqBuilder {
	builder.apiReq.PathParams.Set("alias_id", fmt.Sprint(aliasId))
	return builder
}

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

type DeleteMailgroupAliasReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListMailgroupAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组id或邮件组邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *ListMailgroupAliasReqBuilder) MailgroupId(mailgroupId string) *ListMailgroupAliasReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

type ListMailgroupAliasReq struct {
	apiReq *larkcore.ApiReq
}

type ListMailgroupAliasRespData struct {
	Items []*EmailAlias `json:"items,omitempty"` // 邮件组别名
}

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

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

type BatchCreateMailgroupManagerReqBodyBuilder struct {
	mailgroupManagerList     []*MailgroupManager // 邮件组管理员列表
	mailgroupManagerListFlag bool
}

func NewBatchCreateMailgroupManagerReqBodyBuilder() *BatchCreateMailgroupManagerReqBodyBuilder {
	builder := &BatchCreateMailgroupManagerReqBodyBuilder{}
	return builder
}

// 邮件组管理员列表
//
//示例值：
func (builder *BatchCreateMailgroupManagerReqBodyBuilder) MailgroupManagerList(mailgroupManagerList []*MailgroupManager) *BatchCreateMailgroupManagerReqBodyBuilder {
	builder.mailgroupManagerList = mailgroupManagerList
	builder.mailgroupManagerListFlag = true
	return builder
}

func (builder *BatchCreateMailgroupManagerReqBodyBuilder) Build() *BatchCreateMailgroupManagerReqBody {
	req := &BatchCreateMailgroupManagerReqBody{}
	if builder.mailgroupManagerListFlag {
		req.MailgroupManagerList = builder.mailgroupManagerList
	}
	return req
}

type BatchCreateMailgroupManagerPathReqBodyBuilder struct {
	mailgroupManagerList     []*MailgroupManager
	mailgroupManagerListFlag bool
}

func NewBatchCreateMailgroupManagerPathReqBodyBuilder() *BatchCreateMailgroupManagerPathReqBodyBuilder {
	builder := &BatchCreateMailgroupManagerPathReqBodyBuilder{}
	return builder
}

// 邮件组管理员列表
//
// 示例值：
func (builder *BatchCreateMailgroupManagerPathReqBodyBuilder) MailgroupManagerList(mailgroupManagerList []*MailgroupManager) *BatchCreateMailgroupManagerPathReqBodyBuilder {
	builder.mailgroupManagerList = mailgroupManagerList
	builder.mailgroupManagerListFlag = true
	return builder
}

func (builder *BatchCreateMailgroupManagerPathReqBodyBuilder) Build() (*BatchCreateMailgroupManagerReqBody, error) {
	req := &BatchCreateMailgroupManagerReqBody{}
	if builder.mailgroupManagerListFlag {
		req.MailgroupManagerList = builder.mailgroupManagerList
	}
	return req, nil
}

type BatchCreateMailgroupManagerReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchCreateMailgroupManagerReqBody
}

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

// 邮件组ID或邮箱地址
//
// 示例值：xxxxxx 或 test_mail_group@xx.xx
func (builder *BatchCreateMailgroupManagerReqBuilder) MailgroupId(mailgroupId string) *BatchCreateMailgroupManagerReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 批量创建邮件组管理员
func (builder *BatchCreateMailgroupManagerReqBuilder) Body(body *BatchCreateMailgroupManagerReqBody) *BatchCreateMailgroupManagerReqBuilder {
	builder.body = body
	return builder
}

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

type BatchCreateMailgroupManagerReqBody struct {
	MailgroupManagerList []*MailgroupManager `json:"mailgroup_manager_list,omitempty"` // 邮件组管理员列表
}

type BatchCreateMailgroupManagerReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchCreateMailgroupManagerReqBody `body:""`
}

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

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

type BatchDeleteMailgroupManagerReqBodyBuilder struct {
	mailgroupManagerList     []*MailgroupManager // 邮件组管理员列表
	mailgroupManagerListFlag bool
}

func NewBatchDeleteMailgroupManagerReqBodyBuilder() *BatchDeleteMailgroupManagerReqBodyBuilder {
	builder := &BatchDeleteMailgroupManagerReqBodyBuilder{}
	return builder
}

// 邮件组管理员列表
//
//示例值：
func (builder *BatchDeleteMailgroupManagerReqBodyBuilder) MailgroupManagerList(mailgroupManagerList []*MailgroupManager) *BatchDeleteMailgroupManagerReqBodyBuilder {
	builder.mailgroupManagerList = mailgroupManagerList
	builder.mailgroupManagerListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupManagerReqBodyBuilder) Build() *BatchDeleteMailgroupManagerReqBody {
	req := &BatchDeleteMailgroupManagerReqBody{}
	if builder.mailgroupManagerListFlag {
		req.MailgroupManagerList = builder.mailgroupManagerList
	}
	return req
}

type BatchDeleteMailgroupManagerPathReqBodyBuilder struct {
	mailgroupManagerList     []*MailgroupManager
	mailgroupManagerListFlag bool
}

func NewBatchDeleteMailgroupManagerPathReqBodyBuilder() *BatchDeleteMailgroupManagerPathReqBodyBuilder {
	builder := &BatchDeleteMailgroupManagerPathReqBodyBuilder{}
	return builder
}

// 邮件组管理员列表
//
// 示例值：
func (builder *BatchDeleteMailgroupManagerPathReqBodyBuilder) MailgroupManagerList(mailgroupManagerList []*MailgroupManager) *BatchDeleteMailgroupManagerPathReqBodyBuilder {
	builder.mailgroupManagerList = mailgroupManagerList
	builder.mailgroupManagerListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupManagerPathReqBodyBuilder) Build() (*BatchDeleteMailgroupManagerReqBody, error) {
	req := &BatchDeleteMailgroupManagerReqBody{}
	if builder.mailgroupManagerListFlag {
		req.MailgroupManagerList = builder.mailgroupManagerList
	}
	return req, nil
}

type BatchDeleteMailgroupManagerReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchDeleteMailgroupManagerReqBody
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *BatchDeleteMailgroupManagerReqBuilder) MailgroupId(mailgroupId string) *BatchDeleteMailgroupManagerReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 批量删除邮件组管理员
func (builder *BatchDeleteMailgroupManagerReqBuilder) Body(body *BatchDeleteMailgroupManagerReqBody) *BatchDeleteMailgroupManagerReqBuilder {
	builder.body = body
	return builder
}

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

type BatchDeleteMailgroupManagerReqBody struct {
	MailgroupManagerList []*MailgroupManager `json:"mailgroup_manager_list,omitempty"` // 邮件组管理员列表
}

type BatchDeleteMailgroupManagerReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchDeleteMailgroupManagerReqBody `body:""`
}

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

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

type ListMailgroupManagerReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListMailgroupManagerReqBuilder) Limit(limit int) *ListMailgroupManagerReqBuilder {
	builder.limit = limit
	return builder
}

// 邮件组ID或邮箱地址
//
// 示例值：xxxxxx 或 test_mail_group@xx.xx
func (builder *ListMailgroupManagerReqBuilder) MailgroupId(mailgroupId string) *ListMailgroupManagerReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 分页大小
//
// 示例值：20
func (builder *ListMailgroupManagerReqBuilder) PageSize(pageSize int) *ListMailgroupManagerReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：xxxxxx
func (builder *ListMailgroupManagerReqBuilder) PageToken(pageToken string) *ListMailgroupManagerReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

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

func (builder *ListMailgroupManagerReqBuilder) Build() *ListMailgroupManagerReq {
	req := &ListMailgroupManagerReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListMailgroupManagerReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListMailgroupManagerRespData struct {
	Items []*MailgroupManager `json:"items,omitempty"` // 邮件组管理员列表

	PageToken *string `json:"page_token,omitempty"` // 分页标识

	HasMore *bool `json:"has_more,omitempty"` // 是否有更多数据
}

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

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

type BatchCreateMailgroupMemberReqBodyBuilder struct {
	items     []*MailgroupMember // 本次添加的邮件组成员列表
	itemsFlag bool
}

func NewBatchCreateMailgroupMemberReqBodyBuilder() *BatchCreateMailgroupMemberReqBodyBuilder {
	builder := &BatchCreateMailgroupMemberReqBodyBuilder{}
	return builder
}

// 本次添加的邮件组成员列表
//
//示例值：
func (builder *BatchCreateMailgroupMemberReqBodyBuilder) Items(items []*MailgroupMember) *BatchCreateMailgroupMemberReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreateMailgroupMemberReqBodyBuilder) Build() *BatchCreateMailgroupMemberReqBody {
	req := &BatchCreateMailgroupMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req
}

type BatchCreateMailgroupMemberPathReqBodyBuilder struct {
	items     []*MailgroupMember
	itemsFlag bool
}

func NewBatchCreateMailgroupMemberPathReqBodyBuilder() *BatchCreateMailgroupMemberPathReqBodyBuilder {
	builder := &BatchCreateMailgroupMemberPathReqBodyBuilder{}
	return builder
}

// 本次添加的邮件组成员列表
//
// 示例值：
func (builder *BatchCreateMailgroupMemberPathReqBodyBuilder) Items(items []*MailgroupMember) *BatchCreateMailgroupMemberPathReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreateMailgroupMemberPathReqBodyBuilder) Build() (*BatchCreateMailgroupMemberReqBody, error) {
	req := &BatchCreateMailgroupMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req, nil
}

type BatchCreateMailgroupMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchCreateMailgroupMemberReqBody
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *BatchCreateMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *BatchCreateMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：
func (builder *BatchCreateMailgroupMemberReqBuilder) DepartmentIdType(departmentIdType string) *BatchCreateMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

//
func (builder *BatchCreateMailgroupMemberReqBuilder) Body(body *BatchCreateMailgroupMemberReqBody) *BatchCreateMailgroupMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchCreateMailgroupMemberReqBody struct {
	Items []*MailgroupMember `json:"items,omitempty"` // 本次添加的邮件组成员列表
}

type BatchCreateMailgroupMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchCreateMailgroupMemberReqBody `body:""`
}

type BatchCreateMailgroupMemberRespData struct {
	Items []*MailgroupMember `json:"items,omitempty"` // 添加成功后的邮件组成员信息列表
}

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

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

type BatchDeleteMailgroupMemberReqBodyBuilder struct {
	memberIdList     []string // 本次调用删除的成员ID列表
	memberIdListFlag bool
}

func NewBatchDeleteMailgroupMemberReqBodyBuilder() *BatchDeleteMailgroupMemberReqBodyBuilder {
	builder := &BatchDeleteMailgroupMemberReqBodyBuilder{}
	return builder
}

// 本次调用删除的成员ID列表
//
//示例值：
func (builder *BatchDeleteMailgroupMemberReqBodyBuilder) MemberIdList(memberIdList []string) *BatchDeleteMailgroupMemberReqBodyBuilder {
	builder.memberIdList = memberIdList
	builder.memberIdListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupMemberReqBodyBuilder) Build() *BatchDeleteMailgroupMemberReqBody {
	req := &BatchDeleteMailgroupMemberReqBody{}
	if builder.memberIdListFlag {
		req.MemberIdList = builder.memberIdList
	}
	return req
}

type BatchDeleteMailgroupMemberPathReqBodyBuilder struct {
	memberIdList     []string
	memberIdListFlag bool
}

func NewBatchDeleteMailgroupMemberPathReqBodyBuilder() *BatchDeleteMailgroupMemberPathReqBodyBuilder {
	builder := &BatchDeleteMailgroupMemberPathReqBodyBuilder{}
	return builder
}

// 本次调用删除的成员ID列表
//
// 示例值：
func (builder *BatchDeleteMailgroupMemberPathReqBodyBuilder) MemberIdList(memberIdList []string) *BatchDeleteMailgroupMemberPathReqBodyBuilder {
	builder.memberIdList = memberIdList
	builder.memberIdListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupMemberPathReqBodyBuilder) Build() (*BatchDeleteMailgroupMemberReqBody, error) {
	req := &BatchDeleteMailgroupMemberReqBody{}
	if builder.memberIdListFlag {
		req.MemberIdList = builder.memberIdList
	}
	return req, nil
}

type BatchDeleteMailgroupMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchDeleteMailgroupMemberReqBody
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *BatchDeleteMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *BatchDeleteMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

//
func (builder *BatchDeleteMailgroupMemberReqBuilder) Body(body *BatchDeleteMailgroupMemberReqBody) *BatchDeleteMailgroupMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchDeleteMailgroupMemberReqBody struct {
	MemberIdList []string `json:"member_id_list,omitempty"` // 本次调用删除的成员ID列表
}

type BatchDeleteMailgroupMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchDeleteMailgroupMemberReqBody `body:""`
}

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

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

type CreateMailgroupMemberReqBuilder struct {
	apiReq          *larkcore.ApiReq
	mailgroupMember *MailgroupMember
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *CreateMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *CreateMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *CreateMailgroupMemberReqBuilder) DepartmentIdType(departmentIdType string) *CreateMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 向邮件组添加单个成员
func (builder *CreateMailgroupMemberReqBuilder) MailgroupMember(mailgroupMember *MailgroupMember) *CreateMailgroupMemberReqBuilder {
	builder.mailgroupMember = mailgroupMember
	return builder
}

func (builder *CreateMailgroupMemberReqBuilder) Build() *CreateMailgroupMemberReq {
	req := &CreateMailgroupMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.mailgroupMember
	return req
}

type CreateMailgroupMemberReq struct {
	apiReq          *larkcore.ApiReq
	MailgroupMember *MailgroupMember `body:""`
}

type CreateMailgroupMemberRespData struct {
	MemberId *string `json:"member_id,omitempty"` // The unique ID of a member in this mail group

	Email *string `json:"email,omitempty"` // The member's email address. Value is valid when type is one of USER/EXTERNAL_USER/MAIL_GROUP/PUBLIC_MAILBOX/OTHER_MEMBER

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	DepartmentId *string `json:"department_id,omitempty"` // The member's department id. Value is valid when type is DEPARTMENT

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team;- DEPARTMENT: member is a department;- COMPANY: member is the company;- EXTERNAL_USER: internet user outside the organization;- MAIL_GROUP: member is another mail group;- PUBLIC_MAILBOX: member is a public mailbox;- OTHER_MEMBER: other internal member
}

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

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

type DeleteMailgroupMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *DeleteMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *DeleteMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// The unique ID of a member in this mail group
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *DeleteMailgroupMemberReqBuilder) MemberId(memberId string) *DeleteMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("member_id", fmt.Sprint(memberId))
	return builder
}

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

type DeleteMailgroupMemberReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type GetMailgroupMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *GetMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *GetMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 邮件组内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *GetMailgroupMemberReqBuilder) MemberId(memberId string) *GetMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("member_id", fmt.Sprint(memberId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *GetMailgroupMemberReqBuilder) DepartmentIdType(departmentIdType string) *GetMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

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

type GetMailgroupMemberReq struct {
	apiReq *larkcore.ApiReq
}

type GetMailgroupMemberRespData struct {
	MemberId *string `json:"member_id,omitempty"` // The unique ID of a member in this mail group

	Email *string `json:"email,omitempty"` // The member's email address. Value is valid when type is one of USER/EXTERNAL_USER/MAIL_GROUP/PUBLIC_MAILBOX/OTHER_MEMBER

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	DepartmentId *string `json:"department_id,omitempty"` // The member's department id. Value is valid when type is DEPARTMENT

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team;- DEPARTMENT: member is a department;- COMPANY: member is the company;- EXTERNAL_USER: internet user outside the organization;- MAIL_GROUP: member is another mail group;- PUBLIC_MAILBOX: member is a public mailbox;- OTHER_MEMBER: other internal member
}

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

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

type ListMailgroupMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListMailgroupMemberReqBuilder) Limit(limit int) *ListMailgroupMemberReqBuilder {
	builder.limit = limit
	return builder
}

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *ListMailgroupMemberReqBuilder) MailgroupId(mailgroupId string) *ListMailgroupMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *ListMailgroupMemberReqBuilder) DepartmentIdType(departmentIdType string) *ListMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListMailgroupMemberReqBuilder) PageToken(pageToken string) *ListMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListMailgroupMemberReqBuilder) PageSize(pageSize int) *ListMailgroupMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListMailgroupMemberReqBuilder) Build() *ListMailgroupMemberReq {
	req := &ListMailgroupMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListMailgroupMemberReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListMailgroupMemberRespData struct {
	HasMore *bool `json:"has_more,omitempty"` // 是否有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 下一页分页的token

	Items []*MailgroupMember `json:"items,omitempty"` // 邮件组成员列表
}

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

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

type BatchCreateMailgroupPermissionMemberReqBodyBuilder struct {
	items     []*MailgroupPermissionMember // 本次添加的邮件组权限成员列表
	itemsFlag bool
}

func NewBatchCreateMailgroupPermissionMemberReqBodyBuilder() *BatchCreateMailgroupPermissionMemberReqBodyBuilder {
	builder := &BatchCreateMailgroupPermissionMemberReqBodyBuilder{}
	return builder
}

// 本次添加的邮件组权限成员列表
//
//示例值：
func (builder *BatchCreateMailgroupPermissionMemberReqBodyBuilder) Items(items []*MailgroupPermissionMember) *BatchCreateMailgroupPermissionMemberReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreateMailgroupPermissionMemberReqBodyBuilder) Build() *BatchCreateMailgroupPermissionMemberReqBody {
	req := &BatchCreateMailgroupPermissionMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req
}

type BatchCreateMailgroupPermissionMemberPathReqBodyBuilder struct {
	items     []*MailgroupPermissionMember
	itemsFlag bool
}

func NewBatchCreateMailgroupPermissionMemberPathReqBodyBuilder() *BatchCreateMailgroupPermissionMemberPathReqBodyBuilder {
	builder := &BatchCreateMailgroupPermissionMemberPathReqBodyBuilder{}
	return builder
}

// 本次添加的邮件组权限成员列表
//
// 示例值：
func (builder *BatchCreateMailgroupPermissionMemberPathReqBodyBuilder) Items(items []*MailgroupPermissionMember) *BatchCreateMailgroupPermissionMemberPathReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreateMailgroupPermissionMemberPathReqBodyBuilder) Build() (*BatchCreateMailgroupPermissionMemberReqBody, error) {
	req := &BatchCreateMailgroupPermissionMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req, nil
}

type BatchCreateMailgroupPermissionMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchCreateMailgroupPermissionMemberReqBody
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *BatchCreateMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *BatchCreateMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *BatchCreateMailgroupPermissionMemberReqBuilder) DepartmentIdType(departmentIdType string) *BatchCreateMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

//
func (builder *BatchCreateMailgroupPermissionMemberReqBuilder) Body(body *BatchCreateMailgroupPermissionMemberReqBody) *BatchCreateMailgroupPermissionMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchCreateMailgroupPermissionMemberReqBody struct {
	Items []*MailgroupPermissionMember `json:"items,omitempty"` // 本次添加的邮件组权限成员列表
}

type BatchCreateMailgroupPermissionMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchCreateMailgroupPermissionMemberReqBody `body:""`
}

type BatchCreateMailgroupPermissionMemberRespData struct {
	Items []*MailgroupPermissionMember `json:"items,omitempty"` // 添加成功后的邮件组权限成员信息列表
}

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

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

type BatchDeleteMailgroupPermissionMemberReqBodyBuilder struct {
	permissionMemberIdList     []string // 本次调用删除的权限成员ID列表
	permissionMemberIdListFlag bool
}

func NewBatchDeleteMailgroupPermissionMemberReqBodyBuilder() *BatchDeleteMailgroupPermissionMemberReqBodyBuilder {
	builder := &BatchDeleteMailgroupPermissionMemberReqBodyBuilder{}
	return builder
}

// 本次调用删除的权限成员ID列表
//
//示例值：
func (builder *BatchDeleteMailgroupPermissionMemberReqBodyBuilder) PermissionMemberIdList(permissionMemberIdList []string) *BatchDeleteMailgroupPermissionMemberReqBodyBuilder {
	builder.permissionMemberIdList = permissionMemberIdList
	builder.permissionMemberIdListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupPermissionMemberReqBodyBuilder) Build() *BatchDeleteMailgroupPermissionMemberReqBody {
	req := &BatchDeleteMailgroupPermissionMemberReqBody{}
	if builder.permissionMemberIdListFlag {
		req.PermissionMemberIdList = builder.permissionMemberIdList
	}
	return req
}

type BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder struct {
	permissionMemberIdList     []string
	permissionMemberIdListFlag bool
}

func NewBatchDeleteMailgroupPermissionMemberPathReqBodyBuilder() *BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder {
	builder := &BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder{}
	return builder
}

// 本次调用删除的权限成员ID列表
//
// 示例值：
func (builder *BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder) PermissionMemberIdList(permissionMemberIdList []string) *BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder {
	builder.permissionMemberIdList = permissionMemberIdList
	builder.permissionMemberIdListFlag = true
	return builder
}

func (builder *BatchDeleteMailgroupPermissionMemberPathReqBodyBuilder) Build() (*BatchDeleteMailgroupPermissionMemberReqBody, error) {
	req := &BatchDeleteMailgroupPermissionMemberReqBody{}
	if builder.permissionMemberIdListFlag {
		req.PermissionMemberIdList = builder.permissionMemberIdList
	}
	return req, nil
}

type BatchDeleteMailgroupPermissionMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchDeleteMailgroupPermissionMemberReqBody
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *BatchDeleteMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *BatchDeleteMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

//
func (builder *BatchDeleteMailgroupPermissionMemberReqBuilder) Body(body *BatchDeleteMailgroupPermissionMemberReqBody) *BatchDeleteMailgroupPermissionMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchDeleteMailgroupPermissionMemberReqBody struct {
	PermissionMemberIdList []string `json:"permission_member_id_list,omitempty"` // 本次调用删除的权限成员ID列表
}

type BatchDeleteMailgroupPermissionMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchDeleteMailgroupPermissionMemberReqBody `body:""`
}

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

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

type CreateMailgroupPermissionMemberReqBuilder struct {
	apiReq                    *larkcore.ApiReq
	mailgroupPermissionMember *MailgroupPermissionMember
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *CreateMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *CreateMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：xxx
func (builder *CreateMailgroupPermissionMemberReqBuilder) DepartmentIdType(departmentIdType string) *CreateMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 向邮件组添加单个自定义权限成员，添加后该成员可发送邮件到该邮件组
func (builder *CreateMailgroupPermissionMemberReqBuilder) MailgroupPermissionMember(mailgroupPermissionMember *MailgroupPermissionMember) *CreateMailgroupPermissionMemberReqBuilder {
	builder.mailgroupPermissionMember = mailgroupPermissionMember
	return builder
}

func (builder *CreateMailgroupPermissionMemberReqBuilder) Build() *CreateMailgroupPermissionMemberReq {
	req := &CreateMailgroupPermissionMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.mailgroupPermissionMember
	return req
}

type CreateMailgroupPermissionMemberReq struct {
	apiReq                    *larkcore.ApiReq
	MailgroupPermissionMember *MailgroupPermissionMember `body:""`
}

type CreateMailgroupPermissionMemberRespData struct {
	PermissionMemberId *string `json:"permission_member_id,omitempty"` // The unique ID of a member in this permission group

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	DepartmentId *string `json:"department_id,omitempty"` // The member's department id. Value is valid when type is DEPARTMENT

	Email *string `json:"email,omitempty"` // The member's email address. Value is valid when type is MAIL_GROUP/PUBLIC_MAILBOX

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team;- DEPARTMENT: member is a department
}

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

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

type DeleteMailgroupPermissionMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// The unique ID or email address of a mail group
//
// 示例值：xxxxxxxxxxxxxxx or test_mail_group@xxx.xx
func (builder *DeleteMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *DeleteMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// The unique ID of a member in this permission group
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *DeleteMailgroupPermissionMemberReqBuilder) PermissionMemberId(permissionMemberId string) *DeleteMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("permission_member_id", fmt.Sprint(permissionMemberId))
	return builder
}

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

type DeleteMailgroupPermissionMemberReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type GetMailgroupPermissionMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *GetMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *GetMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

// 权限组内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *GetMailgroupPermissionMemberReqBuilder) PermissionMemberId(permissionMemberId string) *GetMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("permission_member_id", fmt.Sprint(permissionMemberId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *GetMailgroupPermissionMemberReqBuilder) DepartmentIdType(departmentIdType string) *GetMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

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

type GetMailgroupPermissionMemberReq struct {
	apiReq *larkcore.ApiReq
}

type GetMailgroupPermissionMemberRespData struct {
	PermissionMemberId *string `json:"permission_member_id,omitempty"` // The unique ID of a member in this permission group

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	DepartmentId *string `json:"department_id,omitempty"` // The member's department id. Value is valid when type is DEPARTMENT

	Email *string `json:"email,omitempty"` // The member's email address. Value is valid when type is MAIL_GROUP/PUBLIC_MAILBOX

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team;- DEPARTMENT: member is a department
}

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

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

type ListMailgroupPermissionMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListMailgroupPermissionMemberReqBuilder) Limit(limit int) *ListMailgroupPermissionMemberReqBuilder {
	builder.limit = limit
	return builder
}

// 邮件组ID或者邮件组地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_mail_group@xxx.xx
func (builder *ListMailgroupPermissionMemberReqBuilder) MailgroupId(mailgroupId string) *ListMailgroupPermissionMemberReqBuilder {
	builder.apiReq.PathParams.Set("mailgroup_id", fmt.Sprint(mailgroupId))
	return builder
}

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

// 此次调用中使用的部门ID的类型
//
// 示例值：open_department_id
func (builder *ListMailgroupPermissionMemberReqBuilder) DepartmentIdType(departmentIdType string) *ListMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("department_id_type", fmt.Sprint(departmentIdType))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListMailgroupPermissionMemberReqBuilder) PageToken(pageToken string) *ListMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListMailgroupPermissionMemberReqBuilder) PageSize(pageSize int) *ListMailgroupPermissionMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListMailgroupPermissionMemberReqBuilder) Build() *ListMailgroupPermissionMemberReq {
	req := &ListMailgroupPermissionMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListMailgroupPermissionMemberReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListMailgroupPermissionMemberRespData struct {
	HasMore *bool `json:"has_more,omitempty"` // 是否有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 下一页分页的token

	Items []*MailgroupPermissionMember `json:"items,omitempty"` // 邮件组权限成员列表
}

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

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

type CreatePublicMailboxReqBuilder struct {
	apiReq        *larkcore.ApiReq
	publicMailbox *PublicMailbox
}

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

// 创建一个公共邮箱
func (builder *CreatePublicMailboxReqBuilder) PublicMailbox(publicMailbox *PublicMailbox) *CreatePublicMailboxReqBuilder {
	builder.publicMailbox = publicMailbox
	return builder
}

func (builder *CreatePublicMailboxReqBuilder) Build() *CreatePublicMailboxReq {
	req := &CreatePublicMailboxReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.publicMailbox
	return req
}

type CreatePublicMailboxReq struct {
	apiReq        *larkcore.ApiReq
	PublicMailbox *PublicMailbox `body:""`
}

type CreatePublicMailboxRespData struct {
	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // The unique ID of a public mailbox

	Email *string `json:"email,omitempty"` // The public mailbox's email address

	Name *string `json:"name,omitempty"` // The public mailbox's display name

	Geo *string `json:"geo,omitempty"` // 数据驻留地
}

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

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

type DeletePublicMailboxReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 要释放的公共邮箱地址
//
// 示例值：xxxxxx@abc.com
func (builder *DeletePublicMailboxReqBuilder) PublicMailboxId(publicMailboxId string) *DeletePublicMailboxReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

type DeletePublicMailboxReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type GetPublicMailboxReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *GetPublicMailboxReqBuilder) PublicMailboxId(publicMailboxId string) *GetPublicMailboxReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

type GetPublicMailboxReq struct {
	apiReq *larkcore.ApiReq
}

type GetPublicMailboxRespData struct {
	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // The unique ID of a public mailbox

	Email *string `json:"email,omitempty"` // The public mailbox's email address

	Name *string `json:"name,omitempty"` // The public mailbox's display name

	Geo *string `json:"geo,omitempty"` // 数据驻留地
}

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

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

type ListPublicMailboxReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListPublicMailboxReqBuilder) Limit(limit int) *ListPublicMailboxReqBuilder {
	builder.limit = limit
	return builder
}

// user_id
//
// 示例值：
func (builder *ListPublicMailboxReqBuilder) UserId(userId string) *ListPublicMailboxReqBuilder {
	builder.apiReq.QueryParams.Set("user_id", fmt.Sprint(userId))
	return builder
}

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

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListPublicMailboxReqBuilder) PageToken(pageToken string) *ListPublicMailboxReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListPublicMailboxReqBuilder) PageSize(pageSize int) *ListPublicMailboxReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListPublicMailboxReqBuilder) Build() *ListPublicMailboxReq {
	req := &ListPublicMailboxReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListPublicMailboxReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListPublicMailboxRespData struct {
	HasMore *bool `json:"has_more,omitempty"` // 是否有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 下一页分页的token

	Items []*PublicMailbox `json:"items,omitempty"` // 公共邮箱列表
}

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

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

type PatchPublicMailboxReqBuilder struct {
	apiReq        *larkcore.ApiReq
	publicMailbox *PublicMailbox
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *PatchPublicMailboxReqBuilder) PublicMailboxId(publicMailboxId string) *PatchPublicMailboxReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 更新公共邮箱部分字段，没有填写的字段不会被更新
func (builder *PatchPublicMailboxReqBuilder) PublicMailbox(publicMailbox *PublicMailbox) *PatchPublicMailboxReqBuilder {
	builder.publicMailbox = publicMailbox
	return builder
}

func (builder *PatchPublicMailboxReqBuilder) Build() *PatchPublicMailboxReq {
	req := &PatchPublicMailboxReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.publicMailbox
	return req
}

type PatchPublicMailboxReq struct {
	apiReq        *larkcore.ApiReq
	PublicMailbox *PublicMailbox `body:""`
}

type PatchPublicMailboxRespData struct {
	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // The unique ID of a public mailbox

	Email *string `json:"email,omitempty"` // The public mailbox's email address

	Name *string `json:"name,omitempty"` // The public mailbox's display name

	Geo *string `json:"geo,omitempty"` // 数据驻留地
}

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

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

type RemoveToRecycleBinPublicMailboxReqBodyBuilder struct {
	toMailAddress     string // 接收删除邮件的邮箱地址，不填则删除该公共邮箱的邮件
	toMailAddressFlag bool
}

func NewRemoveToRecycleBinPublicMailboxReqBodyBuilder() *RemoveToRecycleBinPublicMailboxReqBodyBuilder {
	builder := &RemoveToRecycleBinPublicMailboxReqBodyBuilder{}
	return builder
}

// 接收删除邮件的邮箱地址，不填则删除该公共邮箱的邮件
//
//示例值：user@xxx.xx
func (builder *RemoveToRecycleBinPublicMailboxReqBodyBuilder) ToMailAddress(toMailAddress string) *RemoveToRecycleBinPublicMailboxReqBodyBuilder {
	builder.toMailAddress = toMailAddress
	builder.toMailAddressFlag = true
	return builder
}

func (builder *RemoveToRecycleBinPublicMailboxReqBodyBuilder) Build() *RemoveToRecycleBinPublicMailboxReqBody {
	req := &RemoveToRecycleBinPublicMailboxReqBody{}
	if builder.toMailAddressFlag {
		req.ToMailAddress = &builder.toMailAddress
	}
	return req
}

type RemoveToRecycleBinPublicMailboxPathReqBodyBuilder struct {
	toMailAddress     string
	toMailAddressFlag bool
}

func NewRemoveToRecycleBinPublicMailboxPathReqBodyBuilder() *RemoveToRecycleBinPublicMailboxPathReqBodyBuilder {
	builder := &RemoveToRecycleBinPublicMailboxPathReqBodyBuilder{}
	return builder
}

// 接收删除邮件的邮箱地址，不填则删除该公共邮箱的邮件
//
// 示例值：user@xxx.xx
func (builder *RemoveToRecycleBinPublicMailboxPathReqBodyBuilder) ToMailAddress(toMailAddress string) *RemoveToRecycleBinPublicMailboxPathReqBodyBuilder {
	builder.toMailAddress = toMailAddress
	builder.toMailAddressFlag = true
	return builder
}

func (builder *RemoveToRecycleBinPublicMailboxPathReqBodyBuilder) Build() (*RemoveToRecycleBinPublicMailboxReqBody, error) {
	req := &RemoveToRecycleBinPublicMailboxReqBody{}
	if builder.toMailAddressFlag {
		req.ToMailAddress = &builder.toMailAddress
	}
	return req, nil
}

type RemoveToRecycleBinPublicMailboxReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *RemoveToRecycleBinPublicMailboxReqBody
}

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

// 公共邮箱地址
//
// 示例值：test_public_mailbox@xxx.xx
func (builder *RemoveToRecycleBinPublicMailboxReqBuilder) PublicMailboxId(publicMailboxId string) *RemoveToRecycleBinPublicMailboxReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

//
func (builder *RemoveToRecycleBinPublicMailboxReqBuilder) Body(body *RemoveToRecycleBinPublicMailboxReqBody) *RemoveToRecycleBinPublicMailboxReqBuilder {
	builder.body = body
	return builder
}

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

type RemoveToRecycleBinPublicMailboxReqBody struct {
	ToMailAddress *string `json:"to_mail_address,omitempty"` // 接收删除邮件的邮箱地址，不填则删除该公共邮箱的邮件
}

type RemoveToRecycleBinPublicMailboxReq struct {
	apiReq *larkcore.ApiReq
	Body   *RemoveToRecycleBinPublicMailboxReqBody `body:""`
}

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

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

type UpdatePublicMailboxReqBuilder struct {
	apiReq        *larkcore.ApiReq
	publicMailbox *PublicMailbox
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *UpdatePublicMailboxReqBuilder) PublicMailboxId(publicMailboxId string) *UpdatePublicMailboxReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 更新公共邮箱所有信息
func (builder *UpdatePublicMailboxReqBuilder) PublicMailbox(publicMailbox *PublicMailbox) *UpdatePublicMailboxReqBuilder {
	builder.publicMailbox = publicMailbox
	return builder
}

func (builder *UpdatePublicMailboxReqBuilder) Build() *UpdatePublicMailboxReq {
	req := &UpdatePublicMailboxReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.publicMailbox
	return req
}

type UpdatePublicMailboxReq struct {
	apiReq        *larkcore.ApiReq
	PublicMailbox *PublicMailbox `body:""`
}

type UpdatePublicMailboxRespData struct {
	PublicMailboxId *string `json:"public_mailbox_id,omitempty"` // The unique ID of a public mailbox

	Email *string `json:"email,omitempty"` // The public mailbox's email address

	Name *string `json:"name,omitempty"` // The public mailbox's display name

	Geo *string `json:"geo,omitempty"` // 数据驻留地
}

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

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

type CreatePublicMailboxAliasReqBuilder struct {
	apiReq     *larkcore.ApiReq
	emailAlias *EmailAlias
}

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

// 公共邮箱id或公共邮箱地址
//
// 示例值：xxxxxx 或 xxx@xx.xxx
func (builder *CreatePublicMailboxAliasReqBuilder) PublicMailboxId(publicMailboxId string) *CreatePublicMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 创建公共邮箱别名
func (builder *CreatePublicMailboxAliasReqBuilder) EmailAlias(emailAlias *EmailAlias) *CreatePublicMailboxAliasReqBuilder {
	builder.emailAlias = emailAlias
	return builder
}

func (builder *CreatePublicMailboxAliasReqBuilder) Build() *CreatePublicMailboxAliasReq {
	req := &CreatePublicMailboxAliasReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.emailAlias
	return req
}

type CreatePublicMailboxAliasReq struct {
	apiReq     *larkcore.ApiReq
	EmailAlias *EmailAlias `body:""`
}

type CreatePublicMailboxAliasRespData struct {
	PublicMailboxAlias *EmailAlias `json:"public_mailbox_alias,omitempty"` // 公共邮箱别名
}

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

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

type DeletePublicMailboxAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱id或公共邮箱地址
//
// 示例值：xxxxxx 或 xxx@xx.xxx
func (builder *DeletePublicMailboxAliasReqBuilder) PublicMailboxId(publicMailboxId string) *DeletePublicMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 公共邮箱别名
//
// 示例值：xxx@xx.xxx
func (builder *DeletePublicMailboxAliasReqBuilder) AliasId(aliasId string) *DeletePublicMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("alias_id", fmt.Sprint(aliasId))
	return builder
}

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

type DeletePublicMailboxAliasReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListPublicMailboxAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱id或公共邮箱邮件地址
//
// 示例值：xxxxxx 或 xxx@xx.xxx
func (builder *ListPublicMailboxAliasReqBuilder) PublicMailboxId(publicMailboxId string) *ListPublicMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

type ListPublicMailboxAliasReq struct {
	apiReq *larkcore.ApiReq
}

type ListPublicMailboxAliasRespData struct {
	Items []*EmailAlias `json:"items,omitempty"` // 公共邮箱别名
}

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

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

type BatchCreatePublicMailboxMemberReqBodyBuilder struct {
	items     []*PublicMailboxMember // 本次调用添加的公共邮箱成员列表
	itemsFlag bool
}

func NewBatchCreatePublicMailboxMemberReqBodyBuilder() *BatchCreatePublicMailboxMemberReqBodyBuilder {
	builder := &BatchCreatePublicMailboxMemberReqBodyBuilder{}
	return builder
}

// 本次调用添加的公共邮箱成员列表
//
//示例值：
func (builder *BatchCreatePublicMailboxMemberReqBodyBuilder) Items(items []*PublicMailboxMember) *BatchCreatePublicMailboxMemberReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreatePublicMailboxMemberReqBodyBuilder) Build() *BatchCreatePublicMailboxMemberReqBody {
	req := &BatchCreatePublicMailboxMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req
}

type BatchCreatePublicMailboxMemberPathReqBodyBuilder struct {
	items     []*PublicMailboxMember
	itemsFlag bool
}

func NewBatchCreatePublicMailboxMemberPathReqBodyBuilder() *BatchCreatePublicMailboxMemberPathReqBodyBuilder {
	builder := &BatchCreatePublicMailboxMemberPathReqBodyBuilder{}
	return builder
}

// 本次调用添加的公共邮箱成员列表
//
// 示例值：
func (builder *BatchCreatePublicMailboxMemberPathReqBodyBuilder) Items(items []*PublicMailboxMember) *BatchCreatePublicMailboxMemberPathReqBodyBuilder {
	builder.items = items
	builder.itemsFlag = true
	return builder
}

func (builder *BatchCreatePublicMailboxMemberPathReqBodyBuilder) Build() (*BatchCreatePublicMailboxMemberReqBody, error) {
	req := &BatchCreatePublicMailboxMemberReqBody{}
	if builder.itemsFlag {
		req.Items = builder.items
	}
	return req, nil
}

type BatchCreatePublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchCreatePublicMailboxMemberReqBody
}

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

// The unique ID or email address of a public mailbox
//
// 示例值：xxxxxxxxxxxxxxx or test_public_mailbox@xxx.xx
func (builder *BatchCreatePublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *BatchCreatePublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

//
func (builder *BatchCreatePublicMailboxMemberReqBuilder) Body(body *BatchCreatePublicMailboxMemberReqBody) *BatchCreatePublicMailboxMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchCreatePublicMailboxMemberReqBody struct {
	Items []*PublicMailboxMember `json:"items,omitempty"` // 本次调用添加的公共邮箱成员列表
}

type BatchCreatePublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchCreatePublicMailboxMemberReqBody `body:""`
}

type BatchCreatePublicMailboxMemberRespData struct {
	Items []*PublicMailboxMember `json:"items,omitempty"` // 添加成功后的公共邮箱成员信息列表
}

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

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

type BatchDeletePublicMailboxMemberReqBodyBuilder struct {
	memberIdList     []string // 本次调用删除的公共邮箱成员ID列表
	memberIdListFlag bool
}

func NewBatchDeletePublicMailboxMemberReqBodyBuilder() *BatchDeletePublicMailboxMemberReqBodyBuilder {
	builder := &BatchDeletePublicMailboxMemberReqBodyBuilder{}
	return builder
}

// 本次调用删除的公共邮箱成员ID列表
//
//示例值：
func (builder *BatchDeletePublicMailboxMemberReqBodyBuilder) MemberIdList(memberIdList []string) *BatchDeletePublicMailboxMemberReqBodyBuilder {
	builder.memberIdList = memberIdList
	builder.memberIdListFlag = true
	return builder
}

func (builder *BatchDeletePublicMailboxMemberReqBodyBuilder) Build() *BatchDeletePublicMailboxMemberReqBody {
	req := &BatchDeletePublicMailboxMemberReqBody{}
	if builder.memberIdListFlag {
		req.MemberIdList = builder.memberIdList
	}
	return req
}

type BatchDeletePublicMailboxMemberPathReqBodyBuilder struct {
	memberIdList     []string
	memberIdListFlag bool
}

func NewBatchDeletePublicMailboxMemberPathReqBodyBuilder() *BatchDeletePublicMailboxMemberPathReqBodyBuilder {
	builder := &BatchDeletePublicMailboxMemberPathReqBodyBuilder{}
	return builder
}

// 本次调用删除的公共邮箱成员ID列表
//
// 示例值：
func (builder *BatchDeletePublicMailboxMemberPathReqBodyBuilder) MemberIdList(memberIdList []string) *BatchDeletePublicMailboxMemberPathReqBodyBuilder {
	builder.memberIdList = memberIdList
	builder.memberIdListFlag = true
	return builder
}

func (builder *BatchDeletePublicMailboxMemberPathReqBodyBuilder) Build() (*BatchDeletePublicMailboxMemberReqBody, error) {
	req := &BatchDeletePublicMailboxMemberReqBody{}
	if builder.memberIdListFlag {
		req.MemberIdList = builder.memberIdList
	}
	return req, nil
}

type BatchDeletePublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchDeletePublicMailboxMemberReqBody
}

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

// The unique ID or email address of a public mailbox
//
// 示例值：xxxxxxxxxxxxxxx or test_public_mailbox@xxx.xx
func (builder *BatchDeletePublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *BatchDeletePublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

//
func (builder *BatchDeletePublicMailboxMemberReqBuilder) Body(body *BatchDeletePublicMailboxMemberReqBody) *BatchDeletePublicMailboxMemberReqBuilder {
	builder.body = body
	return builder
}

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

type BatchDeletePublicMailboxMemberReqBody struct {
	MemberIdList []string `json:"member_id_list,omitempty"` // 本次调用删除的公共邮箱成员ID列表
}

type BatchDeletePublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchDeletePublicMailboxMemberReqBody `body:""`
}

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

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

type ClearPublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *ClearPublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *ClearPublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

type ClearPublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type CreatePublicMailboxMemberReqBuilder struct {
	apiReq              *larkcore.ApiReq
	publicMailboxMember *PublicMailboxMember
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *CreatePublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *CreatePublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

// 向公共邮箱添加单个成员
func (builder *CreatePublicMailboxMemberReqBuilder) PublicMailboxMember(publicMailboxMember *PublicMailboxMember) *CreatePublicMailboxMemberReqBuilder {
	builder.publicMailboxMember = publicMailboxMember
	return builder
}

func (builder *CreatePublicMailboxMemberReqBuilder) Build() *CreatePublicMailboxMemberReq {
	req := &CreatePublicMailboxMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.publicMailboxMember
	return req
}

type CreatePublicMailboxMemberReq struct {
	apiReq              *larkcore.ApiReq
	PublicMailboxMember *PublicMailboxMember `body:""`
}

type CreatePublicMailboxMemberRespData struct {
	MemberId *string `json:"member_id,omitempty"` // The unique ID of a member in this public mailbox

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team
}

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

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

type DeletePublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *DeletePublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *DeletePublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 公共邮箱内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *DeletePublicMailboxMemberReqBuilder) MemberId(memberId string) *DeletePublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("member_id", fmt.Sprint(memberId))
	return builder
}

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

type DeletePublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type GetPublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 公共邮箱唯一标识或公共邮箱地址
//
// 示例值：xxxxxxxxxxxxxxx 或 test_public_mailbox@xxx.xx
func (builder *GetPublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *GetPublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

// 公共邮箱内成员唯一标识
//
// 示例值：xxxxxxxxxxxxxxx
func (builder *GetPublicMailboxMemberReqBuilder) MemberId(memberId string) *GetPublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("member_id", fmt.Sprint(memberId))
	return builder
}

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

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

type GetPublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
}

type GetPublicMailboxMemberRespData struct {
	MemberId *string `json:"member_id,omitempty"` // The unique ID of a member in this public mailbox

	UserId *string `json:"user_id,omitempty"` // The member's user id. Value is valid when type is USER

	Type *string `json:"type,omitempty"` // The type of member. Possible values are:;- USER: internal user in the team
}

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

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

type ListPublicMailboxMemberReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListPublicMailboxMemberReqBuilder) Limit(limit int) *ListPublicMailboxMemberReqBuilder {
	builder.limit = limit
	return builder
}

// The unique ID or email address of a public mailbox
//
// 示例值：xxxxxxxxxxxxxxx or test_public_mailbox@xxx.xx
func (builder *ListPublicMailboxMemberReqBuilder) PublicMailboxId(publicMailboxId string) *ListPublicMailboxMemberReqBuilder {
	builder.apiReq.PathParams.Set("public_mailbox_id", fmt.Sprint(publicMailboxId))
	return builder
}

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

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListPublicMailboxMemberReqBuilder) PageToken(pageToken string) *ListPublicMailboxMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListPublicMailboxMemberReqBuilder) PageSize(pageSize int) *ListPublicMailboxMemberReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

func (builder *ListPublicMailboxMemberReqBuilder) Build() *ListPublicMailboxMemberReq {
	req := &ListPublicMailboxMemberReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListPublicMailboxMemberReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListPublicMailboxMemberRespData struct {
	HasMore *bool `json:"has_more,omitempty"` // 是否有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 下一页分页的token

	Items []*PublicMailboxMember `json:"items,omitempty"` // 公共邮箱成员列表
}

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

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

type QueryUserReqBodyBuilder struct {
	emailList     []string // 需要查询的邮箱地址列表
	emailListFlag bool
}

func NewQueryUserReqBodyBuilder() *QueryUserReqBodyBuilder {
	builder := &QueryUserReqBodyBuilder{}
	return builder
}

// 需要查询的邮箱地址列表
//
//示例值：["aaa@lark.com","bbb@lark.com"]
func (builder *QueryUserReqBodyBuilder) EmailList(emailList []string) *QueryUserReqBodyBuilder {
	builder.emailList = emailList
	builder.emailListFlag = true
	return builder
}

func (builder *QueryUserReqBodyBuilder) Build() *QueryUserReqBody {
	req := &QueryUserReqBody{}
	if builder.emailListFlag {
		req.EmailList = builder.emailList
	}
	return req
}

type QueryUserPathReqBodyBuilder struct {
	emailList     []string
	emailListFlag bool
}

func NewQueryUserPathReqBodyBuilder() *QueryUserPathReqBodyBuilder {
	builder := &QueryUserPathReqBodyBuilder{}
	return builder
}

// 需要查询的邮箱地址列表
//
// 示例值：["aaa@lark.com","bbb@lark.com"]
func (builder *QueryUserPathReqBodyBuilder) EmailList(emailList []string) *QueryUserPathReqBodyBuilder {
	builder.emailList = emailList
	builder.emailListFlag = true
	return builder
}

func (builder *QueryUserPathReqBodyBuilder) Build() (*QueryUserReqBody, error) {
	req := &QueryUserReqBody{}
	if builder.emailListFlag {
		req.EmailList = builder.emailList
	}
	return req, nil
}

type QueryUserReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *QueryUserReqBody
}

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

// 使用邮箱状态查询接口，可以输入邮箱地址，查询出该邮箱地址对应的类型以及状态
func (builder *QueryUserReqBuilder) Body(body *QueryUserReqBody) *QueryUserReqBuilder {
	builder.body = body
	return builder
}

func (builder *QueryUserReqBuilder) Build() *QueryUserReq {
	req := &QueryUserReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type QueryUserReqBody struct {
	EmailList []string `json:"email_list,omitempty"` // 需要查询的邮箱地址列表
}

type QueryUserReq struct {
	apiReq *larkcore.ApiReq
	Body   *QueryUserReqBody `body:""`
}

type QueryUserRespData struct {
	UserList []*User `json:"user_list,omitempty"` // 邮箱地址以及其对应的类型类型和状态
}

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

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

type DeleteUserMailboxReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 要释放的邮箱地址
//
// 示例值：111111@abc.com
func (builder *DeleteUserMailboxReqBuilder) UserMailboxId(userMailboxId string) *DeleteUserMailboxReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 用于接受转移的邮箱地址
//
// 示例值：888888@abc.com
func (builder *DeleteUserMailboxReqBuilder) TransferMailbox(transferMailbox string) *DeleteUserMailboxReqBuilder {
	builder.apiReq.QueryParams.Set("transfer_mailbox", fmt.Sprint(transferMailbox))
	return builder
}

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

type DeleteUserMailboxReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type CreateUserMailboxAliasReqBuilder struct {
	apiReq     *larkcore.ApiReq
	emailAlias *EmailAlias
}

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

// 用户邮箱地址
//
// 示例值：user@xxx.xx
func (builder *CreateUserMailboxAliasReqBuilder) UserMailboxId(userMailboxId string) *CreateUserMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 创建用户邮箱别名
func (builder *CreateUserMailboxAliasReqBuilder) EmailAlias(emailAlias *EmailAlias) *CreateUserMailboxAliasReqBuilder {
	builder.emailAlias = emailAlias
	return builder
}

func (builder *CreateUserMailboxAliasReqBuilder) Build() *CreateUserMailboxAliasReq {
	req := &CreateUserMailboxAliasReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.emailAlias
	return req
}

type CreateUserMailboxAliasReq struct {
	apiReq     *larkcore.ApiReq
	EmailAlias *EmailAlias `body:""`
}

type CreateUserMailboxAliasRespData struct {
	UserMailboxAlias *EmailAlias `json:"user_mailbox_alias,omitempty"` // 用户邮箱别名
}

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

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

type DeleteUserMailboxAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址
//
// 示例值：user@xxx.xx
func (builder *DeleteUserMailboxAliasReqBuilder) UserMailboxId(userMailboxId string) *DeleteUserMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 别名邮箱地址
//
// 示例值：user_alias@xxx.xx
func (builder *DeleteUserMailboxAliasReqBuilder) AliasId(aliasId string) *DeleteUserMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("alias_id", fmt.Sprint(aliasId))
	return builder
}

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

type DeleteUserMailboxAliasReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListUserMailboxAliasReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址
//
// 示例值：user@xxx.xx
func (builder *ListUserMailboxAliasReqBuilder) UserMailboxId(userMailboxId string) *ListUserMailboxAliasReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListUserMailboxAliasReqBuilder) PageToken(pageToken string) *ListUserMailboxAliasReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 分页大小
//
// 示例值：10
func (builder *ListUserMailboxAliasReqBuilder) PageSize(pageSize int) *ListUserMailboxAliasReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

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

type ListUserMailboxAliasReq struct {
	apiReq *larkcore.ApiReq
}

type ListUserMailboxAliasRespData struct {
	Items []*EmailAlias `json:"items,omitempty"` // 用户邮箱别名
}

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

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

type SubscribeUserMailboxEventReqBodyBuilder struct {
	eventType     int // 事件类型
	eventTypeFlag bool
}

func NewSubscribeUserMailboxEventReqBodyBuilder() *SubscribeUserMailboxEventReqBodyBuilder {
	builder := &SubscribeUserMailboxEventReqBodyBuilder{}
	return builder
}

// 事件类型
//
//示例值：1
func (builder *SubscribeUserMailboxEventReqBodyBuilder) EventType(eventType int) *SubscribeUserMailboxEventReqBodyBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

func (builder *SubscribeUserMailboxEventReqBodyBuilder) Build() *SubscribeUserMailboxEventReqBody {
	req := &SubscribeUserMailboxEventReqBody{}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType
	}
	return req
}

type SubscribeUserMailboxEventPathReqBodyBuilder struct {
	eventType     int
	eventTypeFlag bool
}

func NewSubscribeUserMailboxEventPathReqBodyBuilder() *SubscribeUserMailboxEventPathReqBodyBuilder {
	builder := &SubscribeUserMailboxEventPathReqBodyBuilder{}
	return builder
}

// 事件类型
//
// 示例值：1
func (builder *SubscribeUserMailboxEventPathReqBodyBuilder) EventType(eventType int) *SubscribeUserMailboxEventPathReqBodyBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

func (builder *SubscribeUserMailboxEventPathReqBodyBuilder) Build() (*SubscribeUserMailboxEventReqBody, error) {
	req := &SubscribeUserMailboxEventReqBody{}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType
	}
	return req, nil
}

type SubscribeUserMailboxEventReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *SubscribeUserMailboxEventReqBody
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *SubscribeUserMailboxEventReqBuilder) UserMailboxId(userMailboxId string) *SubscribeUserMailboxEventReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *SubscribeUserMailboxEventReqBuilder) Body(body *SubscribeUserMailboxEventReqBody) *SubscribeUserMailboxEventReqBuilder {
	builder.body = body
	return builder
}

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

type SubscribeUserMailboxEventReqBody struct {
	EventType *int `json:"event_type,omitempty"` // 事件类型
}

type SubscribeUserMailboxEventReq struct {
	apiReq *larkcore.ApiReq
	Body   *SubscribeUserMailboxEventReqBody `body:""`
}

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

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

type SubscriptionUserMailboxEventReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *SubscriptionUserMailboxEventReqBuilder) UserMailboxId(userMailboxId string) *SubscriptionUserMailboxEventReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

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

type SubscriptionUserMailboxEventReq struct {
	apiReq *larkcore.ApiReq
}

type SubscriptionUserMailboxEventRespData struct {
	EventTypes []int `json:"event_types,omitempty"` // 订阅的事件列表
}

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

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

type UnsubscribeUserMailboxEventReqBodyBuilder struct {
	eventType     int // 事件类型
	eventTypeFlag bool
}

func NewUnsubscribeUserMailboxEventReqBodyBuilder() *UnsubscribeUserMailboxEventReqBodyBuilder {
	builder := &UnsubscribeUserMailboxEventReqBodyBuilder{}
	return builder
}

// 事件类型
//
//示例值：1
func (builder *UnsubscribeUserMailboxEventReqBodyBuilder) EventType(eventType int) *UnsubscribeUserMailboxEventReqBodyBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

func (builder *UnsubscribeUserMailboxEventReqBodyBuilder) Build() *UnsubscribeUserMailboxEventReqBody {
	req := &UnsubscribeUserMailboxEventReqBody{}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType
	}
	return req
}

type UnsubscribeUserMailboxEventPathReqBodyBuilder struct {
	eventType     int
	eventTypeFlag bool
}

func NewUnsubscribeUserMailboxEventPathReqBodyBuilder() *UnsubscribeUserMailboxEventPathReqBodyBuilder {
	builder := &UnsubscribeUserMailboxEventPathReqBodyBuilder{}
	return builder
}

// 事件类型
//
// 示例值：1
func (builder *UnsubscribeUserMailboxEventPathReqBodyBuilder) EventType(eventType int) *UnsubscribeUserMailboxEventPathReqBodyBuilder {
	builder.eventType = eventType
	builder.eventTypeFlag = true
	return builder
}

func (builder *UnsubscribeUserMailboxEventPathReqBodyBuilder) Build() (*UnsubscribeUserMailboxEventReqBody, error) {
	req := &UnsubscribeUserMailboxEventReqBody{}
	if builder.eventTypeFlag {
		req.EventType = &builder.eventType
	}
	return req, nil
}

type UnsubscribeUserMailboxEventReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *UnsubscribeUserMailboxEventReqBody
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *UnsubscribeUserMailboxEventReqBuilder) UserMailboxId(userMailboxId string) *UnsubscribeUserMailboxEventReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *UnsubscribeUserMailboxEventReqBuilder) Body(body *UnsubscribeUserMailboxEventReqBody) *UnsubscribeUserMailboxEventReqBuilder {
	builder.body = body
	return builder
}

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

type UnsubscribeUserMailboxEventReqBody struct {
	EventType *int `json:"event_type,omitempty"` // 事件类型
}

type UnsubscribeUserMailboxEventReq struct {
	apiReq *larkcore.ApiReq
	Body   *UnsubscribeUserMailboxEventReqBody `body:""`
}

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

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

type CreateUserMailboxFolderReqBuilder struct {
	apiReq *larkcore.ApiReq
	folder *Folder
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *CreateUserMailboxFolderReqBuilder) UserMailboxId(userMailboxId string) *CreateUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *CreateUserMailboxFolderReqBuilder) Folder(folder *Folder) *CreateUserMailboxFolderReqBuilder {
	builder.folder = folder
	return builder
}

func (builder *CreateUserMailboxFolderReqBuilder) Build() *CreateUserMailboxFolderReq {
	req := &CreateUserMailboxFolderReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.folder
	return req
}

type CreateUserMailboxFolderReq struct {
	apiReq *larkcore.ApiReq
	Folder *Folder `body:""`
}

type CreateUserMailboxFolderRespData struct {
	Folder *Folder `json:"folder,omitempty"` // 文件夹实体
}

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

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

type DeleteUserMailboxFolderReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *DeleteUserMailboxFolderReqBuilder) UserMailboxId(userMailboxId string) *DeleteUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 文件夹 id
//
// 示例值：111111
func (builder *DeleteUserMailboxFolderReqBuilder) FolderId(folderId string) *DeleteUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("folder_id", fmt.Sprint(folderId))
	return builder
}

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

type DeleteUserMailboxFolderReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListUserMailboxFolderReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *ListUserMailboxFolderReqBuilder) UserMailboxId(userMailboxId string) *ListUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 文件夹类型
//
// 示例值：1
func (builder *ListUserMailboxFolderReqBuilder) FolderType(folderType int) *ListUserMailboxFolderReqBuilder {
	builder.apiReq.QueryParams.Set("folder_type", fmt.Sprint(folderType))
	return builder
}

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

type ListUserMailboxFolderReq struct {
	apiReq *larkcore.ApiReq
}

type ListUserMailboxFolderRespData struct {
	Items []*Folder `json:"items,omitempty"` // 文件夹列表
}

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

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

type PatchUserMailboxFolderReqBuilder struct {
	apiReq *larkcore.ApiReq
	folder *Folder
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *PatchUserMailboxFolderReqBuilder) UserMailboxId(userMailboxId string) *PatchUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 文件夹 id
//
// 示例值：111111
func (builder *PatchUserMailboxFolderReqBuilder) FolderId(folderId string) *PatchUserMailboxFolderReqBuilder {
	builder.apiReq.PathParams.Set("folder_id", fmt.Sprint(folderId))
	return builder
}

//
func (builder *PatchUserMailboxFolderReqBuilder) Folder(folder *Folder) *PatchUserMailboxFolderReqBuilder {
	builder.folder = folder
	return builder
}

func (builder *PatchUserMailboxFolderReqBuilder) Build() *PatchUserMailboxFolderReq {
	req := &PatchUserMailboxFolderReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.folder
	return req
}

type PatchUserMailboxFolderReq struct {
	apiReq *larkcore.ApiReq
	Folder *Folder `body:""`
}

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

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

type CreateUserMailboxMailContactReqBuilder struct {
	apiReq      *larkcore.ApiReq
	mailContact *MailContact
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *CreateUserMailboxMailContactReqBuilder) UserMailboxId(userMailboxId string) *CreateUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *CreateUserMailboxMailContactReqBuilder) MailContact(mailContact *MailContact) *CreateUserMailboxMailContactReqBuilder {
	builder.mailContact = mailContact
	return builder
}

func (builder *CreateUserMailboxMailContactReqBuilder) Build() *CreateUserMailboxMailContactReq {
	req := &CreateUserMailboxMailContactReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.mailContact
	return req
}

type CreateUserMailboxMailContactReq struct {
	apiReq      *larkcore.ApiReq
	MailContact *MailContact `body:""`
}

type CreateUserMailboxMailContactRespData struct {
	MailContact *MailContact `json:"mail_contact,omitempty"` // 联系人实体
}

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

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

type DeleteUserMailboxMailContactReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：用户邮箱地址 或 输入me代表当前调用接口用户
func (builder *DeleteUserMailboxMailContactReqBuilder) UserMailboxId(userMailboxId string) *DeleteUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 邮箱联系人 id
//
// 示例值：123
func (builder *DeleteUserMailboxMailContactReqBuilder) MailContactId(mailContactId string) *DeleteUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("mail_contact_id", fmt.Sprint(mailContactId))
	return builder
}

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

type DeleteUserMailboxMailContactReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListUserMailboxMailContactReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListUserMailboxMailContactReqBuilder) Limit(limit int) *ListUserMailboxMailContactReqBuilder {
	builder.limit = limit
	return builder
}

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *ListUserMailboxMailContactReqBuilder) UserMailboxId(userMailboxId string) *ListUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 分页大小
//
// 示例值：20
func (builder *ListUserMailboxMailContactReqBuilder) PageSize(pageSize int) *ListUserMailboxMailContactReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListUserMailboxMailContactReqBuilder) PageToken(pageToken string) *ListUserMailboxMailContactReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

func (builder *ListUserMailboxMailContactReqBuilder) Build() *ListUserMailboxMailContactReq {
	req := &ListUserMailboxMailContactReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListUserMailboxMailContactReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListUserMailboxMailContactRespData struct {
	Items []*MailContact `json:"items,omitempty"` // 邮件联系人列表

	PageToken *string `json:"page_token,omitempty"` // 分页标记，当 has_more 为 true 时，会同时返回新的 page_token，否则不返回 page_token

	HasMore *bool `json:"has_more,omitempty"` // 是否还有更多项
}

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

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

type PatchUserMailboxMailContactReqBuilder struct {
	apiReq      *larkcore.ApiReq
	mailContact *MailContact
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *PatchUserMailboxMailContactReqBuilder) UserMailboxId(userMailboxId string) *PatchUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 邮箱联系人 id
//
// 示例值：123
func (builder *PatchUserMailboxMailContactReqBuilder) MailContactId(mailContactId string) *PatchUserMailboxMailContactReqBuilder {
	builder.apiReq.PathParams.Set("mail_contact_id", fmt.Sprint(mailContactId))
	return builder
}

//
func (builder *PatchUserMailboxMailContactReqBuilder) MailContact(mailContact *MailContact) *PatchUserMailboxMailContactReqBuilder {
	builder.mailContact = mailContact
	return builder
}

func (builder *PatchUserMailboxMailContactReqBuilder) Build() *PatchUserMailboxMailContactReq {
	req := &PatchUserMailboxMailContactReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.mailContact
	return req
}

type PatchUserMailboxMailContactReq struct {
	apiReq      *larkcore.ApiReq
	MailContact *MailContact `body:""`
}

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

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

type GetUserMailboxMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *GetUserMailboxMessageReqBuilder) UserMailboxId(userMailboxId string) *GetUserMailboxMessageReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 用户邮件 id
//
// 示例值：TUlHc1NoWFhJMXgyUi9VZTNVL3h6UnlkRUdzPQ==
func (builder *GetUserMailboxMessageReqBuilder) MessageId(messageId string) *GetUserMailboxMessageReqBuilder {
	builder.apiReq.PathParams.Set("message_id", fmt.Sprint(messageId))
	return builder
}

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

type GetUserMailboxMessageReq struct {
	apiReq *larkcore.ApiReq
}

type GetUserMailboxMessageRespData struct {
	Message *Message `json:"message,omitempty"` // 邮件体
}

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

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

type GetByCardUserMailboxMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *GetByCardUserMailboxMessageReqBuilder) UserMailboxId(userMailboxId string) *GetByCardUserMailboxMessageReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 卡片ID
//
// 示例值：512ca581-6059-4449-8150-5522e6641d32
func (builder *GetByCardUserMailboxMessageReqBuilder) CardId(cardId string) *GetByCardUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("card_id", fmt.Sprint(cardId))
	return builder
}

// 卡片OwnerID
//
// 示例值：1234567890
func (builder *GetByCardUserMailboxMessageReqBuilder) OwnerId(ownerId string) *GetByCardUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("owner_id", fmt.Sprint(ownerId))
	return builder
}

// 用户ID类型
//
// 示例值：open_id
func (builder *GetByCardUserMailboxMessageReqBuilder) UserIdType(userIdType string) *GetByCardUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

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

type GetByCardUserMailboxMessageReq struct {
	apiReq *larkcore.ApiReq
}

type GetByCardUserMailboxMessageRespData struct {
	OwnerInfo *UserInfo `json:"owner_info,omitempty"` // 邮件Owner信息

	MessageIds []string `json:"message_ids,omitempty"` // 邮件ID列表

	CardId *string `json:"card_id,omitempty"` // 卡片ID
}

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

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

type ListUserMailboxMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
	limit  int // 最大返回多少记录，当使用迭代器访问时才有效
}

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

// 最大返回多少记录，当使用迭代器访问时才有效
func (builder *ListUserMailboxMessageReqBuilder) Limit(limit int) *ListUserMailboxMessageReqBuilder {
	builder.limit = limit
	return builder
}

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *ListUserMailboxMessageReqBuilder) UserMailboxId(userMailboxId string) *ListUserMailboxMessageReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 分页大小
//
// 示例值：1
func (builder *ListUserMailboxMessageReqBuilder) PageSize(pageSize int) *ListUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 分页标记，第一次请求不填，表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token，下次遍历可采用该 page_token 获取查询结果
//
// 示例值：xxx
func (builder *ListUserMailboxMessageReqBuilder) PageToken(pageToken string) *ListUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 文件夹 id
//
// 示例值：INBOX 或者用户文件夹 id
func (builder *ListUserMailboxMessageReqBuilder) FolderId(folderId string) *ListUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("folder_id", fmt.Sprint(folderId))
	return builder
}

// 是否只查询未读邮件
//
// 示例值：true
func (builder *ListUserMailboxMessageReqBuilder) OnlyUnread(onlyUnread bool) *ListUserMailboxMessageReqBuilder {
	builder.apiReq.QueryParams.Set("only_unread", fmt.Sprint(onlyUnread))
	return builder
}

func (builder *ListUserMailboxMessageReqBuilder) Build() *ListUserMailboxMessageReq {
	req := &ListUserMailboxMessageReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.Limit = builder.limit
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type ListUserMailboxMessageReq struct {
	apiReq *larkcore.ApiReq
	Limit  int // 最多返回多少记录，只有在使用迭代器访问时，才有效

}

type ListUserMailboxMessageRespData struct {
	Items []string `json:"items,omitempty"` // 邮件 id 列表

	PageToken *string `json:"page_token,omitempty"` // 分页标记，当 has_more 为 true 时，会同时返回新的 page_token，否则不返回 page_token

	HasMore *bool `json:"has_more,omitempty"` // 是否还有更多项
}

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

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

type SendUserMailboxMessageReqBodyBuilder struct {
	subject     string // 主题
	subjectFlag bool

	to     []*MailAddress // 收件人
	toFlag bool

	raw     string // 原始EML信息base64后的字符串
	rawFlag bool

	cc     []*MailAddress // 抄送
	ccFlag bool

	bcc     []*MailAddress // 密送
	bccFlag bool

	bodyHtml     string // 正文
	bodyHtmlFlag bool

	bodyPlainText     string // 正文纯文本
	bodyPlainTextFlag bool

	attachments     []*Attachment // 附件
	attachmentsFlag bool

	dedupeKey     string // 去重键
	dedupeKeyFlag bool

	headFrom     *MailAddress // EML中发件人信息
	headFromFlag bool
}

func NewSendUserMailboxMessageReqBodyBuilder() *SendUserMailboxMessageReqBodyBuilder {
	builder := &SendUserMailboxMessageReqBodyBuilder{}
	return builder
}

// 主题
//
//示例值：邮件标题
func (builder *SendUserMailboxMessageReqBodyBuilder) Subject(subject string) *SendUserMailboxMessageReqBodyBuilder {
	builder.subject = subject
	builder.subjectFlag = true
	return builder
}

// 收件人
//
//示例值：
func (builder *SendUserMailboxMessageReqBodyBuilder) To(to []*MailAddress) *SendUserMailboxMessageReqBodyBuilder {
	builder.to = to
	builder.toFlag = true
	return builder
}

// 原始EML信息base64后的字符串
//
//示例值：U3ViamVjdDogSGVsbG8hCkZyb206ICJtaWtlIiA8bWlrZUBtaWtlLmNvbT4KTWltZS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7CiBib3VuZGFyeT1iMjhmYTIyNGExZWU2ZDY3ZjE3OTViNGUxZDEwM2Q3MTBlNzM5ZWVmYjFmZjlmOWQ4NWI4M2NlOTRmMTEKRGF0ZTogV2VkLCAyMyBKdWwgMjAyNSAxNTo0NDoxOCArMDgwMApNZXNzYWdlLUlkOiA8bW9ja3V1aWRtZXNzYWdlX2lkQGxhcmsuY29tPgpUbzogImphY2siIDxqYWNrQGphY2suY29tPgoKLS1iMjhmYTIyNGExZWU2ZDY3ZjE3OTViNGUxZDEwM2Q3MTBlNzM5ZWVmYjFmZjlmOWQ4NWI4M2NlOTRmMTEKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKCldlbGNvbWUgdG8gTGFyayBtYWlsIQotLWIyOGZhMjI0YTFlZTZkNjdmMTc5NWI0ZTFkMTAzZDcxMGU3MzllZWZiMWZmOWY5ZDg1YjgzY2U5NGYxMQo=
func (builder *SendUserMailboxMessageReqBodyBuilder) Raw(raw string) *SendUserMailboxMessageReqBodyBuilder {
	builder.raw = raw
	builder.rawFlag = true
	return builder
}

// 抄送
//
//示例值：
func (builder *SendUserMailboxMessageReqBodyBuilder) Cc(cc []*MailAddress) *SendUserMailboxMessageReqBodyBuilder {
	builder.cc = cc
	builder.ccFlag = true
	return builder
}

// 密送
//
//示例值：
func (builder *SendUserMailboxMessageReqBodyBuilder) Bcc(bcc []*MailAddress) *SendUserMailboxMessageReqBodyBuilder {
	builder.bcc = bcc
	builder.bccFlag = true
	return builder
}

// 正文
//
//示例值：xxxx
func (builder *SendUserMailboxMessageReqBodyBuilder) BodyHtml(bodyHtml string) *SendUserMailboxMessageReqBodyBuilder {
	builder.bodyHtml = bodyHtml
	builder.bodyHtmlFlag = true
	return builder
}

// 正文纯文本
//
//示例值：xxxx
func (builder *SendUserMailboxMessageReqBodyBuilder) BodyPlainText(bodyPlainText string) *SendUserMailboxMessageReqBodyBuilder {
	builder.bodyPlainText = bodyPlainText
	builder.bodyPlainTextFlag = true
	return builder
}

// 附件
//
//示例值：
func (builder *SendUserMailboxMessageReqBodyBuilder) Attachments(attachments []*Attachment) *SendUserMailboxMessageReqBodyBuilder {
	builder.attachments = attachments
	builder.attachmentsFlag = true
	return builder
}

// 去重键
//
//示例值：abc-ddd-eee-fff-ggg
func (builder *SendUserMailboxMessageReqBodyBuilder) DedupeKey(dedupeKey string) *SendUserMailboxMessageReqBodyBuilder {
	builder.dedupeKey = dedupeKey
	builder.dedupeKeyFlag = true
	return builder
}

// EML中发件人信息
//
//示例值：
func (builder *SendUserMailboxMessageReqBodyBuilder) HeadFrom(headFrom *MailAddress) *SendUserMailboxMessageReqBodyBuilder {
	builder.headFrom = headFrom
	builder.headFromFlag = true
	return builder
}

func (builder *SendUserMailboxMessageReqBodyBuilder) Build() *SendUserMailboxMessageReqBody {
	req := &SendUserMailboxMessageReqBody{}
	if builder.subjectFlag {
		req.Subject = &builder.subject
	}
	if builder.toFlag {
		req.To = builder.to
	}
	if builder.rawFlag {
		req.Raw = &builder.raw
	}
	if builder.ccFlag {
		req.Cc = builder.cc
	}
	if builder.bccFlag {
		req.Bcc = builder.bcc
	}
	if builder.bodyHtmlFlag {
		req.BodyHtml = &builder.bodyHtml
	}
	if builder.bodyPlainTextFlag {
		req.BodyPlainText = &builder.bodyPlainText
	}
	if builder.attachmentsFlag {
		req.Attachments = builder.attachments
	}
	if builder.dedupeKeyFlag {
		req.DedupeKey = &builder.dedupeKey
	}
	if builder.headFromFlag {
		req.HeadFrom = builder.headFrom
	}
	return req
}

type SendUserMailboxMessagePathReqBodyBuilder struct {
	subject           string
	subjectFlag       bool
	to                []*MailAddress
	toFlag            bool
	raw               string
	rawFlag           bool
	cc                []*MailAddress
	ccFlag            bool
	bcc               []*MailAddress
	bccFlag           bool
	bodyHtml          string
	bodyHtmlFlag      bool
	bodyPlainText     string
	bodyPlainTextFlag bool
	attachments       []*Attachment
	attachmentsFlag   bool
	dedupeKey         string
	dedupeKeyFlag     bool
	headFrom          *MailAddress
	headFromFlag      bool
}

func NewSendUserMailboxMessagePathReqBodyBuilder() *SendUserMailboxMessagePathReqBodyBuilder {
	builder := &SendUserMailboxMessagePathReqBodyBuilder{}
	return builder
}

// 主题
//
// 示例值：邮件标题
func (builder *SendUserMailboxMessagePathReqBodyBuilder) Subject(subject string) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.subject = subject
	builder.subjectFlag = true
	return builder
}

// 收件人
//
// 示例值：
func (builder *SendUserMailboxMessagePathReqBodyBuilder) To(to []*MailAddress) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.to = to
	builder.toFlag = true
	return builder
}

// 原始EML信息base64后的字符串
//
// 示例值：U3ViamVjdDogSGVsbG8hCkZyb206ICJtaWtlIiA8bWlrZUBtaWtlLmNvbT4KTWltZS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7CiBib3VuZGFyeT1iMjhmYTIyNGExZWU2ZDY3ZjE3OTViNGUxZDEwM2Q3MTBlNzM5ZWVmYjFmZjlmOWQ4NWI4M2NlOTRmMTEKRGF0ZTogV2VkLCAyMyBKdWwgMjAyNSAxNTo0NDoxOCArMDgwMApNZXNzYWdlLUlkOiA8bW9ja3V1aWRtZXNzYWdlX2lkQGxhcmsuY29tPgpUbzogImphY2siIDxqYWNrQGphY2suY29tPgoKLS1iMjhmYTIyNGExZWU2ZDY3ZjE3OTViNGUxZDEwM2Q3MTBlNzM5ZWVmYjFmZjlmOWQ4NWI4M2NlOTRmMTEKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKCldlbGNvbWUgdG8gTGFyayBtYWlsIQotLWIyOGZhMjI0YTFlZTZkNjdmMTc5NWI0ZTFkMTAzZDcxMGU3MzllZWZiMWZmOWY5ZDg1YjgzY2U5NGYxMQo=
func (builder *SendUserMailboxMessagePathReqBodyBuilder) Raw(raw string) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.raw = raw
	builder.rawFlag = true
	return builder
}

// 抄送
//
// 示例值：
func (builder *SendUserMailboxMessagePathReqBodyBuilder) Cc(cc []*MailAddress) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.cc = cc
	builder.ccFlag = true
	return builder
}

// 密送
//
// 示例值：
func (builder *SendUserMailboxMessagePathReqBodyBuilder) Bcc(bcc []*MailAddress) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.bcc = bcc
	builder.bccFlag = true
	return builder
}

// 正文
//
// 示例值：xxxx
func (builder *SendUserMailboxMessagePathReqBodyBuilder) BodyHtml(bodyHtml string) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.bodyHtml = bodyHtml
	builder.bodyHtmlFlag = true
	return builder
}

// 正文纯文本
//
// 示例值：xxxx
func (builder *SendUserMailboxMessagePathReqBodyBuilder) BodyPlainText(bodyPlainText string) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.bodyPlainText = bodyPlainText
	builder.bodyPlainTextFlag = true
	return builder
}

// 附件
//
// 示例值：
func (builder *SendUserMailboxMessagePathReqBodyBuilder) Attachments(attachments []*Attachment) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.attachments = attachments
	builder.attachmentsFlag = true
	return builder
}

// 去重键
//
// 示例值：abc-ddd-eee-fff-ggg
func (builder *SendUserMailboxMessagePathReqBodyBuilder) DedupeKey(dedupeKey string) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.dedupeKey = dedupeKey
	builder.dedupeKeyFlag = true
	return builder
}

// EML中发件人信息
//
// 示例值：
func (builder *SendUserMailboxMessagePathReqBodyBuilder) HeadFrom(headFrom *MailAddress) *SendUserMailboxMessagePathReqBodyBuilder {
	builder.headFrom = headFrom
	builder.headFromFlag = true
	return builder
}

func (builder *SendUserMailboxMessagePathReqBodyBuilder) Build() (*SendUserMailboxMessageReqBody, error) {
	req := &SendUserMailboxMessageReqBody{}
	if builder.subjectFlag {
		req.Subject = &builder.subject
	}
	if builder.toFlag {
		req.To = builder.to
	}
	if builder.rawFlag {
		req.Raw = &builder.raw
	}
	if builder.ccFlag {
		req.Cc = builder.cc
	}
	if builder.bccFlag {
		req.Bcc = builder.bcc
	}
	if builder.bodyHtmlFlag {
		req.BodyHtml = &builder.bodyHtml
	}
	if builder.bodyPlainTextFlag {
		req.BodyPlainText = &builder.bodyPlainText
	}
	if builder.attachmentsFlag {
		req.Attachments = builder.attachments
	}
	if builder.dedupeKeyFlag {
		req.DedupeKey = &builder.dedupeKey
	}
	if builder.headFromFlag {
		req.HeadFrom = builder.headFrom
	}
	return req, nil
}

type SendUserMailboxMessageReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *SendUserMailboxMessageReqBody
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *SendUserMailboxMessageReqBuilder) UserMailboxId(userMailboxId string) *SendUserMailboxMessageReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *SendUserMailboxMessageReqBuilder) Body(body *SendUserMailboxMessageReqBody) *SendUserMailboxMessageReqBuilder {
	builder.body = body
	return builder
}

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

type SendUserMailboxMessageReqBody struct {
	Subject *string `json:"subject,omitempty"` // 主题

	To []*MailAddress `json:"to,omitempty"` // 收件人

	Raw *string `json:"raw,omitempty"` // 原始EML信息base64后的字符串

	Cc []*MailAddress `json:"cc,omitempty"` // 抄送

	Bcc []*MailAddress `json:"bcc,omitempty"` // 密送

	BodyHtml *string `json:"body_html,omitempty"` // 正文

	BodyPlainText *string `json:"body_plain_text,omitempty"` // 正文纯文本

	Attachments []*Attachment `json:"attachments,omitempty"` // 附件

	DedupeKey *string `json:"dedupe_key,omitempty"` // 去重键

	HeadFrom *MailAddress `json:"head_from,omitempty"` // EML中发件人信息
}

type SendUserMailboxMessageReq struct {
	apiReq *larkcore.ApiReq
	Body   *SendUserMailboxMessageReqBody `body:""`
}

type SendUserMailboxMessageRespData struct {
	MessageId *string `json:"message_id,omitempty"` // 邮件ID

	ThreadId *string `json:"thread_id,omitempty"` // 会话ID
}

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

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

type DownloadUrlUserMailboxMessageAttachmentReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *DownloadUrlUserMailboxMessageAttachmentReqBuilder) UserMailboxId(userMailboxId string) *DownloadUrlUserMailboxMessageAttachmentReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 用户邮件 id
//
// 示例值：TUlHc1NoWFhJMXgyUi9VZTNVL3h6UnlkRUdzPQ==
func (builder *DownloadUrlUserMailboxMessageAttachmentReqBuilder) MessageId(messageId string) *DownloadUrlUserMailboxMessageAttachmentReqBuilder {
	builder.apiReq.PathParams.Set("message_id", fmt.Sprint(messageId))
	return builder
}

// 附件 id 列表
//
// 示例值：
func (builder *DownloadUrlUserMailboxMessageAttachmentReqBuilder) AttachmentIds(attachmentIds []string) *DownloadUrlUserMailboxMessageAttachmentReqBuilder {
	for _, v := range attachmentIds {
		builder.apiReq.QueryParams.Add("attachment_ids", fmt.Sprint(v))
	}
	return builder
}

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

type DownloadUrlUserMailboxMessageAttachmentReq struct {
	apiReq *larkcore.ApiReq
}

type DownloadUrlUserMailboxMessageAttachmentRespData struct {
	DownloadUrls []*AttachmentDownloadUrlItem `json:"download_urls,omitempty"` // 下载链接列表

	FailedIds []string `json:"failed_ids,omitempty"` // 获取失败的附件 id 列表
}

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

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

type CreateUserMailboxRuleReqBuilder struct {
	apiReq *larkcore.ApiReq
	rule   *Rule
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *CreateUserMailboxRuleReqBuilder) UserMailboxId(userMailboxId string) *CreateUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *CreateUserMailboxRuleReqBuilder) Rule(rule *Rule) *CreateUserMailboxRuleReqBuilder {
	builder.rule = rule
	return builder
}

func (builder *CreateUserMailboxRuleReqBuilder) Build() *CreateUserMailboxRuleReq {
	req := &CreateUserMailboxRuleReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.rule
	return req
}

type CreateUserMailboxRuleReq struct {
	apiReq *larkcore.ApiReq
	Rule   *Rule `body:""`
}

type CreateUserMailboxRuleRespData struct {
	Rule *Rule `json:"rule,omitempty"` // 规则实体
}

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

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

type DeleteUserMailboxRuleReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *DeleteUserMailboxRuleReqBuilder) UserMailboxId(userMailboxId string) *DeleteUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 规则 id
//
// 示例值：123123123
func (builder *DeleteUserMailboxRuleReqBuilder) RuleId(ruleId string) *DeleteUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("rule_id", fmt.Sprint(ruleId))
	return builder
}

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

type DeleteUserMailboxRuleReq struct {
	apiReq *larkcore.ApiReq
}

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

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

type ListUserMailboxRuleReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *ListUserMailboxRuleReqBuilder) UserMailboxId(userMailboxId string) *ListUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

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

type ListUserMailboxRuleReq struct {
	apiReq *larkcore.ApiReq
}

type ListUserMailboxRuleRespData struct {
	Items []*Rule `json:"items,omitempty"` // 规则列表
}

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

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

type ReorderUserMailboxRuleReqBodyBuilder struct {
	ruleIds     []string // 规则 id 列表
	ruleIdsFlag bool
}

func NewReorderUserMailboxRuleReqBodyBuilder() *ReorderUserMailboxRuleReqBodyBuilder {
	builder := &ReorderUserMailboxRuleReqBodyBuilder{}
	return builder
}

// 规则 id 列表
//
//示例值：111111111
func (builder *ReorderUserMailboxRuleReqBodyBuilder) RuleIds(ruleIds []string) *ReorderUserMailboxRuleReqBodyBuilder {
	builder.ruleIds = ruleIds
	builder.ruleIdsFlag = true
	return builder
}

func (builder *ReorderUserMailboxRuleReqBodyBuilder) Build() *ReorderUserMailboxRuleReqBody {
	req := &ReorderUserMailboxRuleReqBody{}
	if builder.ruleIdsFlag {
		req.RuleIds = builder.ruleIds
	}
	return req
}

type ReorderUserMailboxRulePathReqBodyBuilder struct {
	ruleIds     []string
	ruleIdsFlag bool
}

func NewReorderUserMailboxRulePathReqBodyBuilder() *ReorderUserMailboxRulePathReqBodyBuilder {
	builder := &ReorderUserMailboxRulePathReqBodyBuilder{}
	return builder
}

// 规则 id 列表
//
// 示例值：111111111
func (builder *ReorderUserMailboxRulePathReqBodyBuilder) RuleIds(ruleIds []string) *ReorderUserMailboxRulePathReqBodyBuilder {
	builder.ruleIds = ruleIds
	builder.ruleIdsFlag = true
	return builder
}

func (builder *ReorderUserMailboxRulePathReqBodyBuilder) Build() (*ReorderUserMailboxRuleReqBody, error) {
	req := &ReorderUserMailboxRuleReqBody{}
	if builder.ruleIdsFlag {
		req.RuleIds = builder.ruleIds
	}
	return req, nil
}

type ReorderUserMailboxRuleReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *ReorderUserMailboxRuleReqBody
}

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

// 用户邮箱地址，使用 user_access_token 时可使用 me
//
// 示例值：user@xxx.xx 或 me
func (builder *ReorderUserMailboxRuleReqBuilder) UserMailboxId(userMailboxId string) *ReorderUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

//
func (builder *ReorderUserMailboxRuleReqBuilder) Body(body *ReorderUserMailboxRuleReqBody) *ReorderUserMailboxRuleReqBuilder {
	builder.body = body
	return builder
}

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

type ReorderUserMailboxRuleReqBody struct {
	RuleIds []string `json:"rule_ids,omitempty"` // 规则 id 列表
}

type ReorderUserMailboxRuleReq struct {
	apiReq *larkcore.ApiReq
	Body   *ReorderUserMailboxRuleReqBody `body:""`
}

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

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

type UpdateUserMailboxRuleReqBuilder struct {
	apiReq *larkcore.ApiReq
	rule   *Rule
}

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

// 用户邮箱地址 或 输入me代表当前调用接口用户
//
// 示例值：user@xxx.xx 或 me
func (builder *UpdateUserMailboxRuleReqBuilder) UserMailboxId(userMailboxId string) *UpdateUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("user_mailbox_id", fmt.Sprint(userMailboxId))
	return builder
}

// 规则 id
//
// 示例值：123123123
func (builder *UpdateUserMailboxRuleReqBuilder) RuleId(ruleId string) *UpdateUserMailboxRuleReqBuilder {
	builder.apiReq.PathParams.Set("rule_id", fmt.Sprint(ruleId))
	return builder
}

//
func (builder *UpdateUserMailboxRuleReqBuilder) Rule(rule *Rule) *UpdateUserMailboxRuleReqBuilder {
	builder.rule = rule
	return builder
}

func (builder *UpdateUserMailboxRuleReqBuilder) Build() *UpdateUserMailboxRuleReq {
	req := &UpdateUserMailboxRuleReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.PathParams = builder.apiReq.PathParams
	req.apiReq.Body = builder.rule
	return req
}

type UpdateUserMailboxRuleReq struct {
	apiReq *larkcore.ApiReq
	Rule   *Rule `body:""`
}

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

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

type P2UserMailboxEventMessageReceivedV1Data struct {
	MailAddress *string `json:"mail_address,omitempty"` // 收信的邮箱

	MessageId *string `json:"message_id,omitempty"` // 邮件 id

	MailboxType *int `json:"mailbox_type,omitempty"` // 收到邮件的邮箱类型

	Subscriber *Subscriber `json:"subscriber,omitempty"` // 订阅者
}

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

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

type ListMailgroupIterator struct {
	nextPageToken *string
	items         []*Mailgroup
	index         int
	limit         int
	ctx           context.Context
	req           *ListMailgroupReq
	listFunc      func(ctx context.Context, req *ListMailgroupReq, options ...larkcore.RequestOptionFunc) (*ListMailgroupResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListMailgroupIterator) Next() (bool, *Mailgroup, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListMailgroupIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListMailgroupManagerIterator struct {
	nextPageToken *string
	items         []*MailgroupManager
	index         int
	limit         int
	ctx           context.Context
	req           *ListMailgroupManagerReq
	listFunc      func(ctx context.Context, req *ListMailgroupManagerReq, options ...larkcore.RequestOptionFunc) (*ListMailgroupManagerResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListMailgroupManagerIterator) Next() (bool, *MailgroupManager, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListMailgroupManagerIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListMailgroupMemberIterator struct {
	nextPageToken *string
	items         []*MailgroupMember
	index         int
	limit         int
	ctx           context.Context
	req           *ListMailgroupMemberReq
	listFunc      func(ctx context.Context, req *ListMailgroupMemberReq, options ...larkcore.RequestOptionFunc) (*ListMailgroupMemberResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListMailgroupMemberIterator) Next() (bool, *MailgroupMember, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListMailgroupMemberIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListMailgroupPermissionMemberIterator struct {
	nextPageToken *string
	items         []*MailgroupPermissionMember
	index         int
	limit         int
	ctx           context.Context
	req           *ListMailgroupPermissionMemberReq
	listFunc      func(ctx context.Context, req *ListMailgroupPermissionMemberReq, options ...larkcore.RequestOptionFunc) (*ListMailgroupPermissionMemberResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListMailgroupPermissionMemberIterator) Next() (bool, *MailgroupPermissionMember, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListMailgroupPermissionMemberIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListPublicMailboxIterator struct {
	nextPageToken *string
	items         []*PublicMailbox
	index         int
	limit         int
	ctx           context.Context
	req           *ListPublicMailboxReq
	listFunc      func(ctx context.Context, req *ListPublicMailboxReq, options ...larkcore.RequestOptionFunc) (*ListPublicMailboxResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListPublicMailboxIterator) Next() (bool, *PublicMailbox, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListPublicMailboxIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListPublicMailboxMemberIterator struct {
	nextPageToken *string
	items         []*PublicMailboxMember
	index         int
	limit         int
	ctx           context.Context
	req           *ListPublicMailboxMemberReq
	listFunc      func(ctx context.Context, req *ListPublicMailboxMemberReq, options ...larkcore.RequestOptionFunc) (*ListPublicMailboxMemberResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListPublicMailboxMemberIterator) Next() (bool, *PublicMailboxMember, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListPublicMailboxMemberIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListUserMailboxMailContactIterator struct {
	nextPageToken *string
	items         []*MailContact
	index         int
	limit         int
	ctx           context.Context
	req           *ListUserMailboxMailContactReq
	listFunc      func(ctx context.Context, req *ListUserMailboxMailContactReq, options ...larkcore.RequestOptionFunc) (*ListUserMailboxMailContactResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListUserMailboxMailContactIterator) Next() (bool, *MailContact, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, nil, nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, nil, nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, nil, err
		}

		if resp.Code != 0 {
			return false, nil, errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, nil, nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListUserMailboxMailContactIterator) NextPageToken() *string {
	return iterator.nextPageToken
}

type ListUserMailboxMessageIterator struct {
	nextPageToken *string
	items         []string
	index         int
	limit         int
	ctx           context.Context
	req           *ListUserMailboxMessageReq
	listFunc      func(ctx context.Context, req *ListUserMailboxMessageReq, options ...larkcore.RequestOptionFunc) (*ListUserMailboxMessageResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListUserMailboxMessageIterator) Next() (bool, string, error) {
	// 达到最大量，则返回
	if iterator.limit > 0 && iterator.curlNum >= iterator.limit {
		return false, "", nil
	}

	// 为0则拉取数据
	if iterator.index == 0 || iterator.index >= len(iterator.items) {
		if iterator.index != 0 && iterator.nextPageToken == nil {
			return false, "", nil
		}
		if iterator.nextPageToken != nil {
			iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken)
		}
		resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)
		if err != nil {
			return false, "", err
		}

		if resp.Code != 0 {
			return false, "", errors.New(fmt.Sprintf("Code:%d,Msg:%s", resp.Code, resp.Msg))
		}

		if len(resp.Data.Items) == 0 {
			return false, "", nil
		}

		iterator.nextPageToken = resp.Data.PageToken
		iterator.items = resp.Data.Items
		iterator.index = 0
	}

	block := iterator.items[iterator.index]
	iterator.index++
	iterator.curlNum++
	return true, block, nil
}

func (iterator *ListUserMailboxMessageIterator) NextPageToken() *string {
	return iterator.nextPageToken
}
