Skip to content

Commit

Permalink
update rippling
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Aug 11, 2024
1 parent 9062cef commit 4dfe8b5
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 88 deletions.
2 changes: 1 addition & 1 deletion kittycad.rs
138 changes: 138 additions & 0 deletions rippling/rippling-api.rs.patch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[
{
"op": "add",
"path": "/info/x-rust",
"value": {
"client": "// Authenticate via an API token.\nlet client = rippling-api::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `RIPPLING_API_TOKEN`.\nlet client = rippling_api::Client::new_from_env();",
"install": "[dependencies]\nrippling-api = \"0.1.0\""
}
},
{
"op": "add",
"path": "/paths/~1companies/get/x-rust",
"value": {
"example": "/// List companies\n/// \n/// A List of companies\n/// - Requires: `API Tier 1`\n/// - Expandable fields: `legal_entities`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `order_by: Option<String>`\nasync fn example_companies_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListCompaniesResponse = client\n .companies()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1custom-fields/get/x-rust",
"value": {
"example": "/// List custom fields\n/// \n/// A List of custom fields\n/// - Requires: `API Tier 1`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `order_by: Option<String>`\nasync fn example_custom_fields_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListCustomFieldsResponse = client\n .custom_fields()\n .list(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/custom_fields/struct.CustomFields.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1departments/get/x-rust",
"value": {
"example": "/// List departments\n/// \n/// A List of departments\n/// - Requires: `API Tier 1`\n/// - Expandable fields: `parent`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `order_by: Option<String>`\nasync fn example_departments_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListDepartmentsResponse = client\n .departments()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/departments/struct.Departments.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1departments~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific department\n/// \n/// Retrieve a specific department\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_departments_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetDepartmentsResponse = client\n .departments()\n .get(\n Some(\"some-string\".to_string()),\n uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/departments/struct.Departments.html#method.get"
}
},
{
"op": "add",
"path": "/paths/~1employment-types/get/x-rust",
"value": {
"example": "/// List employment types\n/// \n/// A List of employment types\n/// - Requires: `API Tier 1`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `order_by: Option<String>`\nasync fn example_employment_types_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListEmploymentTypesResponse = client\n .employment_types()\n .list(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/employment_types/struct.EmploymentTypes.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1employment-types~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific employment type\n/// \n/// Retrieve a specific employment type\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_employment_types_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetEmploymentTypesResponse = client\n .employment_types()\n .get(uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?)\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/employment_types/struct.EmploymentTypes.html#method.get"
}
},
{
"op": "add",
"path": "/paths/~1entitlements/get/x-rust",
"value": {
"example": "/// List entitlements\n/// \n/// A List of entitlements\n/// - Requires: `API Tier 1`\nasync fn example_entitlements_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListEntitlementsResponse = client.entitlements().list().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/entitlements/struct.Entitlements.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1sso-me/get/x-rust",
"value": {
"example": "/// Retrieve my SSO information\n/// \n/// SSO information of the current user\n/// - Requires: `API Tier 1`\n/// - Expandable fields: `company`\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\nasync fn example_me_list_sso() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Ssome = client\n .me()\n .list_sso(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/me/struct.Me.html#method.list_sso"
}
},
{
"op": "add",
"path": "/paths/~1teams/get/x-rust",
"value": {
"example": "/// List teams\n/// \n/// A List of teams\n/// - Requires: `API Tier 1`\n/// - Expandable fields: `parent`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `order_by: Option<String>`\nasync fn example_teams_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListTeamsResponse = client\n .teams()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/teams/struct.Teams.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1teams~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific team\n/// \n/// Retrieve a specific team\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_teams_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetTeamsResponse = client\n .teams()\n .get(\n Some(\"some-string\".to_string()),\n uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/teams/struct.Teams.html#method.get"
}
},
{
"op": "add",
"path": "/paths/~1users/get/x-rust",
"value": {
"example": "/// List users\n/// \n/// A List of users\n/// - Requires: `API Tier 1`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `order_by: Option<String>`\nasync fn example_users_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListUsersResponse =\n client.users().list(Some(\"some-string\".to_string())).await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/users/struct.Users.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1users~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific user\n/// \n/// Retrieve a specific user\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_users_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetUsersResponse = client\n .users()\n .get(uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?)\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/users/struct.Users.html#method.get"
}
},
{
"op": "add",
"path": "/paths/~1work-locations/get/x-rust",
"value": {
"example": "/// List work locations\n/// \n/// A List of work locations\n/// - Requires: `API Tier 1`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `order_by: Option<String>`\nasync fn example_work_locations_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListWorkLocationsResponse = client\n .work_locations()\n .list(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/work_locations/struct.WorkLocations.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1work-locations~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific work location\n/// \n/// Retrieve a specific work location\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_work_locations_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetWorkLocationsResponse = client\n .work_locations()\n .get(uuid::Uuid::from_str(\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )?)\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/work_locations/struct.WorkLocations.html#method.get"
}
},
{
"op": "add",
"path": "/paths/~1workers/get/x-rust",
"value": {
"example": "/// List workers\n/// \n/// A List of workers\n/// - Requires: `API Tier 1`\n/// - Filterable fields: `status`, `work_email`\n/// - Expandable fields: `user`, `legal_entity`, `employment_type`, `compensation`, `department`, `teams`, `level`, `custom_fields`\n/// - Sortable fields: `id`, `created_at`, `updated_at`\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `filter: Option<String>`\n/// - `order_by: Option<String>`\nasync fn example_workers_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListWorkersResponse = client\n .workers()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/workers/struct.Workers.html#method.list"
}
},
{
"op": "add",
"path": "/paths/~1workers~1{id}/get/x-rust",
"value": {
"example": "/// Retrieve a specific worker\n/// \n/// Retrieve a specific worker\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option<String>`\n/// - `id: &'astr`: ID of the resource to return (required)\nuse std::str::FromStr;\nasync fn example_workers_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetWorkersResponse = client\n .workers()\n .get(\n Some(\"some-string\".to_string()),\n uuid::Uuid::from_str(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")?,\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n",
"libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/workers/struct.Workers.html#method.get"
}
}
]
3 changes: 1 addition & 2 deletions rippling/src/companies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl Companies {
Self { client }
}

#[doc = "List companies\n\nA List of companies\n- Requires: `API Tier 1`\n- Expandable fields: `parent_legal_entity`, `legal_entities`\n- Sortable fields: `id`, `created_at`, `updated_at`\n\n**Parameters:**\n\n- `expand: Option<String>`\n- `order_by: Option<String>`\n\n```rust,no_run\nasync fn example_companies_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListCompaniesResponse = client\n .companies()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "List companies\n\nA List of companies\n- Requires: `API Tier 1`\n- Expandable fields: `legal_entities`\n- Sortable fields: `id`, `created_at`, `updated_at`\n\n**Parameters:**\n\n- `expand: Option<String>`\n- `order_by: Option<String>`\n\n```rust,no_run\nasync fn example_companies_list() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::ListCompaniesResponse = client\n .companies()\n .list(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn list<'a>(
&'a self,
Expand Down Expand Up @@ -43,7 +43,6 @@ impl Companies {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
1 change: 0 additions & 1 deletion rippling/src/custom_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl CustomFields {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
4 changes: 1 addition & 3 deletions rippling/src/departments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl Departments {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down Expand Up @@ -74,7 +73,7 @@ impl Departments {
&format!(
"{}/{}",
self.client.base_url,
"departments/{id}".replace("{id}", &id)
"departments/{id}".replace("{id}", id)
),
);
req = req.bearer_auth(&self.client.token);
Expand All @@ -93,7 +92,6 @@ impl Departments {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
4 changes: 1 addition & 3 deletions rippling/src/employment_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl EmploymentTypes {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down Expand Up @@ -74,7 +73,7 @@ impl EmploymentTypes {
&format!(
"{}/{}",
self.client.base_url,
"employment-types/{id}".replace("{id}", &id)
"employment-types/{id}".replace("{id}", id)
),
);
req = req.bearer_auth(&self.client.token);
Expand All @@ -87,7 +86,6 @@ impl EmploymentTypes {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
1 change: 0 additions & 1 deletion rippling/src/entitlements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ impl Entitlements {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
1 change: 0 additions & 1 deletion rippling/src/me.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ impl Me {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
4 changes: 1 addition & 3 deletions rippling/src/teams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl Teams {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down Expand Up @@ -73,7 +72,7 @@ impl Teams {
&format!(
"{}/{}",
self.client.base_url,
"teams/{id}".replace("{id}", &id)
"teams/{id}".replace("{id}", id)
),
);
req = req.bearer_auth(&self.client.token);
Expand All @@ -92,7 +91,6 @@ impl Teams {
format_serde_error::SerdeError::new(text.to_string(), err),
status,
)
.into()
})
} else {
let text = resp.text().await.unwrap_or_default();
Expand Down
Loading

0 comments on commit 4dfe8b5

Please sign in to comment.