// 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"
)

// EnableDisableCoreHRProbationAssessment 启用/停用试用期考核功能, 启用后系统功能中针对试用期考核相关的字段会自动启用, 并可通过接口更新试用期考核结果
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/probation/enable_disable_assessment
func (r *CoreHRService) EnableDisableCoreHRProbationAssessment(ctx context.Context, request *EnableDisableCoreHRProbationAssessmentReq, options ...MethodOptionFunc) (*EnableDisableCoreHRProbationAssessmentResp, *Response, error) {
	if r.cli.mock.mockCoreHREnableDisableCoreHRProbationAssessment != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#EnableDisableCoreHRProbationAssessment mock enable")
		return r.cli.mock.mockCoreHREnableDisableCoreHRProbationAssessment(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "CoreHR",
		API:                   "EnableDisableCoreHRProbationAssessment",
		Method:                "POST",
		URL:                   r.cli.openBaseURL + "/open-apis/corehr/v2/probation/enable_disable_assessment",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(enableDisableCoreHRProbationAssessmentResp)

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

// MockCoreHREnableDisableCoreHRProbationAssessment mock CoreHREnableDisableCoreHRProbationAssessment method
func (r *Mock) MockCoreHREnableDisableCoreHRProbationAssessment(f func(ctx context.Context, request *EnableDisableCoreHRProbationAssessmentReq, options ...MethodOptionFunc) (*EnableDisableCoreHRProbationAssessmentResp, *Response, error)) {
	r.mockCoreHREnableDisableCoreHRProbationAssessment = f
}

// UnMockCoreHREnableDisableCoreHRProbationAssessment un-mock CoreHREnableDisableCoreHRProbationAssessment method
func (r *Mock) UnMockCoreHREnableDisableCoreHRProbationAssessment() {
	r.mockCoreHREnableDisableCoreHRProbationAssessment = nil
}

// EnableDisableCoreHRProbationAssessmentReq ...
type EnableDisableCoreHRProbationAssessmentReq struct {
	Active bool    `json:"active,omitempty"`  // 启用 / 停用状态。启用后可在试用期管理页面中可见试用期考核相关的字段, 示例值: true
	AppURL *string `json:"app_url,omitempty"` // 试用期考核系统入口链接, 当启用功能时该字段必填, 示例值: "https://qwe111.feishuapp.bytedance.net/ae/ui/apps/176612345027111/appPages/l11bsrwss13yt?dataGrid%41pye4fsbajo21l=%7B%7D&key=ffm41o1&dataGrid%41wmv98t29vif3kj=%1B%7D"
}

// EnableDisableCoreHRProbationAssessmentResp ...
type EnableDisableCoreHRProbationAssessmentResp struct {
}

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