Skip to content

Commit

Permalink
rippling
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Sep 16, 2024
1 parent 2c05af8 commit 74b31f8
Show file tree
Hide file tree
Showing 11 changed files with 260 additions and 265 deletions.
116 changes: 58 additions & 58 deletions rippling/rippling-api.rs.patch.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@ use anyhow::Result;

use crate::Client;
#[derive(Clone, Debug)]
pub struct IApplicationManagement {
pub struct ApplicationManagement {
pub client: Client,
}

impl IApplicationManagement {
impl ApplicationManagement {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
Self { client }
}

#[doc = "GET Matching App Users\n\nReturns matching users and their app IDs based on the app \
handles.\n\nNote:There could be multiple instances of the same app. In this case, the \
API will return all instances in the format \
app_handle_app_owner_id.\n\n\n**Parameters:**\n\n- `app_handles: Option<String>`: CSV \
of app handles. See GET /app_detail/app_handles\n\n\n```rust,no_run\nasync fn \
example_i_application_management_get_app_app_matching_users() -> anyhow::Result<()> \
{\n let client = rippling_api::Client::new_from_env();\n let result: \
rippling_api::types::GetAppAppMatchingUsersResponse = client\n \
.i_application_management()\n \
.get_app_app_matching_users(Some(\"some-string\".to_string()))\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "GET Matching App Users\n\nReturns matching users and their app IDs based on the app handles.\n\nNote:There could be multiple instances of the same app. In this case, the API will return all instances in the format app_handle_app_owner_id.\n\n\n**Parameters:**\n\n- `app_handles: Option<String>`: CSV of app handles. See GET /app_detail/app_handles\n\n\n```rust,no_run\nasync fn example_application_management_get_app_app_matching_users() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetAppAppMatchingUsersResponse = client\n .application_management()\n .get_app_app_matching_users(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_app_app_matching_users<'a>(
&'a self,
Expand Down Expand Up @@ -61,7 +51,15 @@ impl IApplicationManagement {
}
}

#[doc = "Mark App Installed\n\nThis endpoint can be hit to mark your app as installed in Rippling, if you aren't hitting Rippling's other endpoints on installation. The endpoint does not require any scopes.\n\nPlease note, hitting any other endpoint should mark your app as installed as well.\n\n```rust,no_run\nasync fn example_i_application_management_post_mark_app_installed() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::PostMarkAppInstalledResponse = client\n .i_application_management()\n .post_mark_app_installed()\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Mark App Installed\n\nThis endpoint can be hit to mark your app as installed in \
Rippling, if you aren't hitting Rippling's other endpoints on installation. The \
endpoint does not require any scopes.\n\nPlease note, hitting any other endpoint \
should mark your app as installed as well.\n\n```rust,no_run\nasync fn \
example_application_management_post_mark_app_installed() -> anyhow::Result<()> {\n \
let client = rippling_api::Client::new_from_env();\n let result: \
rippling_api::types::PostMarkAppInstalledResponse = client\n \
.application_management()\n .post_mark_app_installed()\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_mark_app_installed<'a>(
&'a self,
Expand Down
8 changes: 4 additions & 4 deletions rippling/src/h_ats.rs → rippling/src/ats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ use anyhow::Result;

use crate::Client;
#[derive(Clone, Debug)]
pub struct HAts {
pub struct Ats {
pub client: Client,
}

impl HAts {
impl Ats {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
Self { client }
}

#[doc = "POST New Candidate\n\nPushes a candidate from an applicant tracking system directly into the Rippling onboarding flow. Please note, this endpoint is only available to applications integrating with OAuth2.0.\n\nNOTE: This endpoint is NOT available for use with Rippling customer API Keys.\n\n```rust,no_run\nasync fn example_h_ats_post_ats_candidates_push_candidate() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Candidate = client\n .h_ats()\n .post_ats_candidates_push_candidate(&rippling_api::types::Candidate {\n name: Some(\"some-string\".to_string()),\n email: Some(\"some-string\".to_string()),\n job_title: Some(\"some-string\".to_string()),\n phone_number: Some(\"some-string\".to_string()),\n candidate_id: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n salary_unit: Some(rippling_api::types::SalaryUnit::PayPeriod),\n salary_per_unit: Some(3.14 as f64),\n signing_bonus: Some(3.14 as f64),\n currency: Some(\"some-string\".to_string()),\n equity_shares: Some(4 as i64),\n department: Some(\"some-string\".to_string()),\n employment_type: Some(rippling_api::types::CandidateEmploymentType::Temp),\n work_location: Some(\"some-string\".to_string()),\n attachments: Some(vec![rippling_api::types::Attachments {\n file_name: Some(\"some-string\".to_string()),\n file_url: Some(\"some-string\".to_string()),\n }]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "POST New Candidate\n\nPushes a candidate from an applicant tracking system directly into the Rippling onboarding flow. Please note, this endpoint is only available to applications integrating with OAuth2.0.\n\nNOTE: This endpoint is NOT available for use with Rippling customer API Keys.\n\n```rust,no_run\nasync fn example_ats_post_candidates_push_candidate() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Candidate = client\n .ats()\n .post_candidates_push_candidate(&rippling_api::types::Candidate {\n name: Some(\"some-string\".to_string()),\n email: Some(\"some-string\".to_string()),\n job_title: Some(\"some-string\".to_string()),\n phone_number: Some(\"some-string\".to_string()),\n candidate_id: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n salary_unit: Some(rippling_api::types::SalaryUnit::PayPeriod),\n salary_per_unit: Some(3.14 as f64),\n signing_bonus: Some(3.14 as f64),\n currency: Some(\"some-string\".to_string()),\n equity_shares: Some(4 as i64),\n department: Some(\"some-string\".to_string()),\n employment_type: Some(rippling_api::types::CandidateEmploymentType::Temp),\n work_location: Some(\"some-string\".to_string()),\n attachments: Some(vec![rippling_api::types::Attachments {\n file_name: Some(\"some-string\".to_string()),\n file_url: Some(\"some-string\".to_string()),\n }]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_ats_candidates_push_candidate<'a>(
pub async fn post_candidates_push_candidate<'a>(
&'a self,
body: &crate::types::Candidate,
) -> Result<crate::types::Candidate, crate::types::error::Error> {
Expand Down
56 changes: 30 additions & 26 deletions rippling/src/a_companies.rs → rippling/src/companies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@ use anyhow::Result;

use crate::Client;
#[derive(Clone, Debug)]
pub struct ACompanies {
pub struct Companies {
pub client: Client,
}

impl ACompanies {
impl Companies {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
Self { client }
}

#[doc = "GET Current Company\n\nReturns the currently accessible company for the given token. \
Please note, the returned fields depend on the scopes that are enabled for your \
access token or API key.\n\n```rust,no_run\nasync fn \
example_a_companies_get_companies() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: rippling_api::types::Company = \
client.a_companies().get_companies().await?;\n println!(\"{:?}\", result);\n \
Ok(())\n}\n```"]
access token or API key.\n\n```rust,no_run\nasync fn example_companies_get() -> \
anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let \
result: rippling_api::types::Company = client.companies().get().await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_companies<'a>(
&'a self,
) -> Result<crate::types::Company, crate::types::error::Error> {
pub async fn get<'a>(&'a self) -> Result<crate::types::Company, crate::types::error::Error> {
let mut req = self.client.client.request(
http::Method::GET,
&format!(
Expand Down Expand Up @@ -50,7 +47,14 @@ impl ACompanies {
}
}

#[doc = "GET Departments\n\nReturns a list of departments for the given company.\n\n**Parameters:**\n\n- `limit: Option<i64>`: Sets a limit on the returned values\n- `offset: Option<i64>`: Offsets the returned values\n\n```rust,no_run\nasync fn example_a_companies_get_departments() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec<Option<rippling_api::types::Department>> = client\n .a_companies()\n .get_departments(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "GET Departments\n\nReturns a list of departments for the given \
company.\n\n**Parameters:**\n\n- `limit: Option<i64>`: Sets a limit on the returned \
values\n- `offset: Option<i64>`: Offsets the returned values\n\n```rust,no_run\nasync \
fn example_companies_get_departments() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: \
Vec<Option<rippling_api::types::Department>> = client\n .companies()\n \
.get_departments(Some(4 as i64), Some(4 as i64))\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_departments<'a>(
&'a self,
Expand Down Expand Up @@ -94,9 +98,9 @@ impl ACompanies {
#[doc = "GET Work Locations\n\nReturns the list of work locations for a given \
company.\n\n**Parameters:**\n\n- `limit: Option<i64>`: Sets a limit on the returned \
values\n- `offset: Option<i64>`: Offsets the returned values\n\n```rust,no_run\nasync \
fn example_a_companies_get_work_locations() -> anyhow::Result<()> {\n let client = \
fn example_companies_get_work_locations() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: \
Vec<rippling_api::types::WorkLocation> = client\n .a_companies()\n \
Vec<rippling_api::types::WorkLocation> = client\n .companies()\n \
.get_work_locations(Some(4 as i64), Some(4 as i64))\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
Expand Down Expand Up @@ -142,9 +146,9 @@ impl ACompanies {
#[doc = "GET Custom Fields\n\nReturns the custom fields for the given \
company.\n\n**Parameters:**\n\n- `limit: Option<i64>`: Sets a limit on the returned \
values\n- `offset: Option<i64>`: Offsets the returned values\n\n```rust,no_run\nasync \
fn example_a_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = \
fn example_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: \
Vec<rippling_api::types::CustomFields> = client\n .a_companies()\n \
Vec<rippling_api::types::CustomFields> = client\n .companies()\n \
.get_custom_fields(Some(4 as i64), Some(4 as i64))\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
Expand Down Expand Up @@ -189,11 +193,11 @@ impl ACompanies {

#[doc = "GET Teams\n\nRetrieves the list of teams for the company.\n\n**Parameters:**\n\n- \
`limit: Option<i64>`: Sets a limit on the returned values\n- `offset: Option<i64>`: \
Offsets the returned values\n\n```rust,no_run\nasync fn \
example_a_companies_get_teams() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: Vec<rippling_api::types::Team> \
= client\n .a_companies()\n .get_teams(Some(4 as i64), Some(4 as \
i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
Offsets the returned values\n\n```rust,no_run\nasync fn example_companies_get_teams() \
-> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n \
let result: Vec<rippling_api::types::Team> = client\n .companies()\n \
.get_teams(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", \
result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_teams<'a>(
&'a self,
Expand Down Expand Up @@ -237,9 +241,9 @@ impl ACompanies {
#[doc = "GET Levels\n\nRetrieves the levels for the company. Levels are set positions for an \
organization, such as Manager, or Executive.\n\n**Parameters:**\n\n- `limit: \
Option<i64>`: Sets a limit on the returned values\n- `offset: Option<i64>`: Offsets \
the returned values\n\n```rust,no_run\nasync fn example_a_companies_get_levels() -> \
the returned values\n\n```rust,no_run\nasync fn example_companies_get_levels() -> \
anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let \
result: Vec<rippling_api::types::Level> = client\n .a_companies()\n \
result: Vec<rippling_api::types::Level> = client\n .companies()\n \
.get_levels(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", \
result);\n Ok(())\n}\n```"]
#[tracing::instrument]
Expand Down Expand Up @@ -285,9 +289,9 @@ impl ACompanies {
#[doc = "GET Company Leave Types\n\nRetrieves the current company leave types. The query can \
be filtered by managedBy field.\n\n**Parameters:**\n\n- `managed_by: \
Option<String>`\n\n```rust,no_run\nasync fn \
example_a_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client \
= rippling_api::Client::new_from_env();\n let result: \
Vec<rippling_api::types::CompanyLeaveType> = client\n .a_companies()\n \
example_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client = \
rippling_api::Client::new_from_env();\n let result: \
Vec<rippling_api::types::CompanyLeaveType> = client\n .companies()\n \
.get_company_leave_types(Some(\"some-string\".to_string()))\n .await?;\n \
println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
Expand Down Expand Up @@ -328,7 +332,7 @@ impl ACompanies {
}
}

#[doc = "GET Company Activity\n\nRetrieves the activity for a given company.\n\nThe most reliable method to ingest all activity from Rippling is to use a pagination cursor via the 'next' parameter. This will ensure that events are not skipped or duplicated due to the lack of timestamp precision.\n\nThe general sequence of steps to leverage the next parameter:\n\n1. Issue an initial request using startDate with a value set to some date in the last 90 days\n2. Retrieve the next page of events through the next value from the response data.\n3. Issue the paginated request\n4. Retrieve the next page of events through the next value from the response data\n5. Pause and repeat the previous step\n\n\n**Parameters:**\n\n- `end_date: Option<chrono::NaiveDate>`: Timestamp to list activity before (inclusive).\n- `limit: Option<String>`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n- `next: Option<String>`: Specifies the pagination cursor to the next page\n- `start_date: Option<chrono::NaiveDate>`: Timestamp to list activity after (inclusive). This should be less than 90 days from now. Defaults to 90 days.\n\n```rust,no_run\nasync fn example_a_companies_get_company_activity() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetCompanyActivityResponse = client\n .a_companies()\n .get_company_activity(\n Some(chrono::Utc::now().date_naive()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "GET Company Activity\n\nRetrieves the activity for a given company.\n\nThe most reliable method to ingest all activity from Rippling is to use a pagination cursor via the 'next' parameter. This will ensure that events are not skipped or duplicated due to the lack of timestamp precision.\n\nThe general sequence of steps to leverage the next parameter:\n\n1. Issue an initial request using startDate with a value set to some date in the last 90 days\n2. Retrieve the next page of events through the next value from the response data.\n3. Issue the paginated request\n4. Retrieve the next page of events through the next value from the response data\n5. Pause and repeat the previous step\n\n\n**Parameters:**\n\n- `end_date: Option<chrono::NaiveDate>`: Timestamp to list activity before (inclusive).\n- `limit: Option<String>`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n- `next: Option<String>`: Specifies the pagination cursor to the next page\n- `start_date: Option<chrono::NaiveDate>`: Timestamp to list activity after (inclusive). This should be less than 90 days from now. Defaults to 90 days.\n\n```rust,no_run\nasync fn example_companies_get_company_activity() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetCompanyActivityResponse = client\n .companies()\n .get_company_activity(\n Some(chrono::Utc::now().date_naive()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(chrono::Utc::now().date_naive()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_company_activity<'a>(
&'a self,
Expand Down
Loading

0 comments on commit 74b31f8

Please sign in to comment.