open-lark 0.14.0

Enterprise-grade Lark/Feishu Open API SDK with comprehensive Chinese documentation and advanced error handling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
use reqwest::Method;
use serde::{Deserialize, Serialize};

use crate::{
    core::{
        api_req::ApiRequest,
        api_resp::{ApiResponseTrait, BaseResponse, ResponseFormat},
        config::Config,
        constants::AccessTokenType,
        endpoints::hire::*,
        endpoints::EndpointBuilder,
        http::Transport,
        req_option::RequestOption,
        SDKResult,
    },
    service::hire::models::{CommonResponse, PageResponse},
};

/// 背调服务
pub struct BackgroundCheckService {
    pub config: Config,
}

/// 背调包信息
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckPackage {
    /// 背调包ID
    pub id: String,
    /// 背调包名称
    pub name: String,
    /// 背调包描述
    pub description: Option<String>,
    /// 背调供应商
    pub vendor: String,
    /// 背调项目列表
    pub check_items: Vec<BackgroundCheckItem>,
    /// 包价格
    pub price: Option<String>,
    /// 币种
    pub currency: Option<String>,
    /// 执行时长(天)
    pub duration_days: u32,
    /// 是否启用
    pub enabled: bool,
    /// 创建时间
    pub created_time: Option<String>,
    /// 更新时间
    pub updated_time: Option<String>,
}

/// 背调项目
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckItem {
    /// 项目ID
    pub id: String,
    /// 项目名称
    pub name: String,
    /// 项目类型
    pub item_type: String,
    /// 项目描述
    pub description: Option<String>,
    /// 是否必须
    pub required: bool,
    /// 执行时长(天)
    pub duration_days: u32,
}

/// 背调订单信息
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckOrder {
    /// 订单ID
    pub id: String,
    /// 投递ID
    pub application_id: String,
    /// 候选人ID
    pub talent_id: String,
    /// 背调包ID
    pub package_id: String,
    /// 订单状态
    pub status: String,
    /// 背调结果
    pub result: Option<String>,
    /// 背调报告URL
    pub report_url: Option<String>,
    /// 订单金额
    pub amount: Option<String>,
    /// 币种
    pub currency: Option<String>,
    /// 开始时间
    pub start_time: Option<String>,
    /// 完成时间
    pub completion_time: Option<String>,
    /// 备注信息
    pub remark: Option<String>,
    /// 背调项目结果
    pub item_results: Vec<BackgroundCheckItemResult>,
    /// 创建时间
    pub created_time: Option<String>,
    /// 更新时间
    pub updated_time: Option<String>,
}

/// 背调项目结果
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckItemResult {
    /// 项目ID
    pub item_id: String,
    /// 项目名称
    pub item_name: String,
    /// 检查结果
    pub result: String,
    /// 结果详情
    pub details: Option<String>,
    /// 完成时间
    pub completion_time: Option<String>,
}

/// 背调供应商信息
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckVendor {
    /// 供应商ID
    pub id: String,
    /// 供应商名称
    pub name: String,
    /// 供应商描述
    pub description: Option<String>,
    /// 联系方式
    pub contact_info: Option<String>,
    /// API配置
    pub api_config: Option<serde_json::Value>,
    /// 支持的背调项目
    pub supported_items: Vec<String>,
    /// 是否启用
    pub enabled: bool,
    /// 创建时间
    pub created_time: Option<String>,
    /// 更新时间
    pub updated_time: Option<String>,
}

/// 背调订单创建请求
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BackgroundCheckOrderCreateRequest {
    /// 投递ID
    pub application_id: String,
    /// 背调包ID
    pub package_id: String,
    /// 候选人信息
    pub candidate_info: BackgroundCheckCandidateInfo,
    /// 紧急程度
    pub urgency: Option<String>,
    /// 备注信息
    pub remark: Option<String>,
}

/// 背调候选人信息
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BackgroundCheckCandidateInfo {
    /// 候选人姓名
    pub name: String,
    /// 身份证号
    pub id_number: String,
    /// 手机号
    pub phone: String,
    /// 邮箱
    pub email: Option<String>,
    /// 工作经历
    pub work_experience: Vec<WorkExperience>,
    /// 教育经历
    pub education_experience: Vec<EducationExperience>,
}

