Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Beta Flag to Autocomplete #21

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "peopledatalabs"
version = "0.1.3"
version = "1.0.0"
edition = "2021"
description = "A Rust client for the People Data Labs API"
documentation = "https://docs.peopledatalabs.com/docs/rust-sdk"
Expand Down
2 changes: 2 additions & 0 deletions examples/autocompete/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ fn main() {
let autocomplete_base_params = AutocompleteBaseParams {
field: "text".to_string(),
text: Some("full".to_string()),
titlecase: Some(false),
beta: Some(false),
};
let autocomplete_params = AutocompleteParams {
base_params: None,
Expand Down
1 change: 1 addition & 0 deletions examples/job_title/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
let client = PDL::new();
let job_title_base_params = JobTitleBaseParams {
job_title: Some("software engineer".to_string()),
titlecase: Some(false),
};
let params = JobTitleParams {
base_params: None,
Expand Down
1 change: 1 addition & 0 deletions examples/skill/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
let client = PDL::new();
let skill_base_params = SkillBaseParams {
skill: Some("python".to_string()),
titlecase: Some(false),
};
let params = SkillParams {
base_params: None,
Expand Down
2 changes: 2 additions & 0 deletions src/api/autocomplete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ mod tests {
let autocomplete_base_params = AutocompleteBaseParams {
field: "school".to_string(),
text: Some("stanf".to_string()),
titlecase: Some(false),
beta: Some(false),
};

let autocomplete_params = AutocompleteParams {
Expand Down
1 change: 1 addition & 0 deletions src/api/jobtitle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ mod tests {

let job_title_base_params = JobTitleBaseParams {
job_title: Some("data scientist".to_string()),
titlecase: Some(false),
};

let job_title_params = JobTitleParams {
Expand Down
1 change: 1 addition & 0 deletions src/api/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ mod tests {

let skill_base_params = SkillBaseParams {
skill: Some("rust".to_string()),
titlecase: Some(false),
};

let skill_params = SkillParams {
Expand Down
6 changes: 6 additions & 0 deletions src/models/autocomplete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ pub struct AutocompleteBaseParams {
/// Text that is used as the seed for autocompletion
#[serde(rename = "text", default)]
pub text: Option<String>,
/// Setting titlecase to true will titlecase the data in 200 responses
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
pub titlecase: Option<bool>,
/// Setting beta to true will enable the beta autocomplete endpoint
#[serde(rename = "beta", skip_serializing_if = "Option::is_none")]
pub beta: Option<bool>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
3 changes: 3 additions & 0 deletions src/models/jobtitle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ pub struct JobTitleBaseParams {
/// JobTitle that is used as the seed for enrichment
#[serde(rename = "job_title", default)]
pub job_title: Option<String>,
/// Setting titlecase to true will titlecase the data in 200 responses
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
pub titlecase: Option<bool>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
3 changes: 3 additions & 0 deletions src/models/skills.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ pub struct SkillBaseParams {
/// Skill that is used as the seed for enrichment
#[serde(rename = "skill", default)]
pub skill: Option<String>,
/// Setting titlecase to true will titlecase the data in 200 responses
#[serde(rename = "titlecase", skip_serializing_if = "Option::is_none")]
pub titlecase: Option<bool>,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
Loading