// Package auth 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 larkauth

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

type AppAccessToken struct {
}

type AppAccessTokenBuilder struct {
}

func NewAppAccessTokenBuilder() *AppAccessTokenBuilder {
	builder := &AppAccessTokenBuilder{}
	return builder
}

func (builder *AppAccessTokenBuilder) Build() *AppAccessToken {
	req := &AppAccessToken{}
	return req
}

type AppTicket struct {
}

type AppTicketBuilder struct {
}

func NewAppTicketBuilder() *AppTicketBuilder {
	builder := &AppTicketBuilder{}
	return builder
}

func (builder *AppTicketBuilder) Build() *AppTicket {
	req := &AppTicket{}
	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 RevokeTokenEvent struct {
	RevokeTokenType *string `json:"revoke_token_type,omitempty"` // 撤销token的类型

	RevokeReason *string `json:"revoke_reason,omitempty"` // 撤销token的原因

	OpenId *string `json:"open_id,omitempty"` // 用户open_id

	UnionId *string `json:"union_id,omitempty"` // 用户union_id

	UserId *string `json:"user_id,omitempty"` // 租户内用户的唯一标识
}

type RevokeTokenEventBuilder struct {
	revokeTokenType     string // 撤销token的类型
	revokeTokenTypeFlag bool

	revokeReason     string // 撤销token的原因
	revokeReasonFlag bool

	openId     string // 用户open_id
	openIdFlag bool

	unionId     string // 用户union_id
	unionIdFlag bool

	userId     string // 租户内用户的唯一标识
	userIdFlag bool
}

func NewRevokeTokenEventBuilder() *RevokeTokenEventBuilder {
	builder := &RevokeTokenEventBuilder{}
	return builder
}

// 撤销token的类型
//
// 示例值：user_access_token refresh_token
func (builder *RevokeTokenEventBuilder) RevokeTokenType(revokeTokenType string) *RevokeTokenEventBuilder {
	builder.revokeTokenType = revokeTokenType
	builder.revokeTokenTypeFlag = true
	return builder
}

// 撤销token的原因
//
// 示例值：Revoked by security and risk control action.
func (builder *RevokeTokenEventBuilder) RevokeReason(revokeReason string) *RevokeTokenEventBuilder {
	builder.revokeReason = revokeReason
	builder.revokeReasonFlag = true
	return builder
}

// 用户open_id
//
// 示例值：ou_c99c5f35d542efc7ee492afe11af19ef
func (builder *RevokeTokenEventBuilder) OpenId(openId string) *RevokeTokenEventBuilder {
	builder.openId = openId
	builder.openIdFlag = true
	return builder
}

// 用户union_id
//
// 示例值：on_cad4860e7af114fb4ff6c5d496d1dd76
func (builder *RevokeTokenEventBuilder) UnionId(unionId string) *RevokeTokenEventBuilder {
	builder.unionId = unionId
	builder.unionIdFlag = true
	return builder
}

// 租户内用户的唯一标识
//
// 示例值：gg895344
func (builder *RevokeTokenEventBuilder) UserId(userId string) *RevokeTokenEventBuilder {
	builder.userId = userId
	builder.userIdFlag = true
	return builder
}

func (builder *RevokeTokenEventBuilder) Build() *RevokeTokenEvent {
	req := &RevokeTokenEvent{}
	if builder.revokeTokenTypeFlag {
		req.RevokeTokenType = &builder.revokeTokenType

	}
	if builder.revokeReasonFlag {
		req.RevokeReason = &builder.revokeReason

	}
	if builder.openIdFlag {
		req.OpenId = &builder.openId

	}
	if builder.unionIdFlag {
		req.UnionId = &builder.unionId

	}
	if builder.userIdFlag {
		req.UserId = &builder.userId

	}
	return req
}

type TenantAccessToken struct {
}

type TenantAccessTokenBuilder struct {
}

func NewTenantAccessTokenBuilder() *TenantAccessTokenBuilder {
	builder := &TenantAccessTokenBuilder{}
	return builder
}

func (builder *TenantAccessTokenBuilder) Build() *TenantAccessToken {
	req := &TenantAccessToken{}
	return req
}

type CreateAppAccessTokenReqBodyBuilder struct {
	appId     string // 应用唯一标识，创建应用后获得。有关app_id 的详细介绍。
	appIdFlag bool

	appSecret     string // 应用秘钥，创建应用后获得。
	appSecretFlag bool

	appTicket     string // 平台定时推送给应用的临时凭证，通过事件监听机制获得。
	appTicketFlag bool
}

func NewCreateAppAccessTokenReqBodyBuilder() *CreateAppAccessTokenReqBodyBuilder {
	builder := &CreateAppAccessTokenReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。有关app_id 的详细介绍。
//
//示例值：cli_ddfgkk38emd38
func (builder *CreateAppAccessTokenReqBodyBuilder) AppId(appId string) *CreateAppAccessTokenReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
//示例值：clkfgkfdjes384kjdf9830d3k
func (builder *CreateAppAccessTokenReqBodyBuilder) AppSecret(appSecret string) *CreateAppAccessTokenReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

// 平台定时推送给应用的临时凭证，通过事件监听机制获得。
//
//示例值：jdjlsd03jk34hj3kldjflcmkel
func (builder *CreateAppAccessTokenReqBodyBuilder) AppTicket(appTicket string) *CreateAppAccessTokenReqBodyBuilder {
	builder.appTicket = appTicket
	builder.appTicketFlag = true
	return builder
}

func (builder *CreateAppAccessTokenReqBodyBuilder) Build() *CreateAppAccessTokenReqBody {
	req := &CreateAppAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	if builder.appTicketFlag {
		req.AppTicket = &builder.appTicket
	}
	return req
}

type CreateAppAccessTokenPathReqBodyBuilder struct {
	appId         string
	appIdFlag     bool
	appSecret     string
	appSecretFlag bool
	appTicket     string
	appTicketFlag bool
}

func NewCreateAppAccessTokenPathReqBodyBuilder() *CreateAppAccessTokenPathReqBodyBuilder {
	builder := &CreateAppAccessTokenPathReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。有关app_id 的详细介绍。
//
// 示例值：cli_ddfgkk38emd38
func (builder *CreateAppAccessTokenPathReqBodyBuilder) AppId(appId string) *CreateAppAccessTokenPathReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
// 示例值：clkfgkfdjes384kjdf9830d3k
func (builder *CreateAppAccessTokenPathReqBodyBuilder) AppSecret(appSecret string) *CreateAppAccessTokenPathReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

// 平台定时推送给应用的临时凭证，通过事件监听机制获得。
//
// 示例值：jdjlsd03jk34hj3kldjflcmkel
func (builder *CreateAppAccessTokenPathReqBodyBuilder) AppTicket(appTicket string) *CreateAppAccessTokenPathReqBodyBuilder {
	builder.appTicket = appTicket
	builder.appTicketFlag = true
	return builder
}

func (builder *CreateAppAccessTokenPathReqBodyBuilder) Build() (*CreateAppAccessTokenReqBody, error) {
	req := &CreateAppAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	if builder.appTicketFlag {
		req.AppTicket = &builder.appTicket
	}
	return req, nil
}

type CreateAppAccessTokenReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateAppAccessTokenReqBody
}

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

//
func (builder *CreateAppAccessTokenReqBuilder) Body(body *CreateAppAccessTokenReqBody) *CreateAppAccessTokenReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateAppAccessTokenReqBuilder) Build() *CreateAppAccessTokenReq {
	req := &CreateAppAccessTokenReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type CreateAppAccessTokenReqBody struct {
	AppId *string `json:"app_id,omitempty"` // 应用唯一标识，创建应用后获得。有关app_id 的详细介绍。

	AppSecret *string `json:"app_secret,omitempty"` // 应用秘钥，创建应用后获得。

	AppTicket *string `json:"app_ticket,omitempty"` // 平台定时推送给应用的临时凭证，通过事件监听机制获得。
}

type CreateAppAccessTokenReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateAppAccessTokenReqBody `body:""`
}

type CreateAppAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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

type InternalAppAccessTokenReqBodyBuilder struct {
	appId     string // 应用唯一标识，创建应用后获得。
	appIdFlag bool

	appSecret     string // 应用秘钥，创建应用后获得。
	appSecretFlag bool
}

func NewInternalAppAccessTokenReqBodyBuilder() *InternalAppAccessTokenReqBodyBuilder {
	builder := &InternalAppAccessTokenReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。
//
//示例值：cli_hsjeriogfkd93jf84
func (builder *InternalAppAccessTokenReqBodyBuilder) AppId(appId string) *InternalAppAccessTokenReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
//示例值：jdsfslkjdg8e73hdf9237enbd
func (builder *InternalAppAccessTokenReqBodyBuilder) AppSecret(appSecret string) *InternalAppAccessTokenReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *InternalAppAccessTokenReqBodyBuilder) Build() *InternalAppAccessTokenReqBody {
	req := &InternalAppAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req
}

type InternalAppAccessTokenPathReqBodyBuilder struct {
	appId         string
	appIdFlag     bool
	appSecret     string
	appSecretFlag bool
}

func NewInternalAppAccessTokenPathReqBodyBuilder() *InternalAppAccessTokenPathReqBodyBuilder {
	builder := &InternalAppAccessTokenPathReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。
//
// 示例值：cli_hsjeriogfkd93jf84
func (builder *InternalAppAccessTokenPathReqBodyBuilder) AppId(appId string) *InternalAppAccessTokenPathReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
// 示例值：jdsfslkjdg8e73hdf9237enbd
func (builder *InternalAppAccessTokenPathReqBodyBuilder) AppSecret(appSecret string) *InternalAppAccessTokenPathReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *InternalAppAccessTokenPathReqBodyBuilder) Build() (*InternalAppAccessTokenReqBody, error) {
	req := &InternalAppAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req, nil
}

type InternalAppAccessTokenReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *InternalAppAccessTokenReqBody
}

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

