// Package personal_settings 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 larkpersonal_settings

import (
	"fmt"

	"context"
	"errors"

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

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

const (
	UserIdTypeBatchOpenSystemStatusUserId  = "user_id"  // 以user_id来识别用户
	UserIdTypeBatchOpenSystemStatusUnionId = "union_id" // 以union_id来识别用户
	UserIdTypeBatchOpenSystemStatusOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	SystemStatusIconKeyGeneralDoNotDisturb      = "GeneralDoNotDisturb"      // GeneralDoNotDisturb
	SystemStatusIconKeyGeneralInMeetingBusy     = "GeneralInMeetingBusy"     // GeneralInMeetingBusy
	SystemStatusIconKeyCoffee                   = "Coffee"                   // Coffee
	SystemStatusIconKeyGeneralBusinessTrip      = "GeneralBusinessTrip"      // GeneralBusinessTrip
	SystemStatusIconKeyGeneralWorkFromHome      = "GeneralWorkFromHome"      // GeneralWorkFromHome
	SystemStatusIconKeyStatusEnjoyLife          = "StatusEnjoyLife"          // StatusEnjoyLife
	SystemStatusIconKeyGeneralTravellingCar     = "GeneralTravellingCar"     // GeneralTravellingCar
	SystemStatusIconKeyStatusBus                = "StatusBus"                // StatusBus
	SystemStatusIconKeyStatusInFlight           = "StatusInFlight"           // StatusInFlight
	SystemStatusIconKeyTyping                   = "Typing"                   // Typing
	SystemStatusIconKeyEatingFood               = "EatingFood"               // EatingFood
	SystemStatusIconKeySICK                     = "SICK"                     // SICK
	SystemStatusIconKeyGeneralSun               = "GeneralSun"               // GeneralSun
	SystemStatusIconKeyGeneralMoonRest          = "GeneralMoonRest"          // GeneralMoonRest
	SystemStatusIconKeyStatusReading            = "StatusReading"            // StatusReading
	SystemStatusIconKeyStatusPrivateMessage     = "Status_PrivateMessage"    // Status_PrivateMessage
	SystemStatusIconKeyStatusFlashOfInspiration = "StatusFlashOfInspiration" // StatusFlashOfInspiration
	SystemStatusIconKeyGeneralVacation          = "GeneralVacation"          // GeneralVacation
)

const (
	SystemStatusColorBLUE      = "BLUE"      // 蓝色
	SystemStatusColorGRAY      = "GRAY"      // 灰色
	SystemStatusColorINDIGO    = "INDIGO"    // 靛青色
	SystemStatusColorWATHET    = "WATHET"    // 浅蓝色
	SystemStatusColorGREEN     = "GREEN"     // 绿色
	SystemStatusColorTURQUOISE = "TURQUOISE" // 绿松石色
	SystemStatusColorYELLOW    = "YELLOW"    // 黄色
	SystemStatusColorLIME      = "LIME"      // 酸橙色
	SystemStatusColorRED       = "RED"       // 红色
	SystemStatusColorORANGE    = "ORANGE"    // 橙色
	SystemStatusColorPURPLE    = "PURPLE"    // 紫色
	SystemStatusColorVIOLET    = "VIOLET"    // 紫罗兰色
	SystemStatusColorCARMINE   = "CARMINE"   // 胭脂红色
)

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 SystemStatus struct {
	SystemStatusId *string `json:"system_status_id,omitempty"` // 系统状态ID

	Title *string `json:"title,omitempty"` // 系统状态名称，名称字符数要在1到20范围内。不同系统状态的title不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符

	I18nTitle *SystemStatusI18nName `json:"i18n_title,omitempty"` // 系统状态国际化名称，名称字符数要在1到20范围内。不同系统状态之间i18n_title中任何一种title都不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符

	IconKey *string `json:"icon_key,omitempty"` // 图标;;[**了解icon_key可选值**](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/overview)

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

	Priority *int `json:"priority,omitempty"` // 优先级，数值越小，客户端展示的优先级越高。不同系统状态的优先级不能一样。

	SyncSetting *SystemStatusSyncSetting `json:"sync_setting,omitempty"` // 同步设置
}

type SystemStatusBuilder struct {
	systemStatusId     string // 系统状态ID
	systemStatusIdFlag bool

	title     string // 系统状态名称，名称字符数要在1到20范围内。不同系统状态的title不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符
	titleFlag bool

	i18nTitle     *SystemStatusI18nName // 系统状态国际化名称，名称字符数要在1到20范围内。不同系统状态之间i18n_title中任何一种title都不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符
	i18nTitleFlag bool

	iconKey     string // 图标;;[**了解icon_key可选值**](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/overview)
	iconKeyFlag bool

	color     string // 颜色
	colorFlag bool

	priority     int // 优先级，数值越小，客户端展示的优先级越高。不同系统状态的优先级不能一样。
	priorityFlag bool

	syncSetting     *SystemStatusSyncSetting // 同步设置
	syncSettingFlag bool
}

func NewSystemStatusBuilder() *SystemStatusBuilder {
	builder := &SystemStatusBuilder{}
	return builder
}

// 系统状态ID
//
// 示例值：7101214603622940633
func (builder *SystemStatusBuilder) SystemStatusId(systemStatusId string) *SystemStatusBuilder {
	builder.systemStatusId = systemStatusId
	builder.systemStatusIdFlag = true
	return builder
}

// 系统状态名称，名称字符数要在1到20范围内。不同系统状态的title不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：出差
func (builder *SystemStatusBuilder) Title(title string) *SystemStatusBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 系统状态国际化名称，名称字符数要在1到20范围内。不同系统状态之间i18n_title中任何一种title都不能重复。;; **注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：
func (builder *SystemStatusBuilder) I18nTitle(i18nTitle *SystemStatusI18nName) *SystemStatusBuilder {
	builder.i18nTitle = i18nTitle
	builder.i18nTitleFlag = true
	return builder
}

// 图标;;[**了解icon_key可选值**](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/overview)
//
// 示例值：GeneralBusinessTrip
func (builder *SystemStatusBuilder) IconKey(iconKey string) *SystemStatusBuilder {
	builder.iconKey = iconKey
	builder.iconKeyFlag = true
	return builder
}

// 颜色
//
// 示例值：BLUE
func (builder *SystemStatusBuilder) Color(color string) *SystemStatusBuilder {
	builder.color = color
	builder.colorFlag = true
	return builder
}

// 优先级，数值越小，客户端展示的优先级越高。不同系统状态的优先级不能一样。
//
// 示例值：1
func (builder *SystemStatusBuilder) Priority(priority int) *SystemStatusBuilder {
	builder.priority = priority
	builder.priorityFlag = true
	return builder
}

// 同步设置
//
// 示例值：
func (builder *SystemStatusBuilder) SyncSetting(syncSetting *SystemStatusSyncSetting) *SystemStatusBuilder {
	builder.syncSetting = syncSetting
	builder.syncSettingFlag = true
	return builder
}

func (builder *SystemStatusBuilder) Build() *SystemStatus {
	req := &SystemStatus{}
	if builder.systemStatusIdFlag {
		req.SystemStatusId = &builder.systemStatusId

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

	}
	if builder.i18nTitleFlag {
		req.I18nTitle = builder.i18nTitle
	}
	if builder.iconKeyFlag {
		req.IconKey = &builder.iconKey

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

	}
	if builder.priorityFlag {
		req.Priority = &builder.priority

	}
	if builder.syncSettingFlag {
		req.SyncSetting = builder.syncSetting
	}
	return req
}

type SystemStatusI18nName struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文名

	EnUs *string `json:"en_us,omitempty"` // 英文名

	JaJp *string `json:"ja_jp,omitempty"` // 日文名
}

