// 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"
)

// EventV2CorehrOffboardingUpdatedV1 在离职发起审批和产生审批结果时触发该事件, 审批结果产生的场景包括撤销、审批通过、审批拒绝。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/events/updated
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/offboarding/updated
func (r *EventCallbackService) HandlerEventV2CorehrOffboardingUpdatedV1(f EventV2CorehrOffboardingUpdatedV1Handler) {
	r.cli.eventHandler.eventV2CorehrOffboardingUpdatedV1Handler = f
}

// EventV2CorehrOffboardingUpdatedV1Handler event EventV2CorehrOffboardingUpdatedV1 handler
type EventV2CorehrOffboardingUpdatedV1Handler func(ctx context.Context, cli *Lark, schema string, header *EventHeaderV2, event *EventV2CorehrOffboardingUpdatedV1) (string, error)

// EventV2CorehrOffboardingUpdatedV1 ...
type EventV2CorehrOffboardingUpdatedV1 struct {
	EmploymentID  string                                         `json:"employment_id,omitempty"`  // 员工 ID
	TargetUserID  *EventV2CorehrOffboardingUpdatedV1TargetUserID `json:"target_user_id,omitempty"` // 用户 ID
	OffboardingID string                                         `json:"offboarding_id,omitempty"` // 离职记录 ID
	ProcessID     string                                         `json:"process_id,omitempty"`     // 离职发起后的审批流程实例 ID
	Status        int64                                          `json:"status,omitempty"`         // 离职状态, 可选值有: 1: 离职发起/审批中, 2: 已撤销, 3: 已拒绝, 4: 审批通过, 5: 已生效（生效日期后自动生效）
}

// EventV2CorehrOffboardingUpdatedV1TargetUserID ...
type EventV2CorehrOffboardingUpdatedV1TargetUserID struct {
	UnionID string `json:"union_id,omitempty"` // 用户的 union id
	UserID  string `json:"user_id,omitempty"`  // 用户的 user id, 字段权限要求: 获取用户 user ID
	OpenID  string `json:"open_id,omitempty"`  // 用户的 open id
}
