// Package workplace 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 larkworkplace

import (
	"fmt"

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

type AccessData struct {
	Pv *int `json:"pv,omitempty"` // 访问次数

	Uv *int `json:"uv,omitempty"` // 访问用户数(去重)
}

type AccessDataBuilder struct {
	pv     int // 访问次数
	pvFlag bool

	uv     int // 访问用户数(去重)
	uvFlag bool
}

func NewAccessDataBuilder() *AccessDataBuilder {
	builder := &AccessDataBuilder{}
	return builder
}

// 访问次数
//
// 示例值：100
func (builder *AccessDataBuilder) Pv(pv int) *AccessDataBuilder {
	builder.pv = pv
	builder.pvFlag = true
	return builder
}

// 访问用户数(去重)
//
// 示例值：30
func (builder *AccessDataBuilder) Uv(uv int) *AccessDataBuilder {
	builder.uv = uv
	builder.uvFlag = true
	return builder
}

func (builder *AccessDataBuilder) Build() *AccessData {
	req := &AccessData{}
	if builder.pvFlag {
		req.Pv = &builder.pv

	}
	if builder.uvFlag {
		req.Uv = &builder.uv

	}
	return req
}

type BlockAccessData struct {
	Date *string `json:"date,omitempty"` // 时间,精确到天,格式yyyy-MM-dd

	BlockId *string `json:"block_id,omitempty"` // 小组件id

	AccessData *AccessData `json:"access_data,omitempty"` // block访问数据信息。
}

type BlockAccessDataBuilder struct {
	date     string // 时间,精确到天,格式yyyy-MM-dd
	dateFlag bool

	blockId     string // 小组件id
	blockIdFlag bool

	accessData     *AccessData // block访问数据信息。
	accessDataFlag bool
}

func NewBlockAccessDataBuilder() *BlockAccessDataBuilder {
	builder := &BlockAccessDataBuilder{}
	return builder
}

// 时间,精确到天,格式yyyy-MM-dd
//
// 示例值：2023-03-12
func (builder *BlockAccessDataBuilder) Date(date string) *BlockAccessDataBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 小组件id
//
// 示例值：283438293839422334
func (builder *BlockAccessDataBuilder) BlockId(blockId string) *BlockAccessDataBuilder {
	builder.blockId = blockId
	builder.blockIdFlag = true
	return builder
}

// block访问数据信息。
//
// 示例值：
func (builder *BlockAccessDataBuilder) AccessData(accessData *AccessData) *BlockAccessDataBuilder {
	builder.accessData = accessData
	builder.accessDataFlag = true
	return builder
}

func (builder *BlockAccessDataBuilder) Build() *BlockAccessData {
	req := &BlockAccessData{}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.blockIdFlag {
		req.BlockId = &builder.blockId

	}
	if builder.accessDataFlag {
		req.AccessData = builder.accessData
	}
	return req
}

type CustomWorkplaceAccessData struct {
	CustomWorkplaceId *string `json:"custom_workplace_id,omitempty"` // 定制工作台ID

	AccessData *AccessData `json:"access_data,omitempty"` // 访问数据

	Date *string `json:"date,omitempty"` // 时间,精确到天,格式yyyy-MM-dd

	CustomWorkplaceName []*I18nName `json:"custom_workplace_name,omitempty"` // 定制工作台多语言名字。
}

type CustomWorkplaceAccessDataBuilder struct {
	customWorkplaceId     string // 定制工作台ID
	customWorkplaceIdFlag bool

	accessData     *AccessData // 访问数据
	accessDataFlag bool

	date     string // 时间,精确到天,格式yyyy-MM-dd
	dateFlag bool

	customWorkplaceName     []*I18nName // 定制工作台多语言名字。
	customWorkplaceNameFlag bool
}

func NewCustomWorkplaceAccessDataBuilder() *CustomWorkplaceAccessDataBuilder {
	builder := &CustomWorkplaceAccessDataBuilder{}
	return builder
}

// 定制工作台ID
//
// 示例值：tpl_645b003aaa40001435b2ddw
func (builder *CustomWorkplaceAccessDataBuilder) CustomWorkplaceId(customWorkplaceId string) *CustomWorkplaceAccessDataBuilder {
	builder.customWorkplaceId = customWorkplaceId
	builder.customWorkplaceIdFlag = true
	return builder
}

// 访问数据
//
// 示例值：
func (builder *CustomWorkplaceAccessDataBuilder) AccessData(accessData *AccessData) *CustomWorkplaceAccessDataBuilder {
	builder.accessData = accessData
	builder.accessDataFlag = true
	return builder
}

// 时间,精确到天,格式yyyy-MM-dd
//
// 示例值：2023-03-12
func (builder *CustomWorkplaceAccessDataBuilder) Date(date string) *CustomWorkplaceAccessDataBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 定制工作台多语言名字。
//
// 示例值：
func (builder *CustomWorkplaceAccessDataBuilder) CustomWorkplaceName(customWorkplaceName []*I18nName) *CustomWorkplaceAccessDataBuilder {
	builder.customWorkplaceName = customWorkplaceName
	builder.customWorkplaceNameFlag = true
	return builder
}

func (builder *CustomWorkplaceAccessDataBuilder) Build() *CustomWorkplaceAccessData {
	req := &CustomWorkplaceAccessData{}
	if builder.customWorkplaceIdFlag {
		req.CustomWorkplaceId = &builder.customWorkplaceId

	}
	if builder.accessDataFlag {
		req.AccessData = builder.accessData
	}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.customWorkplaceNameFlag {
		req.CustomWorkplaceName = builder.customWorkplaceName
	}
	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 I18nName struct {
	Language *string `json:"language,omitempty"` // ISO 639-1的语言代码。比如zh表示中文。

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

type I18nNameBuilder struct {
	language     string // ISO 639-1的语言代码。比如zh表示中文。
	languageFlag bool

	name     string // 名字
	nameFlag bool
}

func NewI18nNameBuilder() *I18nNameBuilder {
	builder := &I18nNameBuilder{}
	return builder
}

// ISO 639-1的语言代码。比如zh表示中文。
//
// 示例值：zh
func (builder *I18nNameBuilder) Language(language string) *I18nNameBuilder {
	builder.language = language
	builder.languageFlag = true
	return builder
}

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

func (builder *I18nNameBuilder) Build() *I18nName {
	req := &I18nName{}
	if builder.languageFlag {
		req.Language = &builder.language

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

	}
	return req
}

type Rule struct {
	IsAllVisible *bool `json:"is_all_visible,omitempty"` // 是否全员接收通知

	VisibleDepartmentIds []string `json:"visible_department_ids,omitempty"` // 可接收通知的部门id列表，上限为500个
}

type RuleBuilder struct {
	isAllVisible     bool // 是否全员接收通知
	isAllVisibleFlag bool

	visibleDepartmentIds     []string // 可接收通知的部门id列表，上限为500个
	visibleDepartmentIdsFlag bool
}

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

// 是否全员接收通知
//
// 示例值：false
func (builder *RuleBuilder) IsAllVisible(isAllVisible bool) *RuleBuilder {
	builder.isAllVisible = isAllVisible
	builder.isAllVisibleFlag = true
	return builder
}

// 可接收通知的部门id列表，上限为500个
//
// 示例值：["a3ed9ece96ff2b1a","a3ed9ece96ff2b1b"]
func (builder *RuleBuilder) VisibleDepartmentIds(visibleDepartmentIds []string) *RuleBuilder {
	builder.visibleDepartmentIds = visibleDepartmentIds
	builder.visibleDepartmentIdsFlag = true
	return builder
}

func (builder *RuleBuilder) Build() *Rule {
	req := &Rule{}
	if builder.isAllVisibleFlag {
		req.IsAllVisible = &builder.isAllVisible

	}
	if builder.visibleDepartmentIdsFlag {
		req.VisibleDepartmentIds = builder.visibleDepartmentIds
	}
	return req
}

type TemplateWorkplaceAccessData struct {
	TplId *string `json:"tpl_id,omitempty"` // 定制工作台ID

	AccessData *AccessData `json:"access_data,omitempty"` // 访问数据
}

type TemplateWorkplaceAccessDataBuilder struct {
	tplId     string // 定制工作台ID
	tplIdFlag bool

	accessData     *AccessData // 访问数据
	accessDataFlag bool
}

func NewTemplateWorkplaceAccessDataBuilder() *TemplateWorkplaceAccessDataBuilder {
	builder := &TemplateWorkplaceAccessDataBuilder{}
	return builder
}

// 定制工作台ID
//
// 示例值：tpl_645b003aaa40001435b2ddw
func (builder *TemplateWorkplaceAccessDataBuilder) TplId(tplId string) *TemplateWorkplaceAccessDataBuilder {
	builder.tplId = tplId
	builder.tplIdFlag = true
	return builder
}

// 访问数据
//
// 示例值：
func (builder *TemplateWorkplaceAccessDataBuilder) AccessData(accessData *AccessData) *TemplateWorkplaceAccessDataBuilder {
	builder.accessData = accessData
	builder.accessDataFlag = true
	return builder
}

func (builder *TemplateWorkplaceAccessDataBuilder) Build() *TemplateWorkplaceAccessData {
	req := &TemplateWorkplaceAccessData{}
	if builder.tplIdFlag {
		req.TplId = &builder.tplId

	}
	if builder.accessDataFlag {
		req.AccessData = builder.accessData
	}
	return req
}

type WorkplaceAccessData struct {
	Date *string `json:"date,omitempty"` // 时间,精确到天,格式yyyy-MM-dd

	AllWorkplace *AccessData `json:"all_workplace,omitempty"` // 全部工作台的访问数据

	DefaultWorkplace *AccessData `json:"default_workplace,omitempty"` // 默认工作台的访问数据
}

type WorkplaceAccessDataBuilder struct {
	date     string // 时间,精确到天,格式yyyy-MM-dd
	dateFlag bool

	allWorkplace     *AccessData // 全部工作台的访问数据
	allWorkplaceFlag bool

	defaultWorkplace     *AccessData // 默认工作台的访问数据
	defaultWorkplaceFlag bool
}

func NewWorkplaceAccessDataBuilder() *WorkplaceAccessDataBuilder {
	builder := &WorkplaceAccessDataBuilder{}
	return builder
}

// 时间,精确到天,格式yyyy-MM-dd
//
// 示例值：2023-03-12
func (builder *WorkplaceAccessDataBuilder) Date(date string) *WorkplaceAccessDataBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 全部工作台的访问数据
//
// 示例值：20
func (builder *WorkplaceAccessDataBuilder) AllWorkplace(allWorkplace *AccessData) *WorkplaceAccessDataBuilder {
	builder.allWorkplace = allWorkplace
	builder.allWorkplaceFlag = true
	return builder
}

// 默认工作台的访问数据
//
// 示例值：10
func (builder *WorkplaceAccessDataBuilder) DefaultWorkplace(defaultWorkplace *AccessData) *WorkplaceAccessDataBuilder {
	builder.defaultWorkplace = defaultWorkplace
	builder.defaultWorkplaceFlag = true
	return builder
}

func (builder *WorkplaceAccessDataBuilder) Build() *WorkplaceAccessData {
	req := &WorkplaceAccessData{}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.allWorkplaceFlag {
		req.AllWorkplace = builder.allWorkplace
	}
	if builder.defaultWorkplaceFlag {
		req.DefaultWorkplace = builder.defaultWorkplace
	}
	return req
}

type WorkplaceTenantNotification struct {
	NotificationId *string `json:"notification_id,omitempty"` // 通知id

	Content *string `json:"content,omitempty"` // 通知内容 json 格式

	ExpireTime *string `json:"expire_time,omitempty"` // 自动过期删除的时间戳(秒)

	Rule *Rule `json:"rule,omitempty"` // 配置可接收到通知的规则
}

type WorkplaceTenantNotificationBuilder struct {
	notificationId     string // 通知id
	notificationIdFlag bool

	content     string // 通知内容 json 格式
	contentFlag bool

	expireTime     string // 自动过期删除的时间戳(秒)
	expireTimeFlag bool

	rule     *Rule // 配置可接收到通知的规则
	ruleFlag bool
}

func NewWorkplaceTenantNotificationBuilder() *WorkplaceTenantNotificationBuilder {
	builder := &WorkplaceTenantNotificationBuilder{}
	return builder
}

// 通知id
//
// 示例值：own_xxxxxxxxxxxxxxxx
func (builder *WorkplaceTenantNotificationBuilder) NotificationId(notificationId string) *WorkplaceTenantNotificationBuilder {
	builder.notificationId = notificationId
	builder.notificationIdFlag = true
	return builder
}

// 通知内容 json 格式
//
// 示例值：{\"pc_notification\":{\"config\":{\"width\":500,\"height\":500},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"img\",\"url\":\"https://www.feishu.cn\",\"img_key\":\"test\"}]}}}
func (builder *WorkplaceTenantNotificationBuilder) Content(content string) *WorkplaceTenantNotificationBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 自动过期删除的时间戳(秒)
//
// 示例值：1739717852
func (builder *WorkplaceTenantNotificationBuilder) ExpireTime(expireTime string) *WorkplaceTenantNotificationBuilder {
	builder.expireTime = expireTime
	builder.expireTimeFlag = true
	return builder
}

// 配置可接收到通知的规则
//
// 示例值：
func (builder *WorkplaceTenantNotificationBuilder) Rule(rule *Rule) *WorkplaceTenantNotificationBuilder {
	builder.rule = rule
	builder.ruleFlag = true
	return builder
}

func (builder *WorkplaceTenantNotificationBuilder) Build() *WorkplaceTenantNotification {
	req := &WorkplaceTenantNotification{}
	if builder.notificationIdFlag {
		req.NotificationId = &builder.notificationId

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

	}
	if builder.expireTimeFlag {
		req.ExpireTime = &builder.expireTime

	}
	if builder.ruleFlag {
		req.Rule = builder.rule
	}
	return req
}

type WorkplaceUserNotification struct {
	NotificationId *string `json:"notification_id,omitempty"` // 通知 id

	Content *string `json:"content,omitempty"` // 通知内容 json 格式

	ExpireTime *string `json:"expire_time,omitempty"` // 自动过期删除的时间戳(秒)
}

type WorkplaceUserNotificationBuilder struct {
	notificationId     string // 通知 id
	notificationIdFlag bool

	content     string // 通知内容 json 格式
	contentFlag bool

	expireTime     string // 自动过期删除的时间戳(秒)
	expireTimeFlag bool
}

func NewWorkplaceUserNotificationBuilder() *WorkplaceUserNotificationBuilder {
	builder := &WorkplaceUserNotificationBuilder{}
	return builder
}

// 通知 id
//
// 示例值：own_xxxxxxxxxxxxxxxx
func (builder *WorkplaceUserNotificationBuilder) NotificationId(notificationId string) *WorkplaceUserNotificationBuilder {
	builder.notificationId = notificationId
	builder.notificationIdFlag = true
	return builder
}

// 通知内容 json 格式
//
// 示例值：{\"pc_notification\":{\"config\":{\"width\":500,\"height\":500},\"i18n_elements\":{\"zh_cn\":[{\"tag\":\"img\",\"url\":\"https://www.feishu.cn\",\"img_key\":\"test\"}]}}}
func (builder *WorkplaceUserNotificationBuilder) Content(content string) *WorkplaceUserNotificationBuilder {
	builder.content = content
	builder.contentFlag = true
	return builder
}

// 自动过期删除的时间戳(秒)
//
// 示例值：1739717852
func (builder *WorkplaceUserNotificationBuilder) ExpireTime(expireTime string) *WorkplaceUserNotificationBuilder {
	builder.expireTime = expireTime
	builder.expireTimeFlag = true
	return builder
}

func (builder *WorkplaceUserNotificationBuilder) Build() *WorkplaceUserNotification {
	req := &WorkplaceUserNotification{}
	if builder.notificationIdFlag {
		req.NotificationId = &builder.notificationId

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

	}
	if builder.expireTimeFlag {
		req.ExpireTime = &builder.expireTime

	}
	return req
}

type SearchCustomWorkplaceAccessDataReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 数据检索开始时间，精确到日。格式yyyy-MM-dd
//
// 示例值：2023-03-01
func (builder *SearchCustomWorkplaceAccessDataReqBuilder) FromDate(fromDate string) *SearchCustomWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("from_date", fmt.Sprint(fromDate))
	return builder
}

// 数据检索结束时间，精确到日。格式yyyy-MM-dd。
//
// 示例值：2023-03-22
func (builder *SearchCustomWorkplaceAccessDataReqBuilder) ToDate(toDate string) *SearchCustomWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("to_date", fmt.Sprint(toDate))
	return builder
}

// 分页大小，最小为 1，最大为 200，默认为 20。
//
// 示例值：20
func (builder *SearchCustomWorkplaceAccessDataReqBuilder) PageSize(pageSize int) *SearchCustomWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 用于标记当前请求的分页标记，将返回以当前分页标记开始，往后 page_size 个元素。第一次访问接口的时候不需要传。
//
// 示例值：ddowkdkl9w2d
func (builder *SearchCustomWorkplaceAccessDataReqBuilder) PageToken(pageToken string) *SearchCustomWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 定制化工作台id.非必填,不填的时候,返回所有定制化工作台数据。
//
// 示例值：tpl_647184b585400013254c4ea6
func (builder *SearchCustomWorkplaceAccessDataReqBuilder) CustomWorkplaceId(customWorkplaceId string) *SearchCustomWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("custom_workplace_id", fmt.Sprint(customWorkplaceId))
	return builder
}

