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

// EventV1P2PChatCreate 首次会话是用户了解应用的重要机会, 你可以发送操作说明、配置地址来指导用户开始使用你的应用。
//
// :::warnning
// 如果是应用商店应用, 请务必确保订阅并响应此事件。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uYDNxYjL2QTM24iN0EjN/bot-events
// new doc: https://open.feishu.cn/document/server-docs/group/chat-member/event/bot-events
func (r *EventCallbackService) HandlerEventV1P2PChatCreate(f EventV1P2PChatCreateHandler) {
	r.cli.eventHandler.eventV1P2PChatCreateHandler = f
}

// EventV1P2PChatCreateHandler event EventV1P2PChatCreate handler
type EventV1P2PChatCreateHandler func(ctx context.Context, cli *Lark, schema string, header *EventHeaderV1, event *EventV1P2PChatCreate) (string, error)

// EventV1P2PChatCreate ...
type EventV1P2PChatCreate struct {
	AppID     string                             `json:"app_id,omitempty"`     // 如: cli_9c8609450f78d102
	ChatID    string                             `json:"chat_id,omitempty"`    // 机器人和用户的会话id. 如: oc_26b66a5eb603162b849f91bcd8815b20
	Operator  *EventV1P2PChatCreateEventOperator `json:"operator,omitempty"`   // 会话的发起人。可能是用户, 也可能是机器人。
	TenantKey string                             `json:"tenant_key,omitempty"` // 企业标识. 如: 736588c9260f175c
	Type      string                             `json:"type,omitempty"`       // 事件类型. 如: p2p_chat_create
	User      *EventV1P2PChatCreateEventUser     `json:"user,omitempty"`       // 会话的用户
}

// EventV1P2PChatCreateEventOperator ...
type EventV1P2PChatCreateEventOperator struct {
	OpenID string `json:"open_id,omitempty"` // 员工对此应用的唯一标识, 同一员工对不同应用的open_id不同. 如: ou_2d2c0399b53d06fd195bb393cd1e38f2
	UserID string `json:"user_id,omitempty"` // 即“用户ID”, 仅企业自建应用会返回. 如: gfa21d92
}

// EventV1P2PChatCreateEventUser ...
type EventV1P2PChatCreateEventUser struct {
	Name   string `json:"name,omitempty"`    // 如: 张三
	OpenID string `json:"open_id,omitempty"` // 员工对此应用的唯一标识, 同一员工对不同应用的open_id不同. 如: ou_7dede290d6a27698b969a7fd70ca53da
	UserID string `json:"user_id,omitempty"` // 即“用户ID”, 仅企业自建应用会返回. 如: gfa21d92
}
