// Package tenant 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 larktenant

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

type Avatar struct {
	AvatarOrigin *string `json:"avatar_origin,omitempty"` // 企业头像

	Avatar72 *string `json:"avatar_72,omitempty"` // 企业头像 72x72

	Avatar240 *string `json:"avatar_240,omitempty"` // 企业头像 240x240

	Avatar640 *string `json:"avatar_640,omitempty"` // 企业头像 640x640
}

type AvatarBuilder struct {
	avatarOrigin     string // 企业头像
	avatarOriginFlag bool

	avatar72     string // 企业头像 72x72
	avatar72Flag bool

	avatar240     string // 企业头像 240x240
	avatar240Flag bool

	avatar640     string // 企业头像 640x640
	avatar640Flag bool
}

func NewAvatarBuilder() *AvatarBuilder {
	builder := &AvatarBuilder{}
	return builder
}

// 企业头像
//
// 示例值：https://foo.icon.com/xxxx
func (builder *AvatarBuilder) AvatarOrigin(avatarOrigin string) *AvatarBuilder {
	builder.avatarOrigin = avatarOrigin
	builder.avatarOriginFlag = true
	return builder
}

// 企业头像 72x72
//
// 示例值：https://foo.icon.com/xxxx
func (builder *AvatarBuilder) Avatar72(avatar72 string) *AvatarBuilder {
	builder.avatar72 = avatar72
	builder.avatar72Flag = true
	return builder
}

// 企业头像 240x240
//
// 示例值：https://foo.icon.com/xxxx
func (builder *AvatarBuilder) Avatar240(avatar240 string) *AvatarBuilder {
	builder.avatar240 = avatar240
	builder.avatar240Flag = true
	return builder
}

// 企业头像 640x640
//
// 示例值：https://foo.icon.com/xxxx
func (builder *AvatarBuilder) Avatar640(avatar640 string) *AvatarBuilder {
	builder.avatar640 = avatar640
	builder.avatar640Flag = true
	return builder
}

