// Package verification 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 larkverification

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

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 Verification struct {
	Name *string `json:"name,omitempty"` // 企业主体名称

	HasVerification *bool `json:"has_verification,omitempty"` // 企业是否完成认证； true 表示已经完成认证，false 表示未认证
}

type VerificationBuilder struct {
	name     string // 企业主体名称
	nameFlag bool

	hasVerification     bool // 企业是否完成认证； true 表示已经完成认证，false 表示未认证
	hasVerificationFlag bool
}

func NewVerificationBuilder() *VerificationBuilder {
	builder := &VerificationBuilder{}
	return builder
}

// 企业主体名称
//
// 示例值：无限未来科技公司
func (builder *VerificationBuilder) Name(name string) *VerificationBuilder {
	builder.name = name
	builder.nameFlag = true
	return builder
}

// 企业是否完成认证； true 表示已经完成认证，false 表示未认证
//
// 示例值：
func (builder *VerificationBuilder) HasVerification(hasVerification bool) *VerificationBuilder {
	builder.hasVerification = hasVerification
	builder.hasVerificationFlag = true
	return builder
}

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

	}
	if builder.hasVerificationFlag {
		req.HasVerification = &builder.hasVerification

	}
	return req
}

type VerificationDetail struct {
	VerificationType *int `json:"verification_type,omitempty"` // 认证类型

	VerificationSource *int `json:"verification_source,omitempty"` // 认证方式

	OrgName *string `json:"org_name,omitempty"` // 工商名称

	Usci *string `json:"usci,omitempty"` // 统一工商信用代码

	OrgType *int `json:"org_type,omitempty"` // 企业类型

	LegalPersonName *string `json:"legal_person_name,omitempty"` // 法人姓名

	EnterpriseLicense *string `json:"enterprise_license,omitempty"` // 企业经营许可证

	VerificationLetter *string `json:"verification_letter,omitempty"` // 认证公函
}

type VerificationDetailBuilder struct {
	verificationType     int // 认证类型
	verificationTypeFlag bool

	verificationSource     int // 认证方式
	verificationSourceFlag bool

	orgName     string // 工商名称
	orgNameFlag bool

	usci     string // 统一工商信用代码
	usciFlag bool

	orgType     int // 企业类型
	orgTypeFlag bool

	legalPersonName     string // 法人姓名
	legalPersonNameFlag bool

	enterpriseLicense     string // 企业经营许可证
	enterpriseLicenseFlag bool

	verificationLetter     string // 认证公函
	verificationLetterFlag bool
}

func NewVerificationDetailBuilder() *VerificationDetailBuilder {
	builder := &VerificationDetailBuilder{}
	return builder
}

// 认证类型
//
// 示例值：
func (builder *VerificationDetailBuilder) VerificationType(verificationType int) *VerificationDetailBuilder {
	builder.verificationType = verificationType
	builder.verificationTypeFlag = true
	return builder
}

// 认证方式
//
// 示例值：
func (builder *VerificationDetailBuilder) VerificationSource(verificationSource int) *VerificationDetailBuilder {
	builder.verificationSource = verificationSource
	builder.verificationSourceFlag = true
	return builder
}

// 工商名称
//
// 示例值：未来有限公司
func (builder *VerificationDetailBuilder) OrgName(orgName string) *VerificationDetailBuilder {
	builder.orgName = orgName
	builder.orgNameFlag = true
	return builder
}

// 统一工商信用代码
//
// 示例值：xxxx
func (builder *VerificationDetailBuilder) Usci(usci string) *VerificationDetailBuilder {
	builder.usci = usci
	builder.usciFlag = true
	return builder
}

// 企业类型
//
// 示例值：
func (builder *VerificationDetailBuilder) OrgType(orgType int) *VerificationDetailBuilder {
	builder.orgType = orgType
	builder.orgTypeFlag = true
	return builder
}

// 法人姓名
//
// 示例值：张三
func (builder *VerificationDetailBuilder) LegalPersonName(legalPersonName string) *VerificationDetailBuilder {
	builder.legalPersonName = legalPersonName
	builder.legalPersonNameFlag = true
	return builder
}

// 企业经营许可证
//
// 示例值：https://xxx
func (builder *VerificationDetailBuilder) EnterpriseLicense(enterpriseLicense string) *VerificationDetailBuilder {
	builder.enterpriseLicense = enterpriseLicense
	builder.enterpriseLicenseFlag = true
	return builder
}

// 认证公函
//
// 示例值：https://xxx
func (builder *VerificationDetailBuilder) VerificationLetter(verificationLetter string) *VerificationDetailBuilder {
	builder.verificationLetter = verificationLetter
	builder.verificationLetterFlag = true
	return builder
}

func (builder *VerificationDetailBuilder) Build() *VerificationDetail {
	req := &VerificationDetail{}
	if builder.verificationTypeFlag {
		req.VerificationType = &builder.verificationType

	}
	if builder.verificationSourceFlag {
		req.VerificationSource = &builder.verificationSource

	}
	if builder.orgNameFlag {
		req.OrgName = &builder.orgName

	}
	if builder.usciFlag {
		req.Usci = &builder.usci

	}
	if builder.orgTypeFlag {
		req.OrgType = &builder.orgType

	}
	if builder.legalPersonNameFlag {
		req.LegalPersonName = &builder.legalPersonName

	}
	if builder.enterpriseLicenseFlag {
		req.EnterpriseLicense = &builder.enterpriseLicense

	}
	if builder.verificationLetterFlag {
		req.VerificationLetter = &builder.verificationLetter

	}
	return req
}

type GetVerificationRespData struct {
	Verification *Verification `json:"verification,omitempty"` // 认证信息
}

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

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