//
func (builder *InternalAppAccessTokenReqBuilder) Body(body *InternalAppAccessTokenReqBody) *InternalAppAccessTokenReqBuilder {
	builder.body = body
	return builder
}

func (builder *InternalAppAccessTokenReqBuilder) Build() *InternalAppAccessTokenReq {
	req := &InternalAppAccessTokenReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type InternalAppAccessTokenReqBody struct {
	AppId *string `json:"app_id,omitempty"` // 应用唯一标识，创建应用后获得。

	AppSecret *string `json:"app_secret,omitempty"` // 应用秘钥，创建应用后获得。
}

type InternalAppAccessTokenReq struct {
	apiReq *larkcore.ApiReq
	Body   *InternalAppAccessTokenReqBody `body:""`
}

type InternalAppAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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

type ResendAppTicketReqBodyBuilder struct {
	appId     string // 应用唯一标识，创建应用后获得
	appIdFlag bool

	appSecret     string // 应用秘钥，创建应用后获得
	appSecretFlag bool
}

func NewResendAppTicketReqBodyBuilder() *ResendAppTicketReqBodyBuilder {
	builder := &ResendAppTicketReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得
//
//示例值：cli_slkdjalasdkjasd
func (builder *ResendAppTicketReqBodyBuilder) AppId(appId string) *ResendAppTicketReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得
//
//示例值：dskLLdkasdjlasdKK
func (builder *ResendAppTicketReqBodyBuilder) AppSecret(appSecret string) *ResendAppTicketReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *ResendAppTicketReqBodyBuilder) Build() *ResendAppTicketReqBody {
	req := &ResendAppTicketReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req
}

type ResendAppTicketPathReqBodyBuilder struct {
	appId         string
	appIdFlag     bool
	appSecret     string
	appSecretFlag bool
}

func NewResendAppTicketPathReqBodyBuilder() *ResendAppTicketPathReqBodyBuilder {
	builder := &ResendAppTicketPathReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得
//
// 示例值：cli_slkdjalasdkjasd
func (builder *ResendAppTicketPathReqBodyBuilder) AppId(appId string) *ResendAppTicketPathReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得
//
// 示例值：dskLLdkasdjlasdKK
func (builder *ResendAppTicketPathReqBodyBuilder) AppSecret(appSecret string) *ResendAppTicketPathReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *ResendAppTicketPathReqBodyBuilder) Build() (*ResendAppTicketReqBody, error) {
	req := &ResendAppTicketReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req, nil
}

type ResendAppTicketReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *ResendAppTicketReqBody
}

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

