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

// MatchCoreHRCompensationStandard 根据员工获取匹配的薪资标准信息。
//
// 该接口会按照应用拥有的「薪资标准资源」的权限范围返回数据, 请确定在「开发者后台 - 权限管理 - 数据权限」中已申请「薪资标准资源」权限范围
//
// doc: https://open.feishu.cn/document/server-docs/corehr-v1/compensation_standard/match
func (r *CoreHRService) MatchCoreHRCompensationStandard(ctx context.Context, request *MatchCoreHRCompensationStandardReq, options ...MethodOptionFunc) (*MatchCoreHRCompensationStandardResp, *Response, error) {
	if r.cli.mock.mockCoreHRMatchCoreHRCompensationStandard != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#MatchCoreHRCompensationStandard mock enable")
		return r.cli.mock.mockCoreHRMatchCoreHRCompensationStandard(ctx, request, options...)
	}

	req := &RawRequestReq{
		Scope:                 "CoreHR",
		API:                   "MatchCoreHRCompensationStandard",
		Method:                "GET",
		URL:                   r.cli.openBaseURL + "/open-apis/corehr/v1/compensation_standards/match",
		Body:                  request,
		MethodOption:          newMethodOption(options),
		NeedTenantAccessToken: true,
	}
	resp := new(matchCoreHRCompensationStandardResp)

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

// MockCoreHRMatchCoreHRCompensationStandard mock CoreHRMatchCoreHRCompensationStandard method
func (r *Mock) MockCoreHRMatchCoreHRCompensationStandard(f func(ctx context.Context, request *MatchCoreHRCompensationStandardReq, options ...MethodOptionFunc) (*MatchCoreHRCompensationStandardResp, *Response, error)) {
	r.mockCoreHRMatchCoreHRCompensationStandard = f
}

// UnMockCoreHRMatchCoreHRCompensationStandard un-mock CoreHRMatchCoreHRCompensationStandard method
func (r *Mock) UnMockCoreHRMatchCoreHRCompensationStandard() {
	r.mockCoreHRMatchCoreHRCompensationStandard = nil
}

// MatchCoreHRCompensationStandardReq ...
type MatchCoreHRCompensationStandardReq struct {
	UserIDType         *IDType           `query:"user_id_type" json:"-"`          // 用户 ID 类型, 示例值: open_id, 可选值有: open_id: 标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。[了解更多: 如何获取 Open ID](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-openid), union_id: 标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的, 在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID, 应用开发商可以把同个用户在多个应用中的身份关联起来。[了解更多: 如何获取 Union ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-union-id), user_id: 标识一个用户在某个租户内的身份。同一个用户在租户 A 和租户 B 内的 User ID 是不同的。在同一个租户内, 一个用户的 User ID 在所有应用（包括商店应用）中都保持一致。User ID 主要用于在不同的应用间打通用户数据。[了解更多: 如何获取 User ID？](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-obtain-user-id), people_corehr_id: 以飞书人事的ID来识别用户, 默认值: `open_id`, 当值为 `user_id`, 字段权限要求: 获取用户 user ID
	DepartmentIDType   *DepartmentIDType `query:"department_id_type" json:"-"`    // 此次调用中使用的部门 ID 类型, 示例值: open_department_id, 可选值有: open_department_id: [飞书]用来在具体某个应用中标识一个部门, 同一个department_id 在不同应用中的 open_department_id 相同。, department_id: [飞书]用来标识租户内一个唯一的部门。, people_corehr_department_id: [飞书人事]用来标识「飞书人事」中的部门。, 默认值: `people_corehr_department_id`
	EmploymentID       string            `query:"employment_id" json:"-"`         // 雇员ID, 可通过接口[批量查询员工信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/employee/batch_get)获取, 示例值: 7124293751317038636
	ReferenceObjectApi *string           `query:"reference_object_api" json:"-"`  // 薪资标准的关联对象, 项目或者指标, 示例值: cpst_item, 可选值有: cpst_item: 薪资项目, cpst_indicator: 薪资统计指标
	ReferenceObjectID  string            `query:"reference_object_id" json:"-"`   // 薪资标准关联对象ID, 示例值: 7156853394442044972
	DepartmentID       *string           `query:"department_id" json:"-"`         // 部门ID, 可通过接口[批量查询部门](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/department/list)获取, 示例值: od-53899868dd0da32292a2d809f0518c8f
	WorkLocationID     *string           `query:"work_location_id" json:"-"`      // 工作地点ID, 可通过接口[批量查询地点](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/location/list)获取, 示例值: 7094869485965870636
	CompanyID          *string           `query:"company_id" json:"-"`            // 公司ID, 可通过接口[批量查询公司](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/company/list)获取, 示例值: 7091599096804394540
	JobFamilyID        *string           `query:"job_family_id" json:"-"`         // 职务序列ID, 可通过接口[批量查询职务序列](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_family/list)获取, 示例值: 7039313681989502508
	JobLevelID         *string           `query:"job_level_id" json:"-"`          // 职级ID, 可通过接口[批量查询职务级别](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_level/list)获取, 示例值: 7086415175263258156
	EmployeeTypeID     *string           `query:"employee_type_id" json:"-"`      // 人员类型ID, 可通过接口[批量查询人员类型](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/employee_type/list)获取, 示例值: 7039310401359775276
	RecruitmentType    *string           `query:"recruitment_type" json:"-"`      // 招聘类型, 示例值: experienced_professionals, 可选值有: experienced_professionals: 社招, recent_graduates: 校招, routine_intern: 日常实习
	CpstChangeReasonID *string           `query:"cpst_change_reason_id" json:"-"` // 定调薪原因ID, 示例值: 6967639606963471117
	CpstPlanID         *string           `query:"cpst_plan_id" json:"-"`          // 薪资方案ID, 示例值: 6967639606963471118
	CpstSalaryLevelID  *string           `query:"cpst_salary_level_id" json:"-"`  // 薪级薪等ID, 示例值: 6967639606963471119
	EffectiveTime      *string           `query:"effective_time" json:"-"`        // 生效时间, 示例值: 1660924800000
}

