-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jess Frazelle <[email protected]>
- Loading branch information
Showing
23 changed files
with
23,306 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ members = [ | |
"ramp", | ||
"remote", | ||
"rippling", | ||
"rippling-beta", | ||
"twilio", | ||
"vercel", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[package] | ||
name = "rippling-beta-api" | ||
description = "A fully generated & opinionated API client for the Rippling Beta API." | ||
version = "0.1.0" | ||
documentation = "https://docs.rs/rippling-beta-api" | ||
readme = "README.md" | ||
|
||
edition = "2018" | ||
license = "MIT" | ||
|
||
[dependencies] | ||
anyhow = "1" | ||
async-trait = { version = "^0.1.53", optional = true } | ||
base64 = "0.22" | ||
bigdecimal = { version = "0.4", features = ["serde"] } | ||
bytes = { version = "1", features = ["serde"] } | ||
clap = { version = "4.2.4", features = ["cargo", "derive", "env", "unicode"], optional = true } | ||
chrono = { version = "0.4", default-features = false, features = ["serde", "std"] } | ||
data-encoding = "^2.3.2" | ||
dirs = { version = "^5.0.1", optional = true } | ||
format_serde_error = { version = "^0.3.0", optional = true } | ||
futures = { version = "0.3.26", optional = true } | ||
http = { version = "^0.2.8", optional = true } | ||
itertools = "0.13.0" | ||
log = { version = "^0.4", features = ["serde"], optional = true } | ||
mime_guess = "2.0.4" | ||
parse-display = "0.9.1" | ||
phonenumber = "0.3.5" | ||
rand = { version = "0.8", optional = true } | ||
reqwest = { version = "0.11.27", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true } | ||
reqwest-conditional-middleware = { version = "0.2.1", optional = true } | ||
reqwest-middleware = { version = "0.2.2", optional = true } | ||
reqwest-retry = { version = "0.2.2", optional = true } | ||
reqwest-tracing = { version = "0.4.4", features = ["opentelemetry_0_17"], optional = true } | ||
schemars = { version = "0.8.17", features = ["bigdecimal04", "bytes", "chrono", "url", "uuid1"] } | ||
serde = { version = "1", features = ["derive"] } | ||
serde_bytes = "0.11" | ||
serde_json = "1" | ||
serde_urlencoded = { version = "^0.7", optional = true } | ||
tabled = { version = "0.15.0", features = ["ansi"], optional = true } | ||
thiserror = "1" | ||
tracing = { version = "^0.1", optional = true } | ||
url = { version = "2", features = ["serde"] } | ||
uuid = { version = "1", features = ["serde", "v4", "v7"] } | ||
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
tokio = { version = "1.38.0", features = ["rt", "macros"] } | ||
|
||
[dev-dependencies] | ||
expectorate = "1" | ||
futures-util = "^0.3.26" | ||
pretty_assertions = "1" | ||
rand = "0.8" | ||
tokio = { version = "1.38.0", features = ["rt", "macros"] } | ||
tokio-tungstenite = "0.23" | ||
|
||
[features] | ||
default = ["requests", "retry"] | ||
clap = ["dep:clap"] | ||
tabled = ["dep:tabled"] | ||
requests = ["dep:async-trait", "dep:format_serde_error", "dep:futures", "dep:http", "dep:log", "dep:rand", "dep:reqwest", "dep:serde_urlencoded", "dep:tracing"] | ||
retry = ["dep:reqwest-conditional-middleware", "dep:reqwest-retry", "dep:reqwest-middleware", "dep:reqwest-tracing"] | ||
js = ["uuid/js"] | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# `rippling-beta-api` | ||
|
||
A fully generated & opinionated API client for the Rippling Beta API. | ||
|
||
[](https://docs.rs/rippling-beta-api) | ||
|
||
## API Details | ||
|
||
Documentation for the Rippling Platform API. | ||
|
||
|
||
|
||
|
||
|
||
|
||
## Client Details | ||
|
||
|
||
|
||
The documentation for the crate is generated | ||
along with the code to make this library easy to use. | ||
|
||
|
||
To install the library, add the following to your `Cargo.toml` file. | ||
|
||
```toml | ||
[dependencies] | ||
rippling-beta-api = "0.1.0" | ||
``` | ||
|
||
## Basic example | ||
|
||
Typical use will require intializing a `Client`. This requires | ||
a user agent string and set of credentials. | ||
|
||
```rust,no_run | ||
use rippling_beta_api::Client; | ||
let client = Client::new( | ||
String::from("api-key"), | ||
); | ||
``` | ||
|
||
Alternatively, the library can search for most of the variables required for | ||
the client in the environment: | ||
|
||
- `RIPPLING_BETA_API_TOKEN` | ||
|
||
And then you can create a client from the environment. | ||
|
||
```rust,no_run | ||
use rippling_beta_api::Client; | ||
let client = Client::new_from_env(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-beta-api::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `RIPPLING_BETA_API_TOKEN`.\nlet client = rippling_beta_api::Client::new_from_env();", | ||
"install": "[dependencies]\nrippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_departments_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::GetDepartmentsResponse = client\n .departments()\n .get(\n Some(\"some-string\".to_string()),\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_employment_types_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::GetEmploymentTypesResponse = client\n .employment_types()\n .get(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::ListEntitlementsResponse = client.entitlements().list().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_teams_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::GetTeamsResponse = client\n .teams()\n .get(\n Some(\"some-string\".to_string()),\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_users_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::GetUsersResponse = client\n .users()\n .get(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_work_locations_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::GetWorkLocationsResponse = client\n .work_locations()\n .get(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-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_beta_api::Client::new_from_env();\n let result: rippling_beta_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-beta-api/latest/rippling-beta-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)\nasync fn example_workers_get() -> anyhow::Result<()> {\n let client = rippling_beta_api::Client::new_from_env();\n let result: rippling_beta_api::types::Worker = client\n .workers()\n .get(\n Some(\"some-string\".to_string()),\n \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", | ||
"libDocsLink": "https://docs.rs/rippling-beta-api/latest/rippling-beta-api/workers/struct.Workers.html#method.get" | ||
} | ||
} | ||
] |
Oops, something went wrong.