// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
 * Copyright 2022 chyroc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lark

import (
	"context"
)

// DeactivateHireReferralAccount 停用后, 对应的内推账号信息将无法通过接口[「内推账户余额变更事件」](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/events/assets_update)、[「提取内推账号余额」](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/withdraw)获取、修改
//
// doc: https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/deactivate
func (r *HireService) DeactivateHireReferralAccount(ctx context.Context, request *DeactivateHireReferralAccountReq, options ...MethodOptionFunc) (*DeactivateHireReferralAccountResp, *Response, error) {
	if r.cli.mock.mockHireDeactivateHireReferralAccount != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] Hire#DeactivateHireReferralAccount mock enable")
		return r.cli.mock.mockHireDeactivateHireReferralAccount(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "Hire",
		API:                   "DeactivateHireReferralAccount",
		Method:                "POST",
		URL:                   r.cli.openBaseURL + "/open-apis/hire/v1/referral_account/:referral_account_id/deactivate",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(deactivateHireReferralAccountResp)

	response, err := r.cli.RawRequest(ctx, req, resp)
	return resp.Data, response, err
}

// MockHireDeactivateHireReferralAccount mock HireDeactivateHireReferralAccount method
func (r *Mock) MockHireDeactivateHireReferralAccount(f func(ctx context.Context, request *DeactivateHireReferralAccountReq, options ...MethodOptionFunc) (*DeactivateHireReferralAccountResp, *Response, error)) {
	r.mockHireDeactivateHireReferralAccount = f
}

// UnMockHireDeactivateHireReferralAccount un-mock HireDeactivateHireReferralAccount method
func (r *Mock) UnMockHireDeactivateHireReferralAccount() {
	r.mockHireDeactivateHireReferralAccount = nil
}

// DeactivateHireReferralAccountReq ...
type DeactivateHireReferralAccountReq struct {
	ReferralAccountID string `path:"referral_account_id" json:"-"` // 账户ID, 示例值: "6942778198054125570"
}

// DeactivateHireReferralAccountResp ...
type DeactivateHireReferralAccountResp struct {
	Account *DeactivateHireReferralAccountRespAccount `json:"account,omitempty"` // 账号信息
}

// DeactivateHireReferralAccountRespAccount ...
type DeactivateHireReferralAccountRespAccount struct {
	AccountID string                                          `json:"account_id,omitempty"` // 账户ID
	Assets    *DeactivateHireReferralAccountRespAccountAssets `json:"assets,omitempty"`     // 账户资产
	Status    int64                                           `json:"status,omitempty"`     // 账号状态, 可选值有: 1: 可用, 2: 停用
}

// DeactivateHireReferralAccountRespAccountAssets ...
type DeactivateHireReferralAccountRespAccountAssets struct {
	ConfirmedBonus *DeactivateHireReferralAccountRespAccountAssetsConfirmedBonus `json:"confirmed_bonus,omitempty"` // 已确认的奖励
}

// DeactivateHireReferralAccountRespAccountAssetsConfirmedBonus ...
type DeactivateHireReferralAccountRespAccountAssetsConfirmedBonus struct {
	PointBonus int64 `json:"point_bonus,omitempty"` // 积分奖励
}

// deactivateHireReferralAccountResp ...
type deactivateHireReferralAccountResp struct {
	Code  int64                              `json:"code,omitempty"` // 错误码, 非 0 表示失败
	Msg   string                             `json:"msg,omitempty"`  // 错误描述
	Data  *DeactivateHireReferralAccountResp `json:"data,omitempty"`
	Error *ErrorDetail                       `json:"error,omitempty"`
}