type SystemStatusI18nNameBuilder struct {
	zhCn     string // 中文名
	zhCnFlag bool

	enUs     string // 英文名
	enUsFlag bool

	jaJp     string // 日文名
	jaJpFlag bool
}

func NewSystemStatusI18nNameBuilder() *SystemStatusI18nNameBuilder {
	builder := &SystemStatusI18nNameBuilder{}
	return builder
}

// 中文名
//
// 示例值：出差
func (builder *SystemStatusI18nNameBuilder) ZhCn(zhCn string) *SystemStatusI18nNameBuilder {
	builder.zhCn = zhCn
	builder.zhCnFlag = true
	return builder
}

// 英文名
//
// 示例值：On business trip
func (builder *SystemStatusI18nNameBuilder) EnUs(enUs string) *SystemStatusI18nNameBuilder {
	builder.enUs = enUs
	builder.enUsFlag = true
	return builder
}

// 日文名
//
// 示例值：出張中
func (builder *SystemStatusI18nNameBuilder) JaJp(jaJp string) *SystemStatusI18nNameBuilder {
	builder.jaJp = jaJp
	builder.jaJpFlag = true
	return builder
}

func (builder *SystemStatusI18nNameBuilder) Build() *SystemStatusI18nName {
	req := &SystemStatusI18nName{}
	if builder.zhCnFlag {
		req.ZhCn = &builder.zhCn

	}
	if builder.enUsFlag {
		req.EnUs = &builder.enUs

	}
	if builder.jaJpFlag {
		req.JaJp = &builder.jaJp

	}
	return req
}

