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

// GetCoreHRNationalIDTypeList 批量查询国家证件类型。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/national_id_type/list
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/basic-infomation/national_id_type/list
func (r *CoreHRService) GetCoreHRNationalIDTypeList(ctx context.Context, request *GetCoreHRNationalIDTypeListReq, options ...MethodOptionFunc) (*GetCoreHRNationalIDTypeListResp, *Response, error) {
	if r.cli.mock.mockCoreHRGetCoreHRNationalIDTypeList != nil {
		r.cli.Log(ctx, LogLevelDebug, "[lark] CoreHR#GetCoreHRNationalIDTypeList mock enable")
		return r.cli.mock.mockCoreHRGetCoreHRNationalIDTypeList(ctx, request, options...)
	}

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

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

// MockCoreHRGetCoreHRNationalIDTypeList mock CoreHRGetCoreHRNationalIDTypeList method
func (r *Mock) MockCoreHRGetCoreHRNationalIDTypeList(f func(ctx context.Context, request *GetCoreHRNationalIDTypeListReq, options ...MethodOptionFunc) (*GetCoreHRNationalIDTypeListResp, *Response, error)) {
	r.mockCoreHRGetCoreHRNationalIDTypeList = f
}

// UnMockCoreHRGetCoreHRNationalIDTypeList un-mock CoreHRGetCoreHRNationalIDTypeList method
func (r *Mock) UnMockCoreHRGetCoreHRNationalIDTypeList() {
	r.mockCoreHRGetCoreHRNationalIDTypeList = nil
}

// GetCoreHRNationalIDTypeListReq ...
type GetCoreHRNationalIDTypeListReq struct {
	PageToken          *string `query:"page_token" json:"-"`          // 分页标记, 第一次请求不填, 表示从头开始遍历；分页查询结果还有更多项时会同时返回新的 page_token, 下次遍历可采用该 page_token 获取查询结果, 示例值: 1231231987
	PageSize           int64   `query:"page_size" json:"-"`           // 分页大小, 示例值: 100
	IdentificationType *string `query:"identification_type" json:"-"` // 证件类型, 示例值: regular_passport
	Code               *string `query:"code" json:"-"`                // 证件类型编码, 示例值: MYS-ID
	CountryRegionID    *string `query:"country_region_id" json:"-"`   // 国家地区ID, 示例值: 6862995749043439111
}

// GetCoreHRNationalIDTypeListResp ...
type GetCoreHRNationalIDTypeListResp struct {
	Items     []*GetCoreHRNationalIDTypeListRespItem `json:"items,omitempty"`      // 查询的国家证件类型信息
	HasMore   bool                                   `json:"has_more,omitempty"`   // 是否还有更多项
	PageToken string                                 `json:"page_token,omitempty"` // 分页标记, 当 has_more 为 true 时, 会同时返回新的 page_token, 否则不返回 page_token
}

// GetCoreHRNationalIDTypeListRespItem ...
type GetCoreHRNationalIDTypeListRespItem struct {
	ID                        string                                                          `json:"id,omitempty"`                          // 证件类型 ID
	CountryRegionID           string                                                          `json:"country_region_id,omitempty"`           // 国家 / 地区
	Name                      []*GetCoreHRNationalIDTypeListRespItemName                      `json:"name,omitempty"`                        // 名称
	Active                    bool                                                            `json:"active,omitempty"`                      // 是否启用
	ValidationRule            string                                                          `json:"validation_rule,omitempty"`             // 校验规则
	ValidationRuleDescription []*GetCoreHRNationalIDTypeListRespItemValidationRuleDescription `json:"validation_rule_description,omitempty"` // 校验规则描述
	Code                      string                                                          `json:"code,omitempty"`                        // 编码
	IdentificationType        *GetCoreHRNationalIDTypeListRespItemIdentificationType          `json:"identification_type,omitempty"`         // 证件类型
	CustomFields              []*GetCoreHRNationalIDTypeListRespItemCustomField               `json:"custom_fields,omitempty"`               // 自定义字段
}

// GetCoreHRNationalIDTypeListRespItemCustomField ...
type GetCoreHRNationalIDTypeListRespItemCustomField struct {
	FieldName string `json:"field_name,omitempty"` // 字段名
	Value     string `json:"value,omitempty"`      // 字段值, 是json转义后的字符串, 根据元数据定义不同, 字段格式不同(如123, 123.23, "true", [\"id1\", \"id2\"], "2006-01-02 15:04:05")
}

// GetCoreHRNationalIDTypeListRespItemIdentificationType ...
type GetCoreHRNationalIDTypeListRespItemIdentificationType struct {
	EnumName string                                                          `json:"enum_name,omitempty"` // 枚举值
	Display  []*GetCoreHRNationalIDTypeListRespItemIdentificationTypeDisplay `json:"display,omitempty"`   // 枚举多语展示
}

// GetCoreHRNationalIDTypeListRespItemIdentificationTypeDisplay ...
type GetCoreHRNationalIDTypeListRespItemIdentificationTypeDisplay struct {
	Lang  string `json:"lang,omitempty"`  // 名称信息的语言
	Value string `json:"value,omitempty"` // 名称信息的内容
}

// GetCoreHRNationalIDTypeListRespItemName ...
type GetCoreHRNationalIDTypeListRespItemName struct {
	Lang  string `json:"lang,omitempty"`  // 名称信息的语言
	Value string `json:"value,omitempty"` // 名称信息的内容
}

// GetCoreHRNationalIDTypeListRespItemValidationRuleDescription ...
type GetCoreHRNationalIDTypeListRespItemValidationRuleDescription struct {
	Lang  string `json:"lang,omitempty"`  // 名称信息的语言
	Value string `json:"value,omitempty"` // 名称信息的内容
}

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