// Package docs code generated by oapi sdk gen
/*
 * MIT License
 *
 * Copyright (c) 2022 Lark Technologies Pte. Ltd.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package larkdocs

import (
	"fmt"

	"github.com/larksuite/oapi-sdk-go/v3/core"
)

const (
	DocTypeDOCX = "docx" // 新版文档
)

const (
	ContentTypeMarkdown = "markdown" // Markdown 格式
)

const (
	LangZH = "zh" // 中文
	LangEN = "en" // 英文
	LangJA = "ja" // 日文
)

type DepartmentId struct {
	DepartmentId *string `json:"department_id,omitempty"` //

	OpenDepartmentId *string `json:"open_department_id,omitempty"` //
}

type DepartmentIdBuilder struct {
	departmentId     string //
	departmentIdFlag bool

	openDepartmentId     string //
	openDepartmentIdFlag bool
}

func NewDepartmentIdBuilder() *DepartmentIdBuilder {
	builder := &DepartmentIdBuilder{}
	return builder
}

//
//
// 示例值：
func (builder *DepartmentIdBuilder) DepartmentId(departmentId string) *DepartmentIdBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

//
//
// 示例值：
func (builder *DepartmentIdBuilder) OpenDepartmentId(openDepartmentId string) *DepartmentIdBuilder {
	builder.openDepartmentId = openDepartmentId
	builder.openDepartmentIdFlag = true
	return builder
}

func (builder *DepartmentIdBuilder) Build() *DepartmentId {
	req := &DepartmentId{}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	if builder.openDepartmentIdFlag {
		req.OpenDepartmentId = &builder.openDepartmentId

	}
	return req
}

type GetContentReqBuilder struct {
	apiReq *larkcore.ApiReq
}

func NewGetContentReqBuilder() *GetContentReqBuilder {
	builder := &GetContentReqBuilder{}
	builder.apiReq = &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	return builder
}

// 文档唯一标识
//
// 示例值：B4EPdAYx8oi8HRxgPQQbM15UcBf
func (builder *GetContentReqBuilder) DocToken(docToken string) *GetContentReqBuilder {
	builder.apiReq.QueryParams.Set("doc_token", fmt.Sprint(docToken))
	return builder
}

// 文档类型
//
// 示例值：docx
func (builder *GetContentReqBuilder) DocType(docType string) *GetContentReqBuilder {
	builder.apiReq.QueryParams.Set("doc_type", fmt.Sprint(docType))
	return builder
}

// 内容类型
//
// 示例值：markdown
func (builder *GetContentReqBuilder) ContentType(contentType string) *GetContentReqBuilder {
	builder.apiReq.QueryParams.Set("content_type", fmt.Sprint(contentType))
	return builder
}

// 语言
//
// 示例值：zh
func (builder *GetContentReqBuilder) Lang(lang string) *GetContentReqBuilder {
	builder.apiReq.QueryParams.Set("lang", fmt.Sprint(lang))
	return builder
}

func (builder *GetContentReqBuilder) Build() *GetContentReq {
	req := &GetContentReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	return req
}

type GetContentReq struct {
	apiReq *larkcore.ApiReq
}

type GetContentRespData struct {
	Content *string `json:"content,omitempty"` // 内容
}

type GetContentResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
	Data *GetContentRespData `json:"data"` // 业务数据
}

func (resp *GetContentResp) Success() bool {
	return resp.Code == 0
}
