Skip to content

Commit

Permalink
Feature: Adding Company Response Fields (#23)
Browse files Browse the repository at this point in the history
* Feature: Adding Company Response fields

This PR updates the Company struct to optionally include all the
available information for the `enrich` endpoint.

Added `linkedin_slug` as that's a new field for Company Enrich.
  • Loading branch information
joshfinnie authored Jan 12, 2024
1 parent 406b154 commit aa5e482
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 7 deletions.
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 = "1.0.0"
version = "1.0.1"
edition = "2021"
description = "A Rust client for the People Data Labs API"
documentation = "https://docs.peopledatalabs.com/docs/rust-sdk"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 People Data Labs
Copyright (c) 2023-2024 People Data Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions src/models/autocomplete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl AutocompleteParams {

#[derive(Debug, Serialize, Deserialize)]
pub struct AutocompleteResponse {
/// See https://docs.peopledatalabs.com/docs/output-response-autocomplete-api for more information
pub status: i32,
pub data: Option<Vec<AutocompleteResult>>,
pub fields: Option<Vec<String>>,
Expand Down
81 changes: 76 additions & 5 deletions src/models/company.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,40 +143,111 @@ pub struct Location {
pub geo: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct TopUsEmployeeMetros {
pub current_head_count: Option<i32>,
pub twelve_moth_growth_rate: Option<f32>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct RecentExecHires {
pub joined_date: Option<String>,
pub pdl_id: Option<String>,
pub job_title: Option<String>,
pub job_title_role: Option<String>,
pub job_title_sub_role: Option<String>,
pub job_title_levels: Option<Vec<String>>,
pub previous_company_id: Option<String>,
pub previous_company_job_title: Option<String>,
pub previous_company_job_title_role: Option<String>,
pub previous_company_job_title_sub_role: Option<String>,
pub previous_company_job_title_levels: Option<Vec<String>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct RecentExecDepartures {
pub departed_date: Option<String>,
pub pdl_id: Option<String>,
pub job_title: Option<String>,
pub job_title_role: Option<String>,
pub job_title_sub_role: Option<String>,
pub job_title_levels: Option<Vec<String>>,
pub new_company_id: Option<String>,
pub new_company_job_title: Option<String>,
pub new_company_job_title_role: Option<String>,
pub new_company_job_title_sub_role: Option<String>,
pub new_company_job_title_levels: Option<Vec<String>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct FundingDetails {
pub funding_round_date: Option<String>,
pub funding_raised: Option<f64>,
pub funding_currency: Option<String>,
pub funding_type: Option<String>,
pub investing_companies: Option<Vec<String>>,
pub investing_individuals: Option<Vec<String>>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CompanyResponse {
/// See https://docs.peopledatalabs.com/docs/example-company-record for more information.
pub status: Option<i32>,
pub display_name: Option<String>,
pub name: Option<String>,
pub size: Option<String>,
pub employee_count: Option<i32>,
pub linkedin_employee_count: Option<i32>,
pub id: Option<String>,
pub founded: Option<i32>,
pub industry: Option<String>,
pub naics: Option<Vec<Naics>>,
pub sic: Option<Vec<Sic>>,
pub location: Option<Location>,
pub linkedin_id: Option<String>,
pub linkedin_url: Option<String>,
pub linkedin_slug: Option<String>,
pub facebook_url: Option<String>,
pub twitter_url: Option<String>,
pub profiles: Option<Vec<String>>,
pub website: Option<String>,
pub ticker: Option<String>,
pub gics_sector: Option<String>,
pub mic_exchange: Option<String>,
pub type_: Option<String>,
pub summary: Option<String>,
pub tags: Option<Vec<String>>,
pub headline: Option<String>,
pub display_name_history: Option<Vec<String>>,
pub alternative_names: Option<Vec<String>>,
pub alternative_domains: Option<Vec<String>>,
pub affiliated_profiles: Option<Vec<String>>,
pub location: Option<Location>,
pub naics: Option<Vec<Naics>>,
pub sic: Option<Vec<Sic>>,
pub employee_growth_rate: Option<HashMap<String, f32>>,
pub employee_churn_rate: Option<HashMap<String, f32>>,
pub average_employee_tenure: Option<f32>,
pub average_tenure_by_role: Option<HashMap<String, f32>>,
pub average_tenure_by_level: Option<HashMap<String, f32>>,
pub employee_count_by_country: Option<HashMap<String, i32>>,
pub top_us_employee_metro: Option<Vec<TopUsEmployeeMetros>>,
pub employee_count_by_month: Option<HashMap<String, i32>>,
pub gross_additions_by_month: Option<HashMap<String, i32>>,
pub gross_departures_by_month: Option<HashMap<String, i32>>,
pub employee_count_by_month_by_role: Option<HashMap<String, HashMap<String, i32>>>,
pub employee_count_by_month_by_level: Option<HashMap<String, HashMap<String, i32>>>,
pub recent_exec_hires: Option<Vec<RecentExecHires>>,
pub recent_exec_departures: Option<Vec<RecentExecDepartures>>,
pub top_previous_employers_by_role: Option<HashMap<String, HashMap<String, i32>>>,
pub top_next_employers_by_role: Option<HashMap<String, HashMap<String, i32>>>,
pub total_funding_raised: Option<f32>,
pub latest_funding_stage: Option<String>,
pub latest_funding_date: Option<String>,
pub number_funding_rounds: Option<i32>,
pub funding_stages: Option<Vec<String>>,
pub funding_details: Option<Vec<FundingDetails>>,
pub likelihood: Option<i32>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CleanCompanyResponse {
/// See https://docs.peopledatalabs.com/docs/output-response-cleaner-apis#company-cleaner-api-response for more information.
pub status: i32,
pub name: Option<String>,
pub size: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions src/models/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl CleanLocationParams {

#[derive(Debug, Serialize, Deserialize)]
pub struct CleanLocationResponse {
/// See https://docs.peopledatalabs.com/docs/output-response-cleaner-apis#location-cleaner-api-response for more information
pub status: i32,
pub name: Option<String>,
pub locality: Option<String>,
Expand Down
1 change: 1 addition & 0 deletions src/models/school.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub struct Location {

#[derive(Debug, Serialize, Deserialize)]
pub struct CleanSchoolResponse {
/// See https://docs.peopledatalabs.com/docs/output-response-cleaner-apis#school-cleaner-api-response for more information
pub status: i32,
pub name: Option<String>,
pub type_: Option<String>,
Expand Down

0 comments on commit aa5e482

Please sign in to comment.