//
func (builder *ResendAppTicketReqBuilder) Body(body *ResendAppTicketReqBody) *ResendAppTicketReqBuilder {
	builder.body = body
	return builder
}

func (builder *ResendAppTicketReqBuilder) Build() *ResendAppTicketReq {
	req := &ResendAppTicketReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type ResendAppTicketReqBody struct {
	AppId *string `json:"app_id,omitempty"` // 应用唯一标识，创建应用后获得

	AppSecret *string `json:"app_secret,omitempty"` // 应用秘钥，创建应用后获得
}

type ResendAppTicketReq struct {
	apiReq *larkcore.ApiReq
	Body   *ResendAppTicketReqBody `body:""`
}

type ResendAppTicketResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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

type CreateTenantAccessTokenReqBodyBuilder struct {
	appAccessToken     string // 应用访问凭证，通过商店应用获取 app_access_token接口获取。
	appAccessTokenFlag bool

	tenantKey     string // 租户在飞书上的唯一标识，也可以理解为企业标识可以通过如下方式获取：  业开通应用时，开放平台推送给应用，具体可参考【首次启用应用】事件； 用户登录到小程序、H5 应用或者浏览器应用时，在用户的身份信息中获取。
	tenantKeyFlag bool
}

func NewCreateTenantAccessTokenReqBodyBuilder() *CreateTenantAccessTokenReqBodyBuilder {
	builder := &CreateTenantAccessTokenReqBodyBuilder{}
	return builder
}

// 应用访问凭证，通过商店应用获取 app_access_token接口获取。
//
//示例值：a-32bd8551db2f081cbfd26293f27516390b9feb04
func (builder *CreateTenantAccessTokenReqBodyBuilder) AppAccessToken(appAccessToken string) *CreateTenantAccessTokenReqBodyBuilder {
	builder.appAccessToken = appAccessToken
	builder.appAccessTokenFlag = true
	return builder
}

// 租户在飞书上的唯一标识，也可以理解为企业标识可以通过如下方式获取：  业开通应用时，开放平台推送给应用，具体可参考【首次启用应用】事件； 用户登录到小程序、H5 应用或者浏览器应用时，在用户的身份信息中获取。
//
//示例值：73658811060f175d
func (builder *CreateTenantAccessTokenReqBodyBuilder) TenantKey(tenantKey string) *CreateTenantAccessTokenReqBodyBuilder {
	builder.tenantKey = tenantKey
	builder.tenantKeyFlag = true
	return builder
}

func (builder *CreateTenantAccessTokenReqBodyBuilder) Build() *CreateTenantAccessTokenReqBody {
	req := &CreateTenantAccessTokenReqBody{}
	if builder.appAccessTokenFlag {
		req.AppAccessToken = &builder.appAccessToken
	}
	if builder.tenantKeyFlag {
		req.TenantKey = &builder.tenantKey
	}
	return req
}

type CreateTenantAccessTokenPathReqBodyBuilder struct {
	appAccessToken     string
	appAccessTokenFlag bool
	tenantKey          string
	tenantKeyFlag      bool
}

func NewCreateTenantAccessTokenPathReqBodyBuilder() *CreateTenantAccessTokenPathReqBodyBuilder {
	builder := &CreateTenantAccessTokenPathReqBodyBuilder{}
	return builder
}

// 应用访问凭证，通过商店应用获取 app_access_token接口获取。
//
// 示例值：a-32bd8551db2f081cbfd26293f27516390b9feb04
func (builder *CreateTenantAccessTokenPathReqBodyBuilder) AppAccessToken(appAccessToken string) *CreateTenantAccessTokenPathReqBodyBuilder {
	builder.appAccessToken = appAccessToken
	builder.appAccessTokenFlag = true
	return builder
}

// 租户在飞书上的唯一标识，也可以理解为企业标识可以通过如下方式获取：  业开通应用时，开放平台推送给应用，具体可参考【首次启用应用】事件； 用户登录到小程序、H5 应用或者浏览器应用时，在用户的身份信息中获取。
//
// 示例值：73658811060f175d
func (builder *CreateTenantAccessTokenPathReqBodyBuilder) TenantKey(tenantKey string) *CreateTenantAccessTokenPathReqBodyBuilder {
	builder.tenantKey = tenantKey
	builder.tenantKeyFlag = true
	return builder
}

func (builder *CreateTenantAccessTokenPathReqBodyBuilder) Build() (*CreateTenantAccessTokenReqBody, error) {
	req := &CreateTenantAccessTokenReqBody{}
	if builder.appAccessTokenFlag {
		req.AppAccessToken = &builder.appAccessToken
	}
	if builder.tenantKeyFlag {
		req.TenantKey = &builder.tenantKey
	}
	return req, nil
}

type CreateTenantAccessTokenReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *CreateTenantAccessTokenReqBody
}

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

