// Package mdm 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 larkmdm

import (
	"fmt"

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

const (
	UserIdTypeUserId  = "user_id"  // 以user_id来识别用户
	UserIdTypeUnionId = "union_id" // 以union_id来识别用户
	UserIdTypeOpenId  = "open_id"  // 以open_id来识别用户
)

const (
	UserIdTypeUnbindUserAuthDataRelationUserId  = "user_id"  // 以user_id来识别用户
	UserIdTypeUnbindUserAuthDataRelationUnionId = "union_id" // 以union_id来识别用户
	UserIdTypeUnbindUserAuthDataRelationOpenId  = "open_id"  // 以open_id来识别用户
)

type Appendix struct {
	FileId *string `json:"file_id,omitempty"` // 文件id(文件的唯一标识)

	FileName *string `json:"file_name,omitempty"` // 文件名称

	FileType *string `json:"file_type,omitempty"` // 文件类型

	FileSize *int `json:"file_size,omitempty"` // 文件大小

	DownloadUrl *string `json:"download_url,omitempty"` // 文件下载地址
}

type AppendixBuilder struct {
	fileId     string // 文件id(文件的唯一标识)
	fileIdFlag bool

	fileName     string // 文件名称
	fileNameFlag bool

	fileType     string // 文件类型
	fileTypeFlag bool

	fileSize     int // 文件大小
	fileSizeFlag bool

	downloadUrl     string // 文件下载地址
	downloadUrlFlag bool
}

func NewAppendixBuilder() *AppendixBuilder {
	builder := &AppendixBuilder{}
	return builder
}

// 文件id(文件的唯一标识)
//
// 示例值：5c7237e821a8409d9b8b2e1041cdc9a4
func (builder *AppendixBuilder) FileId(fileId string) *AppendixBuilder {
	builder.fileId = fileId
	builder.fileIdFlag = true
	return builder
}

// 文件名称
//
// 示例值：附件
func (builder *AppendixBuilder) FileName(fileName string) *AppendixBuilder {
	builder.fileName = fileName
	builder.fileNameFlag = true
	return builder
}

// 文件类型
//
// 示例值：DOX
func (builder *AppendixBuilder) FileType(fileType string) *AppendixBuilder {
	builder.fileType = fileType
	builder.fileTypeFlag = true
	return builder
}

// 文件大小
//
// 示例值：1024
func (builder *AppendixBuilder) FileSize(fileSize int) *AppendixBuilder {
	builder.fileSize = fileSize
	builder.fileSizeFlag = true
	return builder
}

// 文件下载地址
//
// 示例值：http://download.com/xxxxx
func (builder *AppendixBuilder) DownloadUrl(downloadUrl string) *AppendixBuilder {
	builder.downloadUrl = downloadUrl
	builder.downloadUrlFlag = true
	return builder
}

func (builder *AppendixBuilder) Build() *Appendix {
	req := &Appendix{}
	if builder.fileIdFlag {
		req.FileId = &builder.fileId

	}
	if builder.fileNameFlag {
		req.FileName = &builder.fileName

	}
	if builder.fileTypeFlag {
		req.FileType = &builder.fileType

	}
	if builder.fileSizeFlag {
		req.FileSize = &builder.fileSize

	}
	if builder.downloadUrlFlag {
		req.DownloadUrl = &builder.downloadUrl

	}
	return req
}

type Company struct {
	CompanyCode *string `json:"company_code,omitempty"` // 公司编码

	CompanyName *string `json:"company_name,omitempty"` // 公司名称

	CompanyUid *string `json:"company_uid,omitempty"` // 公司唯一ID

	LegalEntityCode *string `json:"legal_entity_code,omitempty"` // 法人实体编码

	CoAreaCode *string `json:"co_area_code,omitempty"` // 控制范围编码

	CurrencyCode *string `json:"currency_code,omitempty"` // 币种三字码

	CountryCode *string `json:"country_code,omitempty"` // 国家二字码

	CompanyNameEn *string `json:"company_name_en,omitempty"` // 公司英文名
}

type CompanyBuilder struct {
	companyCode     string // 公司编码
	companyCodeFlag bool

	companyName     string // 公司名称
	companyNameFlag bool

	companyUid     string // 公司唯一ID
	companyUidFlag bool

	legalEntityCode     string // 法人实体编码
	legalEntityCodeFlag bool

	coAreaCode     string // 控制范围编码
	coAreaCodeFlag bool

	currencyCode     string // 币种三字码
	currencyCodeFlag bool

	countryCode     string // 国家二字码
	countryCodeFlag bool

	companyNameEn     string // 公司英文名
	companyNameEnFlag bool
}

func NewCompanyBuilder() *CompanyBuilder {
	builder := &CompanyBuilder{}
	return builder
}

// 公司编码
//
// 示例值：9011
func (builder *CompanyBuilder) CompanyCode(companyCode string) *CompanyBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 公司名称
//
// 示例值：xxx科技有限公司
func (builder *CompanyBuilder) CompanyName(companyName string) *CompanyBuilder {
	builder.companyName = companyName
	builder.companyNameFlag = true
	return builder
}

// 公司唯一ID
//
// 示例值：U1404700189381369856
func (builder *CompanyBuilder) CompanyUid(companyUid string) *CompanyBuilder {
	builder.companyUid = companyUid
	builder.companyUidFlag = true
	return builder
}

// 法人实体编码
//
// 示例值：U1404691637455560704
func (builder *CompanyBuilder) LegalEntityCode(legalEntityCode string) *CompanyBuilder {
	builder.legalEntityCode = legalEntityCode
	builder.legalEntityCodeFlag = true
	return builder
}

// 控制范围编码
//
// 示例值：HL00
func (builder *CompanyBuilder) CoAreaCode(coAreaCode string) *CompanyBuilder {
	builder.coAreaCode = coAreaCode
	builder.coAreaCodeFlag = true
	return builder
}

// 币种三字码
//
// 示例值：CNY
func (builder *CompanyBuilder) CurrencyCode(currencyCode string) *CompanyBuilder {
	builder.currencyCode = currencyCode
	builder.currencyCodeFlag = true
	return builder
}

// 国家二字码
//
// 示例值：CN
func (builder *CompanyBuilder) CountryCode(countryCode string) *CompanyBuilder {
	builder.countryCode = countryCode
	builder.countryCodeFlag = true
	return builder
}

// 公司英文名
//
// 示例值：Bei**n**S**g**n**e**a**T**h**l**y**o** **d
func (builder *CompanyBuilder) CompanyNameEn(companyNameEn string) *CompanyBuilder {
	builder.companyNameEn = companyNameEn
	builder.companyNameEnFlag = true
	return builder
}

func (builder *CompanyBuilder) Build() *Company {
	req := &Company{}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.companyNameFlag {
		req.CompanyName = &builder.companyName

	}
	if builder.companyUidFlag {
		req.CompanyUid = &builder.companyUid

	}
	if builder.legalEntityCodeFlag {
		req.LegalEntityCode = &builder.legalEntityCode

	}
	if builder.coAreaCodeFlag {
		req.CoAreaCode = &builder.coAreaCode

	}
	if builder.currencyCodeFlag {
		req.CurrencyCode = &builder.currencyCode

	}
	if builder.countryCodeFlag {
		req.CountryCode = &builder.countryCode

	}
	if builder.companyNameEnFlag {
		req.CompanyNameEn = &builder.companyNameEn

	}
	return req
}

type CompanyAsset struct {
	AssetUid *string `json:"asset_uid,omitempty"` // 资产唯一ID

	AssetSubNo *string `json:"asset_sub_no,omitempty"` // 资产子编码

	AssetType *string `json:"asset_type,omitempty"` // 资产类型编码

	AssetTypeName *string `json:"asset_type_name,omitempty"` // 资产类型描述

	AssetName *string `json:"asset_name,omitempty"` // 资产描述

	Quantity *int `json:"quantity,omitempty"` // 资产数量

	Unit *string `json:"unit,omitempty"` // 资产计量单位

	CompanyUid *string `json:"company_uid,omitempty"` // 资产所属公司的唯一ID

	AssetTypeNameEn *string `json:"asset_type_name_en,omitempty"` // 资产类型英文描述

	AssetNo *string `json:"asset_no,omitempty"` // 资产编码
}

type CompanyAssetBuilder struct {
	assetUid     string // 资产唯一ID
	assetUidFlag bool

	assetSubNo     string // 资产子编码
	assetSubNoFlag bool

	assetType     string // 资产类型编码
	assetTypeFlag bool

	assetTypeName     string // 资产类型描述
	assetTypeNameFlag bool

	assetName     string // 资产描述
	assetNameFlag bool

	quantity     int // 资产数量
	quantityFlag bool

	unit     string // 资产计量单位
	unitFlag bool

	companyUid     string // 资产所属公司的唯一ID
	companyUidFlag bool

	assetTypeNameEn     string // 资产类型英文描述
	assetTypeNameEnFlag bool

	assetNo     string // 资产编码
	assetNoFlag bool
}

func NewCompanyAssetBuilder() *CompanyAssetBuilder {
	builder := &CompanyAssetBuilder{}
	return builder
}

// 资产唯一ID
//
// 示例值：U1404709301842354176
func (builder *CompanyAssetBuilder) AssetUid(assetUid string) *CompanyAssetBuilder {
	builder.assetUid = assetUid
	builder.assetUidFlag = true
	return builder
}

// 资产子编码
//
// 示例值：0
func (builder *CompanyAssetBuilder) AssetSubNo(assetSubNo string) *CompanyAssetBuilder {
	builder.assetSubNo = assetSubNo
	builder.assetSubNoFlag = true
	return builder
}

// 资产类型编码
//
// 示例值：1000
func (builder *CompanyAssetBuilder) AssetType(assetType string) *CompanyAssetBuilder {
	builder.assetType = assetType
	builder.assetTypeFlag = true
	return builder
}

// 资产类型描述
//
// 示例值：设计软件
func (builder *CompanyAssetBuilder) AssetTypeName(assetTypeName string) *CompanyAssetBuilder {
	builder.assetTypeName = assetTypeName
	builder.assetTypeNameFlag = true
	return builder
}

// 资产描述
//
// 示例值：设计类软件AutoCAD
func (builder *CompanyAssetBuilder) AssetName(assetName string) *CompanyAssetBuilder {
	builder.assetName = assetName
	builder.assetNameFlag = true
	return builder
}

// 资产数量
//
// 示例值：40
func (builder *CompanyAssetBuilder) Quantity(quantity int) *CompanyAssetBuilder {
	builder.quantity = quantity
	builder.quantityFlag = true
	return builder
}

// 资产计量单位
//
// 示例值：Suit
func (builder *CompanyAssetBuilder) Unit(unit string) *CompanyAssetBuilder {
	builder.unit = unit
	builder.unitFlag = true
	return builder
}

// 资产所属公司的唯一ID
//
// 示例值：U1404700168376295424
func (builder *CompanyAssetBuilder) CompanyUid(companyUid string) *CompanyAssetBuilder {
	builder.companyUid = companyUid
	builder.companyUidFlag = true
	return builder
}

// 资产类型英文描述
//
// 示例值：Fixed assets
func (builder *CompanyAssetBuilder) AssetTypeNameEn(assetTypeNameEn string) *CompanyAssetBuilder {
	builder.assetTypeNameEn = assetTypeNameEn
	builder.assetTypeNameEnFlag = true
	return builder
}

// 资产编码
//
// 示例值：100010010001
func (builder *CompanyAssetBuilder) AssetNo(assetNo string) *CompanyAssetBuilder {
	builder.assetNo = assetNo
	builder.assetNoFlag = true
	return builder
}

func (builder *CompanyAssetBuilder) Build() *CompanyAsset {
	req := &CompanyAsset{}
	if builder.assetUidFlag {
		req.AssetUid = &builder.assetUid

	}
	if builder.assetSubNoFlag {
		req.AssetSubNo = &builder.assetSubNo

	}
	if builder.assetTypeFlag {
		req.AssetType = &builder.assetType

	}
	if builder.assetTypeNameFlag {
		req.AssetTypeName = &builder.assetTypeName

	}
	if builder.assetNameFlag {
		req.AssetName = &builder.assetName

	}
	if builder.quantityFlag {
		req.Quantity = &builder.quantity

	}
	if builder.unitFlag {
		req.Unit = &builder.unit

	}
	if builder.companyUidFlag {
		req.CompanyUid = &builder.companyUid

	}
	if builder.assetTypeNameEnFlag {
		req.AssetTypeNameEn = &builder.assetTypeNameEn

	}
	if builder.assetNoFlag {
		req.AssetNo = &builder.assetNo

	}
	return req
}

type CompanyCompanyBankAccount struct {
	CompanyBankAccountUid *string `json:"company_bank_account_uid,omitempty"` // 公司银行账号唯一ID

	CompanyUid *string `json:"company_uid,omitempty"` // 公司唯一ID

	Account *string `json:"account,omitempty"` // 银行账号

	Iban *string `json:"iban,omitempty"` // 国际银行账号

	AccountName *string `json:"account_name,omitempty"` // 开户名

	CurrencyCode *string `json:"currency_code,omitempty"` // 币种三字码

	LocalRoutingCode *string `json:"local_routing_code,omitempty"` // 银行本地清算代码

	GlAccountCode *string `json:"gl_account_code,omitempty"` // 总账科目编码

	ClearingAccountCode *string `json:"clearing_account_code,omitempty"` // 清算科目编码

	Swift *string `json:"swift,omitempty"` // swift

	AccountAttriDesc *string `json:"account_attri_desc,omitempty"` // 账户属性描述

	I18nAccountAttriDesc []*I18nStruct `json:"i18n_account_attri_desc,omitempty"` // 账户属性描述多语言
}

type CompanyCompanyBankAccountBuilder struct {
	companyBankAccountUid     string // 公司银行账号唯一ID
	companyBankAccountUidFlag bool

	companyUid     string // 公司唯一ID
	companyUidFlag bool

	account     string // 银行账号
	accountFlag bool

	iban     string // 国际银行账号
	ibanFlag bool

	accountName     string // 开户名
	accountNameFlag bool

	currencyCode     string // 币种三字码
	currencyCodeFlag bool

	localRoutingCode     string // 银行本地清算代码
	localRoutingCodeFlag bool

	glAccountCode     string // 总账科目编码
	glAccountCodeFlag bool

	clearingAccountCode     string // 清算科目编码
	clearingAccountCodeFlag bool

	swift     string // swift
	swiftFlag bool

	accountAttriDesc     string // 账户属性描述
	accountAttriDescFlag bool

	i18nAccountAttriDesc     []*I18nStruct // 账户属性描述多语言
	i18nAccountAttriDescFlag bool
}

func NewCompanyCompanyBankAccountBuilder() *CompanyCompanyBankAccountBuilder {
	builder := &CompanyCompanyBankAccountBuilder{}
	return builder
}

// 公司银行账号唯一ID
//
// 示例值：U1409787258113892352
func (builder *CompanyCompanyBankAccountBuilder) CompanyBankAccountUid(companyBankAccountUid string) *CompanyCompanyBankAccountBuilder {
	builder.companyBankAccountUid = companyBankAccountUid
	builder.companyBankAccountUidFlag = true
	return builder
}

// 公司唯一ID
//
// 示例值：U1409787216334430208
func (builder *CompanyCompanyBankAccountBuilder) CompanyUid(companyUid string) *CompanyCompanyBankAccountBuilder {
	builder.companyUid = companyUid
	builder.companyUidFlag = true
	return builder
}

// 银行账号
//
// 示例值：642*********423
func (builder *CompanyCompanyBankAccountBuilder) Account(account string) *CompanyCompanyBankAccountBuilder {
	builder.account = account
	builder.accountFlag = true
	return builder
}

// 国际银行账号
//
// 示例值：ES7921000813610123456789
func (builder *CompanyCompanyBankAccountBuilder) Iban(iban string) *CompanyCompanyBankAccountBuilder {
	builder.iban = iban
	builder.ibanFlag = true
	return builder
}

// 开户名
//
// 示例值：xxx有限公司
func (builder *CompanyCompanyBankAccountBuilder) AccountName(accountName string) *CompanyCompanyBankAccountBuilder {
	builder.accountName = accountName
	builder.accountNameFlag = true
	return builder
}

// 币种三字码
//
// 示例值：CNY
func (builder *CompanyCompanyBankAccountBuilder) CurrencyCode(currencyCode string) *CompanyCompanyBankAccountBuilder {
	builder.currencyCode = currencyCode
	builder.currencyCodeFlag = true
	return builder
}

// 银行本地清算代码
//
// 示例值：308290003732
func (builder *CompanyCompanyBankAccountBuilder) LocalRoutingCode(localRoutingCode string) *CompanyCompanyBankAccountBuilder {
	builder.localRoutingCode = localRoutingCode
	builder.localRoutingCodeFlag = true
	return builder
}

// 总账科目编码
//
// 示例值：10020102
func (builder *CompanyCompanyBankAccountBuilder) GlAccountCode(glAccountCode string) *CompanyCompanyBankAccountBuilder {
	builder.glAccountCode = glAccountCode
	builder.glAccountCodeFlag = true
	return builder
}

// 清算科目编码
//
// 示例值：10020102
func (builder *CompanyCompanyBankAccountBuilder) ClearingAccountCode(clearingAccountCode string) *CompanyCompanyBankAccountBuilder {
	builder.clearingAccountCode = clearingAccountCode
	builder.clearingAccountCodeFlag = true
	return builder
}

// swift
//
// 示例值：95566
func (builder *CompanyCompanyBankAccountBuilder) Swift(swift string) *CompanyCompanyBankAccountBuilder {
	builder.swift = swift
	builder.swiftFlag = true
	return builder
}

// 账户属性描述
//
// 示例值：支出户
func (builder *CompanyCompanyBankAccountBuilder) AccountAttriDesc(accountAttriDesc string) *CompanyCompanyBankAccountBuilder {
	builder.accountAttriDesc = accountAttriDesc
	builder.accountAttriDescFlag = true
	return builder
}

// 账户属性描述多语言
//
// 示例值：
func (builder *CompanyCompanyBankAccountBuilder) I18nAccountAttriDesc(i18nAccountAttriDesc []*I18nStruct) *CompanyCompanyBankAccountBuilder {
	builder.i18nAccountAttriDesc = i18nAccountAttriDesc
	builder.i18nAccountAttriDescFlag = true
	return builder
}

func (builder *CompanyCompanyBankAccountBuilder) Build() *CompanyCompanyBankAccount {
	req := &CompanyCompanyBankAccount{}
	if builder.companyBankAccountUidFlag {
		req.CompanyBankAccountUid = &builder.companyBankAccountUid

	}
	if builder.companyUidFlag {
		req.CompanyUid = &builder.companyUid

	}
	if builder.accountFlag {
		req.Account = &builder.account

	}
	if builder.ibanFlag {
		req.Iban = &builder.iban

	}
	if builder.accountNameFlag {
		req.AccountName = &builder.accountName

	}
	if builder.currencyCodeFlag {
		req.CurrencyCode = &builder.currencyCode

	}
	if builder.localRoutingCodeFlag {
		req.LocalRoutingCode = &builder.localRoutingCode

	}
	if builder.glAccountCodeFlag {
		req.GlAccountCode = &builder.glAccountCode

	}
	if builder.clearingAccountCodeFlag {
		req.ClearingAccountCode = &builder.clearingAccountCode

	}
	if builder.swiftFlag {
		req.Swift = &builder.swift

	}
	if builder.accountAttriDescFlag {
		req.AccountAttriDesc = &builder.accountAttriDesc

	}
	if builder.i18nAccountAttriDescFlag {
		req.I18nAccountAttriDesc = builder.i18nAccountAttriDesc
	}
	return req
}

type Config struct {
	FieldCode *string `json:"field_code,omitempty"` // 字段编码

	FieldName *string `json:"field_name,omitempty"` // 字段名称

	Module *int `json:"module,omitempty"` // 模块分组

	FieldDescribe *string `json:"field_describe,omitempty"` // 字段描述

	Sys *int `json:"sys,omitempty"` // 是否系统字段

	FieldType *int `json:"field_type,omitempty"` // 字段类型

	Required *int `json:"required,omitempty"` // 是否必填

	Status *int `json:"status,omitempty"` // 是否启用

	FieldVersion *int `json:"field_version,omitempty"` // 当前最新版本号
}

type ConfigBuilder struct {
	fieldCode     string // 字段编码
	fieldCodeFlag bool

	fieldName     string // 字段名称
	fieldNameFlag bool

	module     int // 模块分组
	moduleFlag bool

	fieldDescribe     string // 字段描述
	fieldDescribeFlag bool

	sys     int // 是否系统字段
	sysFlag bool

	fieldType     int // 字段类型
	fieldTypeFlag bool

	required     int // 是否必填
	requiredFlag bool

	status     int // 是否启用
	statusFlag bool

	fieldVersion     int // 当前最新版本号
	fieldVersionFlag bool
}

func NewConfigBuilder() *ConfigBuilder {
	builder := &ConfigBuilder{}
	return builder
}

// 字段编码
//
// 示例值：V00000001
func (builder *ConfigBuilder) FieldCode(fieldCode string) *ConfigBuilder {
	builder.fieldCode = fieldCode
	builder.fieldCodeFlag = true
	return builder
}

// 字段名称
//
// 示例值：字段1
func (builder *ConfigBuilder) FieldName(fieldName string) *ConfigBuilder {
	builder.fieldName = fieldName
	builder.fieldNameFlag = true
	return builder
}

// 模块分组
//
// 示例值：0
func (builder *ConfigBuilder) Module(module int) *ConfigBuilder {
	builder.module = module
	builder.moduleFlag = true
	return builder
}

// 字段描述
//
// 示例值：字段描述
func (builder *ConfigBuilder) FieldDescribe(fieldDescribe string) *ConfigBuilder {
	builder.fieldDescribe = fieldDescribe
	builder.fieldDescribeFlag = true
	return builder
}

// 是否系统字段
//
// 示例值：0
func (builder *ConfigBuilder) Sys(sys int) *ConfigBuilder {
	builder.sys = sys
	builder.sysFlag = true
	return builder
}

// 字段类型
//
// 示例值：
func (builder *ConfigBuilder) FieldType(fieldType int) *ConfigBuilder {
	builder.fieldType = fieldType
	builder.fieldTypeFlag = true
	return builder
}

// 是否必填
//
// 示例值：0
func (builder *ConfigBuilder) Required(required int) *ConfigBuilder {
	builder.required = required
	builder.requiredFlag = true
	return builder
}

// 是否启用
//
// 示例值：0
func (builder *ConfigBuilder) Status(status int) *ConfigBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 当前最新版本号
//
// 示例值：1
func (builder *ConfigBuilder) FieldVersion(fieldVersion int) *ConfigBuilder {
	builder.fieldVersion = fieldVersion
	builder.fieldVersionFlag = true
	return builder
}

func (builder *ConfigBuilder) Build() *Config {
	req := &Config{}
	if builder.fieldCodeFlag {
		req.FieldCode = &builder.fieldCode

	}
	if builder.fieldNameFlag {
		req.FieldName = &builder.fieldName

	}
	if builder.moduleFlag {
		req.Module = &builder.module

	}
	if builder.fieldDescribeFlag {
		req.FieldDescribe = &builder.fieldDescribe

	}
	if builder.sysFlag {
		req.Sys = &builder.sys

	}
	if builder.fieldTypeFlag {
		req.FieldType = &builder.fieldType

	}
	if builder.requiredFlag {
		req.Required = &builder.required

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.fieldVersionFlag {
		req.FieldVersion = &builder.fieldVersion

	}
	return req
}

type CostCenter struct {
	CostCenterUid *string `json:"cost_center_uid,omitempty"` // 成本中心唯一ID

	CostCenterCode *string `json:"cost_center_code,omitempty"` // 成本中心编码

	I18nCostCenterName []*I18nStruct `json:"i18n_cost_center_name,omitempty"` // 成本中心名称多语言配置

	ResponsibleUserUnionId *string `json:"responsible_user_union_id,omitempty"` // 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)

	CoAreaCode *string `json:"co_area_code,omitempty"` // 控制范围编码

	CompanyCode *string `json:"company_code,omitempty"` // 公司唯一ID

	ProfitCenterCode *string `json:"profit_center_code,omitempty"` // 利润中心编码

	BusinessArea *string `json:"business_area,omitempty"` // 业务范围

	FeeType *string `json:"fee_type,omitempty"` // 费用类型

	ValidTo *string `json:"valid_to,omitempty"` // 有效期至（yyyy-MM-dd）

	CostCenterName *string `json:"cost_center_name,omitempty"` // 成本中心名称

	CompanyCodeList []string `json:"company_code_list,omitempty"` // 公司编码列表
}

type CostCenterBuilder struct {
	costCenterUid     string // 成本中心唯一ID
	costCenterUidFlag bool

	costCenterCode     string // 成本中心编码
	costCenterCodeFlag bool

	i18nCostCenterName     []*I18nStruct // 成本中心名称多语言配置
	i18nCostCenterNameFlag bool

	responsibleUserUnionId     string // 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)
	responsibleUserUnionIdFlag bool

	coAreaCode     string // 控制范围编码
	coAreaCodeFlag bool

	companyCode     string // 公司唯一ID
	companyCodeFlag bool

	profitCenterCode     string // 利润中心编码
	profitCenterCodeFlag bool

	businessArea     string // 业务范围
	businessAreaFlag bool

	feeType     string // 费用类型
	feeTypeFlag bool

	validTo     string // 有效期至（yyyy-MM-dd）
	validToFlag bool

	costCenterName     string // 成本中心名称
	costCenterNameFlag bool

	companyCodeList     []string // 公司编码列表
	companyCodeListFlag bool
}

func NewCostCenterBuilder() *CostCenterBuilder {
	builder := &CostCenterBuilder{}
	return builder
}

// 成本中心唯一ID
//
// 示例值：U1404779844306214912
func (builder *CostCenterBuilder) CostCenterUid(costCenterUid string) *CostCenterBuilder {
	builder.costCenterUid = costCenterUid
	builder.costCenterUidFlag = true
	return builder
}

// 成本中心编码
//
// 示例值：1002000100
func (builder *CostCenterBuilder) CostCenterCode(costCenterCode string) *CostCenterBuilder {
	builder.costCenterCode = costCenterCode
	builder.costCenterCodeFlag = true
	return builder
}

// 成本中心名称多语言配置
//
// 示例值：总经理办公室
func (builder *CostCenterBuilder) I18nCostCenterName(i18nCostCenterName []*I18nStruct) *CostCenterBuilder {
	builder.i18nCostCenterName = i18nCostCenterName
	builder.i18nCostCenterNameFlag = true
	return builder
}

// 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)
//
// 示例值：8763419
func (builder *CostCenterBuilder) ResponsibleUserUnionId(responsibleUserUnionId string) *CostCenterBuilder {
	builder.responsibleUserUnionId = responsibleUserUnionId
	builder.responsibleUserUnionIdFlag = true
	return builder
}

// 控制范围编码
//
// 示例值：HL01
func (builder *CostCenterBuilder) CoAreaCode(coAreaCode string) *CostCenterBuilder {
	builder.coAreaCode = coAreaCode
	builder.coAreaCodeFlag = true
	return builder
}

// 公司唯一ID
//
// 示例值：U1404700185187065856
func (builder *CostCenterBuilder) CompanyCode(companyCode string) *CostCenterBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 利润中心编码
//
// 示例值：100101
func (builder *CostCenterBuilder) ProfitCenterCode(profitCenterCode string) *CostCenterBuilder {
	builder.profitCenterCode = profitCenterCode
	builder.profitCenterCodeFlag = true
	return builder
}

// 业务范围
//
// 示例值：FIC
func (builder *CostCenterBuilder) BusinessArea(businessArea string) *CostCenterBuilder {
	builder.businessArea = businessArea
	builder.businessAreaFlag = true
	return builder
}

// 费用类型
//
// 示例值：Administration
func (builder *CostCenterBuilder) FeeType(feeType string) *CostCenterBuilder {
	builder.feeType = feeType
	builder.feeTypeFlag = true
	return builder
}

// 有效期至（yyyy-MM-dd）
//
// 示例值：9999-12-31
func (builder *CostCenterBuilder) ValidTo(validTo string) *CostCenterBuilder {
	builder.validTo = validTo
	builder.validToFlag = true
	return builder
}

// 成本中心名称
//
// 示例值：总经理办公室
func (builder *CostCenterBuilder) CostCenterName(costCenterName string) *CostCenterBuilder {
	builder.costCenterName = costCenterName
	builder.costCenterNameFlag = true
	return builder
}

// 公司编码列表
//
// 示例值：s1001
func (builder *CostCenterBuilder) CompanyCodeList(companyCodeList []string) *CostCenterBuilder {
	builder.companyCodeList = companyCodeList
	builder.companyCodeListFlag = true
	return builder
}

func (builder *CostCenterBuilder) Build() *CostCenter {
	req := &CostCenter{}
	if builder.costCenterUidFlag {
		req.CostCenterUid = &builder.costCenterUid

	}
	if builder.costCenterCodeFlag {
		req.CostCenterCode = &builder.costCenterCode

	}
	if builder.i18nCostCenterNameFlag {
		req.I18nCostCenterName = builder.i18nCostCenterName
	}
	if builder.responsibleUserUnionIdFlag {
		req.ResponsibleUserUnionId = &builder.responsibleUserUnionId

	}
	if builder.coAreaCodeFlag {
		req.CoAreaCode = &builder.coAreaCode

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.profitCenterCodeFlag {
		req.ProfitCenterCode = &builder.profitCenterCode

	}
	if builder.businessAreaFlag {
		req.BusinessArea = &builder.businessArea

	}
	if builder.feeTypeFlag {
		req.FeeType = &builder.feeType

	}
	if builder.validToFlag {
		req.ValidTo = &builder.validTo

	}
	if builder.costCenterNameFlag {
		req.CostCenterName = &builder.costCenterName

	}
	if builder.companyCodeListFlag {
		req.CompanyCodeList = builder.companyCodeList
	}
	return req
}

type DepartmentCostCenterRelationship struct {
	DepartmentCostCenterRelationshipUid *string `json:"department_cost_center_relationship_uid,omitempty"` // 部门成本中心关系唯一ID

	CompanyCode *string `json:"company_code,omitempty"` // 公司编码

	OpenDepartmentId *string `json:"open_department_id,omitempty"` // 部门open id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)

	CostCenterCode *string `json:"cost_center_code,omitempty"` // 成本中心代码

	DepartmentId *string `json:"department_id,omitempty"` // 部门id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)
}

type DepartmentCostCenterRelationshipBuilder struct {
	departmentCostCenterRelationshipUid     string // 部门成本中心关系唯一ID
	departmentCostCenterRelationshipUidFlag bool

	companyCode     string // 公司编码
	companyCodeFlag bool

	openDepartmentId     string // 部门open id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)
	openDepartmentIdFlag bool

	costCenterCode     string // 成本中心代码
	costCenterCodeFlag bool

	departmentId     string // 部门id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)
	departmentIdFlag bool
}

func NewDepartmentCostCenterRelationshipBuilder() *DepartmentCostCenterRelationshipBuilder {
	builder := &DepartmentCostCenterRelationshipBuilder{}
	return builder
}

// 部门成本中心关系唯一ID
//
// 示例值：U1418468581452029052
func (builder *DepartmentCostCenterRelationshipBuilder) DepartmentCostCenterRelationshipUid(departmentCostCenterRelationshipUid string) *DepartmentCostCenterRelationshipBuilder {
	builder.departmentCostCenterRelationshipUid = departmentCostCenterRelationshipUid
	builder.departmentCostCenterRelationshipUidFlag = true
	return builder
}

// 公司编码
//
// 示例值：100101
func (builder *DepartmentCostCenterRelationshipBuilder) CompanyCode(companyCode string) *DepartmentCostCenterRelationshipBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 部门open id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)
//
// 示例值：od-1001
func (builder *DepartmentCostCenterRelationshipBuilder) OpenDepartmentId(openDepartmentId string) *DepartmentCostCenterRelationshipBuilder {
	builder.openDepartmentId = openDepartmentId
	builder.openDepartmentIdFlag = true
	return builder
}

// 成本中心代码
//
// 示例值：1002000100
func (builder *DepartmentCostCenterRelationshipBuilder) CostCenterCode(costCenterCode string) *DepartmentCostCenterRelationshipBuilder {
	builder.costCenterCode = costCenterCode
	builder.costCenterCodeFlag = true
	return builder
}

// 部门id，详细说明参见[部门 ID 说明](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/department/field-overview#23857fe0)
//
// 示例值：1001
func (builder *DepartmentCostCenterRelationshipBuilder) DepartmentId(departmentId string) *DepartmentCostCenterRelationshipBuilder {
	builder.departmentId = departmentId
	builder.departmentIdFlag = true
	return builder
}

func (builder *DepartmentCostCenterRelationshipBuilder) Build() *DepartmentCostCenterRelationship {
	req := &DepartmentCostCenterRelationship{}
	if builder.departmentCostCenterRelationshipUidFlag {
		req.DepartmentCostCenterRelationshipUid = &builder.departmentCostCenterRelationshipUid

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

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

	}
	if builder.costCenterCodeFlag {
		req.CostCenterCode = &builder.costCenterCode

	}
	if builder.departmentIdFlag {
		req.DepartmentId = &builder.departmentId

	}
	return req
}

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 ExtendField struct {
	FieldType *int `json:"field_type,omitempty"` // 字段类型

	FieldValue *string `json:"field_value,omitempty"` // 字段类型为 单行文本框(0)、多行文本框(1)、单选框(3)、下拉单选框(5) 时的值

	Options []string `json:"options,omitempty"` // 字段类型为 多选框(4) 下拉多选(6) 时的值

	Num *float64 `json:"num,omitempty"` // 字段类型为 数字(2) 时的值

	Date *string `json:"date,omitempty"` // 字段类型是 日期(7)时候的值

	RangeDate []string `json:"range_date,omitempty"` // 字段类型是 日期区间(8) 时候的值	数组长度为2	  0-startTime   1-endTime

	FieldCode *string `json:"field_code,omitempty"` // 字段编码

	Appendix []*Appendix `json:"appendix,omitempty"` // 附件列表 字段类型是 附件(12) 时候的值
}

type ExtendFieldBuilder struct {
	fieldType     int // 字段类型
	fieldTypeFlag bool

	fieldValue     string // 字段类型为 单行文本框(0)、多行文本框(1)、单选框(3)、下拉单选框(5) 时的值
	fieldValueFlag bool

	options     []string // 字段类型为 多选框(4) 下拉多选(6) 时的值
	optionsFlag bool

	num     float64 // 字段类型为 数字(2) 时的值
	numFlag bool

	date     string // 字段类型是 日期(7)时候的值
	dateFlag bool

	rangeDate     []string // 字段类型是 日期区间(8) 时候的值	数组长度为2	  0-startTime   1-endTime
	rangeDateFlag bool

	fieldCode     string // 字段编码
	fieldCodeFlag bool

	appendix     []*Appendix // 附件列表 字段类型是 附件(12) 时候的值
	appendixFlag bool
}

func NewExtendFieldBuilder() *ExtendFieldBuilder {
	builder := &ExtendFieldBuilder{}
	return builder
}

// 字段类型
//
// 示例值：0
func (builder *ExtendFieldBuilder) FieldType(fieldType int) *ExtendFieldBuilder {
	builder.fieldType = fieldType
	builder.fieldTypeFlag = true
	return builder
}

// 字段类型为 单行文本框(0)、多行文本框(1)、单选框(3)、下拉单选框(5) 时的值
//
// 示例值：文本值
func (builder *ExtendFieldBuilder) FieldValue(fieldValue string) *ExtendFieldBuilder {
	builder.fieldValue = fieldValue
	builder.fieldValueFlag = true
	return builder
}

// 字段类型为 多选框(4) 下拉多选(6) 时的值
//
// 示例值：["2021-09-23","2021-10-14"]
func (builder *ExtendFieldBuilder) Options(options []string) *ExtendFieldBuilder {
	builder.options = options
	builder.optionsFlag = true
	return builder
}

// 字段类型为 数字(2) 时的值
//
// 示例值：1.11
func (builder *ExtendFieldBuilder) Num(num float64) *ExtendFieldBuilder {
	builder.num = num
	builder.numFlag = true
	return builder
}

// 字段类型是 日期(7)时候的值
//
// 示例值：2021-10-14
func (builder *ExtendFieldBuilder) Date(date string) *ExtendFieldBuilder {
	builder.date = date
	builder.dateFlag = true
	return builder
}

// 字段类型是 日期区间(8) 时候的值	数组长度为2	  0-startTime   1-endTime
//
// 示例值：2021-10-14
func (builder *ExtendFieldBuilder) RangeDate(rangeDate []string) *ExtendFieldBuilder {
	builder.rangeDate = rangeDate
	builder.rangeDateFlag = true
	return builder
}

// 字段编码
//
// 示例值：X00000001
func (builder *ExtendFieldBuilder) FieldCode(fieldCode string) *ExtendFieldBuilder {
	builder.fieldCode = fieldCode
	builder.fieldCodeFlag = true
	return builder
}

// 附件列表 字段类型是 附件(12) 时候的值
//
// 示例值：
func (builder *ExtendFieldBuilder) Appendix(appendix []*Appendix) *ExtendFieldBuilder {
	builder.appendix = appendix
	builder.appendixFlag = true
	return builder
}

func (builder *ExtendFieldBuilder) Build() *ExtendField {
	req := &ExtendField{}
	if builder.fieldTypeFlag {
		req.FieldType = &builder.fieldType

	}
	if builder.fieldValueFlag {
		req.FieldValue = &builder.fieldValue

	}
	if builder.optionsFlag {
		req.Options = builder.options
	}
	if builder.numFlag {
		req.Num = &builder.num

	}
	if builder.dateFlag {
		req.Date = &builder.date

	}
	if builder.rangeDateFlag {
		req.RangeDate = builder.rangeDate
	}
	if builder.fieldCodeFlag {
		req.FieldCode = &builder.fieldCode

	}
	if builder.appendixFlag {
		req.Appendix = builder.appendix
	}
	return req
}

type FixedExchangeRate struct {
	SourceCurrency *string `json:"source_currency,omitempty"` // 原始币种代码

	TargetCurrency *string `json:"target_currency,omitempty"` // 目标币种代码

	EffectiveDate *string `json:"effective_date,omitempty"` // 换算日期

	ExchangeRate *string `json:"exchange_rate,omitempty"` // 汇率值，保留10位小数

	Status *int `json:"status,omitempty"` // 状态，枚举值：1_生效，0_失效
}

type FixedExchangeRateBuilder struct {
	sourceCurrency     string // 原始币种代码
	sourceCurrencyFlag bool

	targetCurrency     string // 目标币种代码
	targetCurrencyFlag bool

	effectiveDate     string // 换算日期
	effectiveDateFlag bool

	exchangeRate     string // 汇率值，保留10位小数
	exchangeRateFlag bool

	status     int // 状态，枚举值：1_生效，0_失效
	statusFlag bool
}

func NewFixedExchangeRateBuilder() *FixedExchangeRateBuilder {
	builder := &FixedExchangeRateBuilder{}
	return builder
}

// 原始币种代码
//
// 示例值：USD
func (builder *FixedExchangeRateBuilder) SourceCurrency(sourceCurrency string) *FixedExchangeRateBuilder {
	builder.sourceCurrency = sourceCurrency
	builder.sourceCurrencyFlag = true
	return builder
}

// 目标币种代码
//
// 示例值：CNY
func (builder *FixedExchangeRateBuilder) TargetCurrency(targetCurrency string) *FixedExchangeRateBuilder {
	builder.targetCurrency = targetCurrency
	builder.targetCurrencyFlag = true
	return builder
}

// 换算日期
//
// 示例值：2022-02-13
func (builder *FixedExchangeRateBuilder) EffectiveDate(effectiveDate string) *FixedExchangeRateBuilder {
	builder.effectiveDate = effectiveDate
	builder.effectiveDateFlag = true
	return builder
}

// 汇率值，保留10位小数
//
// 示例值：0.1720000000
func (builder *FixedExchangeRateBuilder) ExchangeRate(exchangeRate string) *FixedExchangeRateBuilder {
	builder.exchangeRate = exchangeRate
	builder.exchangeRateFlag = true
	return builder
}

// 状态，枚举值：1_生效，0_失效
//
// 示例值：1
func (builder *FixedExchangeRateBuilder) Status(status int) *FixedExchangeRateBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

func (builder *FixedExchangeRateBuilder) Build() *FixedExchangeRate {
	req := &FixedExchangeRate{}
	if builder.sourceCurrencyFlag {
		req.SourceCurrency = &builder.sourceCurrency

	}
	if builder.targetCurrencyFlag {
		req.TargetCurrency = &builder.targetCurrency

	}
	if builder.effectiveDateFlag {
		req.EffectiveDate = &builder.effectiveDate

	}
	if builder.exchangeRateFlag {
		req.ExchangeRate = &builder.exchangeRate

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	return req
}

type GlAccount struct {
	GlAccountUid *string `json:"gl_account_uid,omitempty"` // 会计科目唯一ID

	GlAccount *string `json:"gl_account,omitempty"` // 会计科目编码

	GlAccountName *string `json:"gl_account_name,omitempty"` // 会计科目名称

	I18nGlAccountName []*I18nStruct `json:"i18n_gl_account_name,omitempty"` // 会计科目名称多语言

	Type *string `json:"type,omitempty"` // 会计科目类型

	ValidTo *string `json:"valid_to,omitempty"` // 有效期至，格式：yyyy-MM-dd
}

type GlAccountBuilder struct {
	glAccountUid     string // 会计科目唯一ID
	glAccountUidFlag bool

	glAccount     string // 会计科目编码
	glAccountFlag bool

	glAccountName     string // 会计科目名称
	glAccountNameFlag bool

	i18nGlAccountName     []*I18nStruct // 会计科目名称多语言
	i18nGlAccountNameFlag bool

	type_    string // 会计科目类型
	typeFlag bool

	validTo     string // 有效期至，格式：yyyy-MM-dd
	validToFlag bool
}

func NewGlAccountBuilder() *GlAccountBuilder {
	builder := &GlAccountBuilder{}
	return builder
}

// 会计科目唯一ID
//
// 示例值：U1404732463745343488
func (builder *GlAccountBuilder) GlAccountUid(glAccountUid string) *GlAccountBuilder {
	builder.glAccountUid = glAccountUid
	builder.glAccountUidFlag = true
	return builder
}

// 会计科目编码
//
// 示例值：51012006
func (builder *GlAccountBuilder) GlAccount(glAccount string) *GlAccountBuilder {
	builder.glAccount = glAccount
	builder.glAccountFlag = true
	return builder
}

// 会计科目名称
//
// 示例值：管理费用-电力工程
func (builder *GlAccountBuilder) GlAccountName(glAccountName string) *GlAccountBuilder {
	builder.glAccountName = glAccountName
	builder.glAccountNameFlag = true
	return builder
}

// 会计科目名称多语言
//
// 示例值：
func (builder *GlAccountBuilder) I18nGlAccountName(i18nGlAccountName []*I18nStruct) *GlAccountBuilder {
	builder.i18nGlAccountName = i18nGlAccountName
	builder.i18nGlAccountNameFlag = true
	return builder
}

// 会计科目类型
//
// 示例值：101
func (builder *GlAccountBuilder) Type(type_ string) *GlAccountBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 有效期至，格式：yyyy-MM-dd
//
// 示例值：9999-12-31
func (builder *GlAccountBuilder) ValidTo(validTo string) *GlAccountBuilder {
	builder.validTo = validTo
	builder.validToFlag = true
	return builder
}

func (builder *GlAccountBuilder) Build() *GlAccount {
	req := &GlAccount{}
	if builder.glAccountUidFlag {
		req.GlAccountUid = &builder.glAccountUid

	}
	if builder.glAccountFlag {
		req.GlAccount = &builder.glAccount

	}
	if builder.glAccountNameFlag {
		req.GlAccountName = &builder.glAccountName

	}
	if builder.i18nGlAccountNameFlag {
		req.I18nGlAccountName = builder.i18nGlAccountName
	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.validToFlag {
		req.ValidTo = &builder.validTo

	}
	return req
}

type GlAccountCompanyRelationship struct {
	GlAccountCode *string `json:"gl_account_code,omitempty"` // 会计科目编码

	CompanyCode *string `json:"company_code,omitempty"` // 公司编码

	GlAccountCompanyRelationshipUid *string `json:"gl_account_company_relationship_uid,omitempty"` // 会计科目公司关系唯一ID

	ValidTo *string `json:"valid_to,omitempty"` // 有效期至，格式：yyyy-MM-dd
}

type GlAccountCompanyRelationshipBuilder struct {
	glAccountCode     string // 会计科目编码
	glAccountCodeFlag bool

	companyCode     string // 公司编码
	companyCodeFlag bool

	glAccountCompanyRelationshipUid     string // 会计科目公司关系唯一ID
	glAccountCompanyRelationshipUidFlag bool

	validTo     string // 有效期至，格式：yyyy-MM-dd
	validToFlag bool
}

func NewGlAccountCompanyRelationshipBuilder() *GlAccountCompanyRelationshipBuilder {
	builder := &GlAccountCompanyRelationshipBuilder{}
	return builder
}

// 会计科目编码
//
// 示例值：U1404733114483220480
func (builder *GlAccountCompanyRelationshipBuilder) GlAccountCode(glAccountCode string) *GlAccountCompanyRelationshipBuilder {
	builder.glAccountCode = glAccountCode
	builder.glAccountCodeFlag = true
	return builder
}

// 公司编码
//
// 示例值：U1404700185187065856
func (builder *GlAccountCompanyRelationshipBuilder) CompanyCode(companyCode string) *GlAccountCompanyRelationshipBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 会计科目公司关系唯一ID
//
// 示例值：U1404732747611643904
func (builder *GlAccountCompanyRelationshipBuilder) GlAccountCompanyRelationshipUid(glAccountCompanyRelationshipUid string) *GlAccountCompanyRelationshipBuilder {
	builder.glAccountCompanyRelationshipUid = glAccountCompanyRelationshipUid
	builder.glAccountCompanyRelationshipUidFlag = true
	return builder
}

// 有效期至，格式：yyyy-MM-dd
//
// 示例值：2021-12-31
func (builder *GlAccountCompanyRelationshipBuilder) ValidTo(validTo string) *GlAccountCompanyRelationshipBuilder {
	builder.validTo = validTo
	builder.validToFlag = true
	return builder
}

func (builder *GlAccountCompanyRelationshipBuilder) Build() *GlAccountCompanyRelationship {
	req := &GlAccountCompanyRelationship{}
	if builder.glAccountCodeFlag {
		req.GlAccountCode = &builder.glAccountCode

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.glAccountCompanyRelationshipUidFlag {
		req.GlAccountCompanyRelationshipUid = &builder.glAccountCompanyRelationshipUid

	}
	if builder.validToFlag {
		req.ValidTo = &builder.validTo

	}
	return req
}

type I18nStruct struct {
	LangLocale *string `json:"lang_locale,omitempty"` // 语言编码

	Value *string `json:"value,omitempty"` // 描述

	ValidTo *string `json:"valid_to,omitempty"` // 有效期至，格式：yyyy-MM-dd
}

type I18nStructBuilder struct {
	langLocale     string // 语言编码
	langLocaleFlag bool

	value     string // 描述
	valueFlag bool

	validTo     string // 有效期至，格式：yyyy-MM-dd
	validToFlag bool
}

func NewI18nStructBuilder() *I18nStructBuilder {
	builder := &I18nStructBuilder{}
	return builder
}

// 语言编码
//
// 示例值：en-US
func (builder *I18nStructBuilder) LangLocale(langLocale string) *I18nStructBuilder {
	builder.langLocale = langLocale
	builder.langLocaleFlag = true
	return builder
}

// 描述
//
// 示例值：abc
func (builder *I18nStructBuilder) Value(value string) *I18nStructBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

// 有效期至，格式：yyyy-MM-dd
//
// 示例值：9999-12-31
func (builder *I18nStructBuilder) ValidTo(validTo string) *I18nStructBuilder {
	builder.validTo = validTo
	builder.validToFlag = true
	return builder
}

func (builder *I18nStructBuilder) Build() *I18nStruct {
	req := &I18nStruct{}
	if builder.langLocaleFlag {
		req.LangLocale = &builder.langLocale

	}
	if builder.valueFlag {
		req.Value = &builder.value

	}
	if builder.validToFlag {
		req.ValidTo = &builder.validTo

	}
	return req
}

type InternalOrder struct {
	InternalOrderUid *string `json:"internal_order_uid,omitempty"` // 内部订单唯一ID

	InternalOrderCode *string `json:"internal_order_code,omitempty"` // 内部订单编码

	InternalOrderName *string `json:"internal_order_name,omitempty"` // 内部订单名称

	Type *string `json:"type,omitempty"` // 内部订单类型

	ResponsibleUserUnionId *string `json:"responsible_user_union_id,omitempty"` // 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)

	CompanyCode *string `json:"company_code,omitempty"` // 关联公司唯一ID

	CoAreaCode *string `json:"co_area_code,omitempty"` // 控制范围编码
}

type InternalOrderBuilder struct {
	internalOrderUid     string // 内部订单唯一ID
	internalOrderUidFlag bool

	internalOrderCode     string // 内部订单编码
	internalOrderCodeFlag bool

	internalOrderName     string // 内部订单名称
	internalOrderNameFlag bool

	type_    string // 内部订单类型
	typeFlag bool

	responsibleUserUnionId     string // 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)
	responsibleUserUnionIdFlag bool

	companyCode     string // 关联公司唯一ID
	companyCodeFlag bool

	coAreaCode     string // 控制范围编码
	coAreaCodeFlag bool
}

func NewInternalOrderBuilder() *InternalOrderBuilder {
	builder := &InternalOrderBuilder{}
	return builder
}

// 内部订单唯一ID
//
// 示例值：U1404789143929626624
func (builder *InternalOrderBuilder) InternalOrderUid(internalOrderUid string) *InternalOrderBuilder {
	builder.internalOrderUid = internalOrderUid
	builder.internalOrderUidFlag = true
	return builder
}

// 内部订单编码
//
// 示例值：8010010001
func (builder *InternalOrderBuilder) InternalOrderCode(internalOrderCode string) *InternalOrderBuilder {
	builder.internalOrderCode = internalOrderCode
	builder.internalOrderCodeFlag = true
	return builder
}

// 内部订单名称
//
// 示例值：北京工会年度统计
func (builder *InternalOrderBuilder) InternalOrderName(internalOrderName string) *InternalOrderBuilder {
	builder.internalOrderName = internalOrderName
	builder.internalOrderNameFlag = true
	return builder
}

// 内部订单类型
//
// 示例值：A0001
func (builder *InternalOrderBuilder) Type(type_ string) *InternalOrderBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 负责人union id，详细说明参见[union id说明](https://open.feishu.cn/document/home/user-identity-introduction/union-id)
//
// 示例值：8763419
func (builder *InternalOrderBuilder) ResponsibleUserUnionId(responsibleUserUnionId string) *InternalOrderBuilder {
	builder.responsibleUserUnionId = responsibleUserUnionId
	builder.responsibleUserUnionIdFlag = true
	return builder
}

// 关联公司唯一ID
//
// 示例值：U20783822457920
func (builder *InternalOrderBuilder) CompanyCode(companyCode string) *InternalOrderBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 控制范围编码
//
// 示例值：HL01
func (builder *InternalOrderBuilder) CoAreaCode(coAreaCode string) *InternalOrderBuilder {
	builder.coAreaCode = coAreaCode
	builder.coAreaCodeFlag = true
	return builder
}

func (builder *InternalOrderBuilder) Build() *InternalOrder {
	req := &InternalOrder{}
	if builder.internalOrderUidFlag {
		req.InternalOrderUid = &builder.internalOrderUid

	}
	if builder.internalOrderCodeFlag {
		req.InternalOrderCode = &builder.internalOrderCode

	}
	if builder.internalOrderNameFlag {
		req.InternalOrderName = &builder.internalOrderName

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.responsibleUserUnionIdFlag {
		req.ResponsibleUserUnionId = &builder.responsibleUserUnionId

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.coAreaCodeFlag {
		req.CoAreaCode = &builder.coAreaCode

	}
	return req
}

type LegalEntity struct {
	Id *string `json:"id,omitempty"` // 法人实体id

	LegalEntity *string `json:"legal_entity,omitempty"` // 法人实体编码(根据配置会有不同的生成规则)

	LegalEntityText *string `json:"legal_entity_text,omitempty"` // 法人实体名称

	ShortText *string `json:"short_text,omitempty"` // 法人实体英文名称

	CertificationType *string `json:"certification_type,omitempty"` // 证件类型

	CertificationId *string `json:"certification_id,omitempty"` // 证件id

	LegalPerson *string `json:"legal_person,omitempty"` // 法人

	Country *string `json:"country,omitempty"` // 国家

	Province *string `json:"province,omitempty"` // 省份

	City *string `json:"city,omitempty"` // 城市

	Address *string `json:"address,omitempty"` // 地址

	TaxpayerType *string `json:"taxpayer_type,omitempty"` // 纳税人类型

	Telephone *string `json:"telephone,omitempty"` // 联系电话

	BankId *string `json:"bank_id,omitempty"` // 银行内部Id

	BankName *string `json:"bank_name,omitempty"` // 开户银行名称

	BankAccount *string `json:"bank_account,omitempty"` // 开户行账号

	Status *int `json:"status,omitempty"` // 状态

	LegalEntityBanks []*LegalEntityBank `json:"legal_entity_banks,omitempty"` // 银行账户列表

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表

	Appendix []*Appendix `json:"appendix,omitempty"` // 附件列表
}

type LegalEntityBuilder struct {
	id     string // 法人实体id
	idFlag bool

	legalEntity     string // 法人实体编码(根据配置会有不同的生成规则)
	legalEntityFlag bool

	legalEntityText     string // 法人实体名称
	legalEntityTextFlag bool

	shortText     string // 法人实体英文名称
	shortTextFlag bool

	certificationType     string // 证件类型
	certificationTypeFlag bool

	certificationId     string // 证件id
	certificationIdFlag bool

	legalPerson     string // 法人
	legalPersonFlag bool

	country     string // 国家
	countryFlag bool

	province     string // 省份
	provinceFlag bool

	city     string // 城市
	cityFlag bool

	address     string // 地址
	addressFlag bool

	taxpayerType     string // 纳税人类型
	taxpayerTypeFlag bool

	telephone     string // 联系电话
	telephoneFlag bool

	bankId     string // 银行内部Id
	bankIdFlag bool

	bankName     string // 开户银行名称
	bankNameFlag bool

	bankAccount     string // 开户行账号
	bankAccountFlag bool

	status     int // 状态
	statusFlag bool

	legalEntityBanks     []*LegalEntityBank // 银行账户列表
	legalEntityBanksFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool

	appendix     []*Appendix // 附件列表
	appendixFlag bool
}

func NewLegalEntityBuilder() *LegalEntityBuilder {
	builder := &LegalEntityBuilder{}
	return builder
}

// 法人实体id
//
// 示例值：7003410079584092448
func (builder *LegalEntityBuilder) Id(id string) *LegalEntityBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 法人实体编码(根据配置会有不同的生成规则)
//
// 示例值：L00002002
func (builder *LegalEntityBuilder) LegalEntity(legalEntity string) *LegalEntityBuilder {
	builder.legalEntity = legalEntity
	builder.legalEntityFlag = true
	return builder
}

// 法人实体名称
//
// 示例值：法人22
func (builder *LegalEntityBuilder) LegalEntityText(legalEntityText string) *LegalEntityBuilder {
	builder.legalEntityText = legalEntityText
	builder.legalEntityTextFlag = true
	return builder
}

// 法人实体英文名称
//
// 示例值：legal_person
func (builder *LegalEntityBuilder) ShortText(shortText string) *LegalEntityBuilder {
	builder.shortText = shortText
	builder.shortTextFlag = true
	return builder
}

// 证件类型
//
// 示例值：0
func (builder *LegalEntityBuilder) CertificationType(certificationType string) *LegalEntityBuilder {
	builder.certificationType = certificationType
	builder.certificationTypeFlag = true
	return builder
}

// 证件id
//
// 示例值：91310120MA1H23N81AX
func (builder *LegalEntityBuilder) CertificationId(certificationId string) *LegalEntityBuilder {
	builder.certificationId = certificationId
	builder.certificationIdFlag = true
	return builder
}

// 法人
//
// 示例值：张三
func (builder *LegalEntityBuilder) LegalPerson(legalPerson string) *LegalEntityBuilder {
	builder.legalPerson = legalPerson
	builder.legalPersonFlag = true
	return builder
}

// 国家
//
// 示例值：CN
func (builder *LegalEntityBuilder) Country(country string) *LegalEntityBuilder {
	builder.country = country
	builder.countryFlag = true
	return builder
}

// 省份
//
// 示例值：MDPS00004000
func (builder *LegalEntityBuilder) Province(province string) *LegalEntityBuilder {
	builder.province = province
	builder.provinceFlag = true
	return builder
}

// 城市
//
// 示例值：MDCY00006000
func (builder *LegalEntityBuilder) City(city string) *LegalEntityBuilder {
	builder.city = city
	builder.cityFlag = true
	return builder
}

// 地址
//
// 示例值：地址
func (builder *LegalEntityBuilder) Address(address string) *LegalEntityBuilder {
	builder.address = address
	builder.addressFlag = true
	return builder
}

// 纳税人类型
//
// 示例值：1
func (builder *LegalEntityBuilder) TaxpayerType(taxpayerType string) *LegalEntityBuilder {
	builder.taxpayerType = taxpayerType
	builder.taxpayerTypeFlag = true
	return builder
}

// 联系电话
//
// 示例值：010-58341796
func (builder *LegalEntityBuilder) Telephone(telephone string) *LegalEntityBuilder {
	builder.telephone = telephone
	builder.telephoneFlag = true
	return builder
}

// 银行内部Id
//
// 示例值：MDBK00072319
func (builder *LegalEntityBuilder) BankId(bankId string) *LegalEntityBuilder {
	builder.bankId = bankId
	builder.bankIdFlag = true
	return builder
}

// 开户银行名称
//
// 示例值：中原银行股份有限公司南阳华瑞支行
func (builder *LegalEntityBuilder) BankName(bankName string) *LegalEntityBuilder {
	builder.bankName = bankName
	builder.bankNameFlag = true
	return builder
}

// 开户行账号
//
// 示例值：644666446
func (builder *LegalEntityBuilder) BankAccount(bankAccount string) *LegalEntityBuilder {
	builder.bankAccount = bankAccount
	builder.bankAccountFlag = true
	return builder
}

// 状态
//
// 示例值：1
func (builder *LegalEntityBuilder) Status(status int) *LegalEntityBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 银行账户列表
//
// 示例值：
func (builder *LegalEntityBuilder) LegalEntityBanks(legalEntityBanks []*LegalEntityBank) *LegalEntityBuilder {
	builder.legalEntityBanks = legalEntityBanks
	builder.legalEntityBanksFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *LegalEntityBuilder) ExtendInfo(extendInfo []*ExtendField) *LegalEntityBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

// 附件列表
//
// 示例值：
func (builder *LegalEntityBuilder) Appendix(appendix []*Appendix) *LegalEntityBuilder {
	builder.appendix = appendix
	builder.appendixFlag = true
	return builder
}

func (builder *LegalEntityBuilder) Build() *LegalEntity {
	req := &LegalEntity{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.legalEntityFlag {
		req.LegalEntity = &builder.legalEntity

	}
	if builder.legalEntityTextFlag {
		req.LegalEntityText = &builder.legalEntityText

	}
	if builder.shortTextFlag {
		req.ShortText = &builder.shortText

	}
	if builder.certificationTypeFlag {
		req.CertificationType = &builder.certificationType

	}
	if builder.certificationIdFlag {
		req.CertificationId = &builder.certificationId

	}
	if builder.legalPersonFlag {
		req.LegalPerson = &builder.legalPerson

	}
	if builder.countryFlag {
		req.Country = &builder.country

	}
	if builder.provinceFlag {
		req.Province = &builder.province

	}
	if builder.cityFlag {
		req.City = &builder.city

	}
	if builder.addressFlag {
		req.Address = &builder.address

	}
	if builder.taxpayerTypeFlag {
		req.TaxpayerType = &builder.taxpayerType

	}
	if builder.telephoneFlag {
		req.Telephone = &builder.telephone

	}
	if builder.bankIdFlag {
		req.BankId = &builder.bankId

	}
	if builder.bankNameFlag {
		req.BankName = &builder.bankName

	}
	if builder.bankAccountFlag {
		req.BankAccount = &builder.bankAccount

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.legalEntityBanksFlag {
		req.LegalEntityBanks = builder.legalEntityBanks
	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	if builder.appendixFlag {
		req.Appendix = builder.appendix
	}
	return req
}

type LegalEntityBank struct {
	Id *string `json:"id,omitempty"` // 法人实体银行账户id

	CompanyCode *string `json:"company_code,omitempty"` // 公司编码

	BankId *string `json:"bank_id,omitempty"` // 银行Id

	BankCode *string `json:"bank_code,omitempty"` // 银联号

	BankName *string `json:"bank_name,omitempty"` // 银行名称

	BankAcronym *string `json:"bank_acronym,omitempty"` // 总行英文缩写

	Country *string `json:"country,omitempty"` // 国家

	AccountName *string `json:"account_name,omitempty"` // 账户名称

	BankAccount *string `json:"bank_account,omitempty"` // 银行账号

	SwiftCode *string `json:"swift_code,omitempty"` // 银行SWIFT编码

	BankControlCode *string `json:"bank_control_code,omitempty"` // 银行控制码

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表

	IbanAccount *string `json:"iban_account,omitempty"` // IBAN账号

	Currency *string `json:"currency,omitempty"` // 币种

	GlAccount *string `json:"gl_account,omitempty"` // 总账科目编码

	ClearingAccount *string `json:"clearing_account,omitempty"` // 清算科目编码

	AccountAttributeDesc *string `json:"account_attribute_desc,omitempty"` // 账户属性描述
}

type LegalEntityBankBuilder struct {
	id     string // 法人实体银行账户id
	idFlag bool

	companyCode     string // 公司编码
	companyCodeFlag bool

	bankId     string // 银行Id
	bankIdFlag bool

	bankCode     string // 银联号
	bankCodeFlag bool

	bankName     string // 银行名称
	bankNameFlag bool

	bankAcronym     string // 总行英文缩写
	bankAcronymFlag bool

	country     string // 国家
	countryFlag bool

	accountName     string // 账户名称
	accountNameFlag bool

	bankAccount     string // 银行账号
	bankAccountFlag bool

	swiftCode     string // 银行SWIFT编码
	swiftCodeFlag bool

	bankControlCode     string // 银行控制码
	bankControlCodeFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool

	ibanAccount     string // IBAN账号
	ibanAccountFlag bool

	currency     string // 币种
	currencyFlag bool

	glAccount     string // 总账科目编码
	glAccountFlag bool

	clearingAccount     string // 清算科目编码
	clearingAccountFlag bool

	accountAttributeDesc     string // 账户属性描述
	accountAttributeDescFlag bool
}

func NewLegalEntityBankBuilder() *LegalEntityBankBuilder {
	builder := &LegalEntityBankBuilder{}
	return builder
}

// 法人实体银行账户id
//
// 示例值：1433492736852541442
func (builder *LegalEntityBankBuilder) Id(id string) *LegalEntityBankBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 公司编码
//
// 示例值：1002
func (builder *LegalEntityBankBuilder) CompanyCode(companyCode string) *LegalEntityBankBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 银行Id
//
// 示例值：MDBK00131739
func (builder *LegalEntityBankBuilder) BankId(bankId string) *LegalEntityBankBuilder {
	builder.bankId = bankId
	builder.bankIdFlag = true
	return builder
}

// 银联号
//
// 示例值：001755053005
func (builder *LegalEntityBankBuilder) BankCode(bankCode string) *LegalEntityBankBuilder {
	builder.bankCode = bankCode
	builder.bankCodeFlag = true
	return builder
}

// 银行名称
//
// 示例值：中国人民银行丽江市中心支行
func (builder *LegalEntityBankBuilder) BankName(bankName string) *LegalEntityBankBuilder {
	builder.bankName = bankName
	builder.bankNameFlag = true
	return builder
}

// 总行英文缩写
//
// 示例值：PBC
func (builder *LegalEntityBankBuilder) BankAcronym(bankAcronym string) *LegalEntityBankBuilder {
	builder.bankAcronym = bankAcronym
	builder.bankAcronymFlag = true
	return builder
}

// 国家
//
// 示例值：CN
func (builder *LegalEntityBankBuilder) Country(country string) *LegalEntityBankBuilder {
	builder.country = country
	builder.countryFlag = true
	return builder
}

// 账户名称
//
// 示例值：账户名称
func (builder *LegalEntityBankBuilder) AccountName(accountName string) *LegalEntityBankBuilder {
	builder.accountName = accountName
	builder.accountNameFlag = true
	return builder
}

// 银行账号
//
// 示例值：122907287xxxxx9
func (builder *LegalEntityBankBuilder) BankAccount(bankAccount string) *LegalEntityBankBuilder {
	builder.bankAccount = bankAccount
	builder.bankAccountFlag = true
	return builder
}

// 银行SWIFT编码
//
// 示例值：CMBCCNBS
func (builder *LegalEntityBankBuilder) SwiftCode(swiftCode string) *LegalEntityBankBuilder {
	builder.swiftCode = swiftCode
	builder.swiftCodeFlag = true
	return builder
}

// 银行控制码
//
// 示例值：40001xxxxxxx00313261
func (builder *LegalEntityBankBuilder) BankControlCode(bankControlCode string) *LegalEntityBankBuilder {
	builder.bankControlCode = bankControlCode
	builder.bankControlCodeFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *LegalEntityBankBuilder) ExtendInfo(extendInfo []*ExtendField) *LegalEntityBankBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

// IBAN账号
//
// 示例值：6446777
func (builder *LegalEntityBankBuilder) IbanAccount(ibanAccount string) *LegalEntityBankBuilder {
	builder.ibanAccount = ibanAccount
	builder.ibanAccountFlag = true
	return builder
}

// 币种
//
// 示例值：RMB
func (builder *LegalEntityBankBuilder) Currency(currency string) *LegalEntityBankBuilder {
	builder.currency = currency
	builder.currencyFlag = true
	return builder
}

// 总账科目编码
//
// 示例值：123ASD
func (builder *LegalEntityBankBuilder) GlAccount(glAccount string) *LegalEntityBankBuilder {
	builder.glAccount = glAccount
	builder.glAccountFlag = true
	return builder
}

// 清算科目编码
//
// 示例值：ASD123
func (builder *LegalEntityBankBuilder) ClearingAccount(clearingAccount string) *LegalEntityBankBuilder {
	builder.clearingAccount = clearingAccount
	builder.clearingAccountFlag = true
	return builder
}

// 账户属性描述
//
// 示例值：QWE123
func (builder *LegalEntityBankBuilder) AccountAttributeDesc(accountAttributeDesc string) *LegalEntityBankBuilder {
	builder.accountAttributeDesc = accountAttributeDesc
	builder.accountAttributeDescFlag = true
	return builder
}

func (builder *LegalEntityBankBuilder) Build() *LegalEntityBank {
	req := &LegalEntityBank{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.bankIdFlag {
		req.BankId = &builder.bankId

	}
	if builder.bankCodeFlag {
		req.BankCode = &builder.bankCode

	}
	if builder.bankNameFlag {
		req.BankName = &builder.bankName

	}
	if builder.bankAcronymFlag {
		req.BankAcronym = &builder.bankAcronym

	}
	if builder.countryFlag {
		req.Country = &builder.country

	}
	if builder.accountNameFlag {
		req.AccountName = &builder.accountName

	}
	if builder.bankAccountFlag {
		req.BankAccount = &builder.bankAccount

	}
	if builder.swiftCodeFlag {
		req.SwiftCode = &builder.swiftCode

	}
	if builder.bankControlCodeFlag {
		req.BankControlCode = &builder.bankControlCode

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	if builder.ibanAccountFlag {
		req.IbanAccount = &builder.ibanAccount

	}
	if builder.currencyFlag {
		req.Currency = &builder.currency

	}
	if builder.glAccountFlag {
		req.GlAccount = &builder.glAccount

	}
	if builder.clearingAccountFlag {
		req.ClearingAccount = &builder.clearingAccount

	}
	if builder.accountAttributeDescFlag {
		req.AccountAttributeDesc = &builder.accountAttributeDesc

	}
	return req
}

type MultiLanguage struct {
	Language *string `json:"language,omitempty"` // 语言枚举

	Value *string `json:"value,omitempty"` // 语言对应的value
}

type MultiLanguageBuilder struct {
	language     string // 语言枚举
	languageFlag bool

	value     string // 语言对应的value
	valueFlag bool
}

func NewMultiLanguageBuilder() *MultiLanguageBuilder {
	builder := &MultiLanguageBuilder{}
	return builder
}

// 语言枚举
//
// 示例值：zh
func (builder *MultiLanguageBuilder) Language(language string) *MultiLanguageBuilder {
	builder.language = language
	builder.languageFlag = true
	return builder
}

// 语言对应的value
//
// 示例值：haha
func (builder *MultiLanguageBuilder) Value(value string) *MultiLanguageBuilder {
	builder.value = value
	builder.valueFlag = true
	return builder
}

func (builder *MultiLanguageBuilder) Build() *MultiLanguage {
	req := &MultiLanguage{}
	if builder.languageFlag {
		req.Language = &builder.language

	}
	if builder.valueFlag {
		req.Value = &builder.value

	}
	return req
}

type OpenApiUpdateVendor struct {
	Id *string `json:"id,omitempty"` // id
}

type OpenApiUpdateVendorBuilder struct {
	id     string // id
	idFlag bool
}

func NewOpenApiUpdateVendorBuilder() *OpenApiUpdateVendorBuilder {
	builder := &OpenApiUpdateVendorBuilder{}
	return builder
}

// id
//
// 示例值：1111111111
func (builder *OpenApiUpdateVendorBuilder) Id(id string) *OpenApiUpdateVendorBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

func (builder *OpenApiUpdateVendorBuilder) Build() *OpenApiUpdateVendor {
	req := &OpenApiUpdateVendor{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	return req
}

type Project struct {
	ProjectUid *string `json:"project_uid,omitempty"` // 项目唯一id

	Code *string `json:"code,omitempty"` // 项目编码

	Name *string `json:"name,omitempty"` // 项目名称

	Type *string `json:"type,omitempty"` // 项目类型名称

	ResponsibleUserUnionId *string `json:"responsible_user_union_id,omitempty"` // 负责人id

	StartDay *string `json:"start_day,omitempty"` // 项目开始日期(yyyy-MM-dd)

	EndDay *string `json:"end_day,omitempty"` // 项目截止日期(yyyy-MM-dd)

	ParentCode *string `json:"parent_code,omitempty"` // 父项目节点

	Level *int `json:"level,omitempty"` // 项目层级

	LevelInfo *string `json:"level_info,omitempty"` // 项目层级详情

	Status *int `json:"status,omitempty"` // 项目状态

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段值信息

	IsAllCompany *bool `json:"is_all_company,omitempty"` // 是否全部公司

	ProjectCompanyDeptMappings []*ProjectCompanyDeptMapping `json:"project_company_dept_mappings,omitempty"` // 项目公司部门关系列表

	MultiLanguageName []*MultiLanguage `json:"multi_language_name,omitempty"` // 名称多语言
}

type ProjectBuilder struct {
	projectUid     string // 项目唯一id
	projectUidFlag bool

	code     string // 项目编码
	codeFlag bool

	name     string // 项目名称
	nameFlag bool

	type_    string // 项目类型名称
	typeFlag bool

	responsibleUserUnionId     string // 负责人id
	responsibleUserUnionIdFlag bool

	startDay     string // 项目开始日期(yyyy-MM-dd)
	startDayFlag bool

	endDay     string // 项目截止日期(yyyy-MM-dd)
	endDayFlag bool

	parentCode     string // 父项目节点
	parentCodeFlag bool

	level     int // 项目层级
	levelFlag bool

	levelInfo     string // 项目层级详情
	levelInfoFlag bool

	status     int // 项目状态
	statusFlag bool

	extendInfo     []*ExtendField // 扩展字段值信息
	extendInfoFlag bool

	isAllCompany     bool // 是否全部公司
	isAllCompanyFlag bool

	projectCompanyDeptMappings     []*ProjectCompanyDeptMapping // 项目公司部门关系列表
	projectCompanyDeptMappingsFlag bool

	multiLanguageName     []*MultiLanguage // 名称多语言
	multiLanguageNameFlag bool
}

func NewProjectBuilder() *ProjectBuilder {
	builder := &ProjectBuilder{}
	return builder
}

// 项目唯一id
//
// 示例值：U00000000000001
func (builder *ProjectBuilder) ProjectUid(projectUid string) *ProjectBuilder {
	builder.projectUid = projectUid
	builder.projectUidFlag = true
	return builder
}

// 项目编码
//
// 示例值：P000001
func (builder *ProjectBuilder) Code(code string) *ProjectBuilder {
	builder.code = code
	builder.codeFlag = true
	return builder
}

// 项目名称
//
// 示例值：项目123
func (builder *ProjectBuilder) Name(name string) *ProjectBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 项目类型名称
//
// 示例值：项目类型3
func (builder *ProjectBuilder) Type(type_ string) *ProjectBuilder {
	builder.type_ = type_
	builder.typeFlag = true
	return builder
}

// 负责人id
//
// 示例值：U000012300001
func (builder *ProjectBuilder) ResponsibleUserUnionId(responsibleUserUnionId string) *ProjectBuilder {
	builder.responsibleUserUnionId = responsibleUserUnionId
	builder.responsibleUserUnionIdFlag = true
	return builder
}

// 项目开始日期(yyyy-MM-dd)
//
// 示例值：9999-01-01
func (builder *ProjectBuilder) StartDay(startDay string) *ProjectBuilder {
	builder.startDay = startDay
	builder.startDayFlag = true
	return builder
}

// 项目截止日期(yyyy-MM-dd)
//
// 示例值：9999-01-01
func (builder *ProjectBuilder) EndDay(endDay string) *ProjectBuilder {
	builder.endDay = endDay
	builder.endDayFlag = true
	return builder
}

// 父项目节点
//
// 示例值：123123123
func (builder *ProjectBuilder) ParentCode(parentCode string) *ProjectBuilder {
	builder.parentCode = parentCode
	builder.parentCodeFlag = true
	return builder
}

// 项目层级
//
// 示例值：1
func (builder *ProjectBuilder) Level(level int) *ProjectBuilder {
	builder.level = level
	builder.levelFlag = true
	return builder
}

// 项目层级详情
//
// 示例值：2021-XJ001-02-02
func (builder *ProjectBuilder) LevelInfo(levelInfo string) *ProjectBuilder {
	builder.levelInfo = levelInfo
	builder.levelInfoFlag = true
	return builder
}

// 项目状态
//
// 示例值：1
func (builder *ProjectBuilder) Status(status int) *ProjectBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 扩展字段值信息
//
// 示例值：
func (builder *ProjectBuilder) ExtendInfo(extendInfo []*ExtendField) *ProjectBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

// 是否全部公司
//
// 示例值：true
func (builder *ProjectBuilder) IsAllCompany(isAllCompany bool) *ProjectBuilder {
	builder.isAllCompany = isAllCompany
	builder.isAllCompanyFlag = true
	return builder
}

// 项目公司部门关系列表
//
// 示例值：
func (builder *ProjectBuilder) ProjectCompanyDeptMappings(projectCompanyDeptMappings []*ProjectCompanyDeptMapping) *ProjectBuilder {
	builder.projectCompanyDeptMappings = projectCompanyDeptMappings
	builder.projectCompanyDeptMappingsFlag = true
	return builder
}

// 名称多语言
//
// 示例值：
func (builder *ProjectBuilder) MultiLanguageName(multiLanguageName []*MultiLanguage) *ProjectBuilder {
	builder.multiLanguageName = multiLanguageName
	builder.multiLanguageNameFlag = true
	return builder
}

func (builder *ProjectBuilder) Build() *Project {
	req := &Project{}
	if builder.projectUidFlag {
		req.ProjectUid = &builder.projectUid

	}
	if builder.codeFlag {
		req.Code = &builder.code

	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.typeFlag {
		req.Type = &builder.type_

	}
	if builder.responsibleUserUnionIdFlag {
		req.ResponsibleUserUnionId = &builder.responsibleUserUnionId

	}
	if builder.startDayFlag {
		req.StartDay = &builder.startDay

	}
	if builder.endDayFlag {
		req.EndDay = &builder.endDay

	}
	if builder.parentCodeFlag {
		req.ParentCode = &builder.parentCode

	}
	if builder.levelFlag {
		req.Level = &builder.level

	}
	if builder.levelInfoFlag {
		req.LevelInfo = &builder.levelInfo

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	if builder.isAllCompanyFlag {
		req.IsAllCompany = &builder.isAllCompany

	}
	if builder.projectCompanyDeptMappingsFlag {
		req.ProjectCompanyDeptMappings = builder.projectCompanyDeptMappings
	}
	if builder.multiLanguageNameFlag {
		req.MultiLanguageName = builder.multiLanguageName
	}
	return req
}

type ProjectCompanyDeptMapping struct {
	ProjectUnionId *string `json:"project_union_id,omitempty"` // 项目unionId

	CompanyUnionId *string `json:"company_union_id,omitempty"` // 公司unionId

	IsAllDepartment *bool `json:"is_all_department,omitempty"` // 是否全部部门

	DepartmentUnionId *string `json:"department_union_id,omitempty"` // 部门unionId
}

type ProjectCompanyDeptMappingBuilder struct {
	projectUnionId     string // 项目unionId
	projectUnionIdFlag bool

	companyUnionId     string // 公司unionId
	companyUnionIdFlag bool

	isAllDepartment     bool // 是否全部部门
	isAllDepartmentFlag bool

	departmentUnionId     string // 部门unionId
	departmentUnionIdFlag bool
}

func NewProjectCompanyDeptMappingBuilder() *ProjectCompanyDeptMappingBuilder {
	builder := &ProjectCompanyDeptMappingBuilder{}
	return builder
}

// 项目unionId
//
// 示例值：U0012312312333
func (builder *ProjectCompanyDeptMappingBuilder) ProjectUnionId(projectUnionId string) *ProjectCompanyDeptMappingBuilder {
	builder.projectUnionId = projectUnionId
	builder.projectUnionIdFlag = true
	return builder
}

// 公司unionId
//
// 示例值：U1233123123
func (builder *ProjectCompanyDeptMappingBuilder) CompanyUnionId(companyUnionId string) *ProjectCompanyDeptMappingBuilder {
	builder.companyUnionId = companyUnionId
	builder.companyUnionIdFlag = true
	return builder
}

// 是否全部部门
//
// 示例值：true
func (builder *ProjectCompanyDeptMappingBuilder) IsAllDepartment(isAllDepartment bool) *ProjectCompanyDeptMappingBuilder {
	builder.isAllDepartment = isAllDepartment
	builder.isAllDepartmentFlag = true
	return builder
}

// 部门unionId
//
// 示例值：U123123123
func (builder *ProjectCompanyDeptMappingBuilder) DepartmentUnionId(departmentUnionId string) *ProjectCompanyDeptMappingBuilder {
	builder.departmentUnionId = departmentUnionId
	builder.departmentUnionIdFlag = true
	return builder
}

func (builder *ProjectCompanyDeptMappingBuilder) Build() *ProjectCompanyDeptMapping {
	req := &ProjectCompanyDeptMapping{}
	if builder.projectUnionIdFlag {
		req.ProjectUnionId = &builder.projectUnionId

	}
	if builder.companyUnionIdFlag {
		req.CompanyUnionId = &builder.companyUnionId

	}
	if builder.isAllDepartmentFlag {
		req.IsAllDepartment = &builder.isAllDepartment

	}
	if builder.departmentUnionIdFlag {
		req.DepartmentUnionId = &builder.departmentUnionId

	}
	return req
}

type UserAuthDataRelation struct {
	RootDimensionType *string `json:"root_dimension_type,omitempty"` // 数据类型编码

	SubDimensionTypes []string `json:"sub_dimension_types,omitempty"` // 数据编码列表

	AuthorizedUserIds []string `json:"authorized_user_ids,omitempty"` // 授权人的lark id

	UamsAppId *string `json:"uams_app_id,omitempty"` // uams系统中应用id
}

type UserAuthDataRelationBuilder struct {
	rootDimensionType     string // 数据类型编码
	rootDimensionTypeFlag bool

	subDimensionTypes     []string // 数据编码列表
	subDimensionTypesFlag bool

	authorizedUserIds     []string // 授权人的lark id
	authorizedUserIdsFlag bool

	uamsAppId     string // uams系统中应用id
	uamsAppIdFlag bool
}

func NewUserAuthDataRelationBuilder() *UserAuthDataRelationBuilder {
	builder := &UserAuthDataRelationBuilder{}
	return builder
}

// 数据类型编码
//
// 示例值：gongsi
func (builder *UserAuthDataRelationBuilder) RootDimensionType(rootDimensionType string) *UserAuthDataRelationBuilder {
	builder.rootDimensionType = rootDimensionType
	builder.rootDimensionTypeFlag = true
	return builder
}

// 数据编码列表
//
// 示例值：zijie
func (builder *UserAuthDataRelationBuilder) SubDimensionTypes(subDimensionTypes []string) *UserAuthDataRelationBuilder {
	builder.subDimensionTypes = subDimensionTypes
	builder.subDimensionTypesFlag = true
	return builder
}

// 授权人的lark id
//
// 示例值：on_21f2db9bdbafadeb16cd77b76060d41d
func (builder *UserAuthDataRelationBuilder) AuthorizedUserIds(authorizedUserIds []string) *UserAuthDataRelationBuilder {
	builder.authorizedUserIds = authorizedUserIds
	builder.authorizedUserIdsFlag = true
	return builder
}

// uams系统中应用id
//
// 示例值：uams-tenant-test
func (builder *UserAuthDataRelationBuilder) UamsAppId(uamsAppId string) *UserAuthDataRelationBuilder {
	builder.uamsAppId = uamsAppId
	builder.uamsAppIdFlag = true
	return builder
}

func (builder *UserAuthDataRelationBuilder) Build() *UserAuthDataRelation {
	req := &UserAuthDataRelation{}
	if builder.rootDimensionTypeFlag {
		req.RootDimensionType = &builder.rootDimensionType

	}
	if builder.subDimensionTypesFlag {
		req.SubDimensionTypes = builder.subDimensionTypes
	}
	if builder.authorizedUserIdsFlag {
		req.AuthorizedUserIds = builder.authorizedUserIds
	}
	if builder.uamsAppIdFlag {
		req.UamsAppId = &builder.uamsAppId

	}
	return req
}

type Vendor struct {
	Id *string `json:"id,omitempty"` // 交易方id，创建交易方时不填，修改交易方时必填

	AdCountry *string `json:"ad_country,omitempty"` // 交易方注册国家

	AdProvince *string `json:"ad_province,omitempty"` // 交易方注册省份

	AdCity *string `json:"ad_city,omitempty"` // 交易方注册城市

	Address *string `json:"address,omitempty"` // 详细地址

	AdPostcode *string `json:"ad_postcode,omitempty"` // 交易方注册地址邮编

	LegalPerson *string `json:"legal_person,omitempty"` // 法人名称

	CertificationType *string `json:"certification_type,omitempty"` // 证件类型

	CertificationId *string `json:"certification_id,omitempty"` // 证件ID

	ContactPerson *string `json:"contact_person,omitempty"` // 联系人

	ContactTelephone *string `json:"contact_telephone,omitempty"` // 联系电话

	ContactMobilePhone *string `json:"contact_mobile_phone,omitempty"` // 联系移动电话

	Fax *string `json:"fax,omitempty"` // 传真

	EMail *string `json:"e_mail,omitempty"` // 邮箱

	Status *int `json:"status,omitempty"` // 状态

	Vendor *string `json:"vendor,omitempty"` // 交易方编码

	VendorText *string `json:"vendor_text,omitempty"` // 交易方名称

	ShortText *string `json:"short_text,omitempty"` // 交易方简称

	VendorType *string `json:"vendor_type,omitempty"` // 交易方类型（多个枚举时，采用逗号分隔）

	VendorCategory *string `json:"vendor_category,omitempty"` // 交易方类别

	VendorNature *string `json:"vendor_nature,omitempty"` // 交易方性质

	LinkedEmployee *string `json:"linked_employee,omitempty"` // 关联员工

	LinkedCustomer *string `json:"linked_customer,omitempty"` // 关联客户

	AssociatedWithLegalEntity *bool `json:"associated_with_legal_entity,omitempty"` // 是否关联法人主体

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表,每个扩展字段需要填入【field_code】、【field_type】、【field_value】三个信息，其中【field_code】和【field_type】需要与用户【字段配置】(获取配置字段的开放平台接口：https://open.feishu.cn/open-apis/mdm/v1/config/config_list)中扩展字段（sys = 1）相关联（目前不支持附件类型的扩展信息）

	VendorAccounts []*VendorAccount `json:"vendor_accounts,omitempty"` // 银行账户列表

	VendorAddresses []*VendorAddress `json:"vendor_addresses,omitempty"` // 地址列表

	VendorCompanyViews []*VendorCompanyView `json:"vendor_company_views,omitempty"` // 公司视图列表

	VendorContacts []*VendorContact `json:"vendor_contacts,omitempty"` // 联系人列表

	GlAccount *string `json:"gl_account,omitempty"` // 总账科目

	DownPaymentTerm *string `json:"down_payment_term,omitempty"` // 预付条件

	PaymentTerm *string `json:"payment_term,omitempty"` // 付款条件

	VendorSiteCode *string `json:"vendor_site_code,omitempty"` // 交易方site code

	Appendix []*Appendix `json:"appendix,omitempty"` // 附件列表

	IsRisked *bool `json:"is_risked,omitempty"` // 是否标记风险

	OwnerDepts []string `json:"owner_depts,omitempty"` // 所属部门
}

type VendorBuilder struct {
	id     string // 交易方id，创建交易方时不填，修改交易方时必填
	idFlag bool

	adCountry     string // 交易方注册国家
	adCountryFlag bool

	adProvince     string // 交易方注册省份
	adProvinceFlag bool

	adCity     string // 交易方注册城市
	adCityFlag bool

	address     string // 详细地址
	addressFlag bool

	adPostcode     string // 交易方注册地址邮编
	adPostcodeFlag bool

	legalPerson     string // 法人名称
	legalPersonFlag bool

	certificationType     string // 证件类型
	certificationTypeFlag bool

	certificationId     string // 证件ID
	certificationIdFlag bool

	contactPerson     string // 联系人
	contactPersonFlag bool

	contactTelephone     string // 联系电话
	contactTelephoneFlag bool

	contactMobilePhone     string // 联系移动电话
	contactMobilePhoneFlag bool

	fax     string // 传真
	faxFlag bool

	eMail     string // 邮箱
	eMailFlag bool

	status     int // 状态
	statusFlag bool

	vendor     string // 交易方编码
	vendorFlag bool

	vendorText     string // 交易方名称
	vendorTextFlag bool

	shortText     string // 交易方简称
	shortTextFlag bool

	vendorType     string // 交易方类型（多个枚举时，采用逗号分隔）
	vendorTypeFlag bool

	vendorCategory     string // 交易方类别
	vendorCategoryFlag bool

	vendorNature     string // 交易方性质
	vendorNatureFlag bool

	linkedEmployee     string // 关联员工
	linkedEmployeeFlag bool

	linkedCustomer     string // 关联客户
	linkedCustomerFlag bool

	associatedWithLegalEntity     bool // 是否关联法人主体
	associatedWithLegalEntityFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表,每个扩展字段需要填入【field_code】、【field_type】、【field_value】三个信息，其中【field_code】和【field_type】需要与用户【字段配置】(获取配置字段的开放平台接口：https://open.feishu.cn/open-apis/mdm/v1/config/config_list)中扩展字段（sys = 1）相关联（目前不支持附件类型的扩展信息）
	extendInfoFlag bool

	vendorAccounts     []*VendorAccount // 银行账户列表
	vendorAccountsFlag bool

	vendorAddresses     []*VendorAddress // 地址列表
	vendorAddressesFlag bool

	vendorCompanyViews     []*VendorCompanyView // 公司视图列表
	vendorCompanyViewsFlag bool

	vendorContacts     []*VendorContact // 联系人列表
	vendorContactsFlag bool

	glAccount     string // 总账科目
	glAccountFlag bool

	downPaymentTerm     string // 预付条件
	downPaymentTermFlag bool

	paymentTerm     string // 付款条件
	paymentTermFlag bool

	vendorSiteCode     string // 交易方site code
	vendorSiteCodeFlag bool

	appendix     []*Appendix // 附件列表
	appendixFlag bool

	isRisked     bool // 是否标记风险
	isRiskedFlag bool

	ownerDepts     []string // 所属部门
	ownerDeptsFlag bool
}

func NewVendorBuilder() *VendorBuilder {
	builder := &VendorBuilder{}
	return builder
}

// 交易方id，创建交易方时不填，修改交易方时必填
//
// 示例值：7023646046559404327
func (builder *VendorBuilder) Id(id string) *VendorBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 交易方注册国家
//
// 示例值：CN
func (builder *VendorBuilder) AdCountry(adCountry string) *VendorBuilder {
	builder.adCountry = adCountry
	builder.adCountryFlag = true
	return builder
}

// 交易方注册省份
//
// 示例值：MDPS00000001
func (builder *VendorBuilder) AdProvince(adProvince string) *VendorBuilder {
	builder.adProvince = adProvince
	builder.adProvinceFlag = true
	return builder
}

// 交易方注册城市
//
// 示例值：MDCY00001226
func (builder *VendorBuilder) AdCity(adCity string) *VendorBuilder {
	builder.adCity = adCity
	builder.adCityFlag = true
	return builder
}

// 详细地址
//
// 示例值：上海市浦东新区世纪大道1000号
func (builder *VendorBuilder) Address(address string) *VendorBuilder {
	builder.address = address
	builder.addressFlag = true
	return builder
}

// 交易方注册地址邮编
//
// 示例值：100100
func (builder *VendorBuilder) AdPostcode(adPostcode string) *VendorBuilder {
	builder.adPostcode = adPostcode
	builder.adPostcodeFlag = true
	return builder
}

// 法人名称
//
// 示例值：张三
func (builder *VendorBuilder) LegalPerson(legalPerson string) *VendorBuilder {
	builder.legalPerson = legalPerson
	builder.legalPersonFlag = true
	return builder
}

// 证件类型
//
// 示例值：0
func (builder *VendorBuilder) CertificationType(certificationType string) *VendorBuilder {
	builder.certificationType = certificationType
	builder.certificationTypeFlag = true
	return builder
}

// 证件ID
//
// 示例值：913100xxxxx555781R
func (builder *VendorBuilder) CertificationId(certificationId string) *VendorBuilder {
	builder.certificationId = certificationId
	builder.certificationIdFlag = true
	return builder
}

// 联系人
//
// 示例值：李四
func (builder *VendorBuilder) ContactPerson(contactPerson string) *VendorBuilder {
	builder.contactPerson = contactPerson
	builder.contactPersonFlag = true
	return builder
}

// 联系电话
//
// 示例值：021-87853200
func (builder *VendorBuilder) ContactTelephone(contactTelephone string) *VendorBuilder {
	builder.contactTelephone = contactTelephone
	builder.contactTelephoneFlag = true
	return builder
}

// 联系移动电话
//
// 示例值：+8617621685955
func (builder *VendorBuilder) ContactMobilePhone(contactMobilePhone string) *VendorBuilder {
	builder.contactMobilePhone = contactMobilePhone
	builder.contactMobilePhoneFlag = true
	return builder
}

// 传真
//
// 示例值：021-87853200
func (builder *VendorBuilder) Fax(fax string) *VendorBuilder {
	builder.fax = fax
	builder.faxFlag = true
	return builder
}

// 邮箱
//
// 示例值：shunxing@xxx.com
func (builder *VendorBuilder) EMail(eMail string) *VendorBuilder {
	builder.eMail = eMail
	builder.eMailFlag = true
	return builder
}

// 状态
//
// 示例值：1
func (builder *VendorBuilder) Status(status int) *VendorBuilder {
	builder.status = status
	builder.statusFlag = true
	return builder
}

// 交易方编码
//
// 示例值：V00108006
func (builder *VendorBuilder) Vendor(vendor string) *VendorBuilder {
	builder.vendor = vendor
	builder.vendorFlag = true
	return builder
}

// 交易方名称
//
// 示例值：张三样例
func (builder *VendorBuilder) VendorText(vendorText string) *VendorBuilder {
	builder.vendorText = vendorText
	builder.vendorTextFlag = true
	return builder
}

// 交易方简称
//
// 示例值：王五
func (builder *VendorBuilder) ShortText(shortText string) *VendorBuilder {
	builder.shortText = shortText
	builder.shortTextFlag = true
	return builder
}

// 交易方类型（多个枚举时，采用逗号分隔）
//
// 示例值：1
func (builder *VendorBuilder) VendorType(vendorType string) *VendorBuilder {
	builder.vendorType = vendorType
	builder.vendorTypeFlag = true
	return builder
}

// 交易方类别
//
// 示例值：11
func (builder *VendorBuilder) VendorCategory(vendorCategory string) *VendorBuilder {
	builder.vendorCategory = vendorCategory
	builder.vendorCategoryFlag = true
	return builder
}

// 交易方性质
//
// 示例值：0
func (builder *VendorBuilder) VendorNature(vendorNature string) *VendorBuilder {
	builder.vendorNature = vendorNature
	builder.vendorNatureFlag = true
	return builder
}

// 关联员工
//
// 示例值：6959513973725069601
func (builder *VendorBuilder) LinkedEmployee(linkedEmployee string) *VendorBuilder {
	builder.linkedEmployee = linkedEmployee
	builder.linkedEmployeeFlag = true
	return builder
}

// 关联客户
//
// 示例值：客户
func (builder *VendorBuilder) LinkedCustomer(linkedCustomer string) *VendorBuilder {
	builder.linkedCustomer = linkedCustomer
	builder.linkedCustomerFlag = true
	return builder
}

// 是否关联法人主体
//
// 示例值：true
func (builder *VendorBuilder) AssociatedWithLegalEntity(associatedWithLegalEntity bool) *VendorBuilder {
	builder.associatedWithLegalEntity = associatedWithLegalEntity
	builder.associatedWithLegalEntityFlag = true
	return builder
}

// 扩展字段相关信息列表,每个扩展字段需要填入【field_code】、【field_type】、【field_value】三个信息，其中【field_code】和【field_type】需要与用户【字段配置】(获取配置字段的开放平台接口：https://open.feishu.cn/open-apis/mdm/v1/config/config_list)中扩展字段（sys = 1）相关联（目前不支持附件类型的扩展信息）
//
// 示例值：
func (builder *VendorBuilder) ExtendInfo(extendInfo []*ExtendField) *VendorBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

// 银行账户列表
//
// 示例值：
func (builder *VendorBuilder) VendorAccounts(vendorAccounts []*VendorAccount) *VendorBuilder {
	builder.vendorAccounts = vendorAccounts
	builder.vendorAccountsFlag = true
	return builder
}

// 地址列表
//
// 示例值：
func (builder *VendorBuilder) VendorAddresses(vendorAddresses []*VendorAddress) *VendorBuilder {
	builder.vendorAddresses = vendorAddresses
	builder.vendorAddressesFlag = true
	return builder
}

// 公司视图列表
//
// 示例值：
func (builder *VendorBuilder) VendorCompanyViews(vendorCompanyViews []*VendorCompanyView) *VendorBuilder {
	builder.vendorCompanyViews = vendorCompanyViews
	builder.vendorCompanyViewsFlag = true
	return builder
}

// 联系人列表
//
// 示例值：
func (builder *VendorBuilder) VendorContacts(vendorContacts []*VendorContact) *VendorBuilder {
	builder.vendorContacts = vendorContacts
	builder.vendorContactsFlag = true
	return builder
}

// 总账科目
//
// 示例值：22020101
func (builder *VendorBuilder) GlAccount(glAccount string) *VendorBuilder {
	builder.glAccount = glAccount
	builder.glAccountFlag = true
	return builder
}

// 预付条件
//
// 示例值：PT09
func (builder *VendorBuilder) DownPaymentTerm(downPaymentTerm string) *VendorBuilder {
	builder.downPaymentTerm = downPaymentTerm
	builder.downPaymentTermFlag = true
	return builder
}

// 付款条件
//
// 示例值：PT08
func (builder *VendorBuilder) PaymentTerm(paymentTerm string) *VendorBuilder {
	builder.paymentTerm = paymentTerm
	builder.paymentTermFlag = true
	return builder
}

// 交易方site code
//
// 示例值：999999
func (builder *VendorBuilder) VendorSiteCode(vendorSiteCode string) *VendorBuilder {
	builder.vendorSiteCode = vendorSiteCode
	builder.vendorSiteCodeFlag = true
	return builder
}

// 附件列表
//
// 示例值：
func (builder *VendorBuilder) Appendix(appendix []*Appendix) *VendorBuilder {
	builder.appendix = appendix
	builder.appendixFlag = true
	return builder
}

// 是否标记风险
//
// 示例值：false
func (builder *VendorBuilder) IsRisked(isRisked bool) *VendorBuilder {
	builder.isRisked = isRisked
	builder.isRiskedFlag = true
	return builder
}

// 所属部门
//
// 示例值：["7098978978848833836"]
func (builder *VendorBuilder) OwnerDepts(ownerDepts []string) *VendorBuilder {
	builder.ownerDepts = ownerDepts
	builder.ownerDeptsFlag = true
	return builder
}

func (builder *VendorBuilder) Build() *Vendor {
	req := &Vendor{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.adCountryFlag {
		req.AdCountry = &builder.adCountry

	}
	if builder.adProvinceFlag {
		req.AdProvince = &builder.adProvince

	}
	if builder.adCityFlag {
		req.AdCity = &builder.adCity

	}
	if builder.addressFlag {
		req.Address = &builder.address

	}
	if builder.adPostcodeFlag {
		req.AdPostcode = &builder.adPostcode

	}
	if builder.legalPersonFlag {
		req.LegalPerson = &builder.legalPerson

	}
	if builder.certificationTypeFlag {
		req.CertificationType = &builder.certificationType

	}
	if builder.certificationIdFlag {
		req.CertificationId = &builder.certificationId

	}
	if builder.contactPersonFlag {
		req.ContactPerson = &builder.contactPerson

	}
	if builder.contactTelephoneFlag {
		req.ContactTelephone = &builder.contactTelephone

	}
	if builder.contactMobilePhoneFlag {
		req.ContactMobilePhone = &builder.contactMobilePhone

	}
	if builder.faxFlag {
		req.Fax = &builder.fax

	}
	if builder.eMailFlag {
		req.EMail = &builder.eMail

	}
	if builder.statusFlag {
		req.Status = &builder.status

	}
	if builder.vendorFlag {
		req.Vendor = &builder.vendor

	}
	if builder.vendorTextFlag {
		req.VendorText = &builder.vendorText

	}
	if builder.shortTextFlag {
		req.ShortText = &builder.shortText

	}
	if builder.vendorTypeFlag {
		req.VendorType = &builder.vendorType

	}
	if builder.vendorCategoryFlag {
		req.VendorCategory = &builder.vendorCategory

	}
	if builder.vendorNatureFlag {
		req.VendorNature = &builder.vendorNature

	}
	if builder.linkedEmployeeFlag {
		req.LinkedEmployee = &builder.linkedEmployee

	}
	if builder.linkedCustomerFlag {
		req.LinkedCustomer = &builder.linkedCustomer

	}
	if builder.associatedWithLegalEntityFlag {
		req.AssociatedWithLegalEntity = &builder.associatedWithLegalEntity

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	if builder.vendorAccountsFlag {
		req.VendorAccounts = builder.vendorAccounts
	}
	if builder.vendorAddressesFlag {
		req.VendorAddresses = builder.vendorAddresses
	}
	if builder.vendorCompanyViewsFlag {
		req.VendorCompanyViews = builder.vendorCompanyViews
	}
	if builder.vendorContactsFlag {
		req.VendorContacts = builder.vendorContacts
	}
	if builder.glAccountFlag {
		req.GlAccount = &builder.glAccount

	}
	if builder.downPaymentTermFlag {
		req.DownPaymentTerm = &builder.downPaymentTerm

	}
	if builder.paymentTermFlag {
		req.PaymentTerm = &builder.paymentTerm

	}
	if builder.vendorSiteCodeFlag {
		req.VendorSiteCode = &builder.vendorSiteCode

	}
	if builder.appendixFlag {
		req.Appendix = builder.appendix
	}
	if builder.isRiskedFlag {
		req.IsRisked = &builder.isRisked

	}
	if builder.ownerDeptsFlag {
		req.OwnerDepts = builder.ownerDepts
	}
	return req
}

type VendorAccount struct {
	Id *string `json:"id,omitempty"` // 交易方银行账户id,修改信息时当前的账户id均必填，新增的账户id不填

	Account *string `json:"account,omitempty"` // 账号

	Iban *string `json:"iban,omitempty"` // 国际银行账号

	AccountName *string `json:"account_name,omitempty"` // 账户名

	BankId *string `json:"bank_id,omitempty"` // 银行内部Id

	BankCode *string `json:"bank_code,omitempty"` // 银联号

	SwiftCode *string `json:"swift_code,omitempty"` // 银行Swift编码

	VendorSiteCode *string `json:"vendor_site_code,omitempty"` // 交易方siteCode

	BankName *string `json:"bank_name,omitempty"` // 银行名称

	BankAcronym *string `json:"bank_acronym,omitempty"` // 银行简码

	Country *string `json:"country,omitempty"` // 国家

	BankControlCode *string `json:"bank_control_code,omitempty"` // 银行控制码

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表
}

type VendorAccountBuilder struct {
	id     string // 交易方银行账户id,修改信息时当前的账户id均必填，新增的账户id不填
	idFlag bool

	account     string // 账号
	accountFlag bool

	iban     string // 国际银行账号
	ibanFlag bool

	accountName     string // 账户名
	accountNameFlag bool

	bankId     string // 银行内部Id
	bankIdFlag bool

	bankCode     string // 银联号
	bankCodeFlag bool

	swiftCode     string // 银行Swift编码
	swiftCodeFlag bool

	vendorSiteCode     string // 交易方siteCode
	vendorSiteCodeFlag bool

	bankName     string // 银行名称
	bankNameFlag bool

	bankAcronym     string // 银行简码
	bankAcronymFlag bool

	country     string // 国家
	countryFlag bool

	bankControlCode     string // 银行控制码
	bankControlCodeFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool
}

func NewVendorAccountBuilder() *VendorAccountBuilder {
	builder := &VendorAccountBuilder{}
	return builder
}

// 交易方银行账户id,修改信息时当前的账户id均必填，新增的账户id不填
//
// 示例值：1453263653228318721
func (builder *VendorAccountBuilder) Id(id string) *VendorAccountBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 账号
//
// 示例值：62448345986564434
func (builder *VendorAccountBuilder) Account(account string) *VendorAccountBuilder {
	builder.account = account
	builder.accountFlag = true
	return builder
}

// 国际银行账号
//
// 示例值：46677
func (builder *VendorAccountBuilder) Iban(iban string) *VendorAccountBuilder {
	builder.iban = iban
	builder.ibanFlag = true
	return builder
}

// 账户名
//
// 示例值：上海xxx技术有限（上海）分公司
func (builder *VendorAccountBuilder) AccountName(accountName string) *VendorAccountBuilder {
	builder.accountName = accountName
	builder.accountNameFlag = true
	return builder
}

// 银行内部Id
//
// 示例值：MDBK00061195
func (builder *VendorAccountBuilder) BankId(bankId string) *VendorAccountBuilder {
	builder.bankId = bankId
	builder.bankIdFlag = true
	return builder
}

// 银联号
//
// 示例值：308290003732
func (builder *VendorAccountBuilder) BankCode(bankCode string) *VendorAccountBuilder {
	builder.bankCode = bankCode
	builder.bankCodeFlag = true
	return builder
}

// 银行Swift编码
//
// 示例值：BOFAUS3NINQ
func (builder *VendorAccountBuilder) SwiftCode(swiftCode string) *VendorAccountBuilder {
	builder.swiftCode = swiftCode
	builder.swiftCodeFlag = true
	return builder
}

// 交易方siteCode
//
// 示例值：99999999
func (builder *VendorAccountBuilder) VendorSiteCode(vendorSiteCode string) *VendorAccountBuilder {
	builder.vendorSiteCode = vendorSiteCode
	builder.vendorSiteCodeFlag = true
	return builder
}

// 银行名称
//
// 示例值：xx银行股份有限公司苏州支行
func (builder *VendorAccountBuilder) BankName(bankName string) *VendorAccountBuilder {
	builder.bankName = bankName
	builder.bankNameFlag = true
	return builder
}

// 银行简码
//
// 示例值：ZJTLCB
func (builder *VendorAccountBuilder) BankAcronym(bankAcronym string) *VendorAccountBuilder {
	builder.bankAcronym = bankAcronym
	builder.bankAcronymFlag = true
	return builder
}

// 国家
//
// 示例值：CN
func (builder *VendorAccountBuilder) Country(country string) *VendorAccountBuilder {
	builder.country = country
	builder.countryFlag = true
	return builder
}

// 银行控制码
//
// 示例值：99999999
func (builder *VendorAccountBuilder) BankControlCode(bankControlCode string) *VendorAccountBuilder {
	builder.bankControlCode = bankControlCode
	builder.bankControlCodeFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *VendorAccountBuilder) ExtendInfo(extendInfo []*ExtendField) *VendorAccountBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

func (builder *VendorAccountBuilder) Build() *VendorAccount {
	req := &VendorAccount{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.accountFlag {
		req.Account = &builder.account

	}
	if builder.ibanFlag {
		req.Iban = &builder.iban

	}
	if builder.accountNameFlag {
		req.AccountName = &builder.accountName

	}
	if builder.bankIdFlag {
		req.BankId = &builder.bankId

	}
	if builder.bankCodeFlag {
		req.BankCode = &builder.bankCode

	}
	if builder.swiftCodeFlag {
		req.SwiftCode = &builder.swiftCode

	}
	if builder.vendorSiteCodeFlag {
		req.VendorSiteCode = &builder.vendorSiteCode

	}
	if builder.bankNameFlag {
		req.BankName = &builder.bankName

	}
	if builder.bankAcronymFlag {
		req.BankAcronym = &builder.bankAcronym

	}
	if builder.countryFlag {
		req.Country = &builder.country

	}
	if builder.bankControlCodeFlag {
		req.BankControlCode = &builder.bankControlCode

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	return req
}

type VendorAddress struct {
	Id *string `json:"id,omitempty"` // 交易方地址id

	Country *string `json:"country,omitempty"` // 国家

	Province *string `json:"province,omitempty"` // 省份

	City *string `json:"city,omitempty"` // 城市

	County *string `json:"county,omitempty"` // 县

	Address *string `json:"address,omitempty"` // 详细地址

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表
}

type VendorAddressBuilder struct {
	id     string // 交易方地址id
	idFlag bool

	country     string // 国家
	countryFlag bool

	province     string // 省份
	provinceFlag bool

	city     string // 城市
	cityFlag bool

	county     string // 县
	countyFlag bool

	address     string // 详细地址
	addressFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool
}

func NewVendorAddressBuilder() *VendorAddressBuilder {
	builder := &VendorAddressBuilder{}
	return builder
}

// 交易方地址id
//
// 示例值：1433488030078558209
func (builder *VendorAddressBuilder) Id(id string) *VendorAddressBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 国家
//
// 示例值：CN
func (builder *VendorAddressBuilder) Country(country string) *VendorAddressBuilder {
	builder.country = country
	builder.countryFlag = true
	return builder
}

// 省份
//
// 示例值：MDPS00000001
func (builder *VendorAddressBuilder) Province(province string) *VendorAddressBuilder {
	builder.province = province
	builder.provinceFlag = true
	return builder
}

// 城市
//
// 示例值：MDCY00000001
func (builder *VendorAddressBuilder) City(city string) *VendorAddressBuilder {
	builder.city = city
	builder.cityFlag = true
	return builder
}

// 县
//
// 示例值：MDCA00002746
func (builder *VendorAddressBuilder) County(county string) *VendorAddressBuilder {
	builder.county = county
	builder.countyFlag = true
	return builder
}

// 详细地址
//
// 示例值：北京市海淀区苏州街
func (builder *VendorAddressBuilder) Address(address string) *VendorAddressBuilder {
	builder.address = address
	builder.addressFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *VendorAddressBuilder) ExtendInfo(extendInfo []*ExtendField) *VendorAddressBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

func (builder *VendorAddressBuilder) Build() *VendorAddress {
	req := &VendorAddress{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.countryFlag {
		req.Country = &builder.country

	}
	if builder.provinceFlag {
		req.Province = &builder.province

	}
	if builder.cityFlag {
		req.City = &builder.city

	}
	if builder.countyFlag {
		req.County = &builder.county

	}
	if builder.addressFlag {
		req.Address = &builder.address

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	return req
}

type VendorCompanyView struct {
	Id *string `json:"id,omitempty"` // 交易方公司视图id

	CompanyCode *string `json:"company_code,omitempty"` // 公司代码

	GlAccount *string `json:"gl_account,omitempty"` // 总账科目

	VendorSiteCode *string `json:"vendor_site_code,omitempty"` // 交易方sitecode

	PaymentTerm *string `json:"payment_term,omitempty"` // 付款条件信息

	DownPaymentTerm *string `json:"down_payment_term,omitempty"` // 预付条件

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表
}

type VendorCompanyViewBuilder struct {
	id     string // 交易方公司视图id
	idFlag bool

	companyCode     string // 公司代码
	companyCodeFlag bool

	glAccount     string // 总账科目
	glAccountFlag bool

	vendorSiteCode     string // 交易方sitecode
	vendorSiteCodeFlag bool

	paymentTerm     string // 付款条件信息
	paymentTermFlag bool

	downPaymentTerm     string // 预付条件
	downPaymentTermFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool
}

func NewVendorCompanyViewBuilder() *VendorCompanyViewBuilder {
	builder := &VendorCompanyViewBuilder{}
	return builder
}

// 交易方公司视图id
//
// 示例值：1453263653228318721
func (builder *VendorCompanyViewBuilder) Id(id string) *VendorCompanyViewBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 公司代码
//
// 示例值：1001
func (builder *VendorCompanyViewBuilder) CompanyCode(companyCode string) *VendorCompanyViewBuilder {
	builder.companyCode = companyCode
	builder.companyCodeFlag = true
	return builder
}

// 总账科目
//
// 示例值：22020101
func (builder *VendorCompanyViewBuilder) GlAccount(glAccount string) *VendorCompanyViewBuilder {
	builder.glAccount = glAccount
	builder.glAccountFlag = true
	return builder
}

// 交易方sitecode
//
// 示例值：999999
func (builder *VendorCompanyViewBuilder) VendorSiteCode(vendorSiteCode string) *VendorCompanyViewBuilder {
	builder.vendorSiteCode = vendorSiteCode
	builder.vendorSiteCodeFlag = true
	return builder
}

// 付款条件信息
//
// 示例值：PT09
func (builder *VendorCompanyViewBuilder) PaymentTerm(paymentTerm string) *VendorCompanyViewBuilder {
	builder.paymentTerm = paymentTerm
	builder.paymentTermFlag = true
	return builder
}

// 预付条件
//
// 示例值：PT08
func (builder *VendorCompanyViewBuilder) DownPaymentTerm(downPaymentTerm string) *VendorCompanyViewBuilder {
	builder.downPaymentTerm = downPaymentTerm
	builder.downPaymentTermFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *VendorCompanyViewBuilder) ExtendInfo(extendInfo []*ExtendField) *VendorCompanyViewBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

func (builder *VendorCompanyViewBuilder) Build() *VendorCompanyView {
	req := &VendorCompanyView{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.companyCodeFlag {
		req.CompanyCode = &builder.companyCode

	}
	if builder.glAccountFlag {
		req.GlAccount = &builder.glAccount

	}
	if builder.vendorSiteCodeFlag {
		req.VendorSiteCode = &builder.vendorSiteCode

	}
	if builder.paymentTermFlag {
		req.PaymentTerm = &builder.paymentTerm

	}
	if builder.downPaymentTermFlag {
		req.DownPaymentTerm = &builder.downPaymentTerm

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	return req
}

type VendorContact struct {
	Id *string `json:"id,omitempty"` // 交易方联系人id

	Name *string `json:"name,omitempty"` // 姓名

	Position *string `json:"position,omitempty"` // 职位

	Email *string `json:"email,omitempty"` // 邮箱

	Phone *string `json:"phone,omitempty"` // 手机号

	Remark *string `json:"remark,omitempty"` // 备注

	ExtendInfo []*ExtendField `json:"extend_info,omitempty"` // 扩展字段相关信息列表
}

type VendorContactBuilder struct {
	id     string // 交易方联系人id
	idFlag bool

	name     string // 姓名
	nameFlag bool

	position     string // 职位
	positionFlag bool

	email     string // 邮箱
	emailFlag bool

	phone     string // 手机号
	phoneFlag bool

	remark     string // 备注
	remarkFlag bool

	extendInfo     []*ExtendField // 扩展字段相关信息列表
	extendInfoFlag bool
}

func NewVendorContactBuilder() *VendorContactBuilder {
	builder := &VendorContactBuilder{}
	return builder
}

// 交易方联系人id
//
// 示例值：1433488091906793474
func (builder *VendorContactBuilder) Id(id string) *VendorContactBuilder {
	builder.id = id
	builder.idFlag = true
	return builder
}

// 姓名
//
// 示例值：张三
func (builder *VendorContactBuilder) Name(name string) *VendorContactBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 职位
//
// 示例值：董事长
func (builder *VendorContactBuilder) Position(position string) *VendorContactBuilder {
	builder.position = position
	builder.positionFlag = true
	return builder
}

// 邮箱
//
// 示例值：haha@xxx.com
func (builder *VendorContactBuilder) Email(email string) *VendorContactBuilder {
	builder.email = email
	builder.emailFlag = true
	return builder
}

// 手机号
//
// 示例值：13333323333
func (builder *VendorContactBuilder) Phone(phone string) *VendorContactBuilder {
	builder.phone = phone
	builder.phoneFlag = true
	return builder
}

// 备注
//
// 示例值：备注
func (builder *VendorContactBuilder) Remark(remark string) *VendorContactBuilder {
	builder.remark = remark
	builder.remarkFlag = true
	return builder
}

// 扩展字段相关信息列表
//
// 示例值：
func (builder *VendorContactBuilder) ExtendInfo(extendInfo []*ExtendField) *VendorContactBuilder {
	builder.extendInfo = extendInfo
	builder.extendInfoFlag = true
	return builder
}

func (builder *VendorContactBuilder) Build() *VendorContact {
	req := &VendorContact{}
	if builder.idFlag {
		req.Id = &builder.id

	}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.positionFlag {
		req.Position = &builder.position

	}
	if builder.emailFlag {
		req.Email = &builder.email

	}
	if builder.phoneFlag {
		req.Phone = &builder.phone

	}
	if builder.remarkFlag {
		req.Remark = &builder.remark

	}
	if builder.extendInfoFlag {
		req.ExtendInfo = builder.extendInfo
	}
	return req
}

type BindUserAuthDataRelationReqBuilder struct {
	apiReq               *larkcore.ApiReq
	userAuthDataRelation *UserAuthDataRelation
}

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

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *BindUserAuthDataRelationReqBuilder) UserIdType(userIdType string) *BindUserAuthDataRelationReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 通过该接口，可为指定应用下的用户绑定一类数据维度，支持批量给多个用户同时增量授权。
func (builder *BindUserAuthDataRelationReqBuilder) UserAuthDataRelation(userAuthDataRelation *UserAuthDataRelation) *BindUserAuthDataRelationReqBuilder {
	builder.userAuthDataRelation = userAuthDataRelation
	return builder
}

func (builder *BindUserAuthDataRelationReqBuilder) Build() *BindUserAuthDataRelationReq {
	req := &BindUserAuthDataRelationReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.userAuthDataRelation
	return req
}

type BindUserAuthDataRelationReq struct {
	apiReq               *larkcore.ApiReq
	UserAuthDataRelation *UserAuthDataRelation `body:""`
}

type BindUserAuthDataRelationResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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

type UnbindUserAuthDataRelationReqBuilder struct {
	apiReq               *larkcore.ApiReq
	userAuthDataRelation *UserAuthDataRelation
}

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

// 此次调用中使用的用户ID的类型
//
// 示例值：
func (builder *UnbindUserAuthDataRelationReqBuilder) UserIdType(userIdType string) *UnbindUserAuthDataRelationReqBuilder {
	builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
	return builder
}

// 通过该接口，可为指定应用下的指定用户解除一类数据维度。
func (builder *UnbindUserAuthDataRelationReqBuilder) UserAuthDataRelation(userAuthDataRelation *UserAuthDataRelation) *UnbindUserAuthDataRelationReqBuilder {
	builder.userAuthDataRelation = userAuthDataRelation
	return builder
}

func (builder *UnbindUserAuthDataRelationReqBuilder) Build() *UnbindUserAuthDataRelationReq {
	req := &UnbindUserAuthDataRelationReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.QueryParams = builder.apiReq.QueryParams
	req.apiReq.Body = builder.userAuthDataRelation
	return req
}

type UnbindUserAuthDataRelationReq struct {
	apiReq               *larkcore.ApiReq
	UserAuthDataRelation *UserAuthDataRelation `body:""`
}

type UnbindUserAuthDataRelationResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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