// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
 * Copyright 2022 chyroc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lark

import (
	"context"
)

// EventV1ShiftApproval 了解事件订阅的使用场景和配置流程, 请点击查看 [事件订阅概述](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM)
//
// 包含换班控件组的换班申请审批通过后触发此事件。
// * 依赖权限: [访问审批应用] 或 [查看、创建、更新、删除审批应用相关信息]
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uIDO24iM4YjLygjN/event/shift-change
// new doc: https://open.feishu.cn/document/server-docs/approval-v4/event/special-event/shift-change
func (r *EventCallbackService) HandlerEventV1ShiftApproval(f EventV1ShiftApprovalHandler) {
	r.cli.eventHandler.eventV1ShiftApprovalHandler = f
}

// EventV1ShiftApprovalHandler event EventV1ShiftApproval handler
type EventV1ShiftApprovalHandler func(ctx context.Context, cli *Lark, schema string, header *EventHeaderV1, event *EventV1ShiftApproval) (string, error)

// EventV1ShiftApproval ...
type EventV1ShiftApproval struct {
	AppID        string `json:"app_id,omitempty"`        // 如: cli_xxx
	TenantKey    string `json:"tenant_key,omitempty"`    // 如: xxx
	Type         string `json:"type,omitempty"`          // 如: shift_approval
	InstanceCode string `json:"instance_code,omitempty"` // 审批实例Code. 如: xxx
	EmployeeID   string `json:"employee_id,omitempty"`   // 用户id. 如: xxx
	OpenID       string `json:"open_id,omitempty"`       // 用户open_id. 如: ou_xxx
	StartTime    int64  `json:"start_time,omitempty"`    // 审批发起时间, 单位: 秒. 如: 1502199207
	EndTime      int64  `json:"end_time,omitempty"`      // 审批结束时间, 单位: 秒. 如: 1502199307
	ShiftTime    string `json:"shift_time,omitempty"`    // 换班时间. 如: 2018-12-01 12:00:00
	ReturnTime   string `json:"return_time,omitempty"`   // 还班时间. 如: 2018-12-02 12:00:00
	ShiftReason  string `json:"shift_reason,omitempty"`  // 换班事由. 如: xxx
}