type SystemStatusSyncI18nExplain struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文名

	EnUs *string `json:"en_us,omitempty"` // 英文名

	JaJp *string `json:"ja_jp,omitempty"` // 日文名
}

type SystemStatusSyncI18nExplainBuilder struct {
	zhCn     string // 中文名
	zhCnFlag bool

	enUs     string // 英文名
	enUsFlag bool

	jaJp     string // 日文名
	jaJpFlag bool
}

func NewSystemStatusSyncI18nExplainBuilder() *SystemStatusSyncI18nExplainBuilder {
	builder := &SystemStatusSyncI18nExplainBuilder{}
	return builder
}

// 中文名
//
// 示例值：出差审批通过后，该状态将自动开启并优先展示
func (builder *SystemStatusSyncI18nExplainBuilder) ZhCn(zhCn string) *SystemStatusSyncI18nExplainBuilder {
	builder.zhCn = zhCn
	builder.zhCnFlag = true
	return builder
}

// 英文名
//
// 示例值：Auto-display after travel request is approved.
func (builder *SystemStatusSyncI18nExplainBuilder) EnUs(enUs string) *SystemStatusSyncI18nExplainBuilder {
	builder.enUs = enUs
	builder.enUsFlag = true
	return builder
}

// 日文名
//
// 示例值：申請が承認されると、このステータスが優先的に表示されます
func (builder *SystemStatusSyncI18nExplainBuilder) JaJp(jaJp string) *SystemStatusSyncI18nExplainBuilder {
	builder.jaJp = jaJp
	builder.jaJpFlag = true
	return builder
}

func (builder *SystemStatusSyncI18nExplainBuilder) Build() *SystemStatusSyncI18nExplain {
	req := &SystemStatusSyncI18nExplain{}
	if builder.zhCnFlag {
		req.ZhCn = &builder.zhCn

	}
	if builder.enUsFlag {
		req.EnUs = &builder.enUs

	}
	if builder.jaJpFlag {
		req.JaJp = &builder.jaJp

	}
	return req
}

type SystemStatusSyncI18nName struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 中文名

	EnUs *string `json:"en_us,omitempty"` // 英文名

	JaJp *string `json:"ja_jp,omitempty"` // 日文名
}

type SystemStatusSyncI18nNameBuilder struct {
	zhCn     string // 中文名
	zhCnFlag bool

	enUs     string // 英文名
	enUsFlag bool

	jaJp     string // 日文名
	jaJpFlag bool
}

func NewSystemStatusSyncI18nNameBuilder() *SystemStatusSyncI18nNameBuilder {
	builder := &SystemStatusSyncI18nNameBuilder{}
	return builder
}

