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

// GetDriveDocRawContent 此接口只支持查询旧版文档纯文本内容。要查询新版文档（文档类型: `docx`）的纯文本内容, 使用[获取文档纯文本内容](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/raw_content)接口。
//
// 该接口用于获取文档的纯文本内容, 不包含富文本格式信息。
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/ukzNzUjL5czM14SO3MTN
// new doc: https://open.feishu.cn/document/server-docs/docs/docs/docs/content/obtain-document-content
//
// Deprecated
func (r *DriveService) GetDriveDocRawContent(ctx context.Context, request *GetDriveDocRawContentReq, options ...MethodOptionFunc) (*GetDriveDocRawContentResp, *Response, error) {
	if r.cli.mock.mockDriveGetDriveDocRawContent != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Drive#GetDriveDocRawContent mock enable")
		return r.cli.mock.mockDriveGetDriveDocRawContent(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Drive",
		API:                   "GetDriveDocRawContent",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/doc/v2/:docToken/raw_content",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
		NeedUserAccessToken:   true,
	}
	resp := new(getDriveDocRawContentResp)

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

// MockDriveGetDriveDocRawContent mock DriveGetDriveDocRawContent method
func (r *Mock) MockDriveGetDriveDocRawContent(f func(ctx context.Context, request *GetDriveDocRawContentReq, options ...MethodOptionFunc) (*GetDriveDocRawContentResp, *Response, error)) {
	r.mockDriveGetDriveDocRawContent = f
}

// UnMockDriveGetDriveDocRawContent un-mock DriveGetDriveDocRawContent method
func (r *Mock) UnMockDriveGetDriveDocRawContent() {
	r.mockDriveGetDriveDocRawContent = nil
}

// GetDriveDocRawContentReq ...
type GetDriveDocRawContentReq struct {
	DocToken string `path:"docToken" json:"-"` // 获取方式详见 [如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN#08bb5df6)
}

// GetDriveDocRawContentResp ...
type GetDriveDocRawContentResp struct {
	Content string `json:"content,omitempty"` // 如: string
}

// getDriveDocRawContentResp ...
type getDriveDocRawContentResp struct {
	Code  int64                      `json:"code,omitempty"`
	Msg   string                     `json:"msg,omitempty"`
	Data  *GetDriveDocRawContentResp `json:"data,omitempty"`
	Error *ErrorDetail               `json:"error,omitempty"`
}