func (builder *SearchCustomWorkplaceAccessDataReqBuilder) Build() *SearchCustomWorkplaceAccessDataReq {
	req := &SearchCustomWorkplaceAccessDataReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type SearchCustomWorkplaceAccessDataReq struct {
	apiReq *larkcore.ApiReq
}

type SearchCustomWorkplaceAccessDataRespData struct {
	Items []*CustomWorkplaceAccessData `json:"items,omitempty"` // 定制工作台访问数据

	HasMore *bool `json:"has_more,omitempty"` // 是否还有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 分页标记，存在下一页时返回
}

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

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

type SearchWorkplaceAccessDataReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 数据检索开始时间，精确到日。格式yyyy-MM-dd
//
// 示例值：2023-03-01
func (builder *SearchWorkplaceAccessDataReqBuilder) FromDate(fromDate string) *SearchWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("from_date", fmt.Sprint(fromDate))
	return builder
}

// 数据检索结束时间，精确到日。格式yyyy-MM-dd。
//
// 示例值：2023-03-22
func (builder *SearchWorkplaceAccessDataReqBuilder) ToDate(toDate string) *SearchWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("to_date", fmt.Sprint(toDate))
	return builder
}

// 分页大小，最小为 1，最大为 200，默认为 20。
//
// 示例值：20
func (builder *SearchWorkplaceAccessDataReqBuilder) PageSize(pageSize int) *SearchWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 用于标记当前请求的分页标记，将返回以当前分页标记开始，往后 page_size 个元素。第一次访问接口的时候不需要传。
//
// 示例值：ddowkdkl9w2d
func (builder *SearchWorkplaceAccessDataReqBuilder) PageToken(pageToken string) *SearchWorkplaceAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