// 中文名
//
// 示例值：出差期间自动开启
func (builder *SystemStatusSyncI18nNameBuilder) ZhCn(zhCn string) *SystemStatusSyncI18nNameBuilder {
	builder.zhCn = zhCn
	builder.zhCnFlag = true
	return builder
}

// 英文名
//
// 示例值：Auto display Business Trip
func (builder *SystemStatusSyncI18nNameBuilder) EnUs(enUs string) *SystemStatusSyncI18nNameBuilder {
	builder.enUs = enUs
	builder.enUsFlag = true
	return builder
}

// 日文名
//
// 示例值：出張中に自動的にオンにする
func (builder *SystemStatusSyncI18nNameBuilder) JaJp(jaJp string) *SystemStatusSyncI18nNameBuilder {
	builder.jaJp = jaJp
	builder.jaJpFlag = true
	return builder
}

func (builder *SystemStatusSyncI18nNameBuilder) Build() *SystemStatusSyncI18nName {
	req := &SystemStatusSyncI18nName{}
	if builder.zhCnFlag {
		req.ZhCn = &builder.zhCn

	}
	if builder.enUsFlag {
		req.EnUs = &builder.enUs

	}
	if builder.jaJpFlag {
		req.JaJp = &builder.jaJp

	}
	return req
}

type SystemStatusSyncSetting struct {
	IsOpenByDefault *bool `json:"is_open_by_default,omitempty"` // 是否默认开启

	Title *string `json:"title,omitempty"` // 同步设置名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符

	I18nTitle *SystemStatusSyncI18nName `json:"i18n_title,omitempty"` // 同步设置国际化名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符

	Explain *string `json:"explain,omitempty"` // 同步设置解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符

	I18nExplain *SystemStatusSyncI18nExplain `json:"i18n_explain,omitempty"` // 同步设置国际化解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
}

type SystemStatusSyncSettingBuilder struct {
	isOpenByDefault     bool // 是否默认开启
	isOpenByDefaultFlag bool

	title     string // 同步设置名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
	titleFlag bool

	i18nTitle     *SystemStatusSyncI18nName // 同步设置国际化名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
	i18nTitleFlag bool

	explain     string // 同步设置解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
	explainFlag bool

	i18nExplain     *SystemStatusSyncI18nExplain // 同步设置国际化解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
	i18nExplainFlag bool
}

func NewSystemStatusSyncSettingBuilder() *SystemStatusSyncSettingBuilder {
	builder := &SystemStatusSyncSettingBuilder{}
	return builder
}

// 是否默认开启
//
// 示例值：true
func (builder *SystemStatusSyncSettingBuilder) IsOpenByDefault(isOpenByDefault bool) *SystemStatusSyncSettingBuilder {
	builder.isOpenByDefault = isOpenByDefault
	builder.isOpenByDefaultFlag = true
	return builder
}

// 同步设置名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：出差期间自动开启
func (builder *SystemStatusSyncSettingBuilder) Title(title string) *SystemStatusSyncSettingBuilder {
	builder.title = title
	builder.titleFlag = true
	return builder
}

// 同步设置国际化名称，名称字符数要在1到30范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：
func (builder *SystemStatusSyncSettingBuilder) I18nTitle(i18nTitle *SystemStatusSyncI18nName) *SystemStatusSyncSettingBuilder {
	builder.i18nTitle = i18nTitle
	builder.i18nTitleFlag = true
	return builder
}

// 同步设置解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：出差审批通过后，将自动开启并优先展示该状态。
func (builder *SystemStatusSyncSettingBuilder) Explain(explain string) *SystemStatusSyncSettingBuilder {
	builder.explain = explain
	builder.explainFlag = true
	return builder
}

// 同步设置国际化解释文案，解释字符数要在1到60范围内。;;**注意：** ;- 1中文=2英文=2其他语言字符=2字符
//
// 示例值：
func (builder *SystemStatusSyncSettingBuilder) I18nExplain(i18nExplain *SystemStatusSyncI18nExplain) *SystemStatusSyncSettingBuilder {
	builder.i18nExplain = i18nExplain
	builder.i18nExplainFlag = true
	return builder
}