// MatchCoreHRCompensationStandardResp ...
type MatchCoreHRCompensationStandardResp struct {
	StandardID    string                                    `json:"standard_id,omitempty"`    // 薪资标准表ID
	Grade         *MatchCoreHRCompensationStandardRespGrade `json:"grade,omitempty"`          // 薪资等级
	EffectiveTime string                                    `json:"effective_time,omitempty"` // 生效时间
}

// MatchCoreHRCompensationStandardRespGrade ...
type MatchCoreHRCompensationStandardRespGrade struct {
	GradeID            string                                                      `json:"grade_id,omitempty"`             // 薪资等级ID
	GradeTid           string                                                      `json:"grade_tid,omitempty"`            // 薪资等级时间轴ID
	GradeStandardValue *MatchCoreHRCompensationStandardRespGradeGradeStandardValue `json:"grade_standard_value,omitempty"` // 带宽上下限和标准值
	Currency           *MatchCoreHRCompensationStandardRespGradeCurrency           `json:"currency,omitempty"`             // 币种
	Description        *MatchCoreHRCompensationStandardRespGradeDescription        `json:"description,omitempty"`          // 薪资标准描述
}

// MatchCoreHRCompensationStandardRespGradeCurrency ...
type MatchCoreHRCompensationStandardRespGradeCurrency struct {
	CurrencyID string                                                `json:"currency_id,omitempty"` // 币种ID
	Code       string                                                `json:"code,omitempty"`        // 币种code
	Name       *MatchCoreHRCompensationStandardRespGradeCurrencyName `json:"name,omitempty"`        // 币种名称
}

// MatchCoreHRCompensationStandardRespGradeCurrencyName ...
type MatchCoreHRCompensationStandardRespGradeCurrencyName struct {
	ZhCn string `json:"zh_cn,omitempty"` // 中文
	EnUs string `json:"en_us,omitempty"` // 英文
}

// MatchCoreHRCompensationStandardRespGradeDescription ...
type MatchCoreHRCompensationStandardRespGradeDescription struct {
	ZhCn string `json:"zh_cn,omitempty"` // 中文
	EnUs string `json:"en_us,omitempty"` // 英文
}

// MatchCoreHRCompensationStandardRespGradeGradeStandardValue ...
type MatchCoreHRCompensationStandardRespGradeGradeStandardValue struct {
	ReferenceObject *MatchCoreHRCompensationStandardRespGradeGradeStandardValueReferenceObject `json:"reference_object,omitempty"` // 薪资标准的关联对象, 项目或者指标
	StandardType    *MatchCoreHRCompensationStandardRespGradeGradeStandardValueStandardType    `json:"standard_type,omitempty"`    // 薪资标准类型
	BandWidth       *MatchCoreHRCompensationStandardRespGradeGradeStandardValueBandWidth       `json:"band_width,omitempty"`       // 上下限
	StandardValue   string                                                                     `json:"standard_value,omitempty"`   // 标准值
}

// MatchCoreHRCompensationStandardRespGradeGradeStandardValueBandWidth ...
type MatchCoreHRCompensationStandardRespGradeGradeStandardValueBandWidth struct {
	UpperLimit string `json:"upper_limit,omitempty"` // 上限
	LowerLimit string `json:"lower_limit,omitempty"` // 下限
}

// MatchCoreHRCompensationStandardRespGradeGradeStandardValueReferenceObject ...
type MatchCoreHRCompensationStandardRespGradeGradeStandardValueReferenceObject struct {
	ApiName string `json:"api_name,omitempty"` // cpst_item(项目)、 cpst_indicator(指标), 可选值有: cpst_item: 项目, cpst_indicator: 指标
	ID      string `json:"id,omitempty"`       // 值列表 例如部门ID
}

// MatchCoreHRCompensationStandardRespGradeGradeStandardValueStandardType ...
type MatchCoreHRCompensationStandardRespGradeGradeStandardValueStandardType struct {
	ApiName string `json:"api_name,omitempty"` // 薪资标准类型, 可选值有: standard_value: standard_value, bandwidth_and_standard_value: bandwidth_and_standard_value, bandwidth_upper_and_lower_limit: bandwidth_upper_and_lower_limit
}

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