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

// EventV2CorehrOrgRoleAuthorizationUpdatedV1 当组织上的角色授权发生变更时, 触发该事件。例如在部门上修改了角色, 并在 2030-01-01 年生效, 则事件将在 2030-01-01 触发。注意: 当前事件只返回在飞书人事中组织角色的变化, 下游组织的影响, 可以通过 「获取组织类角色授权列表」获取。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/org_role_authorization/events/updated
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/authorization/updated
func (r *EventCallbackService) HandlerEventV2CorehrOrgRoleAuthorizationUpdatedV1(f EventV2CorehrOrgRoleAuthorizationUpdatedV1Handler) {
	r.cli.eventHandler.eventV2CorehrOrgRoleAuthorizationUpdatedV1Handler = f
}

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

// EventV2CorehrOrgRoleAuthorizationUpdatedV1 ...
type EventV2CorehrOrgRoleAuthorizationUpdatedV1 struct {
	RoleID              string                                                       `json:"role_id,omitempty"`               // 角色id
	ManagementScopeList []*EventV2CorehrOrgRoleAuthorizationUpdatedV1ManagementScope `json:"management_scope_list,omitempty"` // 管理范围信息
	EmploymentIDList    []string                                                     `json:"employment_id_list,omitempty"`    // 员工雇佣信息ID list
}

// EventV2CorehrOrgRoleAuthorizationUpdatedV1ManagementScope ...
type EventV2CorehrOrgRoleAuthorizationUpdatedV1ManagementScope struct {
	ManagementDimension string `json:"management_dimension,omitempty"` // 管理维度, 可选值有: department: 部门, work_location: 工作地点, company: 公司, social_security_location: 社保城市
	ObjID               string `json:"obj_id,omitempty"`               // 被授权部门/工作地点/公司/社保城市 ID
}
