// 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 (
	"github.com/chyroc/lark/internal"
)

// OpenChat 打开聊天页面
//
// 打开一个聊天页面，单聊会话或群聊会话
//
// doc: https://open.feishu.cn/document/uAjLw4CM/uYjL24iN/applink-protocol/supported-protocol/open-a-chat-page
// new doc: https://open.feishu.cn/document/common-capabilities/applink-protocol/supported-protocol/open-a-chat-page
func (r *AppLinkService) OpenChat(req *OpenChatReq) string {
	return internal.JoinAppLinkURL("https://applink.feishu.cn/client/chat/open", req)
}

// OpenChatReq ...
type OpenChatReq struct {
	OpenID     *string `json:"openId,omitempty"`     // 用户 openId, 获取方式可以参考文档: [如何获取不同的用户 ID](https://open.feishu.cn/document/home/user-identity-introduction/open-id)
	OpenChatID *string `json:"openChatId,omitempty"` // 会话ID, 包括单聊会话和群聊会话。是以 'oc' 开头的字段, 获取方式可参考文档 [群ID说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-id-description)<BR>示例值: oc_41e7bdf4877cfc316136f4ccf6c32613
}
