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

// EventV2CorehrDepartmentUpdatedV1 飞书人事中「部门信息被更新」时将触发此事件。注意: 1. 触发时间为部门更新实际生效时间, 如在 2022-01-01 更新部门, 部门更新生效时间设置为 2022-05-01, 事件将在 2022-05-01 进行推送。2. 只有在部门发生如下字段变更的时候, 会触发「部门更新」事件: 部门名称、code、部门描述、上级部门、部门子类型、部门负责人、是否保密、生效时间、失效时间、自定义字段（不包括其他部门角色）3. 删除部门不会触发「部门更新」事件
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/events/updated
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/organization-management/department/updated
func (r *EventCallbackService) HandlerEventV2CorehrDepartmentUpdatedV1(f EventV2CorehrDepartmentUpdatedV1Handler) {
	r.cli.eventHandler.eventV2CorehrDepartmentUpdatedV1Handler = f
}

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

// EventV2CorehrDepartmentUpdatedV1 ...
type EventV2CorehrDepartmentUpdatedV1 struct {
	DepartmentID string   `json:"department_id,omitempty"` // 被更新部门的 ID
	FieldChanges []string `json:"field_changes,omitempty"` // 发生变更的字段
}