func (builder *SearchWorkplaceAccessDataReqBuilder) Build() *SearchWorkplaceAccessDataReq {
	req := &SearchWorkplaceAccessDataReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type SearchWorkplaceAccessDataReq struct {
	apiReq *larkcore.ApiReq
}

type SearchWorkplaceAccessDataRespData struct {
	Items []*WorkplaceAccessData `json:"items,omitempty"` // 工作台访问数据

	HasMore *bool `json:"has_more,omitempty"` // 是否还有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 分页标记，存在下一页时返回。
}

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

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

type SearchWorkplaceBlockAccessDataReqBuilder struct {
	apiReq *larkcore.ApiReq
}

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

// 数据检索开始时间，精确到日。格式yyyy-MM-dd。
//
// 示例值：2023-02-01
func (builder *SearchWorkplaceBlockAccessDataReqBuilder) FromDate(fromDate string) *SearchWorkplaceBlockAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("from_date", fmt.Sprint(fromDate))
	return builder
}

// 数据检索结束时间，精确到日。格式yyyy-MM-dd。
//
// 示例值：2023-03-02
func (builder *SearchWorkplaceBlockAccessDataReqBuilder) ToDate(toDate string) *SearchWorkplaceBlockAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("to_date", fmt.Sprint(toDate))
	return builder
}