func (builder *SystemStatusSyncSettingBuilder) Build() *SystemStatusSyncSetting {
	req := &SystemStatusSyncSetting{}
	if builder.isOpenByDefaultFlag {
		req.IsOpenByDefault = &builder.isOpenByDefault

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

	}
	if builder.i18nTitleFlag {
		req.I18nTitle = builder.i18nTitle
	}
	if builder.explainFlag {
		req.Explain = &builder.explain

	}
	if builder.i18nExplainFlag {
		req.I18nExplain = builder.i18nExplain
	}
	return req
}

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

	Result *string `json:"result,omitempty"` // 关闭结果
}

type SystemStatusUserCloseResultEntityBuilder struct {
	userId     string // 用户ID
	userIdFlag bool

	result     string // 关闭结果
	resultFlag bool
}

func NewSystemStatusUserCloseResultEntityBuilder() *SystemStatusUserCloseResultEntityBuilder {
	builder := &SystemStatusUserCloseResultEntityBuilder{}
	return builder
}

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

// 关闭结果
//
// 示例值：success
func (builder *SystemStatusUserCloseResultEntityBuilder) Result(result string) *SystemStatusUserCloseResultEntityBuilder {
	builder.result = result
	builder.resultFlag = true
	return builder
}

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

	}
	if builder.resultFlag {
		req.Result = &builder.result

	}
	return req
}

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

	EndTime *string `json:"end_time,omitempty"` // 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。
}

type SystemStatusUserOpenParamBuilder struct {
	userId     string // 用户ID
	userIdFlag bool

	endTime     string // 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。
	endTimeFlag bool
}

func NewSystemStatusUserOpenParamBuilder() *SystemStatusUserOpenParamBuilder {
	builder := &SystemStatusUserOpenParamBuilder{}
	return builder
}

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

// 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。
//
// 示例值：1665990378
func (builder *SystemStatusUserOpenParamBuilder) EndTime(endTime string) *SystemStatusUserOpenParamBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

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

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	return req
}

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

	EndTime *string `json:"end_time,omitempty"` // 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。

	Result *string `json:"result,omitempty"` // 开启结果
}

type SystemStatusUserOpenResultEntityBuilder struct {
	userId     string // 用户ID
	userIdFlag bool

	endTime     string // 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。
	endTimeFlag bool

	result     string // 开启结果
	resultFlag bool
}

func NewSystemStatusUserOpenResultEntityBuilder() *SystemStatusUserOpenResultEntityBuilder {
	builder := &SystemStatusUserOpenResultEntityBuilder{}
	return builder
}

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

// 结束时间，传入的应为秒单位的时间戳，距当前的时间跨度不能超过365天。
//
// 示例值：1665990378
func (builder *SystemStatusUserOpenResultEntityBuilder) EndTime(endTime string) *SystemStatusUserOpenResultEntityBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

// 开启结果
//
// 示例值：success_show
func (builder *SystemStatusUserOpenResultEntityBuilder) Result(result string) *SystemStatusUserOpenResultEntityBuilder {
	builder.result = result
	builder.resultFlag = true
	return builder
}

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

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	if builder.resultFlag {
		req.Result = &builder.result

	}
	return req
}

type BatchCloseSystemStatusReqBodyBuilder struct {
	userList     []string // 成员列表
	userListFlag bool
}

func NewBatchCloseSystemStatusReqBodyBuilder() *BatchCloseSystemStatusReqBodyBuilder {
	builder := &BatchCloseSystemStatusReqBodyBuilder{}
	return builder
}

// 成员列表
//
//示例值：ou_53edd3282dbc2fdbe5c593cfa5ce82ab
func (builder *BatchCloseSystemStatusReqBodyBuilder) UserList(userList []string) *BatchCloseSystemStatusReqBodyBuilder {
	builder.userList = userList
	builder.userListFlag = true
	return builder
}

