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

// EventV1AppTicket 了解事件订阅的使用场景和配置流程, 请点击查看 [事件订阅概述](https://open.feishu.cn/document/ukTMukTMukTM/uUTNz4SN1MjL1UzM)
//
// 对于应用商店应用, 开放平台会每隔1小时推送一次 app_ticket, 应用通过该 app_ticket 获取 app_access_token。
// - 特殊说明: 应用商店应用自动订阅此事件；企业自建应用不需要此事件。
// - 搭配使用: [触发app_ticket重新推送
// ](https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_ticket_resend)、[通过app_ticket获取token
// ](https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_access_token)
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/event/app_ticket-events
// new doc: https://open.feishu.cn/document/server-docs/application-v6/event/app_ticket-events
func (r *EventCallbackService) HandlerEventV1AppTicket(f EventV1AppTicketHandler) {
	r.cli.eventHandler.eventV1AppTicketHandler = f
}

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

// EventV1AppTicket ...
type EventV1AppTicket struct {
	AppID     string `json:"app_id,omitempty"`     // 如: cli_xxx
	AppTicket string `json:"app_ticket,omitempty"` // 如: xxx
	Type      string `json:"type,omitempty"`       // 如: app_ticket
}