// 分页大小，最小为 1，最大为 200，默认为 20。
//
// 示例值：20
func (builder *SearchWorkplaceBlockAccessDataReqBuilder) PageSize(pageSize int) *SearchWorkplaceBlockAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_size", fmt.Sprint(pageSize))
	return builder
}

// 用于标记当前请求的分页标记，将返回以当前分页标记开始，往后 page_size 个元素。第一次访问接口的时候不需要传。
//
// 示例值：ddowkdkl9w2d
func (builder *SearchWorkplaceBlockAccessDataReqBuilder) PageToken(pageToken string) *SearchWorkplaceBlockAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("page_token", fmt.Sprint(pageToken))
	return builder
}

// 小组件id
//
// 示例值：283438293839422334
func (builder *SearchWorkplaceBlockAccessDataReqBuilder) BlockId(blockId string) *SearchWorkplaceBlockAccessDataReqBuilder {
	builder.apiReq.QueryParams.Set("block_id", fmt.Sprint(blockId))
	return builder
}

func (builder *SearchWorkplaceBlockAccessDataReqBuilder) Build() *SearchWorkplaceBlockAccessDataReq {
	req := &SearchWorkplaceBlockAccessDataReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type SearchWorkplaceBlockAccessDataReq struct {
	apiReq *larkcore.ApiReq
}

type SearchWorkplaceBlockAccessDataRespData struct {
	Items []*BlockAccessData `json:"items,omitempty"` // 工作台中block的访问数据

	HasMore *bool `json:"has_more,omitempty"` // 是否还有下一页数据

	PageToken *string `json:"page_token,omitempty"` // 分页标记，存在下一页时返回
}

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

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