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

// EventV2CorehrEmploymentUpdatedV1 员工在飞书人事的「雇佣信息被更新」时将触发此事件, 雇佣信息的创建和删除不会触发该事件
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employment/events/updated
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/employee/employment/updated
func (r *EventCallbackService) HandlerEventV2CorehrEmploymentUpdatedV1(f EventV2CorehrEmploymentUpdatedV1Handler) {
	r.cli.eventHandler.eventV2CorehrEmploymentUpdatedV1Handler = f
}

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

// EventV2CorehrEmploymentUpdatedV1 ...
type EventV2CorehrEmploymentUpdatedV1 struct {
	EmploymentID string                                        `json:"employment_id,omitempty"`  // 被更新的雇佣信息 ID
	TargetUserID *EventV2CorehrEmploymentUpdatedV1TargetUserID `json:"target_user_id,omitempty"` // 用户 ID
	FieldChanges []string                                      `json:"field_changes,omitempty"`  // 发生变更的字段
}

// EventV2CorehrEmploymentUpdatedV1TargetUserID ...
type EventV2CorehrEmploymentUpdatedV1TargetUserID 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
}
