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

// EventV2ACSAccessRecordCreatedV1 门禁设备识别用户成功后发送该事件给订阅应用。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/acs-v1/access_record/events/created
// new doc: https://open.feishu.cn/document/server-docs/acs-v1/access_record/events/created
func (r *EventCallbackService) HandlerEventV2ACSAccessRecordCreatedV1(f EventV2ACSAccessRecordCreatedV1Handler) {
	r.cli.eventHandler.eventV2ACSAccessRecordCreatedV1Handler = f
}

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

// EventV2ACSAccessRecordCreatedV1 ...
type EventV2ACSAccessRecordCreatedV1 struct {
	AccessRecordID string                                 `json:"access_record_id,omitempty"` // 门禁记录 ID
	UserID         *EventV2ACSAccessRecordCreatedV1UserID `json:"user_id,omitempty"`          // 用户 ID
	DeviceID       string                                 `json:"device_id,omitempty"`        // 设备 ID
	IsClockIn      bool                                   `json:"is_clock_in,omitempty"`      // 是否打卡
	IsDoorOpen     bool                                   `json:"is_door_open,omitempty"`     // 是否开门
	AccessTime     string                                 `json:"access_time,omitempty"`      // 识别时间 （单位: 秒）
}

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