func (builder *AvatarBuilder) Build() *Avatar {
	req := &Avatar{}
	if builder.avatarOriginFlag {
		req.AvatarOrigin = &builder.avatarOrigin

	}
	if builder.avatar72Flag {
		req.Avatar72 = &builder.avatar72

	}
	if builder.avatar240Flag {
		req.Avatar240 = &builder.avatar240

	}
	if builder.avatar640Flag {
		req.Avatar640 = &builder.avatar640

	}
	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 ProductI18nName struct {
	ZhCn *string `json:"zh_cn,omitempty"` // 商业化产品的中文名

	JaJp *string `json:"ja_jp,omitempty"` // 商业化产品的日文名

	EnUs *string `json:"en_us,omitempty"` // 商业化产品的英文名
}

type ProductI18nNameBuilder struct {
	zhCn     string // 商业化产品的中文名
	zhCnFlag bool

	jaJp     string // 商业化产品的日文名
	jaJpFlag bool

	enUs     string // 商业化产品的英文名
	enUsFlag bool
}

func NewProductI18nNameBuilder() *ProductI18nNameBuilder {
	builder := &ProductI18nNameBuilder{}
	return builder
}

// 商业化产品的中文名
//
// 示例值：zh_cn_name
func (builder *ProductI18nNameBuilder) ZhCn(zhCn string) *ProductI18nNameBuilder {
	builder.zhCn = zhCn
	builder.zhCnFlag = true
	return builder
}

// 商业化产品的日文名
//
// 示例值：ja_jp_name
func (builder *ProductI18nNameBuilder) JaJp(jaJp string) *ProductI18nNameBuilder {
	builder.jaJp = jaJp
	builder.jaJpFlag = true
	return builder
}

// 商业化产品的英文名
//
// 示例值：en_name
func (builder *ProductI18nNameBuilder) EnUs(enUs string) *ProductI18nNameBuilder {
	builder.enUs = enUs
	builder.enUsFlag = true
	return builder
}

func (builder *ProductI18nNameBuilder) Build() *ProductI18nName {
	req := &ProductI18nName{}
	if builder.zhCnFlag {
		req.ZhCn = &builder.zhCn

	}
	if builder.jaJpFlag {
		req.JaJp = &builder.jaJp

	}
	if builder.enUsFlag {
		req.EnUs = &builder.enUs

	}
	return req
}

type Tenant struct {
	Name *string `json:"name,omitempty"` // 企业名称

	DisplayId *string `json:"display_id,omitempty"` // 企业编号，平台内唯一

	TenantTag *int `json:"tenant_tag,omitempty"` // 个人版/团队版标志

	TenantKey *string `json:"tenant_key,omitempty"` // 企业标识

	Avatar *Avatar `json:"avatar,omitempty"` // 企业头像

	Domain *string `json:"domain,omitempty"` // 企业完整域名。企业域名可用于企业成员访问管理后台、云文档等含URL地址的网页。
}

type TenantBuilder struct {
	name     string // 企业名称
	nameFlag bool

	displayId     string // 企业编号，平台内唯一
	displayIdFlag bool

	tenantTag     int // 个人版/团队版标志
	tenantTagFlag bool

	tenantKey     string // 企业标识
	tenantKeyFlag bool

	avatar     *Avatar // 企业头像
	avatarFlag bool

	domain     string // 企业完整域名。企业域名可用于企业成员访问管理后台、云文档等含URL地址的网页。
	domainFlag bool
}

func NewTenantBuilder() *TenantBuilder {
	builder := &TenantBuilder{}
	return builder
}

// 企业名称
//
// 示例值：企业名称
func (builder *TenantBuilder) Name(name string) *TenantBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 企业编号，平台内唯一
//
// 示例值：F123456789
func (builder *TenantBuilder) DisplayId(displayId string) *TenantBuilder {
	builder.displayId = displayId
	builder.displayIdFlag = true
	return builder
}

// 个人版/团队版标志
//
// 示例值：0
func (builder *TenantBuilder) TenantTag(tenantTag int) *TenantBuilder {
	builder.tenantTag = tenantTag
	builder.tenantTagFlag = true
	return builder
}

// 企业标识
//
// 示例值：abcdefghi
func (builder *TenantBuilder) TenantKey(tenantKey string) *TenantBuilder {
	builder.tenantKey = tenantKey
	builder.tenantKeyFlag = true
	return builder
}

// 企业头像
//
// 示例值：
func (builder *TenantBuilder) Avatar(avatar *Avatar) *TenantBuilder {
	builder.avatar = avatar
	builder.avatarFlag = true
	return builder
}

// 企业完整域名。企业域名可用于企业成员访问管理后台、云文档等含URL地址的网页。
//
// 示例值：newpoint.feishu-boe.cn
func (builder *TenantBuilder) Domain(domain string) *TenantBuilder {
	builder.domain = domain
	builder.domainFlag = true
	return builder
}

func (builder *TenantBuilder) Build() *Tenant {
	req := &Tenant{}
	if builder.nameFlag {
		req.Name = &builder.name

	}
	if builder.displayIdFlag {
		req.DisplayId = &builder.displayId

	}
	if builder.tenantTagFlag {
		req.TenantTag = &builder.tenantTag

	}
	if builder.tenantKeyFlag {
		req.TenantKey = &builder.tenantKey

	}
	if builder.avatarFlag {
		req.Avatar = builder.avatar
	}
	if builder.domainFlag {
		req.Domain = &builder.domain

	}
	return req
}

type TenantAssignInfo struct {
	SubscriptionId *string `json:"subscription_id,omitempty"` // 席位id

	LicensePlanKey *string `json:"license_plan_key,omitempty"` // license_plan_key

	ProductName *string `json:"product_name,omitempty"` // 商业化产品名称

	I18nName *ProductI18nName `json:"i18n_name,omitempty"` // 国际化名称

	TotalSeats *string `json:"total_seats,omitempty"` // 席位总数

	AssignedSeats *string `json:"assigned_seats,omitempty"` // 已分配席位数

	StartTime *string `json:"start_time,omitempty"` // 席位起始时间

	EndTime *string `json:"end_time,omitempty"` // 席位结束时间
}

type TenantAssignInfoBuilder struct {
	subscriptionId     string // 席位id
	subscriptionIdFlag bool

	licensePlanKey     string // license_plan_key
	licensePlanKeyFlag bool

	productName     string // 商业化产品名称
	productNameFlag bool

	i18nName     *ProductI18nName // 国际化名称
	i18nNameFlag bool

	totalSeats     string // 席位总数
	totalSeatsFlag bool

	assignedSeats     string // 已分配席位数
	assignedSeatsFlag bool

	startTime     string // 席位起始时间
	startTimeFlag bool

	endTime     string // 席位结束时间
	endTimeFlag bool
}

func NewTenantAssignInfoBuilder() *TenantAssignInfoBuilder {
	builder := &TenantAssignInfoBuilder{}
	return builder
}

// 席位id
//
// 示例值：7079609167680782300
func (builder *TenantAssignInfoBuilder) SubscriptionId(subscriptionId string) *TenantAssignInfoBuilder {
	builder.subscriptionId = subscriptionId
	builder.subscriptionIdFlag = true
	return builder
}

// license_plan_key
//
// 示例值：suite_enterprise_e5
func (builder *TenantAssignInfoBuilder) LicensePlanKey(licensePlanKey string) *TenantAssignInfoBuilder {
	builder.licensePlanKey = licensePlanKey
	builder.licensePlanKeyFlag = true
	return builder
}

// 商业化产品名称
//
// 示例值：旗舰版 E5
func (builder *TenantAssignInfoBuilder) ProductName(productName string) *TenantAssignInfoBuilder {
	builder.productName = productName
	builder.productNameFlag = true
	return builder
}

// 国际化名称
//
// 示例值：
func (builder *TenantAssignInfoBuilder) I18nName(i18nName *ProductI18nName) *TenantAssignInfoBuilder {
	builder.i18nName = i18nName
	builder.i18nNameFlag = true
	return builder
}

// 席位总数
//
// 示例值：500
func (builder *TenantAssignInfoBuilder) TotalSeats(totalSeats string) *TenantAssignInfoBuilder {
	builder.totalSeats = totalSeats
	builder.totalSeatsFlag = true
	return builder
}

// 已分配席位数
//
// 示例值：20
func (builder *TenantAssignInfoBuilder) AssignedSeats(assignedSeats string) *TenantAssignInfoBuilder {
	builder.assignedSeats = assignedSeats
	builder.assignedSeatsFlag = true
	return builder
}

// 席位起始时间
//
// 示例值：1674981000
func (builder *TenantAssignInfoBuilder) StartTime(startTime string) *TenantAssignInfoBuilder {
	builder.startTime = startTime
	builder.startTimeFlag = true
	return builder
}

// 席位结束时间
//
// 示例值：1674991000
func (builder *TenantAssignInfoBuilder) EndTime(endTime string) *TenantAssignInfoBuilder {
	builder.endTime = endTime
	builder.endTimeFlag = true
	return builder
}

func (builder *TenantAssignInfoBuilder) Build() *TenantAssignInfo {
	req := &TenantAssignInfo{}
	if builder.subscriptionIdFlag {
		req.SubscriptionId = &builder.subscriptionId

	}
	if builder.licensePlanKeyFlag {
		req.LicensePlanKey = &builder.licensePlanKey

	}
	if builder.productNameFlag {
		req.ProductName = &builder.productName

	}
	if builder.i18nNameFlag {
		req.I18nName = builder.i18nName
	}
	if builder.totalSeatsFlag {
		req.TotalSeats = &builder.totalSeats

	}
	if builder.assignedSeatsFlag {
		req.AssignedSeats = &builder.assignedSeats

	}
	if builder.startTimeFlag {
		req.StartTime = &builder.startTime

	}
	if builder.endTimeFlag {
		req.EndTime = &builder.endTime

	}
	return req
}

type QueryTenantRespData struct {
	Tenant *Tenant `json:"tenant,omitempty"` // 企业信息
}

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

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

type QueryTenantProductAssignInfoRespData struct {
	AssignInfoList []*TenantAssignInfo `json:"assign_info_list,omitempty"` // 租户待分配席位列表
}

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

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