//
func (builder *CreateTenantAccessTokenReqBuilder) Body(body *CreateTenantAccessTokenReqBody) *CreateTenantAccessTokenReqBuilder {
	builder.body = body
	return builder
}

func (builder *CreateTenantAccessTokenReqBuilder) Build() *CreateTenantAccessTokenReq {
	req := &CreateTenantAccessTokenReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type CreateTenantAccessTokenReqBody struct {
	AppAccessToken *string `json:"app_access_token,omitempty"` // 应用访问凭证，通过商店应用获取 app_access_token接口获取。

	TenantKey *string `json:"tenant_key,omitempty"` // 租户在飞书上的唯一标识，也可以理解为企业标识可以通过如下方式获取：  业开通应用时，开放平台推送给应用，具体可参考【首次启用应用】事件； 用户登录到小程序、H5 应用或者浏览器应用时，在用户的身份信息中获取。
}

type CreateTenantAccessTokenReq struct {
	apiReq *larkcore.ApiReq
	Body   *CreateTenantAccessTokenReqBody `body:""`
}

type CreateTenantAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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

type InternalTenantAccessTokenReqBodyBuilder struct {
	appId     string // 应用唯一标识，创建应用后获得。
	appIdFlag bool

	appSecret     string // 应用秘钥，创建应用后获得。
	appSecretFlag bool
}

func NewInternalTenantAccessTokenReqBodyBuilder() *InternalTenantAccessTokenReqBodyBuilder {
	builder := &InternalTenantAccessTokenReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。
//
//示例值：cli_slkdjalasdkjasd
func (builder *InternalTenantAccessTokenReqBodyBuilder) AppId(appId string) *InternalTenantAccessTokenReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
//示例值：dskLLdkasdjlasdKK
func (builder *InternalTenantAccessTokenReqBodyBuilder) AppSecret(appSecret string) *InternalTenantAccessTokenReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *InternalTenantAccessTokenReqBodyBuilder) Build() *InternalTenantAccessTokenReqBody {
	req := &InternalTenantAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req
}

type InternalTenantAccessTokenPathReqBodyBuilder struct {
	appId         string
	appIdFlag     bool
	appSecret     string
	appSecretFlag bool
}

func NewInternalTenantAccessTokenPathReqBodyBuilder() *InternalTenantAccessTokenPathReqBodyBuilder {
	builder := &InternalTenantAccessTokenPathReqBodyBuilder{}
	return builder
}

// 应用唯一标识，创建应用后获得。
//
// 示例值：cli_slkdjalasdkjasd
func (builder *InternalTenantAccessTokenPathReqBodyBuilder) AppId(appId string) *InternalTenantAccessTokenPathReqBodyBuilder {
	builder.appId = appId
	builder.appIdFlag = true
	return builder
}

// 应用秘钥，创建应用后获得。
//
// 示例值：dskLLdkasdjlasdKK
func (builder *InternalTenantAccessTokenPathReqBodyBuilder) AppSecret(appSecret string) *InternalTenantAccessTokenPathReqBodyBuilder {
	builder.appSecret = appSecret
	builder.appSecretFlag = true
	return builder
}

func (builder *InternalTenantAccessTokenPathReqBodyBuilder) Build() (*InternalTenantAccessTokenReqBody, error) {
	req := &InternalTenantAccessTokenReqBody{}
	if builder.appIdFlag {
		req.AppId = &builder.appId
	}
	if builder.appSecretFlag {
		req.AppSecret = &builder.appSecret
	}
	return req, nil
}

type InternalTenantAccessTokenReqBuilder struct {
	apiReq *larkcore.ApiReq
	body   *InternalTenantAccessTokenReqBody
}

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

//
func (builder *InternalTenantAccessTokenReqBuilder) Body(body *InternalTenantAccessTokenReqBody) *InternalTenantAccessTokenReqBuilder {
	builder.body = body
	return builder
}

func (builder *InternalTenantAccessTokenReqBuilder) Build() *InternalTenantAccessTokenReq {
	req := &InternalTenantAccessTokenReq{}
	req.apiReq = &larkcore.ApiReq{}
	req.apiReq.Body = builder.body
	return req
}

type InternalTenantAccessTokenReqBody struct {
	AppId *string `json:"app_id,omitempty"` // 应用唯一标识，创建应用后获得。

	AppSecret *string `json:"app_secret,omitempty"` // 应用秘钥，创建应用后获得。
}

type InternalTenantAccessTokenReq struct {
	apiReq *larkcore.ApiReq
	Body   *InternalTenantAccessTokenReqBody `body:""`
}

type InternalTenantAccessTokenResp struct {
	*larkcore.ApiResp `json:"-"`
	larkcore.CodeError
}

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