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

// ResendAppTicket 开放平台每隔 1 小时会向应用推送 app_ticket 事件, 事件体内包含了 app_ticket。应用也可以主动调用此接口, 触发开放平台即时推送 app_ticket 事件。了解事件信息可参见[app_ticket 事件](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v6/event/app_ticket-events)。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_ticket_resend
// new doc: https://open.feishu.cn/document/server-docs/authentication-management/access-token/app_ticket_resend
func (r *AuthService) ResendAppTicket(ctx context.Context, request *ResendAppTicketReq, options ...MethodOptionFunc) (*ResendAppTicketResp, *Response, error) {
	if r.cli.mock.mockAuthResendAppTicket != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Auth#ResendAppTicket mock enable")
		return r.cli.mock.mockAuthResendAppTicket(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:        "Auth",
		API:          "ResendAppTicket",
		Method:       "POST",
		URL:          r.cli.openBaseURL + "/open-apis/auth/v3/app_ticket/resend",
		Body:         request,
		MethodOption: newMethodOption(options),
	}
	resp := new(resendAppTicketResp)

	response, err := r.cli.RawRequest(ctx, req, resp)
	return resp.Data, response, err
}

// MockAuthResendAppTicket mock AuthResendAppTicket method
func (r *Mock) MockAuthResendAppTicket(f func(ctx context.Context, request *ResendAppTicketReq, options ...MethodOptionFunc) (*ResendAppTicketResp, *Response, error)) {
	r.mockAuthResendAppTicket = f
}

// UnMockAuthResendAppTicket un-mock AuthResendAppTicket method
func (r *Mock) UnMockAuthResendAppTicket() {
	r.mockAuthResendAppTicket = nil
}

// ResendAppTicketReq ...
type ResendAppTicketReq struct {
	AppID     string `json:"app_id,omitempty"`     // 应用唯一标识, 创建应用后获得。有关`app_id` 的详细介绍。请参考[通用参数](https://open.feishu.cn/document/ukTMukTMukTM/uYTM5UjL2ETO14iNxkTN/terminology)介绍, 示例值: "cli_slkdjalasdkjasd"
	AppSecret string `json:"app_secret,omitempty"` // 应用秘钥, 创建应用后获得。有关 `app_secret` 的详细介绍, 请参考[通用参数](https://open.feishu.cn/document/ukTMukTMukTM/uYTM5UjL2ETO14iNxkTN/terminology)介绍, 示例值: "dskLLdkasdjlasdKK"
}

// ResendAppTicketResp ...
type ResendAppTicketResp struct {
}

// resendAppTicketResp ...
type resendAppTicketResp struct {
	Code  int64                `json:"code,omitempty"` // 错误码, 非 0 表示失败
	Msg   string               `json:"msg,omitempty"`  // 错误描述
	Data  *ResendAppTicketResp `json:"data,omitempty"`
	Error *ErrorDetail         `json:"error,omitempty"`
}