/// 工作经历
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct WorkExperience {
    /// 公司名称
    pub company_name: String,
    /// 职位
    pub position: String,
    /// 开始时间
    pub start_date: String,
    /// 结束时间
    pub end_date: Option<String>,
    /// 薪资
    pub salary: Option<String>,
    /// 离职原因
    pub leave_reason: Option<String>,
}

/// 教育经历
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct EducationExperience {
    /// 学校名称
    pub school_name: String,
    /// 专业
    pub major: String,
    /// 学历
    pub degree: String,
    /// 开始时间
    pub start_date: String,
    /// 结束时间
    pub end_date: String,
}

/// 背调包列表请求
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BackgroundCheckPackageListRequest {
    /// 分页大小
    pub page_size: Option<u32>,
    /// 分页标记
    pub page_token: Option<String>,
    /// 供应商筛选
    pub vendor: Option<String>,
    /// 启用状态筛选
    pub enabled: Option<bool>,
}

/// 背调订单列表请求
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct BackgroundCheckOrderListRequest {
    /// 分页大小
    pub page_size: Option<u32>,
    /// 分页标记
    pub page_token: Option<String>,
    /// 候选人ID
    pub talent_id: Option<String>,
    /// 订单状态
    pub status: Option<String>,
    /// 创建时间开始
    pub created_start_time: Option<String>,
    /// 创建时间结束
    pub created_end_time: Option<String>,
}

/// 背调包列表响应
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckPackageListResponse {
    /// 背调包列表
    #[serde(flatten)]
    pub packages: PageResponse<BackgroundCheckPackage>,
}

impl ApiResponseTrait for BackgroundCheckPackageListResponse {
    fn data_format() -> ResponseFormat {
        ResponseFormat::Data
    }
}

/// 背调订单列表响应
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckOrderListResponse {
    /// 背调订单列表
    #[serde(flatten)]
    pub orders: PageResponse<BackgroundCheckOrder>,
}

impl ApiResponseTrait for BackgroundCheckOrderListResponse {
    fn data_format() -> ResponseFormat {
        ResponseFormat::Data
    }
}

/// 背调订单详情响应
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckOrderDetailResponse {
    /// 背调订单信息
    pub order: BackgroundCheckOrder,
}

impl ApiResponseTrait for BackgroundCheckOrderDetailResponse {
    fn data_format() -> ResponseFormat {
        ResponseFormat::Data
    }
}

/// 背调操作响应
#[derive(Debug, Serialize, Deserialize)]
pub struct BackgroundCheckOperationResponse {
    /// 操作结果
    #[serde(flatten)]
    pub result: CommonResponse,
    /// 相关ID
    pub id: Option<String>,
}

impl ApiResponseTrait for BackgroundCheckOperationResponse {
    fn data_format() -> ResponseFormat {
        ResponseFormat::Data
    }
}

impl BackgroundCheckService {
    pub fn new(config: Config) -> Self {
        Self { config }
    }