func (builder *BatchCloseSystemStatusReqBodyBuilder) Build() *BatchCloseSystemStatusReqBody {
	req := &BatchCloseSystemStatusReqBody{}
	if builder.userListFlag {
		req.UserList = builder.userList
	}
	return req
}

type BatchCloseSystemStatusPathReqBodyBuilder struct {
	userList     []string
	userListFlag bool
}

func NewBatchCloseSystemStatusPathReqBodyBuilder() *BatchCloseSystemStatusPathReqBodyBuilder {
	builder := &BatchCloseSystemStatusPathReqBodyBuilder{}
	return builder
}

// 成员列表
//
// 示例值：ou_53edd3282dbc2fdbe5c593cfa5ce82ab
func (builder *BatchCloseSystemStatusPathReqBodyBuilder) UserList(userList []string) *BatchCloseSystemStatusPathReqBodyBuilder {
	builder.userList = userList
	builder.userListFlag = true
	return builder
}

func (builder *BatchCloseSystemStatusPathReqBodyBuilder) Build() (*BatchCloseSystemStatusReqBody, error) {
	req := &BatchCloseSystemStatusReqBody{}
	if builder.userListFlag {
		req.UserList = builder.userList
	}
	return req, nil
}

type BatchCloseSystemStatusReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchCloseSystemStatusReqBody
}

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

// 系统状态ID;;[获取系统状态ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list)
//
// 示例值：7101214603622940671
func (builder *BatchCloseSystemStatusReqBuilder) SystemStatusId(systemStatusId string) *BatchCloseSystemStatusReqBuilder {
	builder.apiReq.PathParams.Set("system_status_id", fmt.Sprint(systemStatusId))
	return builder
}

// 用户id类型 open_id/user_id/union_id
//
// 示例值：open_id
func (builder *BatchCloseSystemStatusReqBuilder) UserIdType(userIdType string) *BatchCloseSystemStatusReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 批量关闭用户系统状态可用
func (builder *BatchCloseSystemStatusReqBuilder) Body(body *BatchCloseSystemStatusReqBody) *BatchCloseSystemStatusReqBuilder {
	builder.body = body
	return builder
}

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

type BatchCloseSystemStatusReqBody struct {
	UserList []string `json:"user_list,omitempty"` // 成员列表
}

type BatchCloseSystemStatusReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchCloseSystemStatusReqBody `body:""`
}

type BatchCloseSystemStatusRespData struct {
	ResultList []*SystemStatusUserCloseResultEntity `json:"result_list,omitempty"` // 关闭结果
}

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

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

type BatchOpenSystemStatusReqBodyBuilder struct {
	userList     []*SystemStatusUserOpenParam // 开启列表
	userListFlag bool
}

func NewBatchOpenSystemStatusReqBodyBuilder() *BatchOpenSystemStatusReqBodyBuilder {
	builder := &BatchOpenSystemStatusReqBodyBuilder{}
	return builder
}

// 开启列表
//
//示例值：
func (builder *BatchOpenSystemStatusReqBodyBuilder) UserList(userList []*SystemStatusUserOpenParam) *BatchOpenSystemStatusReqBodyBuilder {
	builder.userList = userList
	builder.userListFlag = true
	return builder
}

func (builder *BatchOpenSystemStatusReqBodyBuilder) Build() *BatchOpenSystemStatusReqBody {
	req := &BatchOpenSystemStatusReqBody{}
	if builder.userListFlag {
		req.UserList = builder.userList
	}
	return req
}

type BatchOpenSystemStatusPathReqBodyBuilder struct {
	userList     []*SystemStatusUserOpenParam
	userListFlag bool
}

func NewBatchOpenSystemStatusPathReqBodyBuilder() *BatchOpenSystemStatusPathReqBodyBuilder {
	builder := &BatchOpenSystemStatusPathReqBodyBuilder{}
	return builder
}

// 开启列表
//
// 示例值：
func (builder *BatchOpenSystemStatusPathReqBodyBuilder) UserList(userList []*SystemStatusUserOpenParam) *BatchOpenSystemStatusPathReqBodyBuilder {
	builder.userList = userList
	builder.userListFlag = true
	return builder
}

