Skip to content

Commit 248f0fc

Browse files
authored
Add Beta Flag to Autocomplete (#21)
* add beta flag to autocomplete * add titlecase * fix examples
1 parent 82db6d2 commit 248f0fc

File tree

10 files changed

+21
-1
lines changed

10 files changed

+21
-1
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "peopledatalabs"
3-
version = "0.1.3"
3+
version = "1.0.0"
44
edition = "2021"
55
description = "A Rust client for the People Data Labs API"
66
documentation = "https://docs.peopledatalabs.com/docs/rust-sdk"

examples/autocompete/main.rs

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ fn main() {
55
let autocomplete_base_params = AutocompleteBaseParams {
66
field: "text".to_string(),
77
text: Some("full".to_string()),
8+
titlecase: Some(false),
9+
beta: Some(false),
810
};
911
let autocomplete_params = AutocompleteParams {
1012
base_params: None,

examples/job_title/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
let client = PDL::new();
55
let job_title_base_params = JobTitleBaseParams {
66
job_title: Some("software engineer".to_string()),
7+
titlecase: Some(false),
78
};
89
let params = JobTitleParams {
910
base_params: None,

examples/skill/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fn main() {
44
let client = PDL::new();
55
let skill_base_params = SkillBaseParams {
66
skill: Some("python".to_string()),
7+
titlecase: Some(false),
78
};
89
let params = SkillParams {
910
base_params: None,

src/api/autocomplete.rs

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ mod tests {
4444
let autocomplete_base_params = AutocompleteBaseParams {
4545
field: "school".to_string(),
4646
text: Some("stanf".to_string()),
47+
titlecase: Some(false),
48+
beta: Some(false),
4749
};
4850

4951
let autocomplete_params = AutocompleteParams {

src/api/jobtitle.rs

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ mod tests {
3535

3636
let job_title_base_params = JobTitleBaseParams {
3737
job_title: Some("data scientist".to_string()),
38+
titlecase: Some(false),
3839
};
3940

4041
let job_title_params = JobTitleParams {

src/api/skills.rs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ mod tests {
3434

3535
let skill_base_params = SkillBaseParams {
3636
skill: Some("rust".to_string()),
37+
titlecase: Some(false),
3738
};
3839

3940
let skill_params = SkillParams {

src/models/autocomplete.rs

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ pub struct AutocompleteBaseParams {
1010
/// Text that is used as the seed for autocompletion
1111
#[serde(rename = "text", default)]
1212
pub text: Option<String>,
13+
/// Setting titlecase to true will titlecase the data in 200 responses
14+
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
15+
pub titlecase: Option<bool>,
16+
/// Setting beta to true will enable the beta autocomplete endpoint
17+
#[serde(rename = "beta", skip_serializing_if = "Option::is_none")]
18+
pub beta: Option<bool>,
1319
}
1420

1521
#[derive(Debug, Serialize, Deserialize)]

src/models/jobtitle.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pub struct JobTitleBaseParams {
77
/// JobTitle that is used as the seed for enrichment
88
#[serde(rename = "job_title", default)]
99
pub job_title: Option<String>,
10+
/// Setting titlecase to true will titlecase the data in 200 responses
11+
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
12+
pub titlecase: Option<bool>,
1013
}
1114

1215
#[derive(Debug, Serialize, Deserialize)]

src/models/skills.rs

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pub struct SkillBaseParams {
77
/// Skill that is used as the seed for enrichment
88
#[serde(rename = "skill", default)]
99
pub skill: Option<String>,
10+
/// Setting titlecase to true will titlecase the data in 200 responses
11+
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
12+
pub titlecase: Option<bool>,
1013
}
1114

1215
#[derive(Debug, Serialize, Deserialize)]

0 commit comments

Comments
 (0)