    /// 获取背调包列表
    ///
    /// 该接口用于获取可用的背调包列表,包括不同供应商
    /// 提供的背调服务包,支持按供应商、启用状态等条件筛选。
    ///
    /// # 参数
    ///
    /// - `request`: 背调包列表查询请求参数,包括:
    ///   - `page_size`: 分页大小,最大值100
    ///   - `page_token`: 分页标记
    ///   - `vendor`: 供应商筛选
    ///   - `enabled`: 启用状态筛选
    /// - `option`: 可选的请求配置
    ///
    /// # 返回值
    ///
    /// 返回分页的背调包列表,包括:
    /// - 背调包基本信息列表
    /// - 背调项目和价格信息
    /// - 分页信息(是否有更多数据、下一页标记)
    ///
    /// # 示例
    ///
    /// ```ignore
    /// use open_lark::service::hire::ecological_docking::background_check::BackgroundCheckPackageListRequest;
    ///
    /// let request = BackgroundCheckPackageListRequest {
    ///     page_size: Some(20),
    ///     page_token: None,
    ///     vendor: Some("某背调公司".to_string()),
    ///     enabled: Some(true),
    /// };
    ///
    /// let response = client.hire.ecological_docking.background_check.list_packages(request, None).await?;
    ///
    /// if let Some(data) = &response.data {
    ///     println!("背调包总数: {}", data.packages.items.len());
    ///     for package in &data.packages.items {
    ///         println!("背调包: {} 价格: {:?}", package.name, package.price);
    ///     }
    /// }
    /// ```
    pub async fn list_packages(
        &self,
        request: BackgroundCheckPackageListRequest,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckPackageListResponse>> {
        let mut api_req = ApiRequest {
            http_method: Method::GET,
            api_path: HIRE_V1_BACKGROUND_CHECK_PACKAGES.to_string(),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: vec![],
            ..Default::default()
        };

        // 添加查询参数
        if let Some(page_size) = request.page_size {
            api_req
                .query_params
                .insert("page_size", page_size.to_string());
        }

        if let Some(page_token) = request.page_token {
            api_req.query_params.insert("page_token", page_token);
        }

        if let Some(vendor) = request.vendor {
            api_req.query_params.insert("vendor", vendor);
        }

        if let Some(enabled) = request.enabled {
            api_req.query_params.insert("enabled", enabled.to_string());
        }

        Transport::request(api_req, &self.config, option).await
    }

    /// 创建背调订单
    ///
    /// 该接口用于为候选人创建背调订单,选择背调包
    /// 并提供候选人相关信息用于背调执行。
    ///
    /// # 参数
    ///
    /// - `request`: 背调订单创建请求参数,包括:
    ///   - `application_id`: 投递ID(必填)
    ///   - `package_id`: 背调包ID(必填)
    ///   - `candidate_info`: 候选人信息(必填)
    ///   - `urgency`: 紧急程度
    ///   - `remark`: 备注信息
    /// - `option`: 可选的请求配置
    ///
    /// # 返回值
    ///
    /// 返回背调订单创建操作结果,包括:
    /// - `success`: 创建是否成功
    /// - `id`: 创建的订单ID
    /// - `message`: 操作结果消息
    ///
    /// # 示例
    ///
    /// ```ignore
    /// use open_lark::service::hire::ecological_docking::background_check::{
    ///     BackgroundCheckOrderCreateRequest, BackgroundCheckCandidateInfo,
    ///     WorkExperience, EducationExperience
    /// };
    ///
    /// let request = BackgroundCheckOrderCreateRequest {
    ///     application_id: "app_123456".to_string(),
    ///     package_id: "pkg_789".to_string(),
    ///     candidate_info: BackgroundCheckCandidateInfo {
    ///         name: "张三".to_string(),
    ///         id_number: "123456789012345678".to_string(),
    ///         phone: "13800138000".to_string(),
    ///         email: Some("zhangsan@example.com".to_string()),
    ///         work_experience: vec![
    ///             WorkExperience {
    ///                 company_name: "某科技公司".to_string(),
    ///                 position: "高级工程师".to_string(),
    ///                 start_date: "2020-01-01".to_string(),
    ///                 end_date: Some("2023-12-31".to_string()),
    ///                 salary: Some("300000".to_string()),
    ///                 leave_reason: Some("寻求更好发展".to_string()),
    ///             },
    ///         ],
    ///         education_experience: vec![
    ///             EducationExperience {
    ///                 school_name: "某大学".to_string(),
    ///                 major: "计算机科学".to_string(),
    ///                 degree: "本科".to_string(),
    ///                 start_date: "2016-09-01".to_string(),
    ///                 end_date: "2020-06-30".to_string(),
    ///             },
    ///         ],
    ///     },
    ///     urgency: Some("normal".to_string()),
    ///     remark: Some("重要职位候选人".to_string()),
    /// };
    ///
    /// let response = client.hire.ecological_docking.background_check.create_order(request, None).await?;
    /// ```
    pub async fn create_order(
        &self,
        request: BackgroundCheckOrderCreateRequest,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckOperationResponse>> {
        let api_req = ApiRequest {
            http_method: Method::POST,
            api_path: HIRE_V1_BACKGROUND_CHECK_ORDERS.to_string(),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: serde_json::to_vec(&request).unwrap_or_default(),
            ..Default::default()
        };

        Transport::request(api_req, &self.config, option).await
    }

    /// 获取背调订单详情
    ///
    /// 该接口用于获取指定背调订单的详细信息,包括
    /// 订单状态、背调结果、各项目完成情况等数据。
    ///
    /// # 参数
    ///
    /// - `order_id`: 背调订单ID
    /// - `option`: 可选的请求配置
    ///
    /// # 返回值
    ///
    /// 返回背调订单详细信息,包括:
    /// - 订单基本信息(状态、价格等)
    /// - 背调结果和报告
    /// - 各背调项目的完成情况
    /// - 创建和更新时间
    ///
    /// # 示例
    ///
    /// ```ignore
    /// let order_id = "order_123456";
    /// let response = client.hire.ecological_docking.background_check.get_order_detail(order_id, None).await?;
    ///
    /// if let Some(data) = &response.data {
    ///     println!("订单状态: {}", data.order.status);
    ///     println!("背调结果: {:?}", data.order.result);
    ///     println!("报告链接: {:?}", data.order.report_url);
    /// }
    /// ```
    pub async fn get_order_detail(
        &self,
        order_id: &str,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckOrderDetailResponse>> {
        let api_req = ApiRequest {
            http_method: Method::GET,
            api_path: EndpointBuilder::replace_param(
                HIRE_V1_BACKGROUND_CHECK_ORDER_GET,
                "order_id",
                order_id,
            ),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: vec![],
            ..Default::default()
        };

        Transport::request(api_req, &self.config, option).await
    }

    /// 获取背调订单列表
    ///
    /// 该接口用于获取企业的背调订单列表,支持按候选人、
    /// 状态、时间等条件筛选。返回的列表包含订单基本信息,
    /// 可用于背调进度管理和统计。
    ///
    /// # 参数
    ///
    /// - `request`: 背调订单列表查询请求参数,包括:
    ///   - `page_size`: 分页大小,最大值100
    ///   - `page_token`: 分页标记
    ///   - `talent_id`: 候选人ID筛选
    ///   - `status`: 订单状态筛选
    ///   - `created_start_time`: 创建时间开始
    ///   - `created_end_time`: 创建时间结束
    /// - `option`: 可选的请求配置
    ///
    /// # 返回值
    ///
    /// 返回分页的背调订单列表,包括:
    /// - 背调订单基本信息列表
    /// - 分页信息(是否有更多数据、下一页标记)
    ///
    /// # 示例
    ///
    /// ```ignore
    /// use open_lark::service::hire::ecological_docking::background_check::BackgroundCheckOrderListRequest;
    ///
    /// let request = BackgroundCheckOrderListRequest {
    ///     page_size: Some(50),
    ///     page_token: None,
    ///     talent_id: Some("talent_789".to_string()),
    ///     status: Some("in_progress".to_string()),
    ///     created_start_time: Some("2024-01-01T00:00:00Z".to_string()),
    ///     created_end_time: Some("2024-01-31T23:59:59Z".to_string()),
    /// };
    ///
    /// let response = client.hire.ecological_docking.background_check.list_orders(request, None).await?;
    ///
    /// if let Some(data) = &response.data {
    ///     println!("背调订单总数: {}", data.orders.items.len());
    ///     for order in &data.orders.items {
    ///         println!("订单: {} 状态: {}", order.id, order.status);
    ///     }
    /// }
    /// ```
    pub async fn list_orders(
        &self,
        request: BackgroundCheckOrderListRequest,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckOrderListResponse>> {
        let mut api_req = ApiRequest {
            http_method: Method::GET,
            api_path: HIRE_V1_BACKGROUND_CHECK_ORDERS.to_string(),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: vec![],
            ..Default::default()
        };

        // 添加查询参数
        if let Some(page_size) = request.page_size {
            api_req
                .query_params
                .insert("page_size", page_size.to_string());
        }

        if let Some(page_token) = request.page_token {
            api_req.query_params.insert("page_token", page_token);
        }

        if let Some(talent_id) = request.talent_id {
            api_req.query_params.insert("talent_id", talent_id);
        }

        if let Some(status) = request.status {
            api_req.query_params.insert("status", status);
        }

        if let Some(created_start_time) = request.created_start_time {
            api_req
                .query_params
                .insert("created_start_time", created_start_time);
        }

        if let Some(created_end_time) = request.created_end_time {
            api_req
                .query_params
                .insert("created_end_time", created_end_time);
        }

        Transport::request(api_req, &self.config, option).await
    }

    /// 取消背调订单
    ///
    /// 该接口用于取消尚未完成的背调订单,
    /// 设置取消原因并处理退款。
    ///
    /// # 参数
    ///
    /// - `order_id`: 背调订单ID
    /// - `reason`: 取消原因
    /// - `option`: 可选的请求配置
    ///
    /// # 示例
    ///
    /// ```ignore
    /// let order_id = "order_123456";
    /// let reason = "候选人已withdrawn申请";
    ///
    /// let response = client.hire.ecological_docking.background_check.cancel_order(order_id, reason, None).await?;
    /// ```
    pub async fn cancel_order(
        &self,
        order_id: &str,
        reason: &str,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckOperationResponse>> {
        #[derive(Serialize)]
        struct CancelOrderRequest {
            reason: String,
        }

        let request = CancelOrderRequest {
            reason: reason.to_string(),
        };

        let api_req = ApiRequest {
            http_method: Method::POST,
            api_path: EndpointBuilder::replace_param(
                HIRE_V1_BACKGROUND_CHECK_ORDER_CANCEL,
                "order_id",
                order_id,
            ),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: serde_json::to_vec(&request).unwrap_or_default(),
            ..Default::default()
        };

        Transport::request(api_req, &self.config, option).await
    }

    /// 获取背调报告
    ///
    /// 该接口用于下载已完成的背调报告,
    /// 返回报告文件的下载链接。
    ///
    /// # 参数
    ///
    /// - `order_id`: 背调订单ID
    /// - `option`: 可选的请求配置
    ///
    /// # 示例
    ///
    /// ```ignore
    /// let order_id = "order_123456";
    /// let response = client.hire.ecological_docking.background_check.get_report(order_id, None).await?;
    /// ```
    pub async fn get_report(
        &self,
        order_id: &str,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<serde_json::Value>> {
        let api_req = ApiRequest {
            http_method: Method::GET,
            api_path: EndpointBuilder::replace_param(
                HIRE_V1_BACKGROUND_CHECK_ORDER_REPORT,
                "order_id",
                order_id,
            ),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: vec![],
            ..Default::default()
        };

        Transport::request(api_req, &self.config, option).await
    }

    /// 批量创建背调订单
    ///
    /// 该接口用于批量为多个候选人创建背调订单,
    /// 提高操作效率。
    ///
    /// # 参数
    ///
    /// - `orders`: 背调订单创建请求列表
    /// - `option`: 可选的请求配置
    ///
    /// # 示例
    ///
    /// ```ignore
    /// let orders = vec![
    ///     BackgroundCheckOrderCreateRequest {
    ///         application_id: "app_001".to_string(),
    ///         package_id: "pkg_789".to_string(),
    ///         // ... 其他参数
    ///     },
    ///     BackgroundCheckOrderCreateRequest {
    ///         application_id: "app_002".to_string(),
    ///         package_id: "pkg_789".to_string(),
    ///         // ... 其他参数
    ///     },
    /// ];
    ///
    /// let response = client.hire.ecological_docking.background_check.batch_create_orders(orders, None).await?;
    /// ```
    pub async fn batch_create_orders(
        &self,
        orders: Vec<BackgroundCheckOrderCreateRequest>,
        option: Option<RequestOption>,
    ) -> SDKResult<BaseResponse<BackgroundCheckOperationResponse>> {
        #[derive(Serialize)]
        struct BatchCreateRequest {
            orders: Vec<BackgroundCheckOrderCreateRequest>,
        }

        let request = BatchCreateRequest { orders };

        let api_req = ApiRequest {
            http_method: Method::POST,
            api_path: HIRE_V1_BACKGROUND_CHECK_ORDERS_BATCH.to_string(),
            supported_access_token_types: vec![AccessTokenType::Tenant],
            body: serde_json::to_vec(&request).unwrap_or_default(),
            ..Default::default()
        };

        Transport::request(api_req, &self.config, option).await
    }
}