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

// GetCoreHRCompensationItemList 批量查询薪资项
//
// doc: https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/compensation-v1/item/list
func (r *CoreHRService) GetCoreHRCompensationItemList(ctx context.Context, request *GetCoreHRCompensationItemListReq, options ...MethodOptionFunc) (*GetCoreHRCompensationItemListResp, *Response, error) {
	if r.cli.mock.mockCoreHRGetCoreHRCompensationItemList != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#GetCoreHRCompensationItemList mock enable")
		return r.cli.mock.mockCoreHRGetCoreHRCompensationItemList(ctx, request, options...)
	}

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

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

// MockCoreHRGetCoreHRCompensationItemList mock CoreHRGetCoreHRCompensationItemList method
func (r *Mock) MockCoreHRGetCoreHRCompensationItemList(f func(ctx context.Context, request *GetCoreHRCompensationItemListReq, options ...MethodOptionFunc) (*GetCoreHRCompensationItemListResp, *Response, error)) {
	r.mockCoreHRGetCoreHRCompensationItemList = f
}

// UnMockCoreHRGetCoreHRCompensationItemList un-mock CoreHRGetCoreHRCompensationItemList method
func (r *Mock) UnMockCoreHRGetCoreHRCompensationItemList() {
	r.mockCoreHRGetCoreHRCompensationItemList = nil
}

// GetCoreHRCompensationItemListReq ...
type GetCoreHRCompensationItemListReq struct {
	PageSize  int64   `query:"page_size" json:"-"`  // 分页大小, 示例值: 100, 默认值: `100`, 取值范围: `1` ～ `500`
	PageToken *string `query:"page_token" json:"-"` // 分页标记, 第一次请求不填, 表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 5234233214
}

// GetCoreHRCompensationItemListResp ...
type GetCoreHRCompensationItemListResp struct {
	Items     []*GetCoreHRCompensationItemListRespItem `json:"items,omitempty"`      // 薪资项信息列表
	PageToken string                                   `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
	HasMore   bool                                     `json:"has_more,omitempty"`   // 是否还有更多项
}

// GetCoreHRCompensationItemListRespItem ...
type GetCoreHRCompensationItemListRespItem struct {
	ID                  string                                                  `json:"id,omitempty"`                     // 薪资项ID
	Name                string                                                  `json:"name,omitempty"`                   // 薪资项名称
	Description         string                                                  `json:"description,omitempty"`            // 薪资项描述
	CategoryID          string                                                  `json:"category_id,omitempty"`            // 薪资项分类ID, 详细信息可以通过[批量获取薪资项分类信息](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/compensation-v1/item_category/list)接口查询获得
	ValueType           string                                                  `json:"value_type,omitempty"`             // 薪资项数值类型, 可选值有: money: 金额, number: 数值, percent: 百分比
	PayOffFrequencyType string                                                  `json:"pay_off_frequency_type,omitempty"` // 发放频率, 可选值有: year: 年, half_year: 半年, quarterly: 季度, bimonthly: 双月, month: 月, biweekly: 双周, week: 周, day: 日, hour: 小时
	DecimalPlaces       int64                                                   `json:"decimal_places,omitempty"`         // 小数位数
	ActiveStatus        int64                                                   `json:"active_status,omitempty"`          // 启用状态, 可选值有: 1: 启用, 0: 禁用
	I18nNames           []*GetCoreHRCompensationItemListRespItemI18nName        `json:"i18n_names,omitempty"`             // 多语言名称
	I18nDescriptions    []*GetCoreHRCompensationItemListRespItemI18nDescription `json:"i18n_descriptions,omitempty"`      // 多语言描述
}

// GetCoreHRCompensationItemListRespItemI18nDescription ...
type GetCoreHRCompensationItemListRespItemI18nDescription struct {
	Locale string `json:"locale,omitempty"` // 语言版本, 例如: “zh-CN”、“en-US”
	Value  string `json:"value,omitempty"`  // 语言名称
}

// GetCoreHRCompensationItemListRespItemI18nName ...
type GetCoreHRCompensationItemListRespItemI18nName struct {
	Locale string `json:"locale,omitempty"` // 语言版本, 例如: “zh-CN”、“en-US”
	Value  string `json:"value,omitempty"`  // 语言名称
}

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