func (builder *BatchOpenSystemStatusPathReqBodyBuilder) Build() (*BatchOpenSystemStatusReqBody, error) {
	req := &BatchOpenSystemStatusReqBody{}
	if builder.userListFlag {
		req.UserList = builder.userList
	}
	return req, nil
}

type BatchOpenSystemStatusReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *BatchOpenSystemStatusReqBody
}

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

// 系统状态ID;;[获取系统状态ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list)
//
// 示例值：7101214603622940672
func (builder *BatchOpenSystemStatusReqBuilder) SystemStatusId(systemStatusId string) *BatchOpenSystemStatusReqBuilder {
	builder.apiReq.PathParams.Set("system_status_id", fmt.Sprint(systemStatusId))
	return builder
}

// 用户id类型 open_id/user_id/union_id
//
// 示例值：open_id
func (builder *BatchOpenSystemStatusReqBuilder) UserIdType(userIdType string) *BatchOpenSystemStatusReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 批量开启用户系统状态可用
func (builder *BatchOpenSystemStatusReqBuilder) Body(body *BatchOpenSystemStatusReqBody) *BatchOpenSystemStatusReqBuilder {
	builder.body = body
	return builder
}

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

type BatchOpenSystemStatusReqBody struct {
	UserList []*SystemStatusUserOpenParam `json:"user_list,omitempty"` // 开启列表
}

type BatchOpenSystemStatusReq struct {
	apiReq *larkcore.ApiReq
	Body   *BatchOpenSystemStatusReqBody `body:""`
}

type BatchOpenSystemStatusRespData struct {
	ResultList []*SystemStatusUserOpenResultEntity `json:"result_list,omitempty"` // 开启结果
}

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

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

type CreateSystemStatusReqBuilder struct {
	apiReq       *larkcore.ApiReq
	systemStatus *SystemStatus
}

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

// 创建租户维度的系统状态。
func (builder *CreateSystemStatusReqBuilder) SystemStatus(systemStatus *SystemStatus) *CreateSystemStatusReqBuilder {
	builder.systemStatus = systemStatus
	return builder
}

func (builder *CreateSystemStatusReqBuilder) Build() *CreateSystemStatusReq {
	req := &CreateSystemStatusReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.systemStatus
	return req
}

type CreateSystemStatusReq struct {
	apiReq       *larkcore.ApiReq
	SystemStatus *SystemStatus `body:""`
}

type CreateSystemStatusRespData struct {
	SystemStatus *SystemStatus `json:"system_status,omitempty"` // 系统状态
}

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

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

type DeleteSystemStatusReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 系统状态ID;;[获取系统状态ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list)
//
// 示例值：7101214603622940633
func (builder *DeleteSystemStatusReqBuilder) SystemStatusId(systemStatusId string) *DeleteSystemStatusReqBuilder {
	builder.apiReq.PathParams.Set("system_status_id", fmt.Sprint(systemStatusId))
	return builder
}

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

type DeleteSystemStatusReq struct {
	apiReq *larkcore.ApiReq
}

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

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

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

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

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

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

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

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

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

}

type ListSystemStatusRespData struct {
	Items []*SystemStatus `json:"items,omitempty"` // 租户系统状态

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

	HasMore *bool `json:"has_more,omitempty"` // 是否存在更多
}

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

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

type PatchSystemStatusReqBodyBuilder struct {
	systemStatus     *SystemStatus // 系统状态
	systemStatusFlag bool

	updateFields     []string // 需要更新的字段
	updateFieldsFlag bool
}

func NewPatchSystemStatusReqBodyBuilder() *PatchSystemStatusReqBodyBuilder {
	builder := &PatchSystemStatusReqBodyBuilder{}
	return builder
}

// 系统状态
//
//示例值：
func (builder *PatchSystemStatusReqBodyBuilder) SystemStatus(systemStatus *SystemStatus) *PatchSystemStatusReqBodyBuilder {
	builder.systemStatus = systemStatus
	builder.systemStatusFlag = true
	return builder
}

// 需要更新的字段
//
//示例值：['TITLE']
func (builder *PatchSystemStatusReqBodyBuilder) UpdateFields(updateFields []string) *PatchSystemStatusReqBodyBuilder {
	builder.updateFields = updateFields
	builder.updateFieldsFlag = true
	return builder
}

func (builder *PatchSystemStatusReqBodyBuilder) Build() *PatchSystemStatusReqBody {
	req := &PatchSystemStatusReqBody{}
	if builder.systemStatusFlag {
		req.SystemStatus = builder.systemStatus
	}
	if builder.updateFieldsFlag {
		req.UpdateFields = builder.updateFields
	}
	return req
}

type PatchSystemStatusPathReqBodyBuilder struct {
	systemStatus     *SystemStatus
	systemStatusFlag bool
	updateFields     []string
	updateFieldsFlag bool
}

func NewPatchSystemStatusPathReqBodyBuilder() *PatchSystemStatusPathReqBodyBuilder {
	builder := &PatchSystemStatusPathReqBodyBuilder{}
	return builder
}

// 系统状态
//
// 示例值：
func (builder *PatchSystemStatusPathReqBodyBuilder) SystemStatus(systemStatus *SystemStatus) *PatchSystemStatusPathReqBodyBuilder {
	builder.systemStatus = systemStatus
	builder.systemStatusFlag = true
	return builder
}

// 需要更新的字段
//
// 示例值：['TITLE']
func (builder *PatchSystemStatusPathReqBodyBuilder) UpdateFields(updateFields []string) *PatchSystemStatusPathReqBodyBuilder {
	builder.updateFields = updateFields
	builder.updateFieldsFlag = true
	return builder
}

func (builder *PatchSystemStatusPathReqBodyBuilder) Build() (*PatchSystemStatusReqBody, error) {
	req := &PatchSystemStatusReqBody{}
	if builder.systemStatusFlag {
		req.SystemStatus = builder.systemStatus
	}
	if builder.updateFieldsFlag {
		req.UpdateFields = builder.updateFields
	}
	return req, nil
}

type PatchSystemStatusReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *PatchSystemStatusReqBody
}

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

// 系统状态ID;;[获取系统状态ID](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/personal_settings-v1/system_status/list)
//
// 示例值：7101214603622940633
func (builder *PatchSystemStatusReqBuilder) SystemStatusId(systemStatusId string) *PatchSystemStatusReqBuilder {
	builder.apiReq.PathParams.Set("system_status_id", fmt.Sprint(systemStatusId))
	return builder
}

// 修改租户维度系统状态。
func (builder *PatchSystemStatusReqBuilder) Body(body *PatchSystemStatusReqBody) *PatchSystemStatusReqBuilder {
	builder.body = body
	return builder
}

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

type PatchSystemStatusReqBody struct {
	SystemStatus *SystemStatus `json:"system_status,omitempty"` // 系统状态

	UpdateFields []string `json:"update_fields,omitempty"` // 需要更新的字段
}

type PatchSystemStatusReq struct {
	apiReq *larkcore.ApiReq
	Body   *PatchSystemStatusReqBody `body:""`
}

type PatchSystemStatusRespData struct {
	SystemStatus *SystemStatus `json:"system_status,omitempty"` // 系统状态
}

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

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

type ListSystemStatusIterator struct {
	nextPageToken *string
	items         []*SystemStatus
	index         int
	limit         int
	ctx           context.Context
	req           *ListSystemStatusReq
	listFunc      func(ctx context.Context, req *ListSystemStatusReq, options ...larkcore.RequestOptionFunc) (*ListSystemStatusResp, error)
	options       []larkcore.RequestOptionFunc
	curlNum       int
}

func (iterator *ListSystemStatusIterator) Next() (bool, *SystemStatus, 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 *ListSystemStatusIterator) NextPageToken() *string {
	return iterator.nextPageToken
}
