diff --git a/Cargo.lock b/Cargo.lock index e566885..6a76e3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1903,7 +1903,7 @@ dependencies = [ ] [[package]] -name = "rippling-beta-api" +name = "rippling-base-api" version = "0.1.0" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 771ca2f..8a9a8f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ "ramp", "remote", "rippling", - "rippling-beta", + "rippling-base", "twilio", "vercel", ] diff --git a/Makefile b/Makefile index 0bcb7b4..96724a0 100644 --- a/Makefile +++ b/Makefile @@ -76,26 +76,26 @@ remote: openapitor --request-timeout-seconds 60 \ --date-time-format "%Y-%m-%dT%H:%M:%S" $(EXTRA_ARGS) -.PHONY: rippling -rippling: openapitor +.PHONY: rippling-base +rippling-base: openapitor $(openapitor_exe) \ --input specs/rippling.yaml \ - --target-version 0.1.3 \ - --output ./rippling \ - --name rippling-api \ - --description "A fully generated & opinionated API client for the Rippling API." \ + --target-version 0.1.0 \ + --output ./rippling-base \ + --name rippling-base-api \ + --description "A fully generated & opinionated API client for the Rippling Base API." \ --base-url "https://api.rippling.com" \ --request-timeout-seconds 60 \ --date-time-format "%Y-%m-%dT%H:%M:%S" $(EXTRA_ARGS) -.PHONY: rippling-beta -rippling-beta: openapitor +.PHONY: rippling +rippling: openapitor $(openapitor_exe) \ --input specs/rippling-beta.yaml \ - --target-version 0.1.0 \ - --output ./rippling-beta \ - --name rippling-beta-api \ - --description "A fully generated & opinionated API client for the Rippling Beta API." \ + --target-version 0.1.3 \ + --output ./rippling \ + --name rippling-api \ + --description "A fully generated & opinionated API client for the Rippling API." \ --base-url "https://rest.ripplingapis.com" \ --request-timeout-seconds 60 \ --date-time-format "%Y-%m-%dT%H:%M:%S" $(EXTRA_ARGS) diff --git a/rippling-beta/Cargo.toml b/rippling-base/Cargo.toml similarity index 96% rename from rippling-beta/Cargo.toml rename to rippling-base/Cargo.toml index 4ca94f1..befafbb 100644 --- a/rippling-beta/Cargo.toml +++ b/rippling-base/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "rippling-beta-api" -description = "A fully generated & opinionated API client for the Rippling Beta API." +name = "rippling-base-api" +description = "A fully generated & opinionated API client for the Rippling Base API." version = "0.1.0" -documentation = "https://docs.rs/rippling-beta-api" +documentation = "https://docs.rs/rippling-base-api" readme = "README.md" edition = "2018" diff --git a/rippling-base/README.md b/rippling-base/README.md new file mode 100644 index 0000000..e1970b0 --- /dev/null +++ b/rippling-base/README.md @@ -0,0 +1,75 @@ +# `rippling-base-api` + +A fully generated & opinionated API client for the Rippling Base API. + +[![docs.rs](https://docs.rs/rippling-base-api/badge.svg)](https://docs.rs/rippling-base-api) + +## API Details + +Using Rippling's API requires either an API key or an access token retrieved from an OAuth exchange. Each is tied to a single Rippling Company. + +If you are a partner building an integration to Rippling,you can use [Rippling's Installation Guide](https://developer.rippling.com/docs/rippling-api/fucwnbc121hiu-installation-guide) to learn how to retrieve an access token to start using Rippling APIs. + +If you are a customer, you can go [here](https://developer.rippling.com/docs/rippling-api/9rw6guf819r5f-introduction-for-customers) to learn create your API keys to start using Rippling APIs. + +### Using the Interactive Documentation + +Rippling's Documentation Portal allows you to test the API endpoints directly within the documentation. To do so, provide your API key or Access Token as a header parameter with the form Authorization Bearer: Bearer. + +[API Terms of Service](https://app.rippling.com/developer/tos) + +### Contact + + +| name | email | +|----|----| +| Rippling Support | support@rippling.com | + +### License + + +| name | +|----| +| MIT | + + +## 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-base-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_base_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_BASE_API_TOKEN` + +And then you can create a client from the environment. + +```rust,no_run +use rippling_base_api::Client; + +let client = Client::new_from_env(); +``` diff --git a/rippling-base/rippling-base-api.rs.patch.json b/rippling-base/rippling-base-api.rs.patch.json new file mode 100644 index 0000000..1b2b24c --- /dev/null +++ b/rippling-base/rippling-base-api.rs.patch.json @@ -0,0 +1,242 @@ +[ + { + "op": "add", + "path": "/info/x-rust", + "value": { + "client": "// Authenticate via an API token.\nlet client = rippling-base-api::Client::new(\"$TOKEN\");\n\n// - OR -\n\n// Authenticate with your token and host parsed from the environment variables:\n// `RIPPLING_BASE_API_TOKEN`.\nlet client = rippling_base_api::Client::new_from_env();", + "install": "[dependencies]\nrippling-base-api = \"0.1.0\"" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1app_detail~1app_matching_users/get/x-rust", + "value": { + "example": "/// GET Matching App Users\n/// \n/// Returns matching users and their app IDs based on the app handles.\n/// \n/// Note: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`: CSV of app handles. See GET /app_detail/app_handles\n/// \nasync fn example_application_management_get_app_app_matching_users() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_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", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/application_management/struct.ApplicationManagement.html#method.get_app_app_matching_users" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1ats_candidates~1push_candidate/post/x-rust", + "value": { + "example": "/// POST New Candidate\n/// \n/// Pushes 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/// \n/// NOTE: This endpoint is NOT available for use with Rippling customer API Keys.\nasync fn example_ats_post_candidates_push_candidate() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Candidate = client\n .ats()\n .post_candidates_push_candidate(&rippling_base_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_base_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_base_api::types::CandidateEmploymentType::Temp),\n work_location: Some(\"some-string\".to_string()),\n attachments: Some(vec![rippling_base_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", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/ats/struct.Ats.html#method.post_candidates_push_candidate" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1companies~1current/get/x-rust", + "value": { + "example": "/// GET Current Company\n/// \n/// Returns 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.\nasync fn example_companies_get() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Company = client.companies().get().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1company_activity/get/x-rust", + "value": { + "example": "/// GET Company Activity\n/// \n/// Retrieves the activity for a given company.\n/// \n/// The 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/// \n/// The general sequence of steps to leverage the next parameter:\n/// \n/// 1. Issue an initial request using startDate with a value set to some date in the last 90 days\n/// 2. Retrieve the next page of events through the next value from the response data.\n/// 3. Issue the paginated request\n/// 4. Retrieve the next page of events through the next value from the response data\n/// 5. Pause and repeat the previous step\n/// \n/// \n/// **Parameters:**\n/// \n/// - `end_date: Option`: Timestamp to list activity before (inclusive).\n/// - `limit: Option`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n/// - `next: Option`: Specifies the pagination cursor to the next page\n/// - `start_date: Option`: Timestamp to list activity after (inclusive). This should be less than 90 days from now. Defaults to 90 days.\nasync fn example_companies_get_company_activity() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_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", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_company_activity" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1company_leave_types/get/x-rust", + "value": { + "example": "/// GET Company Leave Types\n/// \n/// Retrieves the current company leave types. The query can be filtered by managedBy field.\n/// \n/// **Parameters:**\n/// \n/// - `managed_by: Option`\nasync fn example_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_company_leave_types(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_company_leave_types" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1custom_fields/get/x-rust", + "value": { + "example": "/// GET Custom Fields\n/// \n/// Returns the custom fields for the given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_custom_fields(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_custom_fields" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1departments/get/x-rust", + "value": { + "example": "/// GET Departments\n/// \n/// Returns a list of departments for the given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_departments() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec> = client\n .companies()\n .get_departments(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_departments" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1employees/get/x-rust", + "value": { + "example": "/// GET Employees\n/// \n/// Retrieves the list of active employees currently provisioned within the application. The fields retrieved depend on the employee scopes that you have access to for your access token or API key. The only guarenteed fields include id, personalEmail, and roleState.\n/// \n/// For optimal performance, ensure pagination is used via our limit and offset parameters. Pagination should be set to a maximum of 100.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_employees_get() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .employees()\n .get(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/employees/struct.Employees.html#method.get" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1employees~1include_terminated/get/x-rust", + "value": { + "example": "/// GET Employees (Including Terminated)\n/// \n/// This endpoint is similar to the active employees endpoint, but instead, it includes both active and terminated employees.\n/// \n/// For optimal performance, ensure pagination is used via our limit and offset parameters. Pagination should be set to a maximum of 100.\n/// \n/// **Parameters:**\n/// \n/// - `ein: Option`: Employer identification number, also known as the Federal Emplower Identification Number or the Federal Tax Identification Number.\n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\n/// - `send_all_roles: Option`: For integrations that rely on provisioning, this parameter can be used to identify non provisioned roles for compliance purposes. TRUE will return every employee from the company (bypassing any access rules).\nasync fn example_employees_get_include_terminated() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .employees()\n .get_include_terminated(Some(4 as i64), Some(4 as i64), Some(4 as i64), Some(false))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/employees/struct.Employees.html#method.get_include_terminated" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1employees~1{employeeId}/get/x-rust", + "value": { + "example": "/// GET Employee\n/// \n/// Retrieves the information for a single employee based on the scopes that your API key or access token have access to.\n/// \n/// **Parameters:**\n/// \n/// - `employee_id: &'astr`: Unique identifier for the employee within Rippling. (required)\nasync fn example_employees_get_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Employee = client.employees().get_id(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/employees/struct.Employees.html#method.get_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups/get/x-rust", + "value": { + "example": "/// GET Groups\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Lists the current third-party groups for an organization.\nasync fn example_groups_get() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client.groups().get().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.get" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups/post/x-rust", + "value": { + "example": "/// POST Groups\n/// \n/// Creates a generic group, that can be associated within the third-party application.\nasync fn example_groups_post() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .post(&rippling_base_api::types::PostGroupsRequestBody {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![\"some-string\".to_string()]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.post" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups~1{groupId}/delete/x-rust", + "value": { + "example": "/// DELETE Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Deletes the specified group.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_delete_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n client.groups().delete_id(4 as i64).await?;\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.delete_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups~1{groupId}/get/x-rust", + "value": { + "example": "/// GET Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_get_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .get_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.get_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups~1{groupId}/patch/x-rust", + "value": { + "example": "/// PATCH Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_patch_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .patch_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.patch_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1groups~1{groupId}/put/x-rust", + "value": { + "example": "/// PUT Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_put_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .put_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/groups/struct.Groups.html#method.put_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_balances/get/x-rust", + "value": { + "example": "/// GET Leave Balances\n/// \n/// Retrieves the leave balances for employees\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offset the returned values\nasync fn example_leaves_get_balances() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::GetLeaveBalancesResponse = client\n .leaves()\n .get_balances(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.get_balances" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_balances~1{role}/get/x-rust", + "value": { + "example": "/// GET Leave Balance\n/// \n/// Retrieves the leave balances for a given role. A role represents 1 employee. An employee can work at 1 and only 1 company.\n/// \n/// **Parameters:**\n/// \n/// - `role: &'astr`: This is the unique role ID of the employee. It corresponds to the IDs returned in the Get/employees endpoint (required)\nasync fn example_leaves_get_balance() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::GetLeaveBalanceResponse =\n client.leaves().get_balance(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.get_balance" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_requests/get/x-rust", + "value": { + "example": "/// GET Leave Requests\n/// \n/// Retrieves the current leave requests.The query can be filtered by a number of specific query parameters.\n/// \n/// **Parameters:**\n/// \n/// - `end_date: Option`: End date of leave.\n/// - `from: Option`: Filter to capture whether the leave request overlaps with a date range.\n/// - `id: Option`\n/// - `leave_policy: Option`\n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\n/// - `processed_by: Option`\n/// - `requested_by: Option`\n/// - `role: Option`\n/// - `start_date: Option`: Start date of leave.\n/// - `status: Option`\n/// - `to: Option`: Filter to capture whether the leave request overlaps with a date range.\nasync fn example_leaves_get_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .get_requests(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\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-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.get_requests" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_requests/post/x-rust", + "value": { + "example": "/// POST Leave Request\n/// \n/// Create a leave request. This endpoint is currently in alpha and should not be used by default. Only TILT managed requests can have a status other than PENDING.\nasync fn example_leaves_post_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client\n .leaves()\n .post_requests(&rippling_base_api::types::PostLeaveRequestsRequestBody {\n role: \"some-string\".to_string(),\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: \"some-string\".to_string(),\n end_date: \"some-string\".to_string(),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n company_leave_type: \"some-string\".to_string(),\n leave_policy: \"some-string\".to_string(),\n reason_for_leave: Some(\"some-string\".to_string()),\n managed_by: Some(\"some-string\".to_string()),\n external_id: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.post_requests" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_requests~1{id}/patch/x-rust", + "value": { + "example": "/// PATCH Leave Request\n/// \n/// Update an existing leave request. With the exception of TILT-managed leave requests, updates are restricted based on status; APPROVED requests can not be updated with different dates, and the status itself can not be updated. Use the process endpoint to update the status of a PENDING request. For other updates, use the cancel endpoint to cancel the request, and create a new request with the updated information.\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: Unique identifier of the leave request being modified (required)\nasync fn example_leaves_patch_requests_request_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .patch_requests_request_id(\n \"some-string\",\n &rippling_base_api::types::PatchLeaveRequestsLeaveRequestIdRequestBody {\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: Some(\"some-string\".to_string()),\n end_date: Some(\"some-string\".to_string()),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n reason_for_leave: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.patch_requests_request_id" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_requests~1{id}~1cancel/post/x-rust", + "value": { + "example": "/// POST Cancel Leave Request\n/// \n/// Cancel a leave request.\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: Unique identifier of the leave request being canceled. (required)\nasync fn example_leaves_cancel_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client.leaves().cancel_requests(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.cancel_requests" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1leave_requests~1{id}~1process/post/x-rust", + "value": { + "example": "/// POST Process Leave Request\n/// \n/// Approve or decline a leave request. Only pending requests can be processed (approved / declined). Only an admin or manager is capable of taking action on a request.\n/// \n/// **Parameters:**\n/// \n/// - `action: crate::types::Action`: The action to be taken on the leave request. Can be either approved or declined. (required)\n/// - `id: &'astr`: Unique identifier of the leave request being processed. (required)\nasync fn example_leaves_process_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client\n .leaves()\n .process_requests(rippling_base_api::types::Action::Decline, \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/leaves/struct.Leaves.html#method.process_requests" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1levels/get/x-rust", + "value": { + "example": "/// GET Levels\n/// \n/// Retrieves the levels for the company. Levels are set positions for an organization, such as Manager, or Executive.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_levels() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_levels(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_levels" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1mark_app_installed/post/x-rust", + "value": { + "example": "/// Mark App Installed\n/// \n/// This 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/// \n/// Please note, hitting any other endpoint should mark your app as installed as well.\nasync fn example_application_management_post_mark_app_installed() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::PostMarkAppInstalledResponse = client\n .application_management()\n .post_mark_app_installed()\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/application_management/struct.ApplicationManagement.html#method.post_mark_app_installed" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1me/get/x-rust", + "value": { + "example": "/// GCurrent User\n/// \n/// Retrieves basic information about the Rippling user whose access token you're using. This is generally used for the SSO flow.\nasync fn example_current_user_get_me() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::AuthenticatedUserMe = client.current_user().get_me().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/current_user/struct.CurrentUser.html#method.get_me" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1saml~1idp_metadata/get/x-rust", + "value": { + "example": "/// GET SAML Metadata\n/// \n/// Returns a SAML IDP metadata file for the current app integration. Note that this endpoint is only accessible using a token associated with an app integration that has SAML enabled; otherwise it returns a 404 error.\n/// \n/// Rippling's SAML Metadata is per customer app installation. It is not the same across all customers. It is not the same if the customer uninstalls and reinstalls your app. Any time a new app is installed, unique SAML Metadata will be generated specific to that app.\nasync fn example_saml_get_idp_metadata() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: String = client.saml().get_idp_metadata().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/saml/struct.Saml.html#method.get_idp_metadata" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1teams/get/x-rust", + "value": { + "example": "/// GET Teams\n/// \n/// Retrieves the list of teams for the company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_teams() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_teams(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_teams" + } + }, + { + "op": "add", + "path": "/paths/~1platform~1api~1work_locations/get/x-rust", + "value": { + "example": "/// GET Work Locations\n/// \n/// Returns the list of work locations for a given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_work_locations() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_work_locations(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", + "libDocsLink": "https://docs.rs/rippling-base-api/latest/rippling-base-api/companies/struct.Companies.html#method.get_work_locations" + } + } +] \ No newline at end of file diff --git a/rippling/src/application_management.rs b/rippling-base/src/application_management.rs similarity index 87% rename from rippling/src/application_management.rs rename to rippling-base/src/application_management.rs index 05795d8..11b5209 100644 --- a/rippling/src/application_management.rs +++ b/rippling-base/src/application_management.rs @@ -12,7 +12,7 @@ impl ApplicationManagement { 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`: 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```"] + #[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`: 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_base_api::Client::new_from_env();\n let result: rippling_base_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, @@ -56,8 +56,8 @@ impl ApplicationManagement { 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 \ + let client = rippling_base_api::Client::new_from_env();\n let result: \ + rippling_base_api::types::PostMarkAppInstalledResponse = client\n \ .application_management()\n .post_mark_app_installed()\n .await?;\n \ println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] diff --git a/rippling/src/ats.rs b/rippling-base/src/ats.rs similarity index 56% rename from rippling/src/ats.rs rename to rippling-base/src/ats.rs index 798d4bc..2712871 100644 --- a/rippling/src/ats.rs +++ b/rippling-base/src/ats.rs @@ -12,7 +12,7 @@ impl Ats { 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_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```"] + #[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_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Candidate = client\n .ats()\n .post_candidates_push_candidate(&rippling_base_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_base_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_base_api::types::CandidateEmploymentType::Temp),\n work_location: Some(\"some-string\".to_string()),\n attachments: Some(vec![rippling_base_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_candidates_push_candidate<'a>( &'a self, diff --git a/rippling-base/src/companies.rs b/rippling-base/src/companies.rs new file mode 100644 index 0000000..5d04fc1 --- /dev/null +++ b/rippling-base/src/companies.rs @@ -0,0 +1,363 @@ +use anyhow::Result; + +use crate::Client; +#[derive(Clone, Debug)] +pub struct Companies { + pub client: Client, +} + +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_companies_get() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Company = client.companies().get().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn get<'a>(&'a self) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, "platform/api/companies/current" + ), + ); + req = req.bearer_auth(&self.client.token); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "GET Departments\n\nReturns a list of departments for the given company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync fn example_companies_get_departments() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec> = 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, + limit: Option, + offset: Option, + ) -> Result>, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "platform/api/departments"), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = limit { + query_params.push(("limit", format!("{}", p))); + } + + if let Some(p) = offset { + query_params.push(("offset", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "GET Work Locations\n\nReturns the list of work locations for a given \ + company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ + values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync \ + fn example_companies_get_work_locations() -> anyhow::Result<()> {\n let client = \ + rippling_base_api::Client::new_from_env();\n let result: \ + Vec = 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] + pub async fn get_work_locations<'a>( + &'a self, + limit: Option, + offset: Option, + ) -> Result, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "platform/api/work_locations"), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = limit { + query_params.push(("limit", format!("{}", p))); + } + + if let Some(p) = offset { + query_params.push(("offset", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "GET Custom Fields\n\nReturns the custom fields for the given \ + company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ + values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync \ + fn example_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = \ + rippling_base_api::Client::new_from_env();\n let result: \ + Vec = 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] + pub async fn get_custom_fields<'a>( + &'a self, + limit: Option, + offset: Option, + ) -> Result, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "platform/api/custom_fields"), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = limit { + query_params.push(("limit", format!("{}", p))); + } + + if let Some(p) = offset { + query_params.push(("offset", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[doc = "GET Teams\n\nRetrieves the list of teams for the company.\n\n**Parameters:**\n\n- \ + `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: \ + Offsets the returned values\n\n```rust,no_run\nasync fn example_companies_get_teams() \ + -> anyhow::Result<()> {\n let client = \ + rippling_base_api::Client::new_from_env();\n let result: \ + Vec = 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, + limit: Option, + offset: Option, + ) -> Result, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "platform/api/teams"), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = limit { + query_params.push(("limit", format!("{}", p))); + } + + if let Some(p) = offset { + query_params.push(("offset", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[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`: Sets a limit on the returned values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync fn example_companies_get_levels() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = 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] + pub async fn get_levels<'a>( + &'a self, + limit: Option, + offset: Option, + ) -> Result, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!("{}/{}", self.client.base_url, "platform/api/levels"), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = limit { + query_params.push(("limit", format!("{}", p))); + } + + if let Some(p) = offset { + query_params.push(("offset", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[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`\n\n```rust,no_run\nasync fn example_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_company_leave_types(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[tracing::instrument] + pub async fn get_company_leave_types<'a>( + &'a self, + managed_by: Option, + ) -> Result, crate::types::error::Error> { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, "platform/api/company_leave_types" + ), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = managed_by { + query_params.push(("managedBy", p)); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } + + #[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`: Timestamp to list activity before (inclusive).\n- `limit: Option`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n- `next: Option`: Specifies the pagination cursor to the next page\n- `start_date: Option`: 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_base_api::Client::new_from_env();\n let result: rippling_base_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, + end_date: Option, + limit: Option, + next: Option, + start_date: Option, + ) -> Result { + let mut req = self.client.client.request( + http::Method::GET, + &format!( + "{}/{}", + self.client.base_url, "platform/api/company_activity" + ), + ); + req = req.bearer_auth(&self.client.token); + let mut query_params = vec![]; + if let Some(p) = end_date { + query_params.push(("endDate", format!("{}", p))); + } + + if let Some(p) = limit { + query_params.push(("limit", p)); + } + + if let Some(p) = next { + query_params.push(("next", p)); + } + + if let Some(p) = start_date { + query_params.push(("startDate", format!("{}", p))); + } + + req = req.query(&query_params); + let resp = req.send().await?; + let status = resp.status(); + if status.is_success() { + let text = resp.text().await.unwrap_or_default(); + serde_json::from_str(&text).map_err(|err| { + crate::types::error::Error::from_serde_error( + format_serde_error::SerdeError::new(text.to_string(), err), + status, + ) + }) + } else { + let text = resp.text().await.unwrap_or_default(); + return Err(crate::types::error::Error::Server { + body: text.to_string(), + status, + }); + } + } +} diff --git a/rippling/src/current_user.rs b/rippling-base/src/current_user.rs similarity index 73% rename from rippling/src/current_user.rs rename to rippling-base/src/current_user.rs index 91b1f94..5376430 100644 --- a/rippling/src/current_user.rs +++ b/rippling-base/src/current_user.rs @@ -12,7 +12,13 @@ impl CurrentUser { Self { client } } - #[doc = "GCurrent User\n\nRetrieves basic information about the Rippling user whose access token you're using. This is generally used for the SSO flow.\n\n```rust,no_run\nasync fn example_current_user_get_me() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::AuthenticatedUserMe = client.current_user().get_me().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "GCurrent User\n\nRetrieves basic information about the Rippling user whose access \ + token you're using. This is generally used for the SSO flow.\n\n```rust,no_run\nasync \ + fn example_current_user_get_me() -> anyhow::Result<()> {\n let client = \ + rippling_base_api::Client::new_from_env();\n let result: \ + rippling_base_api::types::AuthenticatedUserMe = \ + client.current_user().get_me().await?;\n println!(\"{:?}\", result);\n \ + Ok(())\n}\n```"] #[tracing::instrument] pub async fn get_me<'a>( &'a self, diff --git a/rippling/src/employees.rs b/rippling-base/src/employees.rs similarity index 92% rename from rippling/src/employees.rs rename to rippling-base/src/employees.rs index c7be3e5..b4a0597 100644 --- a/rippling/src/employees.rs +++ b/rippling-base/src/employees.rs @@ -20,8 +20,8 @@ impl Employees { 100.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync \ fn example_employees_get() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = client\n .employees()\n \ + rippling_base_api::Client::new_from_env();\n let result: \ + Vec = client\n .employees()\n \ .get(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", \ result);\n Ok(())\n}\n```"] #[tracing::instrument] @@ -64,7 +64,7 @@ impl Employees { } } - #[doc = "GET Employee\n\nRetrieves the information for a single employee based on the scopes that your API key or access token have access to.\n\n**Parameters:**\n\n- `employee_id: &'astr`: Unique identifier for the employee within Rippling. (required)\n\n```rust,no_run\nasync fn example_employees_get_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Employee = client.employees().get_id(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "GET Employee\n\nRetrieves the information for a single employee based on the scopes that your API key or access token have access to.\n\n**Parameters:**\n\n- `employee_id: &'astr`: Unique identifier for the employee within Rippling. (required)\n\n```rust,no_run\nasync fn example_employees_get_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Employee = client.employees().get_id(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get_id<'a>( &'a self, @@ -110,8 +110,8 @@ impl Employees { provisioned roles for compliance purposes. TRUE will return every employee from the \ company (bypassing any access rules).\n\n```rust,no_run\nasync fn \ example_employees_get_include_terminated() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = client\n .employees()\n \ + rippling_base_api::Client::new_from_env();\n let result: \ + Vec = client\n .employees()\n \ .get_include_terminated(Some(4 as i64), Some(4 as i64), Some(4 as i64), \ Some(false))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] diff --git a/rippling/src/groups.rs b/rippling-base/src/groups.rs similarity index 69% rename from rippling/src/groups.rs rename to rippling-base/src/groups.rs index f78b507..7a1b395 100644 --- a/rippling/src/groups.rs +++ b/rippling-base/src/groups.rs @@ -12,13 +12,7 @@ impl Groups { Self { client } } - #[doc = "GET Groups\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. \ - approved 3rd party partners), as the end point is intended for mapping third-party \ - application “Groups” within Rippling organizations.\n\nLists the current third-party \ - groups for an organization.\n\n```rust,no_run\nasync fn example_groups_get() -> \ - anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let \ - result: Vec = client.groups().get().await?;\n \ - println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "GET Groups\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nLists the current third-party groups for an organization.\n\n```rust,no_run\nasync fn example_groups_get() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client.groups().get().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get<'a>(&'a self) -> Result, crate::types::error::Error> { let mut req = self.client.client.request( @@ -47,9 +41,9 @@ impl Groups { #[doc = "POST Groups\n\nCreates a generic group, that can be associated within the third-party \ application.\n\n```rust,no_run\nasync fn example_groups_post() -> anyhow::Result<()> \ - {\n let client = rippling_api::Client::new_from_env();\n let result: \ - rippling_api::types::Group = client\n .groups()\n \ - .post(&rippling_api::types::PostGroupsRequestBody {\n name: \ + {\n let client = rippling_base_api::Client::new_from_env();\n let result: \ + rippling_base_api::types::Group = client\n .groups()\n \ + .post(&rippling_base_api::types::PostGroupsRequestBody {\n name: \ Some(\"some-string\".to_string()),\n spoke_id: \ Some(\"some-string\".to_string()),\n users: \ Some(vec![\"some-string\".to_string()]),\n })\n .await?;\n \ @@ -84,19 +78,7 @@ impl Groups { } } - #[doc = "GET Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. \ - approved 3rd party partners), as the end point is intended for mapping third-party \ - application “Groups” within Rippling organizations.\n\n**Parameters:**\n\n- \ - `group_id: i64`: Unique identifier for the group within Rippling. \ - (required)\n\n```rust,no_run\nasync fn example_groups_get_id() -> anyhow::Result<()> \ - {\n let client = rippling_api::Client::new_from_env();\n let result: \ - rippling_api::types::Group = client\n .groups()\n .get_id(\n \ - 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n \ - name: Some(\"some-string\".to_string()),\n spoke_id: \ - Some(\"some-string\".to_string()),\n users: \ - Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n \ - version: Some(\"some-string\".to_string()),\n },\n )\n \ - .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "GET Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_get_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .get_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get_id<'a>( &'a self, @@ -132,7 +114,7 @@ impl Groups { } } - #[doc = "PUT Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nUsing the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_put_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .put_id(\n 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "PUT Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nUsing the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_put_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .put_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn put_id<'a>( &'a self, @@ -168,13 +150,7 @@ impl Groups { } } - #[doc = "DELETE Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. \ - approved 3rd party partners), as the end point is intended for mapping third-party \ - application “Groups” within Rippling organizations.\n\nDeletes the specified \ - group.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group \ - within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_delete_id() -> \ - anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n \ - client.groups().delete_id(4 as i64).await?;\n Ok(())\n}\n```"] + #[doc = "DELETE Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nDeletes the specified group.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_delete_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n client.groups().delete_id(4 as i64).await?;\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn delete_id<'a>(&'a self, group_id: i64) -> Result<(), crate::types::error::Error> { let mut req = self.client.client.request( @@ -199,7 +175,7 @@ impl Groups { } } - #[doc = "PATCH Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nUsing the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_patch_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .patch_id(\n 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "PATCH Group\n\nPlease note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n\nUsing the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n\n**Parameters:**\n\n- `group_id: i64`: Unique identifier for the group within Rippling. (required)\n\n```rust,no_run\nasync fn example_groups_patch_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::Group = client\n .groups()\n .patch_id(\n 4 as i64,\n &rippling_base_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn patch_id<'a>( &'a self, diff --git a/rippling/src/leaves.rs b/rippling-base/src/leaves.rs similarity index 67% rename from rippling/src/leaves.rs rename to rippling-base/src/leaves.rs index ed49582..ffdcfe5 100644 --- a/rippling/src/leaves.rs +++ b/rippling-base/src/leaves.rs @@ -12,7 +12,7 @@ impl Leaves { Self { client } } - #[doc = "GET Leave Requests\n\nRetrieves the current leave requests.The query can be filtered by a number of specific query parameters.\n\n**Parameters:**\n\n- `end_date: Option`: End date of leave.\n- `from: Option`: Filter to capture whether the leave request overlaps with a date range.\n- `id: Option`\n- `leave_policy: Option`\n- `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: Offsets the returned values\n- `processed_by: Option`\n- `requested_by: Option`\n- `role: Option`\n- `start_date: Option`: Start date of leave.\n- `status: Option`\n- `to: Option`: Filter to capture whether the leave request overlaps with a date range.\n\n```rust,no_run\nasync fn example_leaves_get_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .get_requests(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\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```"] + #[doc = "GET Leave Requests\n\nRetrieves the current leave requests.The query can be filtered by a number of specific query parameters.\n\n**Parameters:**\n\n- `end_date: Option`: End date of leave.\n- `from: Option`: Filter to capture whether the leave request overlaps with a date range.\n- `id: Option`\n- `leave_policy: Option`\n- `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: Offsets the returned values\n- `processed_by: Option`\n- `requested_by: Option`\n- `role: Option`\n- `start_date: Option`: Start date of leave.\n- `status: Option`\n- `to: Option`: Filter to capture whether the leave request overlaps with a date range.\n\n```rust,no_run\nasync fn example_leaves_get_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .get_requests(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\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```"] #[tracing::instrument] pub async fn get_requests<'a>( &'a self, @@ -103,7 +103,7 @@ impl Leaves { } } - #[doc = "POST Leave Request\n\nCreate a leave request. This endpoint is currently in alpha and should not be used by default. Only TILT managed requests can have a status other than PENDING.\n\n```rust,no_run\nasync fn example_leaves_post_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::LeaveRequest = client\n .leaves()\n .post_requests(&rippling_api::types::PostLeaveRequestsRequestBody {\n role: \"some-string\".to_string(),\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: \"some-string\".to_string(),\n end_date: \"some-string\".to_string(),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n company_leave_type: \"some-string\".to_string(),\n leave_policy: \"some-string\".to_string(),\n reason_for_leave: Some(\"some-string\".to_string()),\n managed_by: Some(\"some-string\".to_string()),\n external_id: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "POST Leave Request\n\nCreate a leave request. This endpoint is currently in alpha and should not be used by default. Only TILT managed requests can have a status other than PENDING.\n\n```rust,no_run\nasync fn example_leaves_post_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client\n .leaves()\n .post_requests(&rippling_base_api::types::PostLeaveRequestsRequestBody {\n role: \"some-string\".to_string(),\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: \"some-string\".to_string(),\n end_date: \"some-string\".to_string(),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n company_leave_type: \"some-string\".to_string(),\n leave_policy: \"some-string\".to_string(),\n reason_for_leave: Some(\"some-string\".to_string()),\n managed_by: Some(\"some-string\".to_string()),\n external_id: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn post_requests<'a>( &'a self, @@ -134,14 +134,7 @@ impl Leaves { } } - #[doc = "GET Leave Balances\n\nRetrieves the leave balances for \ - employees\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ - values\n- `offset: Option`: Offset the returned values\n\n```rust,no_run\nasync \ - fn example_leaves_get_balances() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - rippling_api::types::GetLeaveBalancesResponse = client\n .leaves()\n \ - .get_balances(Some(4 as i64), Some(4 as i64))\n .await?;\n \ - println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "GET Leave Balances\n\nRetrieves the leave balances for employees\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: Offset the returned values\n\n```rust,no_run\nasync fn example_leaves_get_balances() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::GetLeaveBalancesResponse = client\n .leaves()\n .get_balances(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get_balances<'a>( &'a self, @@ -187,8 +180,8 @@ impl Leaves { `role: &'astr`: This is the unique role ID of the employee. It corresponds to the IDs \ returned in the Get/employees endpoint (required)\n\n```rust,no_run\nasync fn \ example_leaves_get_balance() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - rippling_api::types::GetLeaveBalanceResponse =\n \ + rippling_base_api::Client::new_from_env();\n let result: \ + rippling_base_api::types::GetLeaveBalanceResponse =\n \ client.leaves().get_balance(\"some-string\").await?;\n println!(\"{:?}\", \ result);\n Ok(())\n}\n```"] #[tracing::instrument] @@ -224,13 +217,7 @@ impl Leaves { } } - #[doc = "POST Cancel Leave Request\n\nCancel a leave request.\n\n**Parameters:**\n\n- `id: \ - &'astr`: Unique identifier of the leave request being canceled. \ - (required)\n\n```rust,no_run\nasync fn example_leaves_cancel_requests() -> \ - anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let \ - result: rippling_api::types::LeaveRequest = \ - client.leaves().cancel_requests(\"some-string\").await?;\n println!(\"{:?}\", \ - result);\n Ok(())\n}\n```"] + #[doc = "POST Cancel Leave Request\n\nCancel a leave request.\n\n**Parameters:**\n\n- `id: &'astr`: Unique identifier of the leave request being canceled. (required)\n\n```rust,no_run\nasync fn example_leaves_cancel_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client.leaves().cancel_requests(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn cancel_requests<'a>( &'a self, @@ -264,17 +251,7 @@ impl Leaves { } } - #[doc = "POST Process Leave Request\n\nApprove or decline a leave request. Only pending \ - requests can be processed (approved / declined). Only an admin or manager is capable \ - of taking action on a request.\n\n**Parameters:**\n\n- `action: \ - crate::types::Action`: The action to be taken on the leave request. Can be either \ - approved or declined. (required)\n- `id: &'astr`: Unique identifier of the leave \ - request being processed. (required)\n\n```rust,no_run\nasync fn \ - example_leaves_process_requests() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - rippling_api::types::LeaveRequest = client\n .leaves()\n \ - .process_requests(rippling_api::types::Action::Decline, \"some-string\")\n \ - .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "POST Process Leave Request\n\nApprove or decline a leave request. Only pending requests can be processed (approved / declined). Only an admin or manager is capable of taking action on a request.\n\n**Parameters:**\n\n- `action: crate::types::Action`: The action to be taken on the leave request. Can be either approved or declined. (required)\n- `id: &'astr`: Unique identifier of the leave request being processed. (required)\n\n```rust,no_run\nasync fn example_leaves_process_requests() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: rippling_base_api::types::LeaveRequest = client\n .leaves()\n .process_requests(rippling_base_api::types::Action::Decline, \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn process_requests<'a>( &'a self, @@ -311,28 +288,7 @@ impl Leaves { } } - #[doc = "PATCH Leave Request\n\nUpdate an existing leave request. With the exception of \ - TILT-managed leave requests, updates are restricted based on status; APPROVED \ - requests can not be updated with different dates, and the status itself can not be \ - updated. Use the process endpoint to update the status of a PENDING request. For \ - other updates, use the cancel endpoint to cancel the request, and create a new \ - request with the updated information.\n\n**Parameters:**\n\n- `id: &'astr`: Unique \ - identifier of the leave request being modified (required)\n\n```rust,no_run\nasync fn \ - example_leaves_patch_requests_request_id() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = client\n .leaves()\n \ - .patch_requests_request_id(\n \"some-string\",\n \ - &rippling_api::types::PatchLeaveRequestsLeaveRequestIdRequestBody {\n \ - requested_by: Some(\"some-string\".to_string()),\n status: \ - Some(\"some-string\".to_string()),\n start_date: \ - Some(\"some-string\".to_string()),\n end_date: \ - Some(\"some-string\".to_string()),\n start_date_start_time: \ - Some(\"some-string\".to_string()),\n end_date_end_time: \ - Some(\"some-string\".to_string()),\n start_date_custom_hours: \ - Some(\"some-string\".to_string()),\n end_date_custom_hours: \ - Some(\"some-string\".to_string()),\n reason_for_leave: \ - Some(\"some-string\".to_string()),\n },\n )\n .await?;\n \ - println!(\"{:?}\", result);\n Ok(())\n}\n```"] + #[doc = "PATCH Leave Request\n\nUpdate an existing leave request. With the exception of TILT-managed leave requests, updates are restricted based on status; APPROVED requests can not be updated with different dates, and the status itself can not be updated. Use the process endpoint to update the status of a PENDING request. For other updates, use the cancel endpoint to cancel the request, and create a new request with the updated information.\n\n**Parameters:**\n\n- `id: &'astr`: Unique identifier of the leave request being modified (required)\n\n```rust,no_run\nasync fn example_leaves_patch_requests_request_id() -> anyhow::Result<()> {\n let client = rippling_base_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .patch_requests_request_id(\n \"some-string\",\n &rippling_base_api::types::PatchLeaveRequestsLeaveRequestIdRequestBody {\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: Some(\"some-string\".to_string()),\n end_date: Some(\"some-string\".to_string()),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n reason_for_leave: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn patch_requests_request_id<'a>( &'a self, diff --git a/rippling-beta/src/lib.rs b/rippling-base/src/lib.rs similarity index 75% rename from rippling-beta/src/lib.rs rename to rippling-base/src/lib.rs index 59460da..d08f03e 100644 --- a/rippling-beta/src/lib.rs +++ b/rippling-base/src/lib.rs @@ -1,14 +1,34 @@ -//! A fully generated & opinionated API client for the Rippling Beta API. +//! A fully generated & opinionated API client for the Rippling Base API. //! -//! [![docs.rs](https://docs.rs/rippling-beta-api/badge.svg)](https://docs.rs/rippling-beta-api) +//! [![docs.rs](https://docs.rs/rippling-base-api/badge.svg)](https://docs.rs/rippling-base-api) //! //! ## API Details //! -//! Documentation for the Rippling Platform API. +//! Using Rippling's API requires either an API key or an access token retrieved from an OAuth exchange. Each is tied to a single Rippling Company. //! +//! If you are a partner building an integration to Rippling,you can use [Rippling's Installation Guide](https://developer.rippling.com/docs/rippling-api/fucwnbc121hiu-installation-guide) to learn how to retrieve an access token to start using Rippling APIs. //! +//! If you are a customer, you can go [here](https://developer.rippling.com/docs/rippling-api/9rw6guf819r5f-introduction-for-customers) to learn create your API keys to start using Rippling APIs. //! +//! ### Using the Interactive Documentation //! +//! Rippling's Documentation Portal allows you to test the API endpoints directly within the documentation. To do so, provide your API key or Access Token as a header parameter with the form Authorization Bearer: Bearer. +//! +//! [API Terms of Service](https://app.rippling.com/developer/tos) +//! +//! ### Contact +//! +//! +//! | name | email | +//! |----|----| +//! | Rippling Support | support@rippling.com | +//! +//! ### License +//! +//! +//! | name | +//! |----| +//! | MIT | //! //! //! ## Client Details @@ -23,7 +43,7 @@ //! //! ```toml //! [dependencies] -//! rippling-beta-api = "0.1.0" +//! rippling-base-api = "0.1.0" //! ``` //! //! ## Basic example @@ -32,7 +52,7 @@ //! a user agent string and set of credentials. //! //! ```rust,no_run -//! use rippling_beta_api::Client; +//! use rippling_base_api::Client; //! //! let client = Client::new(String::from("api-key")); //! ``` @@ -40,12 +60,12 @@ //! Alternatively, the library can search for most of the variables required for //! the client in the environment: //! -//! - `RIPPLING_BETA_API_TOKEN` +//! - `RIPPLING_BASE_API_TOKEN` //! //! And then you can create a client from the environment. //! //! ```rust,no_run -//! use rippling_beta_api::Client; +//! use rippling_base_api::Client; //! //! let client = Client::new_from_env(); //! ``` @@ -54,41 +74,27 @@ #![allow(clippy::too_many_arguments)] #![cfg_attr(docsrs, feature(doc_cfg))] -/// Companies on Rippling. #[cfg(feature = "requests")] -pub mod companies; -/// Custom fields defined by the company. +pub mod application_management; #[cfg(feature = "requests")] -pub mod custom_fields; -/// Departments used by the company. +pub mod ats; #[cfg(feature = "requests")] -pub mod departments; -/// Employment types used by the company. +pub mod companies; #[cfg(feature = "requests")] -pub mod employment_types; -/// Availability of API features to the company or Partners. +pub mod current_user; #[cfg(feature = "requests")] -pub mod entitlements; -/// Provides the user's SSO information. +pub mod employees; #[cfg(feature = "requests")] -pub mod me; +pub mod groups; +#[cfg(feature = "requests")] +pub mod leaves; mod methods; -/// Teams at the company. #[cfg(feature = "requests")] -pub mod teams; +pub mod saml; #[cfg(test)] mod tests; pub mod types; -/// Users of the company. -#[cfg(feature = "requests")] -pub mod users; pub mod utils; -/// Work locations used by the company. -#[cfg(feature = "requests")] -pub mod work_locations; -/// Workers who work or have worked at the company. -#[cfg(feature = "requests")] -pub mod workers; #[cfg(feature = "requests")] use std::env; @@ -168,7 +174,7 @@ impl Client { .build(); Client { token: token.to_string(), - base_url: "https://rest.ripplingapis.com".to_string(), + base_url: "https://api.rippling.com".to_string(), client, client_http1_only, @@ -182,7 +188,7 @@ impl Client { match (builder_http.build(), builder_websocket.build()) { (Ok(c), Ok(c1)) => Client { token: token.to_string(), - base_url: "https://rest.ripplingapis.com".to_string(), + base_url: "https://api.rippling.com".to_string(), client: c, client_http1_only: c1, @@ -220,7 +226,7 @@ impl Client { .build(); Client { token: token.to_string(), - base_url: "https://rest.ripplingapis.com".to_string(), + base_url: "https://api.rippling.com".to_string(), client, } @@ -233,7 +239,7 @@ impl Client { match builder_http.build() { Ok(c) => Client { token: token.to_string(), - base_url: "https://rest.ripplingapis.com".to_string(), + base_url: "https://api.rippling.com".to_string(), client: c, }, @@ -271,7 +277,7 @@ impl Client { Self::new_from_reqwest(token, client) } - /// Set the base URL for the client to something other than the default: . + /// Set the base URL for the client to something other than the default: . #[tracing::instrument] pub fn set_base_url(&mut self, base_url: H) where @@ -280,10 +286,10 @@ impl Client { self.base_url = base_url.to_string().trim_end_matches('/').to_string(); } - /// Create a new Client struct from the environment variable: `RIPPLING_BETA_API_TOKEN`. + /// Create a new Client struct from the environment variable: `RIPPLING_BASE_API_TOKEN`. #[tracing::instrument] pub fn new_from_env() -> Self { - let token = env::var("RIPPLING_BETA_API_TOKEN").expect("must set RIPPLING_BETA_API_TOKEN"); + let token = env::var("RIPPLING_BASE_API_TOKEN").expect("must set RIPPLING_BASE_API_TOKEN"); Client::new(token) } @@ -324,53 +330,43 @@ impl Client { Ok(RequestBuilder(req)) } - /// Employment types used by the company. - pub fn employment_types(&self) -> employment_types::EmploymentTypes { - employment_types::EmploymentTypes::new(self.clone()) - } - - /// Teams at the company. - pub fn teams(&self) -> teams::Teams { - teams::Teams::new(self.clone()) - } - - /// Availability of API features to the company or Partners. - pub fn entitlements(&self) -> entitlements::Entitlements { - entitlements::Entitlements::new(self.clone()) + /// Return a reference to an interface that provides access to Companies operations. + pub fn companies(&self) -> companies::Companies { + companies::Companies::new(self.clone()) } - /// Users of the company. - pub fn users(&self) -> users::Users { - users::Users::new(self.clone()) + /// Return a reference to an interface that provides access to Employees operations. + pub fn employees(&self) -> employees::Employees { + employees::Employees::new(self.clone()) } - /// Workers who work or have worked at the company. - pub fn workers(&self) -> workers::Workers { - workers::Workers::new(self.clone()) + /// Return a reference to an interface that provides access to Groups operations. + pub fn groups(&self) -> groups::Groups { + groups::Groups::new(self.clone()) } - /// Departments used by the company. - pub fn departments(&self) -> departments::Departments { - departments::Departments::new(self.clone()) + /// Return a reference to an interface that provides access to SAML operations. + pub fn saml(&self) -> saml::Saml { + saml::Saml::new(self.clone()) } - /// Work locations used by the company. - pub fn work_locations(&self) -> work_locations::WorkLocations { - work_locations::WorkLocations::new(self.clone()) + /// Return a reference to an interface that provides access to Current User operations. + pub fn current_user(&self) -> current_user::CurrentUser { + current_user::CurrentUser::new(self.clone()) } - /// Companies on Rippling. - pub fn companies(&self) -> companies::Companies { - companies::Companies::new(self.clone()) + /// Return a reference to an interface that provides access to ATS operations. + pub fn ats(&self) -> ats::Ats { + ats::Ats::new(self.clone()) } - /// Custom fields defined by the company. - pub fn custom_fields(&self) -> custom_fields::CustomFields { - custom_fields::CustomFields::new(self.clone()) + /// Return a reference to an interface that provides access to Application Management operations. + pub fn application_management(&self) -> application_management::ApplicationManagement { + application_management::ApplicationManagement::new(self.clone()) } - /// Provides the user's SSO information. - pub fn me(&self) -> me::Me { - me::Me::new(self.clone()) + /// Return a reference to an interface that provides access to Leaves operations. + pub fn leaves(&self) -> leaves::Leaves { + leaves::Leaves::new(self.clone()) } } diff --git a/rippling-beta/src/methods.rs b/rippling-base/src/methods.rs similarity index 100% rename from rippling-beta/src/methods.rs rename to rippling-base/src/methods.rs diff --git a/rippling/src/saml.rs b/rippling-base/src/saml.rs similarity index 95% rename from rippling/src/saml.rs rename to rippling-base/src/saml.rs index 5e541b7..023b716 100644 --- a/rippling/src/saml.rs +++ b/rippling-base/src/saml.rs @@ -20,7 +20,7 @@ impl Saml { reinstalls your app. Any time a new app is installed, unique SAML Metadata will be \ generated specific to that app.\n\n```rust,no_run\nasync fn \ example_saml_get_idp_metadata() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: String = \ + rippling_base_api::Client::new_from_env();\n let result: String = \ client.saml().get_idp_metadata().await?;\n println!(\"{:?}\", result);\n \ Ok(())\n}\n```"] #[tracing::instrument] diff --git a/rippling-beta/src/tests.rs b/rippling-base/src/tests.rs similarity index 100% rename from rippling-beta/src/tests.rs rename to rippling-base/src/tests.rs diff --git a/rippling-base/src/types.rs b/rippling-base/src/types.rs new file mode 100644 index 0000000..32a7e21 --- /dev/null +++ b/rippling-base/src/types.rs @@ -0,0 +1,4212 @@ +#![doc = r" This module contains the generated types for the library."] +pub mod base64 { + #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"] + #![doc = " base64 implementations to account for various clients and libraries. Compatible"] + #![doc = " with serde and JsonSchema."] + use std::{convert::TryFrom, fmt}; + + use serde::{ + de::{Error, Unexpected, Visitor}, + Deserialize, Deserializer, Serialize, Serializer, + }; + static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[ + data_encoding::BASE64, + data_encoding::BASE64URL, + data_encoding::BASE64URL_NOPAD, + data_encoding::BASE64_MIME, + data_encoding::BASE64_NOPAD, + ]; + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"] + #[doc = " when deserializing, will decode from many different types of base64 possible."] + pub struct Base64Data(pub Vec); + impl Base64Data { + #[doc = " Return is the data is empty."] + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + } + + impl fmt::Display for Base64Data { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0)) + } + } + + impl From for Vec { + fn from(data: Base64Data) -> Vec { + data.0 + } + } + + impl From> for Base64Data { + fn from(data: Vec) -> Base64Data { + Base64Data(data) + } + } + + impl AsRef<[u8]> for Base64Data { + fn as_ref(&self) -> &[u8] { + &self.0 + } + } + + impl TryFrom<&str> for Base64Data { + type Error = anyhow::Error; + fn try_from(v: &str) -> Result { + for config in ALLOWED_DECODING_FORMATS { + if let Ok(data) = config.decode(v.as_bytes()) { + return Ok(Base64Data(data)); + } + } + anyhow::bail!("Could not decode base64 data: {}", v); + } + } + + struct Base64DataVisitor; + impl<'de> Visitor<'de> for Base64DataVisitor { + type Value = Base64Data; + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "a base64 encoded string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + for config in ALLOWED_DECODING_FORMATS { + if let Ok(data) = config.decode(v.as_bytes()) { + return Ok(Base64Data(data)); + } + } + Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self)) + } + } + + impl<'de> Deserialize<'de> for Base64Data { + fn deserialize(deserializer: D) -> Result>::Error> + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(Base64DataVisitor) + } + } + + impl Serialize for Base64Data { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0); + serializer.serialize_str(&encoded) + } + } + + impl schemars::JsonSchema for Base64Data { + fn schema_name() -> String { + "Base64Data".to_string() + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let mut obj = gen.root_schema_for::().schema; + obj.format = Some("byte".to_string()); + schemars::schema::Schema::Object(obj) + } + + fn is_referenceable() -> bool { + false + } + } + + #[cfg(test)] + mod tests { + use std::convert::TryFrom; + + use super::Base64Data; + #[test] + fn test_base64_try_from() { + assert!(Base64Data::try_from("aGVsbG8=").is_ok()); + assert!(Base64Data::try_from("abcdefghij").is_err()); + } + } +} + +#[cfg(feature = "requests")] +pub mod multipart { + #![doc = " Multipart form data types."] + #[doc = " An attachement to a multipart form."] + #[derive(Debug, Clone, PartialEq, Eq, Hash)] + pub struct Attachment { + #[doc = " The name of the field."] + pub name: String, + #[doc = " The filename of the attachment."] + pub filename: Option, + #[doc = " The content type of the attachment."] + pub content_type: Option, + #[doc = " The data of the attachment."] + pub data: Vec, + } + + impl std::convert::TryFrom for reqwest::multipart::Part { + type Error = reqwest::Error; + fn try_from(attachment: Attachment) -> Result { + let mut part = reqwest::multipart::Part::bytes(attachment.data); + if let Some(filename) = attachment.filename { + part = part.file_name(filename); + } + if let Some(content_type) = attachment.content_type { + part = part.mime_str(&content_type)?; + } + Ok(part) + } + } + + impl std::convert::TryFrom for Attachment { + type Error = std::io::Error; + fn try_from(path: std::path::PathBuf) -> Result { + let filename = path + .file_name() + .ok_or_else(|| { + std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") + })? + .to_str() + .ok_or_else(|| { + std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") + })? + .to_string(); + let content_type = mime_guess::from_path(&path).first_raw(); + let data = std::fs::read(path)?; + Ok(Attachment { + name: "file".to_string(), + filename: Some(filename), + content_type: content_type.map(|s| s.to_string()), + data, + }) + } + } +} + +#[cfg(feature = "requests")] +pub mod paginate { + #![doc = " Utility functions used for pagination."] + use anyhow::Result; + #[doc = " A trait for types that allow pagination."] + pub trait Pagination { + #[doc = " The item that is paginated."] + type Item: serde::de::DeserializeOwned; + #[doc = " Returns true if the response has more pages."] + fn has_more_pages(&self) -> bool; + #[doc = " Returns the next page token."] + fn next_page_token(&self) -> Option; + #[doc = " Modify a request to get the next page."] + fn next_page( + &self, + req: reqwest::Request, + ) -> Result; + #[doc = " Get the items from a page."] + fn items(&self) -> Vec; + } +} + +pub mod phone_number { + #![doc = " A library to implement phone numbers for our database and JSON serialization and \ + deserialization."] + use std::str::FromStr; + + use schemars::JsonSchema; + #[doc = " A phone number."] + #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)] + pub struct PhoneNumber(pub Option); + impl From for PhoneNumber { + fn from(id: phonenumber::PhoneNumber) -> PhoneNumber { + PhoneNumber(Some(id)) + } + } + + impl AsRef> for PhoneNumber { + fn as_ref(&self) -> &Option { + &self.0 + } + } + + impl std::ops::Deref for PhoneNumber { + type Target = Option; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + + impl serde::ser::Serialize for PhoneNumber { + fn serialize(&self, serializer: S) -> Result + where + S: serde::ser::Serializer, + { + serializer.serialize_str(&self.to_string()) + } + } + + impl<'de> serde::de::Deserialize<'de> for PhoneNumber { + fn deserialize(deserializer: D) -> Result + where + D: serde::de::Deserializer<'de>, + { + let s = String::deserialize(deserializer).unwrap_or_default(); + PhoneNumber::from_str(&s).map_err(serde::de::Error::custom) + } + } + + impl std::str::FromStr for PhoneNumber { + type Err = anyhow::Error; + fn from_str(s: &str) -> Result { + if s.trim().is_empty() { + return Ok(PhoneNumber(None)); + } + let s = if !s.trim().starts_with('+') { + format!("+1{s}") + } else { + s.to_string() + } + .replace(['-', '(', ')', ' '], ""); + Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err( + |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e), + )?))) + } + } + + impl std::fmt::Display for PhoneNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let s = if let Some(phone) = &self.0 { + phone + .format() + .mode(phonenumber::Mode::International) + .to_string() + } else { + String::new() + }; + write!(f, "{}", s) + } + } + + impl JsonSchema for PhoneNumber { + fn schema_name() -> String { + "PhoneNumber".to_string() + } + + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + let mut obj = gen.root_schema_for::().schema; + obj.format = Some("phone".to_string()); + schemars::schema::Schema::Object(obj) + } + + fn is_referenceable() -> bool { + false + } + } + + #[cfg(test)] + mod test { + use pretty_assertions::assert_eq; + + use super::PhoneNumber; + #[test] + fn test_parse_phone_number() { + let mut phone = "+1-555-555-5555"; + let mut phone_parsed: PhoneNumber = + serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); + assert_eq!(phone_parsed, expected); + let mut expected_str = "+1 555-555-5555"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "555-555-5555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "+1 555-555-5555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "5555555555"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "(510) 864-1234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap())); + assert_eq!(phone_parsed, expected); + expected_str = "+1 510-864-1234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = "(510)8641234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, expected); + expected_str = "+1 510-864-1234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + phone = ""; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + assert_eq!(phone_parsed, PhoneNumber(None)); + assert_eq!("", serde_json::json!(phone_parsed)); + phone = "+49 30 1234 1234"; + phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); + expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); + assert_eq!(phone_parsed, expected); + expected_str = "+49 30 12341234"; + assert_eq!(expected_str, serde_json::json!(phone_parsed)); + } + } +} + +#[cfg(feature = "requests")] +pub mod error { + #![doc = " Error methods."] + #[doc = " Error produced by generated client methods."] + pub enum Error { + #[doc = " The request did not conform to API requirements."] + InvalidRequest(String), + #[cfg(feature = "retry")] + #[doc = " A server error either due to the data, or with the connection."] + CommunicationError(reqwest_middleware::Error), + #[doc = " A request error, caused when building the request."] + RequestError(reqwest::Error), + #[doc = " An expected response whose deserialization failed."] + SerdeError { + #[doc = " The error."] + error: format_serde_error::SerdeError, + #[doc = " The response status."] + status: reqwest::StatusCode, + }, + #[doc = " An expected error response."] + InvalidResponsePayload { + #[cfg(feature = "retry")] + #[doc = " The error."] + error: reqwest_middleware::Error, + #[cfg(not(feature = "retry"))] + #[doc = " The error."] + error: reqwest::Error, + #[doc = " The full response."] + response: reqwest::Response, + }, + #[doc = " An error from the server."] + Server { + #[doc = " The text from the body."] + body: String, + #[doc = " The response status."] + status: reqwest::StatusCode, + }, + #[doc = " A response not listed in the API description. This may represent a"] + #[doc = " success or failure response; check `status().is_success()`."] + UnexpectedResponse(reqwest::Response), + } + + impl Error { + #[doc = " Returns the status code, if the error was generated from a response."] + pub fn status(&self) -> Option { + match self { + Error::InvalidRequest(_) => None, + Error::RequestError(e) => e.status(), + #[cfg(feature = "retry")] + Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(), + #[cfg(feature = "retry")] + Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None, + Error::SerdeError { error: _, status } => Some(*status), + Error::InvalidResponsePayload { error: _, response } => Some(response.status()), + Error::Server { body: _, status } => Some(*status), + Error::UnexpectedResponse(r) => Some(r.status()), + } + } + + #[doc = " Creates a new error from a response status and a serde error."] + pub fn from_serde_error( + e: format_serde_error::SerdeError, + status: reqwest::StatusCode, + ) -> Self { + Self::SerdeError { error: e, status } + } + } + + #[cfg(feature = "retry")] + impl From for Error { + fn from(e: reqwest_middleware::Error) -> Self { + Self::CommunicationError(e) + } + } + + impl From for Error { + fn from(e: reqwest::Error) -> Self { + Self::RequestError(e) + } + } + + impl From for Error { + fn from(e: serde_json::Error) -> Self { + Self::SerdeError { + error: format_serde_error::SerdeError::new(String::new(), e), + status: reqwest::StatusCode::INTERNAL_SERVER_ERROR, + } + } + } + + impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Error::InvalidRequest(s) => { + write!(f, "Invalid Request: {}", s) + } + #[cfg(feature = "retry")] + Error::CommunicationError(e) => { + write!(f, "Communication Error: {}", e) + } + Error::RequestError(e) => { + write!(f, "Request Error: {}", e) + } + Error::SerdeError { error, status: _ } => { + write!(f, "Serde Error: {}", error) + } + Error::InvalidResponsePayload { error, response: _ } => { + write!(f, "Invalid Response Payload: {}", error) + } + Error::Server { body, status } => { + write!(f, "Server Error: {} {}", status, body) + } + Error::UnexpectedResponse(r) => { + write!(f, "Unexpected Response: {:?}", r) + } + } + } + } + + impl std::fmt::Debug for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + std::fmt::Display::fmt(self, f) + } + } + + impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + #[cfg(feature = "retry")] + Error::CommunicationError(e) => Some(e), + Error::SerdeError { error, status: _ } => Some(error), + Error::InvalidResponsePayload { error, response: _ } => Some(error), + _ => None, + } + } + } +} + +#[doc = "An ENUM of employment type"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum EmploymentType { + #[serde(rename = "CONTRACTOR")] + #[display("CONTRACTOR")] + Contractor, + #[serde(rename = "SALARIED_FT")] + #[display("SALARIED_FT")] + SalariedFt, + #[serde(rename = "SALARIED_PT")] + #[display("SALARIED_PT")] + SalariedPt, + #[serde(rename = "HOURLY_FT")] + #[display("HOURLY_FT")] + HourlyFt, + #[serde(rename = "HOURLY_PT")] + #[display("HOURLY_PT")] + HourlyPt, + #[serde(rename = "TEMP")] + #[display("TEMP")] + Temp, +} + +#[doc = "The employee's gender"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Gender { + #[serde(rename = "MALE")] + #[display("MALE")] + Male, + #[serde(rename = "FEMALE")] + #[display("FEMALE")] + Female, +} + +#[doc = "The employee's identified gender"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum IdentifiedGender { + #[serde(rename = "MALE")] + #[display("MALE")] + Male, + #[serde(rename = "FEMALE")] + #[display("FEMALE")] + Female, + #[serde(rename = "NONBINARY")] + #[display("NONBINARY")] + Nonbinary, +} + +#[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \ + individual. An offer has not been made and they have not started working at the \ + company.\n\nHIRED: An offer has been made but they have not accepted or started \ + yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \ + started yet.\n\nACTIVE: The employee currently works at the company and their start date \ + is today or in the past.\n\nTERMINATED: The employee is no longer active."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum RoleState { + #[serde(rename = "INIT")] + #[display("INIT")] + Init, + #[serde(rename = "HIRED")] + #[display("HIRED")] + Hired, + #[serde(rename = "ACCEPTED")] + #[display("ACCEPTED")] + Accepted, + #[serde(rename = "ACTIVE")] + #[display("ACTIVE")] + Active, + #[serde(rename = "TERMINATED")] + #[display("TERMINATED")] + Terminated, +} + +#[doc = "An employee model object."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Employee { + #[doc = "This is the unique role ID of the employee. A role ID exists per 1 and only 1 \ + company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "This is the unique user ID of the employee. A userID can span across 1 or many \ + companies."] + #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, + #[doc = "Full name of the employee"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "preferredFirstName", + default, + skip_serializing_if = "Option::is_none" + )] + pub preferred_first_name: Option, + #[serde( + rename = "preferredLastName", + default, + skip_serializing_if = "Option::is_none" + )] + pub preferred_last_name: Option, + #[doc = "First name of the employee"] + #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[doc = "Last name of the employee"] + #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[doc = "An ENUM of employment type"] + #[serde( + rename = "employmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub employment_type: Option, + #[doc = "The employee's work title"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The employee's gender"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gender: Option, + #[doc = "The employee's identified gender"] + #[serde( + rename = "identifiedGender", + default, + skip_serializing_if = "Option::is_none" + )] + pub identified_gender: Option, + #[doc = "The employee's department name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub department: Option, + #[doc = "An address object as stored within Rippling."] + #[serde( + rename = "workLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_location: Option
, + #[doc = "The work location nickname"] + #[serde( + rename = "worklocationNickname", + default, + skip_serializing_if = "Option::is_none" + )] + pub worklocation_nickname: Option, + #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] + pub spoke_id: Option, + #[doc = "The employee's end date"] + #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \ + individual. An offer has not been made and they have not started working at the \ + company.\n\nHIRED: An offer has been made but they have not accepted or started \ + yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \ + started yet.\n\nACTIVE: The employee currently works at the company and their start \ + date is today or in the past.\n\nTERMINATED: The employee is no longer active."] + #[serde(rename = "roleState", default, skip_serializing_if = "Option::is_none")] + pub role_state: Option, + #[doc = "The employee's work email"] + #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")] + pub work_email: Option, + #[doc = "The unique identifier of the employee's manager. This value can be null."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub manager: Option, + #[doc = "custom_fields."] + #[serde( + rename = "customFields", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_fields: Option, + #[doc = "Whether the employee is an international employee or not."] + #[serde( + rename = "isInternational", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_international: Option, + #[doc = "Whether the employee is a manger"] + #[serde(rename = "isManager", default, skip_serializing_if = "Option::is_none")] + pub is_manager: Option, + #[doc = "The employee's weekly work schedule"] + #[serde( + rename = "workSchedule", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_schedule: Option, + #[doc = "Whether the employee's job is remote"] + #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")] + pub is_remote: Option, + #[doc = "This indicates the sequential employee number within their company. This number \ + continues to grow as each employee is onboarded. i.e if you are the 65th employee to \ + join the company with 32 active employees, the employeeNumber would be 65."] + #[serde( + rename = "employeeNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub employee_number: Option, + #[doc = "The level of the employee"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[doc = "An array of the teams that the employee is on"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub teams: Option>, + #[doc = "The photo of the employee stored in Rippling"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub photo: Option, + #[doc = "The small photo of the employee stored in Rippling"] + #[serde( + rename = "smallPhoto", + default, + skip_serializing_if = "Option::is_none" + )] + pub small_photo: Option, +} + +impl std::fmt::Display for Employee { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Employee { + const LENGTH: usize = 29; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(user_id) = &self.user_id { + format!("{:?}", user_id).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(preferred_first_name) = &self.preferred_first_name { + format!("{:?}", preferred_first_name).into() + } else { + String::new().into() + }, + if let Some(preferred_last_name) = &self.preferred_last_name { + format!("{:?}", preferred_last_name).into() + } else { + String::new().into() + }, + if let Some(first_name) = &self.first_name { + format!("{:?}", first_name).into() + } else { + String::new().into() + }, + if let Some(last_name) = &self.last_name { + format!("{:?}", last_name).into() + } else { + String::new().into() + }, + if let Some(employment_type) = &self.employment_type { + format!("{:?}", employment_type).into() + } else { + String::new().into() + }, + if let Some(title) = &self.title { + format!("{:?}", title).into() + } else { + String::new().into() + }, + if let Some(gender) = &self.gender { + format!("{:?}", gender).into() + } else { + String::new().into() + }, + if let Some(identified_gender) = &self.identified_gender { + format!("{:?}", identified_gender).into() + } else { + String::new().into() + }, + if let Some(department) = &self.department { + format!("{:?}", department).into() + } else { + String::new().into() + }, + if let Some(work_location) = &self.work_location { + format!("{:?}", work_location).into() + } else { + String::new().into() + }, + if let Some(worklocation_nickname) = &self.worklocation_nickname { + format!("{:?}", worklocation_nickname).into() + } else { + String::new().into() + }, + if let Some(spoke_id) = &self.spoke_id { + format!("{:?}", spoke_id).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(role_state) = &self.role_state { + format!("{:?}", role_state).into() + } else { + String::new().into() + }, + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() + } else { + String::new().into() + }, + if let Some(manager) = &self.manager { + format!("{:?}", manager).into() + } else { + String::new().into() + }, + if let Some(custom_fields) = &self.custom_fields { + format!("{:?}", custom_fields).into() + } else { + String::new().into() + }, + if let Some(is_international) = &self.is_international { + format!("{:?}", is_international).into() + } else { + String::new().into() + }, + if let Some(is_manager) = &self.is_manager { + format!("{:?}", is_manager).into() + } else { + String::new().into() + }, + if let Some(work_schedule) = &self.work_schedule { + format!("{:?}", work_schedule).into() + } else { + String::new().into() + }, + if let Some(is_remote) = &self.is_remote { + format!("{:?}", is_remote).into() + } else { + String::new().into() + }, + if let Some(employee_number) = &self.employee_number { + format!("{:?}", employee_number).into() + } else { + String::new().into() + }, + if let Some(level) = &self.level { + format!("{:?}", level).into() + } else { + String::new().into() + }, + if let Some(teams) = &self.teams { + format!("{:?}", teams).into() + } else { + String::new().into() + }, + if let Some(photo) = &self.photo { + format!("{:?}", photo).into() + } else { + String::new().into() + }, + if let Some(small_photo) = &self.small_photo { + format!("{:?}", small_photo).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "user_id".into(), + "name".into(), + "preferred_first_name".into(), + "preferred_last_name".into(), + "first_name".into(), + "last_name".into(), + "employment_type".into(), + "title".into(), + "gender".into(), + "identified_gender".into(), + "department".into(), + "work_location".into(), + "worklocation_nickname".into(), + "spoke_id".into(), + "end_date".into(), + "role_state".into(), + "work_email".into(), + "manager".into(), + "custom_fields".into(), + "is_international".into(), + "is_manager".into(), + "work_schedule".into(), + "is_remote".into(), + "employee_number".into(), + "level".into(), + "teams".into(), + "photo".into(), + "small_photo".into(), + ] + } +} + +#[doc = "A work location object."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct WorkLocation { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub nickname: Option, + #[doc = "An address object as stored within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option
, +} + +impl std::fmt::Display for WorkLocation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for WorkLocation { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(nickname) = &self.nickname { + format!("{:?}", nickname).into() + } else { + String::new().into() + }, + if let Some(address) = &self.address { + format!("{:?}", address).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "nickname".into(), "address".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct SteLocationCode { + #[serde( + rename = "locationCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub location_code: Option, + #[serde(rename = "stateCode", default, skip_serializing_if = "Option::is_none")] + pub state_code: Option, + #[serde( + rename = "countyCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub county_code: Option, + #[serde(rename = "cityCode", default, skip_serializing_if = "Option::is_none")] + pub city_code: Option, + #[serde( + rename = "schoolCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub school_code: Option, + #[serde( + rename = "municipalityCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub municipality_code: Option, + #[serde(rename = "psdCode", default, skip_serializing_if = "Option::is_none")] + pub psd_code: Option, + #[serde( + rename = "transitDistrictCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub transit_district_code: Option, + #[serde( + rename = "isOverridden", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_overridden: Option, +} + +impl std::fmt::Display for SteLocationCode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for SteLocationCode { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(location_code) = &self.location_code { + format!("{:?}", location_code).into() + } else { + String::new().into() + }, + if let Some(state_code) = &self.state_code { + format!("{:?}", state_code).into() + } else { + String::new().into() + }, + if let Some(county_code) = &self.county_code { + format!("{:?}", county_code).into() + } else { + String::new().into() + }, + if let Some(city_code) = &self.city_code { + format!("{:?}", city_code).into() + } else { + String::new().into() + }, + if let Some(school_code) = &self.school_code { + format!("{:?}", school_code).into() + } else { + String::new().into() + }, + if let Some(municipality_code) = &self.municipality_code { + format!("{:?}", municipality_code).into() + } else { + String::new().into() + }, + if let Some(psd_code) = &self.psd_code { + format!("{:?}", psd_code).into() + } else { + String::new().into() + }, + if let Some(transit_district_code) = &self.transit_district_code { + format!("{:?}", transit_district_code).into() + } else { + String::new().into() + }, + if let Some(is_overridden) = &self.is_overridden { + format!("{:?}", is_overridden).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "location_code".into(), + "state_code".into(), + "county_code".into(), + "city_code".into(), + "school_code".into(), + "municipality_code".into(), + "psd_code".into(), + "transit_district_code".into(), + "is_overridden".into(), + ] + } +} + +#[doc = "An address object as stored within Rippling."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Address { + #[serde( + rename = "streetLine1", + default, + skip_serializing_if = "Option::is_none" + )] + pub street_line_1: Option, + #[serde( + rename = "streetLine2", + default, + skip_serializing_if = "Option::is_none" + )] + pub street_line_2: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub zip: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")] + pub is_remote: Option, + #[serde( + rename = "steLocationCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub ste_location_code: Option, +} + +impl std::fmt::Display for Address { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Address { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(street_line_1) = &self.street_line_1 { + format!("{:?}", street_line_1).into() + } else { + String::new().into() + }, + if let Some(street_line_2) = &self.street_line_2 { + format!("{:?}", street_line_2).into() + } else { + String::new().into() + }, + if let Some(zip) = &self.zip { + format!("{:?}", zip).into() + } else { + String::new().into() + }, + if let Some(city) = &self.city { + format!("{:?}", city).into() + } else { + String::new().into() + }, + if let Some(state) = &self.state { + format!("{:?}", state).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(phone) = &self.phone { + format!("{:?}", phone).into() + } else { + String::new().into() + }, + if let Some(is_remote) = &self.is_remote { + format!("{:?}", is_remote).into() + } else { + String::new().into() + }, + if let Some(ste_location_code) = &self.ste_location_code { + format!("{:?}", ste_location_code).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "street_line_1".into(), + "street_line_2".into(), + "zip".into(), + "city".into(), + "state".into(), + "country".into(), + "phone".into(), + "is_remote".into(), + "ste_location_code".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Group { + #[doc = "User-readable name of a Rippling group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Your id for the group; this should a unique string identifier."] + #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] + pub spoke_id: Option, + #[doc = "The version unique identifier of the group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, + #[doc = "An array of employee Rippling ids."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub users: Option>, +} + +impl std::fmt::Display for Group { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Group { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(spoke_id) = &self.spoke_id { + format!("{:?}", spoke_id).into() + } else { + String::new().into() + }, + if let Some(version) = &self.version { + format!("{:?}", version).into() + } else { + String::new().into() + }, + if let Some(users) = &self.users { + format!("{:?}", users).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "id".into(), + "spoke_id".into(), + "version".into(), + "users".into(), + ] + } +} + +#[doc = "A company department object."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Department { + #[doc = "Name of the department"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "Unique identifier of the department"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "id of the parent department, if one exists"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, +} + +impl std::fmt::Display for Department { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Department { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "id".into(), "parent".into()] + } +} + +#[doc = "Denotes the type of the custom field."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Type { + #[serde(rename = "TEXT")] + #[display("TEXT")] + Text, + #[serde(rename = "DATE")] + #[display("DATE")] + Date, + #[serde(rename = "NUMBER")] + #[display("NUMBER")] + Number, + #[serde(rename = "CURRENCY")] + #[display("CURRENCY")] + Currency, + #[serde(rename = "PERCENTAGE")] + #[display("PERCENTAGE")] + Percentage, + #[serde(rename = "SELECT")] + #[display("SELECT")] + Select, + #[serde(rename = "FILE")] + #[display("FILE")] + File, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "RADIO")] + #[display("RADIO")] + Radio, + #[serde(rename = "TEXTAREA")] + #[display("TEXTAREA")] + Textarea, +} + +#[doc = "A Custom Fields object within Rippling."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CustomFields { + #[doc = "The identifier of the specific custom field."] + #[serde(rename = "Id", default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Denotes the type of the custom field."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The title of the custom field."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "Denotes whether the custom field is or is not mandatory"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub required: Option, +} + +impl std::fmt::Display for CustomFields { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CustomFields { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(title) = &self.title { + format!("{:?}", title).into() + } else { + String::new().into() + }, + if let Some(required) = &self.required { + format!("{:?}", required).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "type_".into(), + "title".into(), + "required".into(), + ] + } +} + +#[doc = "A company object as represented within Rippling."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Company { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "An address object as stored within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub address: Option
, + #[serde( + rename = "workLocations", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_locations: Option>, + #[serde( + rename = "primaryEmail", + default, + skip_serializing_if = "Option::is_none" + )] + pub primary_email: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "This model represents the legal entities inside of a given company. Legal entities \ + based in Canada (CA) are currently supported at this time."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub entities: Option, +} + +impl std::fmt::Display for Company { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Company { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(address) = &self.address { + format!("{:?}", address).into() + } else { + String::new().into() + }, + if let Some(work_locations) = &self.work_locations { + format!("{:?}", work_locations).into() + } else { + String::new().into() + }, + if let Some(primary_email) = &self.primary_email { + format!("{:?}", primary_email).into() + } else { + String::new().into() + }, + if let Some(phone) = &self.phone { + format!("{:?}", phone).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(entities) = &self.entities { + format!("{:?}", entities).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "address".into(), + "work_locations".into(), + "primary_email".into(), + "phone".into(), + "name".into(), + "entities".into(), + ] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Status { + #[serde(rename = "PENDING")] + #[display("PENDING")] + Pending, + #[serde(rename = "APPROVED")] + #[display("APPROVED")] + Approved, + #[serde(rename = "REJECTED")] + #[display("REJECTED")] + Rejected, + #[serde(rename = "CANCELED")] + #[display("CANCELED")] + Canceled, +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum LeaveTypeUniqueId { + #[serde(rename = "VACATION")] + #[display("VACATION")] + Vacation, + #[serde(rename = "SICK")] + #[display("SICK")] + Sick, + #[serde(rename = "JURY_DUTY")] + #[display("JURY_DUTY")] + JuryDuty, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Dates { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date: Option, + #[serde( + rename = "numMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub num_minutes: Option, +} + +impl std::fmt::Display for Dates { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Dates { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(date) = &self.date { + format!("{:?}", date).into() + } else { + String::new().into() + }, + if let Some(num_minutes) = &self.num_minutes { + format!("{:?}", num_minutes).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["date".into(), "num_minutes".into()] + } +} + +#[doc = "This indicates the system that manages the Leave Request. PTO = managed by Rippling's \ + Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = managed by \ + third-party partner Tilt."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ManagedBy { + #[serde(rename = "PTO")] + #[display("PTO")] + Pto, + #[serde(rename = "LEAVES")] + #[display("LEAVES")] + Leaves, + #[serde(rename = "TILT")] + #[display("TILT")] + Tilt, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PartialDays { + #[serde( + rename = "partialDay", + default, + skip_serializing_if = "Option::is_none" + )] + pub partial_day: Option, + #[serde( + rename = "numMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub num_minutes: Option, +} + +impl std::fmt::Display for PartialDays { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PartialDays { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(partial_day) = &self.partial_day { + format!("{:?}", partial_day).into() + } else { + String::new().into() + }, + if let Some(num_minutes) = &self.num_minutes { + format!("{:?}", num_minutes).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["partial_day".into(), "num_minutes".into()] + } +} + +#[doc = "Leave request object."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LeaveRequest { + #[doc = "Unique identifier of the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[doc = "Unique identifier of the employee who is taking leave."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option, + #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")] + pub role_name: Option, + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option, + #[doc = "Unique identifier of the employee who made the request (in most cases this is the \ + same as role)."] + #[serde( + rename = "requestedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by_name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[serde( + rename = "startDateStartTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_start_time: Option, + #[serde( + rename = "endDateEndTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_end_time: Option, + #[serde( + rename = "startDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_custom_hours: Option, + #[serde( + rename = "endDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_custom_hours: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option, + #[serde(rename = "numHours", default, skip_serializing_if = "Option::is_none")] + pub num_hours: Option, + #[serde( + rename = "numMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub num_minutes: Option, + #[serde( + rename = "leavePolicy", + default, + skip_serializing_if = "Option::is_none" + )] + pub leave_policy: Option, + #[serde( + rename = "leaveTypeUniqueId", + default, + skip_serializing_if = "Option::is_none" + )] + pub leave_type_unique_id: Option, + #[serde( + rename = "policyDisplayName", + default, + skip_serializing_if = "Option::is_none" + )] + pub policy_display_name: Option, + #[serde( + rename = "reasonForLeave", + default, + skip_serializing_if = "Option::is_none" + )] + pub reason_for_leave: Option, + #[serde( + rename = "processedAt", + default, + skip_serializing_if = "Option::is_none" + )] + pub processed_at: Option, + #[doc = "Unique identifier of the employee who approved or rejected the request. This may be \ + null."] + #[serde( + rename = "processedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub processed_by: Option, + #[serde( + rename = "processedByName", + default, + skip_serializing_if = "Option::is_none" + )] + pub processed_by_name: Option, + #[doc = "Timezone of the role. This will be work location timezone, or home timezone for \ + employees without a work location."] + #[serde( + rename = "roleTimezone", + default, + skip_serializing_if = "Option::is_none" + )] + pub role_timezone: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub dates: Option>, + #[doc = "If the leave request is paid this will be TRUE. Otherwise, this will be FALSE."] + #[serde(rename = "isPaid", default, skip_serializing_if = "Option::is_none")] + pub is_paid: Option, + #[doc = "This indicates the system that manages the Leave Request. PTO = managed by \ + Rippling's Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = \ + managed by third-party partner Tilt."] + #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")] + pub managed_by: Option, + #[serde( + rename = "partialDays", + default, + skip_serializing_if = "Option::is_none" + )] + pub partial_days: Option>>, +} + +impl std::fmt::Display for LeaveRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LeaveRequest { + const LENGTH: usize = 29; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(created_at) = &self.created_at { + format!("{:?}", created_at).into() + } else { + String::new().into() + }, + if let Some(updated_at) = &self.updated_at { + format!("{:?}", updated_at).into() + } else { + String::new().into() + }, + if let Some(role) = &self.role { + format!("{:?}", role).into() + } else { + String::new().into() + }, + if let Some(role_name) = &self.role_name { + format!("{:?}", role_name).into() + } else { + String::new().into() + }, + if let Some(requested_by) = &self.requested_by { + format!("{:?}", requested_by).into() + } else { + String::new().into() + }, + if let Some(requested_by_name) = &self.requested_by_name { + format!("{:?}", requested_by_name).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(start_date_start_time) = &self.start_date_start_time { + format!("{:?}", start_date_start_time).into() + } else { + String::new().into() + }, + if let Some(end_date_end_time) = &self.end_date_end_time { + format!("{:?}", end_date_end_time).into() + } else { + String::new().into() + }, + if let Some(start_date_custom_hours) = &self.start_date_custom_hours { + format!("{:?}", start_date_custom_hours).into() + } else { + String::new().into() + }, + if let Some(end_date_custom_hours) = &self.end_date_custom_hours { + format!("{:?}", end_date_custom_hours).into() + } else { + String::new().into() + }, + if let Some(comments) = &self.comments { + format!("{:?}", comments).into() + } else { + String::new().into() + }, + if let Some(num_hours) = &self.num_hours { + format!("{:?}", num_hours).into() + } else { + String::new().into() + }, + if let Some(num_minutes) = &self.num_minutes { + format!("{:?}", num_minutes).into() + } else { + String::new().into() + }, + if let Some(leave_policy) = &self.leave_policy { + format!("{:?}", leave_policy).into() + } else { + String::new().into() + }, + if let Some(leave_type_unique_id) = &self.leave_type_unique_id { + format!("{:?}", leave_type_unique_id).into() + } else { + String::new().into() + }, + if let Some(policy_display_name) = &self.policy_display_name { + format!("{:?}", policy_display_name).into() + } else { + String::new().into() + }, + if let Some(reason_for_leave) = &self.reason_for_leave { + format!("{:?}", reason_for_leave).into() + } else { + String::new().into() + }, + if let Some(processed_at) = &self.processed_at { + format!("{:?}", processed_at).into() + } else { + String::new().into() + }, + if let Some(processed_by) = &self.processed_by { + format!("{:?}", processed_by).into() + } else { + String::new().into() + }, + if let Some(processed_by_name) = &self.processed_by_name { + format!("{:?}", processed_by_name).into() + } else { + String::new().into() + }, + if let Some(role_timezone) = &self.role_timezone { + format!("{:?}", role_timezone).into() + } else { + String::new().into() + }, + if let Some(dates) = &self.dates { + format!("{:?}", dates).into() + } else { + String::new().into() + }, + if let Some(is_paid) = &self.is_paid { + format!("{:?}", is_paid).into() + } else { + String::new().into() + }, + if let Some(managed_by) = &self.managed_by { + format!("{:?}", managed_by).into() + } else { + String::new().into() + }, + if let Some(partial_days) = &self.partial_days { + format!("{:?}", partial_days).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "role".into(), + "role_name".into(), + "requested_by".into(), + "requested_by_name".into(), + "status".into(), + "start_date".into(), + "end_date".into(), + "start_date_start_time".into(), + "end_date_end_time".into(), + "start_date_custom_hours".into(), + "end_date_custom_hours".into(), + "comments".into(), + "num_hours".into(), + "num_minutes".into(), + "leave_policy".into(), + "leave_type_unique_id".into(), + "policy_display_name".into(), + "reason_for_leave".into(), + "processed_at".into(), + "processed_by".into(), + "processed_by_name".into(), + "role_timezone".into(), + "dates".into(), + "is_paid".into(), + "managed_by".into(), + "partial_days".into(), + ] + } +} + +#[doc = "Leave balances object"] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LeaveBalances { + #[doc = "This is the unique role ID of the company leave types. Corresponds to the ids in \ + response of GET Company Leave Types"] + #[serde( + rename = "companyLeaveType", + default, + skip_serializing_if = "Option::is_none" + )] + pub company_leave_type: Option, + #[doc = "true if employee's balance corresponding to the company leave type is unlimited, \ + else false"] + #[serde( + rename = "isBalanceUnlimited", + default, + skip_serializing_if = "Option::is_none" + )] + pub is_balance_unlimited: Option, + #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \ + type with future leave requests considered."] + #[serde( + rename = "balanceWithFutureRequests", + default, + skip_serializing_if = "Option::is_none" + )] + pub balance_with_future_requests: Option, + #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \ + type with future leave requests not considered."] + #[serde( + rename = "balanceWithoutFutureRequests", + default, + skip_serializing_if = "Option::is_none" + )] + pub balance_without_future_requests: Option, +} + +impl std::fmt::Display for LeaveBalances { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LeaveBalances { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(company_leave_type) = &self.company_leave_type { + format!("{:?}", company_leave_type).into() + } else { + String::new().into() + }, + if let Some(is_balance_unlimited) = &self.is_balance_unlimited { + format!("{:?}", is_balance_unlimited).into() + } else { + String::new().into() + }, + if let Some(balance_with_future_requests) = &self.balance_with_future_requests { + format!("{:?}", balance_with_future_requests).into() + } else { + String::new().into() + }, + if let Some(balance_without_future_requests) = &self.balance_without_future_requests { + format!("{:?}", balance_without_future_requests).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "company_leave_type".into(), + "is_balance_unlimited".into(), + "balance_with_future_requests".into(), + "balance_without_future_requests".into(), + ] + } +} + +#[doc = "Company leave request object"] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CompanyLeaveType { + #[doc = "Unique identifier of the company leave request"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Company leave type key"] + #[serde(rename = "leaveType", default, skip_serializing_if = "Option::is_none")] + pub leave_type: Option, + #[doc = "Company leave type name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "Is leave type unpaid"] + #[serde(rename = "isUnpaid", default, skip_serializing_if = "Option::is_none")] + pub is_unpaid: Option, +} + +impl std::fmt::Display for CompanyLeaveType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CompanyLeaveType { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(leave_type) = &self.leave_type { + format!("{:?}", leave_type).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(is_unpaid) = &self.is_unpaid { + format!("{:?}", is_unpaid).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "leave_type".into(), + "name".into(), + "description".into(), + "is_unpaid".into(), + ] + } +} + +#[doc = "A team is a self-defined group of employees within Rippling."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Team { + #[doc = "The identifier of the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "The name of the team."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The parent team (if this team is a subteam within a larger team)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, +} + +impl std::fmt::Display for Team { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Team { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "name".into(), "parent".into()] + } +} + +#[doc = "Levels enable for self-defined,company-wide position levels, such as Manager, Engineering \ + Manager, Executive, etc."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Level { + #[doc = "Unique identifier of the level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Name of the level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The unique identifier of the parent level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, +} + +impl std::fmt::Display for Level { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Level { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "name".into(), "parent".into()] + } +} + +#[doc = "Information about the Rippling user whose token is being used to access Rippling's API."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct AuthenticatedUserMe { + #[doc = "Unied identifier of the user (likely an admin)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Work email of the user."] + #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")] + pub work_email: Option, + #[doc = "Unique identifier of the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub company: Option, +} + +impl std::fmt::Display for AuthenticatedUserMe { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for AuthenticatedUserMe { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() + } else { + String::new().into() + }, + if let Some(company) = &self.company { + format!("{:?}", company).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "work_email".into(), "company".into()] + } +} + +#[doc = "This payload should be used when updating existing groups."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct GroupUpdatePayload { + #[doc = "The name of the Group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The external identifier of the Group."] + #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] + pub spoke_id: Option, + #[doc = "The array of users within the Group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub users: Option>, + #[doc = "The version identifier of the Group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl std::fmt::Display for GroupUpdatePayload { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for GroupUpdatePayload { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(spoke_id) = &self.spoke_id { + format!("{:?}", spoke_id).into() + } else { + String::new().into() + }, + if let Some(users) = &self.users { + format!("{:?}", users).into() + } else { + String::new().into() + }, + if let Some(version) = &self.version { + format!("{:?}", version).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "spoke_id".into(), + "users".into(), + "version".into(), + ] + } +} + +#[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid once \ + the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per a custom \ + pay period."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SalaryUnit { + #[serde(rename = "HOUR")] + #[display("HOUR")] + Hour, + #[serde(rename = "DAY")] + #[display("DAY")] + Day, + #[serde(rename = "WEEK")] + #[display("WEEK")] + Week, + #[serde(rename = "MONTH")] + #[display("MONTH")] + Month, + #[serde(rename = "PAY_PERIOD")] + #[display("PAY_PERIOD")] + PayPeriod, +} + +#[doc = "The ENUM type of employment the user will have within Rippling."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CandidateEmploymentType { + #[serde(rename = "CONTRACTOR")] + #[display("CONTRACTOR")] + Contractor, + #[serde(rename = "SALARIED_PT")] + #[display("SALARIED_PT")] + SalariedPt, + #[serde(rename = "SALARIED_FT")] + #[display("SALARIED_FT")] + SalariedFt, + #[serde(rename = "HOURLY_FT")] + #[display("HOURLY_FT")] + HourlyFt, + #[serde(rename = "HOURLY_PT")] + #[display("HOURLY_PT")] + HourlyPt, + #[serde(rename = "TEMP")] + #[display("TEMP")] + Temp, +} + +#[doc = "An array of json objects containing file names and public file URLs containing documents \ + pertaining to the candidate."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Attachments { + #[doc = "The file name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub file_name: Option, + #[doc = "The public URL and name of a pdf/docx/doc/odt file containing documents pertaining \ + to the candidate."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub file_url: Option, +} + +impl std::fmt::Display for Attachments { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Attachments { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(file_name) = &self.file_name { + format!("{:?}", file_name).into() + } else { + String::new().into() + }, + if let Some(file_url) = &self.file_url { + format!("{:?}", file_url).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["file_name".into(), "file_url".into()] + } +} + +#[doc = "The Rippling candidate model."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Candidate { + #[doc = "The candidate's name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The candidate's email."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + #[doc = "The candidate's job title."] + #[serde(rename = "jobTitle", default, skip_serializing_if = "Option::is_none")] + pub job_title: Option, + #[doc = "The candidate's phone number."] + #[serde( + rename = "phoneNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub phone_number: Option, + #[doc = "The unique identifier of the candidate from the ATS."] + #[serde( + rename = "candidateId", + default, + skip_serializing_if = "Option::is_none" + )] + pub candidate_id: Option, + #[doc = "The would-be start date of the candidate."] + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid \ + once the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per \ + a custom pay period."] + #[serde( + rename = "salaryUnit", + default, + skip_serializing_if = "Option::is_none" + )] + pub salary_unit: Option, + #[doc = "The decimal value that the candidate gets paid every salaryUnit time period."] + #[serde( + rename = "salaryPerUnit", + default, + skip_serializing_if = "Option::is_none" + )] + pub salary_per_unit: Option, + #[doc = "The bonus cash given to the candidate as a part of a one time payment, with two \ + decimal digit precision."] + #[serde( + rename = "signingBonus", + default, + skip_serializing_if = "Option::is_none" + )] + pub signing_bonus: Option, + #[doc = "A string field of the official currency as listed in ISO 4217."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[doc = "The number of shares that will be given to the candidate."] + #[serde( + rename = "equityShares", + default, + skip_serializing_if = "Option::is_none" + )] + pub equity_shares: Option, + #[doc = "This is the id of the department from GET/departments."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub department: Option, + #[doc = "The ENUM type of employment the user will have within Rippling."] + #[serde( + rename = "employmentType", + default, + skip_serializing_if = "Option::is_none" + )] + pub employment_type: Option, + #[doc = "This is the id of the worklocation from GET/work_locations."] + #[serde( + rename = "workLocation", + default, + skip_serializing_if = "Option::is_none" + )] + pub work_location: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub attachments: Option>, +} + +impl std::fmt::Display for Candidate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Candidate { + const LENGTH: usize = 15; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(email) = &self.email { + format!("{:?}", email).into() + } else { + String::new().into() + }, + if let Some(job_title) = &self.job_title { + format!("{:?}", job_title).into() + } else { + String::new().into() + }, + if let Some(phone_number) = &self.phone_number { + format!("{:?}", phone_number).into() + } else { + String::new().into() + }, + if let Some(candidate_id) = &self.candidate_id { + format!("{:?}", candidate_id).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(salary_unit) = &self.salary_unit { + format!("{:?}", salary_unit).into() + } else { + String::new().into() + }, + if let Some(salary_per_unit) = &self.salary_per_unit { + format!("{:?}", salary_per_unit).into() + } else { + String::new().into() + }, + if let Some(signing_bonus) = &self.signing_bonus { + format!("{:?}", signing_bonus).into() + } else { + String::new().into() + }, + if let Some(currency) = &self.currency { + format!("{:?}", currency).into() + } else { + String::new().into() + }, + if let Some(equity_shares) = &self.equity_shares { + format!("{:?}", equity_shares).into() + } else { + String::new().into() + }, + if let Some(department) = &self.department { + format!("{:?}", department).into() + } else { + String::new().into() + }, + if let Some(employment_type) = &self.employment_type { + format!("{:?}", employment_type).into() + } else { + String::new().into() + }, + if let Some(work_location) = &self.work_location { + format!("{:?}", work_location).into() + } else { + String::new().into() + }, + if let Some(attachments) = &self.attachments { + format!("{:?}", attachments).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "email".into(), + "job_title".into(), + "phone_number".into(), + "candidate_id".into(), + "start_date".into(), + "salary_unit".into(), + "salary_per_unit".into(), + "signing_bonus".into(), + "currency".into(), + "equity_shares".into(), + "department".into(), + "employment_type".into(), + "work_location".into(), + "attachments".into(), + ] + } +} + +#[doc = "Geographic details from where the event was recorded."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct RequestData { + #[doc = "Event IP addresss."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ip: Option, + #[doc = "City the event was triggered from."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub city: Option, + #[doc = "Country the event was triggered from."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "Latitude the event was triggered from."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub latitude: Option, + #[doc = "Longitude the event was triggered from."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub longitude: Option, +} + +impl std::fmt::Display for RequestData { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for RequestData { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(ip) = &self.ip { + format!("{:?}", ip).into() + } else { + String::new().into() + }, + if let Some(city) = &self.city { + format!("{:?}", city).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(latitude) = &self.latitude { + format!("{:?}", latitude).into() + } else { + String::new().into() + }, + if let Some(longitude) = &self.longitude { + format!("{:?}", longitude).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "ip".into(), + "city".into(), + "country".into(), + "latitude".into(), + "longitude".into(), + ] + } +} + +#[doc = "An ENUM value for the type of object."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum SubjectsType { + #[serde(rename = "ROLE")] + #[display("ROLE")] + Role, + #[serde(rename = "SPOKE")] + #[display("SPOKE")] + Spoke, + #[serde(rename = "RPASS_ITEM")] + #[display("RPASS_ITEM")] + RpassItem, + #[serde(rename = "SPOKE_USER")] + #[display("SPOKE_USER")] + SpokeUser, + #[serde(rename = "GROUP")] + #[display("GROUP")] + Group, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Subjects { + #[doc = "Unique key for the event object."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub instance: Option, + #[doc = "An ENUM value for the type of object."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "Name used within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "Icon used within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option, +} + +impl std::fmt::Display for Subjects { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Subjects { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(instance) = &self.instance { + format!("{:?}", instance).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(display_name) = &self.display_name { + format!("{:?}", display_name).into() + } else { + String::new().into() + }, + if let Some(icon) = &self.icon { + format!("{:?}", icon).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "instance".into(), + "type_".into(), + "display_name".into(), + "icon".into(), + ] + } +} + +#[doc = "An ENUM value for the type of the event."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum EventType { + #[serde(rename = "EXTERNAL_ACCOUNT_CREATE")] + #[display("EXTERNAL_ACCOUNT_CREATE")] + ExternalAccountCreate, + #[serde(rename = "EXTERNAL_ACCOUNT_INVITE")] + #[display("EXTERNAL_ACCOUNT_INVITE")] + ExternalAccountInvite, + #[serde(rename = "EXTERNAL_ACCOUNT_DELETE")] + #[display("EXTERNAL_ACCOUNT_DELETE")] + ExternalAccountDelete, + #[serde(rename = "EXTERNAL_ACCOUNT_SUSPEND")] + #[display("EXTERNAL_ACCOUNT_SUSPEND")] + ExternalAccountSuspend, + #[serde(rename = "EXTERNAL_ACCOUNT_PASSWORD_RESET")] + #[display("EXTERNAL_ACCOUNT_PASSWORD_RESET")] + ExternalAccountPasswordReset, + #[serde(rename = "EXTERNAL_GROUP_ADD")] + #[display("EXTERNAL_GROUP_ADD")] + ExternalGroupAdd, + #[serde(rename = "EXTERNAL_GROUP_REMOVE")] + #[display("EXTERNAL_GROUP_REMOVE")] + ExternalGroupRemove, + #[serde(rename = "EXTERNAL_SSO_GRANT")] + #[display("EXTERNAL_SSO_GRANT")] + ExternalSsoGrant, + #[serde(rename = "EXTERNAL_SSO_REVOKE")] + #[display("EXTERNAL_SSO_REVOKE")] + ExternalSsoRevoke, + #[serde(rename = "EXTERNAL_SSO_SIGNIN")] + #[display("EXTERNAL_SSO_SIGNIN")] + ExternalSsoSignin, + #[serde(rename = "RPASS_ITEM_SHARED")] + #[display("RPASS_ITEM_SHARED")] + RpassItemShared, + #[serde(rename = "RPASS_ITEM_UNSHARED")] + #[display("RPASS_ITEM_UNSHARED")] + RpassItemUnshared, + #[serde(rename = "RPASS_ITEM_USED")] + #[display("RPASS_ITEM_USED")] + RpassItemUsed, + #[serde(rename = "USER_LOGIN_SUCCESS")] + #[display("USER_LOGIN_SUCCESS")] + UserLoginSuccess, + #[serde(rename = "USER_LOGIN_FAILED")] + #[display("USER_LOGIN_FAILED")] + UserLoginFailed, + #[serde(rename = "ACCOUNT_PASSWORD_RESET")] + #[display("ACCOUNT_PASSWORD_RESET")] + AccountPasswordReset, + #[serde(rename = "ACCOUNT_PASSWORD_CHANGED")] + #[display("ACCOUNT_PASSWORD_CHANGED")] + AccountPasswordChanged, + #[serde(rename = "TWO_FACTOR_DEVICE_RESET")] + #[display("TWO_FACTOR_DEVICE_RESET")] + TwoFactorDeviceReset, + #[serde(rename = "EXTERNAL_GROUP_MEMBER_REMOVE")] + #[display("EXTERNAL_GROUP_MEMBER_REMOVE")] + ExternalGroupMemberRemove, +} + +#[doc = "ENUM value for the type of actor."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum InitiatorType { + #[serde(rename = "ROLE")] + #[display("ROLE")] + Role, + #[serde(rename = "SYSTEM")] + #[display("SYSTEM")] + System, + #[serde(rename = "EXTERNAL")] + #[display("EXTERNAL")] + External, +} + +#[doc = "The actor of the event."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Initiator { + #[doc = "ENUM value for the type of actor."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "A unique identifier for the employee that initiated the action, if the type is ROLE."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option, + #[doc = "The name used within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The icon used within Rippling."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icon: Option, +} + +impl std::fmt::Display for Initiator { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Initiator { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(role) = &self.role { + format!("{:?}", role).into() + } else { + String::new().into() + }, + if let Some(display_name) = &self.display_name { + format!("{:?}", display_name).into() + } else { + String::new().into() + }, + if let Some(icon) = &self.icon { + format!("{:?}", icon).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "type_".into(), + "role".into(), + "display_name".into(), + "icon".into(), + ] + } +} + +#[doc = "Reason for the event, tied to the type of eveent."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct EventReason { + #[doc = "Reason for the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[doc = "Message of the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +impl std::fmt::Display for EventReason { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for EventReason { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(reason) = &self.reason { + format!("{:?}", reason).into() + } else { + String::new().into() + }, + if let Some(message) = &self.message { + format!("{:?}", message).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["reason".into(), "message".into()] + } +} + +#[doc = "The event model for company activity.\n\nPlease note, the event type can be one of the \ + following:\n\n- EXTERNAL_ACCONT_CREATE\n- EXTERNAL_ACCOUNT_INVITE\n- \ + EXTERNAL_ACCOUNT_DELETE\n- EXTERNAL_ACCOUNT_SUSPEND\n- EXTERNAL_ACCOUNT_PASSWORD_RESET\n- \ + EXTERNAL_GROUP_ADD\n- EXTERNAL_GROUP_REMOVE\n- EXTERNAL_GROUP_MEMBER_REMOVE\n- \ + EXTERNAL_GROUP_MEMBER_ADD\n- EXTERNAL_SSO_GRANT\n- EXTERNAL_SSO_REVOKE\n- \ + EXTERNAL_SSO_SIGNIN\n- RPASS_ITEM_SHARED\n- RPASS_ITEM_UNSHARED\n- RPASS_ITEM_USED\n- \ + USER_LOGIN_SUCCESS\n- USER_LOGIN_FAILED\n- ACCOUNT_PASSWORD_RESET\n- \ + ACCOUNT_PASSWORD_CHANGED\n- TWO_FACTOR_DEVICE_RESET\n"] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Event { + #[doc = "Unique identifier of the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[doc = "Geographic details from where the event was recorded."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub request_data: Option, + #[doc = "An array of event identifiers that are linked to the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub linked_events: Option>, + #[doc = "The list of objects of the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub subjects: Option>>, + #[doc = "An ENUM value for the type of the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event_type: Option, + #[doc = "Timestamp at which the event was recorded."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timestamp: Option, + #[doc = "Unique identifier for the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub company: Option, + #[doc = "Unique identifier for the external application for which the event was recorded. \ + This will be Null for events that don't correspond to an external appliction (e.g. \ + Rippling system and RPass events)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub spoke: Option, + #[doc = "The actor of the event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub initiator: Option, + #[doc = "Reason for the event, tied to the type of eveent."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub event_reason: Option, + #[doc = "Display name for the event, tied to the type of event."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl std::fmt::Display for Event { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Event { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(request_data) = &self.request_data { + format!("{:?}", request_data).into() + } else { + String::new().into() + }, + if let Some(linked_events) = &self.linked_events { + format!("{:?}", linked_events).into() + } else { + String::new().into() + }, + if let Some(subjects) = &self.subjects { + format!("{:?}", subjects).into() + } else { + String::new().into() + }, + if let Some(event_type) = &self.event_type { + format!("{:?}", event_type).into() + } else { + String::new().into() + }, + if let Some(timestamp) = &self.timestamp { + format!("{:?}", timestamp).into() + } else { + String::new().into() + }, + if let Some(company) = &self.company { + format!("{:?}", company).into() + } else { + String::new().into() + }, + if let Some(spoke) = &self.spoke { + format!("{:?}", spoke).into() + } else { + String::new().into() + }, + if let Some(initiator) = &self.initiator { + format!("{:?}", initiator).into() + } else { + String::new().into() + }, + if let Some(event_reason) = &self.event_reason { + format!("{:?}", event_reason).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "request_data".into(), + "linked_events".into(), + "subjects".into(), + "event_type".into(), + "timestamp".into(), + "company".into(), + "spoke".into(), + "initiator".into(), + "event_reason".into(), + "name".into(), + ] + } +} + +#[doc = "CustomField."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CustomField { + #[serde( + rename = "customFieldTitle1", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_field_title_1: Option, + #[serde( + rename = "customFieldTitleN", + default, + skip_serializing_if = "Option::is_none" + )] + pub custom_field_title_n: Option, +} + +impl std::fmt::Display for CustomField { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CustomField { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(custom_field_title_1) = &self.custom_field_title_1 { + format!("{:?}", custom_field_title_1).into() + } else { + String::new().into() + }, + if let Some(custom_field_title_n) = &self.custom_field_title_n { + format!("{:?}", custom_field_title_n).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["custom_field_title_1".into(), "custom_field_title_n".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct EntityInfo { + #[doc = "The legal name of the entity"] + #[serde(rename = "legalName", default, skip_serializing_if = "Option::is_none")] + pub legal_name: Option, + #[doc = "The Canada Business Number"] + #[serde( + rename = "businessNumber", + default, + skip_serializing_if = "Option::is_none" + )] + pub business_number: Option, +} + +impl std::fmt::Display for EntityInfo { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for EntityInfo { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(legal_name) = &self.legal_name { + format!("{:?}", legal_name).into() + } else { + String::new().into() + }, + if let Some(business_number) = &self.business_number { + format!("{:?}", business_number).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["legal_name".into(), "business_number".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Ca { + #[doc = "The unique Rippling ID of the legal entity"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde( + rename = "entityInfo", + default, + skip_serializing_if = "Option::is_none" + )] + pub entity_info: Option, + #[doc = "If set to true, the legal entity is Rippling's EOR. If set to false, the legal \ + entity is not on Rippling's EOR."] + #[serde(rename = "isEor", default, skip_serializing_if = "Option::is_none")] + pub is_eor: Option, +} + +impl std::fmt::Display for Ca { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Ca { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(id) = &self.id { + format!("{:?}", id).into() + } else { + String::new().into() + }, + if let Some(entity_info) = &self.entity_info { + format!("{:?}", entity_info).into() + } else { + String::new().into() + }, + if let Some(is_eor) = &self.is_eor { + format!("{:?}", is_eor).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "entity_info".into(), "is_eor".into()] + } +} + +#[doc = "This model represents the legal entities inside of a given company. Legal entities based \ + in Canada (CA) are currently supported at this time."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Entities { + #[doc = "CA represents Canada."] + #[serde(rename = "CA", default, skip_serializing_if = "Option::is_none")] + pub ca: Option>, +} + +impl std::fmt::Display for Entities { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Entities { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(ca) = &self.ca { + format!("{:?}", ca).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["ca".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PostGroupsRequestBody { + #[doc = "User-readable name of the group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The unique ID for the group, this can be the unique identifier for the group entity \ + object within your application."] + #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] + pub spoke_id: Option, + #[doc = "An array of Rippling IDs that will be in the group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub users: Option>, +} + +impl std::fmt::Display for PostGroupsRequestBody { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PostGroupsRequestBody { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(spoke_id) = &self.spoke_id { + format!("{:?}", spoke_id).into() + } else { + String::new().into() + }, + if let Some(users) = &self.users { + format!("{:?}", users).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "spoke_id".into(), "users".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PostLeaveRequestsRequestBody { + #[doc = "Unique identifier of the employee who is taking leave."] + pub role: String, + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option, + #[doc = "The status to create the leave request in. Only TILT managed requests can take a \ + status other than PENDING."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "startDate")] + pub start_date: String, + #[serde(rename = "endDate")] + pub end_date: String, + #[serde( + rename = "startDateStartTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_start_time: Option, + #[serde( + rename = "endDateEndTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_end_time: Option, + #[serde( + rename = "startDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_custom_hours: Option, + #[serde( + rename = "endDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_custom_hours: Option, + #[doc = "Unique identifier of the company leave type"] + #[serde(rename = "companyLeaveType")] + pub company_leave_type: String, + #[doc = "Unique identifier of the leave policy. Required if request is not managed by TILT"] + #[serde(rename = "leavePolicy")] + pub leave_policy: String, + #[serde( + rename = "reasonForLeave", + default, + skip_serializing_if = "Option::is_none" + )] + pub reason_for_leave: Option, + #[doc = "String identifier for third party that manages this leave request. This may be null."] + #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")] + pub managed_by: Option, + #[doc = "Object id for corresponding leave obejct in third party system. This may be null."] + #[serde( + rename = "externalId", + default, + skip_serializing_if = "Option::is_none" + )] + pub external_id: Option, +} + +impl std::fmt::Display for PostLeaveRequestsRequestBody { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PostLeaveRequestsRequestBody { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + self.role.clone().into(), + if let Some(requested_by) = &self.requested_by { + format!("{:?}", requested_by).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + self.start_date.clone().into(), + self.end_date.clone().into(), + if let Some(start_date_start_time) = &self.start_date_start_time { + format!("{:?}", start_date_start_time).into() + } else { + String::new().into() + }, + if let Some(end_date_end_time) = &self.end_date_end_time { + format!("{:?}", end_date_end_time).into() + } else { + String::new().into() + }, + if let Some(start_date_custom_hours) = &self.start_date_custom_hours { + format!("{:?}", start_date_custom_hours).into() + } else { + String::new().into() + }, + if let Some(end_date_custom_hours) = &self.end_date_custom_hours { + format!("{:?}", end_date_custom_hours).into() + } else { + String::new().into() + }, + self.company_leave_type.clone().into(), + self.leave_policy.clone().into(), + if let Some(reason_for_leave) = &self.reason_for_leave { + format!("{:?}", reason_for_leave).into() + } else { + String::new().into() + }, + if let Some(managed_by) = &self.managed_by { + format!("{:?}", managed_by).into() + } else { + String::new().into() + }, + if let Some(external_id) = &self.external_id { + format!("{:?}", external_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "role".into(), + "requested_by".into(), + "status".into(), + "start_date".into(), + "end_date".into(), + "start_date_start_time".into(), + "end_date_end_time".into(), + "start_date_custom_hours".into(), + "end_date_custom_hours".into(), + "company_leave_type".into(), + "leave_policy".into(), + "reason_for_leave".into(), + "managed_by".into(), + "external_id".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct GetLeaveBalancesResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option, + #[doc = "Leave balances object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub balances: Option, +} + +impl std::fmt::Display for GetLeaveBalancesResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for GetLeaveBalancesResponse { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(role) = &self.role { + format!("{:?}", role).into() + } else { + String::new().into() + }, + if let Some(balances) = &self.balances { + format!("{:?}", balances).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["role".into(), "balances".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct GetLeaveBalanceResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub role: Option, + #[doc = "Leave balances object"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub balances: Option, +} + +impl std::fmt::Display for GetLeaveBalanceResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for GetLeaveBalanceResponse { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(role) = &self.role { + format!("{:?}", role).into() + } else { + String::new().into() + }, + if let Some(balances) = &self.balances { + format!("{:?}", balances).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["role".into(), "balances".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Data { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub events: Option>, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next: Option, +} + +impl std::fmt::Display for Data { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Data { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(events) = &self.events { + format!("{:?}", events).into() + } else { + String::new().into() + }, + if let Some(next) = &self.next { + format!("{:?}", next).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["events".into(), "next".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct GetCompanyActivityResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub data: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl std::fmt::Display for GetCompanyActivityResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for GetCompanyActivityResponse { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(data) = &self.data { + format!("{:?}", data).into() + } else { + String::new().into() + }, + if let Some(error) = &self.error { + format!("{:?}", error).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["data".into(), "error".into()] + } +} + +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Action { + #[serde(rename = "approve")] + #[display("approve")] + Approve, + #[serde(rename = "decline")] + #[display("decline")] + Decline, +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PatchLeaveRequestsLeaveRequestIdRequestBody { + #[serde( + rename = "requestedBy", + default, + skip_serializing_if = "Option::is_none" + )] + pub requested_by: Option, + #[doc = "Change the status of a request. This is only possible for TILT managed requests."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[serde( + rename = "startDateStartTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_start_time: Option, + #[serde( + rename = "endDateEndTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_end_time: Option, + #[serde( + rename = "startDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_date_custom_hours: Option, + #[serde( + rename = "endDateCustomHours", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_date_custom_hours: Option, + #[doc = "Updated reason for leave request. This may be updated even for an APPROVED request."] + #[serde( + rename = "reasonForLeave", + default, + skip_serializing_if = "Option::is_none" + )] + pub reason_for_leave: Option, +} + +impl std::fmt::Display for PatchLeaveRequestsLeaveRequestIdRequestBody { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PatchLeaveRequestsLeaveRequestIdRequestBody { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + if let Some(requested_by) = &self.requested_by { + format!("{:?}", requested_by).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(start_date_start_time) = &self.start_date_start_time { + format!("{:?}", start_date_start_time).into() + } else { + String::new().into() + }, + if let Some(end_date_end_time) = &self.end_date_end_time { + format!("{:?}", end_date_end_time).into() + } else { + String::new().into() + }, + if let Some(start_date_custom_hours) = &self.start_date_custom_hours { + format!("{:?}", start_date_custom_hours).into() + } else { + String::new().into() + }, + if let Some(end_date_custom_hours) = &self.end_date_custom_hours { + format!("{:?}", end_date_custom_hours).into() + } else { + String::new().into() + }, + if let Some(reason_for_leave) = &self.reason_for_leave { + format!("{:?}", reason_for_leave).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "requested_by".into(), + "status".into(), + "start_date".into(), + "end_date".into(), + "start_date_start_time".into(), + "end_date_end_time".into(), + "start_date_custom_hours".into(), + "end_date_custom_hours".into(), + "reason_for_leave".into(), + ] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct AppHandleId { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub app_user_name: Option, +} + +impl std::fmt::Display for AppHandleId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for AppHandleId { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(app_user_name) = &self.app_user_name { + format!("{:?}", app_user_name).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["app_user_name".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Results { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rippling_employee_id: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub app_handle_id: Option, +} + +impl std::fmt::Display for Results { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Results { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(rippling_employee_id) = &self.rippling_employee_id { + format!("{:?}", rippling_employee_id).into() + } else { + String::new().into() + }, + if let Some(app_handle_id) = &self.app_handle_id { + format!("{:?}", app_handle_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["rippling_employee_id".into(), "app_handle_id".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct GetAppAppMatchingUsersResponse { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option>, +} + +impl std::fmt::Display for GetAppAppMatchingUsersResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for GetAppAppMatchingUsersResponse { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(results) = &self.results { + format!("{:?}", results).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["results".into()] + } +} + +#[doc = "PostMarkAppInstalledResponse."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PostMarkAppInstalledResponse { + pub ok: bool, +} + +impl std::fmt::Display for PostMarkAppInstalledResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PostMarkAppInstalledResponse { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![format!("{:?}", self.ok).into()] + } + + fn headers() -> Vec> { + vec!["ok".into()] + } +} diff --git a/rippling-beta/src/utils.rs b/rippling-base/src/utils.rs similarity index 100% rename from rippling-beta/src/utils.rs rename to rippling-base/src/utils.rs diff --git a/rippling-beta/README.md b/rippling-beta/README.md deleted file mode 100644 index d669b22..0000000 --- a/rippling-beta/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# `rippling-beta-api` - -A fully generated & opinionated API client for the Rippling Beta API. - -[![docs.rs](https://docs.rs/rippling-beta-api/badge.svg)](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(); -``` diff --git a/rippling-beta/rippling-beta-api.rs.patch.json b/rippling-beta/rippling-beta-api.rs.patch.json deleted file mode 100644 index b1b8d35..0000000 --- a/rippling-beta/rippling-beta-api.rs.patch.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "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`\n/// - `order_by: Option`\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`\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`\n/// - `order_by: Option`\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`\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`\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`\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`\n/// - `order_by: Option`\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`\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`\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`\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`\n/// - `filter: Option`\n/// - `order_by: Option`\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`\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" - } - } -] \ No newline at end of file diff --git a/rippling-beta/src/companies.rs b/rippling-beta/src/companies.rs deleted file mode 100644 index f89a2db..0000000 --- a/rippling-beta/src/companies.rs +++ /dev/null @@ -1,55 +0,0 @@ -use anyhow::Result; - -use crate::Client; -#[derive(Clone, Debug)] -pub struct Companies { - pub client: Client, -} - -impl Companies { - #[doc(hidden)] - pub fn new(client: Client) -> Self { - Self { client } - } - - #[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`\n- `order_by: Option`\n\n```rust,no_run\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```"] - #[tracing::instrument] - pub async fn list<'a>( - &'a self, - expand: Option, - order_by: Option, - ) -> Result { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "companies"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = expand { - query_params.push(("expand", p)); - } - - if let Some(p) = order_by { - query_params.push(("order_by", p)); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } -} diff --git a/rippling-beta/src/types.rs b/rippling-beta/src/types.rs deleted file mode 100644 index c743651..0000000 --- a/rippling-beta/src/types.rs +++ /dev/null @@ -1,15563 +0,0 @@ -#![doc = r" This module contains the generated types for the library."] -pub mod base64 { - #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"] - #![doc = " base64 implementations to account for various clients and libraries. Compatible"] - #![doc = " with serde and JsonSchema."] - use std::{convert::TryFrom, fmt}; - - use serde::{ - de::{Error, Unexpected, Visitor}, - Deserialize, Deserializer, Serialize, Serializer, - }; - static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[ - data_encoding::BASE64, - data_encoding::BASE64URL, - data_encoding::BASE64URL_NOPAD, - data_encoding::BASE64_MIME, - data_encoding::BASE64_NOPAD, - ]; - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"] - #[doc = " when deserializing, will decode from many different types of base64 possible."] - pub struct Base64Data(pub Vec); - impl Base64Data { - #[doc = " Return is the data is empty."] - pub fn is_empty(&self) -> bool { - self.0.is_empty() - } - } - - impl fmt::Display for Base64Data { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0)) - } - } - - impl From for Vec { - fn from(data: Base64Data) -> Vec { - data.0 - } - } - - impl From> for Base64Data { - fn from(data: Vec) -> Base64Data { - Base64Data(data) - } - } - - impl AsRef<[u8]> for Base64Data { - fn as_ref(&self) -> &[u8] { - &self.0 - } - } - - impl TryFrom<&str> for Base64Data { - type Error = anyhow::Error; - fn try_from(v: &str) -> Result { - for config in ALLOWED_DECODING_FORMATS { - if let Ok(data) = config.decode(v.as_bytes()) { - return Ok(Base64Data(data)); - } - } - anyhow::bail!("Could not decode base64 data: {}", v); - } - } - - struct Base64DataVisitor; - impl<'de> Visitor<'de> for Base64DataVisitor { - type Value = Base64Data; - fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { - write!(formatter, "a base64 encoded string") - } - - fn visit_str(self, v: &str) -> Result - where - E: Error, - { - for config in ALLOWED_DECODING_FORMATS { - if let Ok(data) = config.decode(v.as_bytes()) { - return Ok(Base64Data(data)); - } - } - Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self)) - } - } - - impl<'de> Deserialize<'de> for Base64Data { - fn deserialize(deserializer: D) -> Result>::Error> - where - D: Deserializer<'de>, - { - deserializer.deserialize_str(Base64DataVisitor) - } - } - - impl Serialize for Base64Data { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0); - serializer.serialize_str(&encoded) - } - } - - impl schemars::JsonSchema for Base64Data { - fn schema_name() -> String { - "Base64Data".to_string() - } - - fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { - let mut obj = gen.root_schema_for::().schema; - obj.format = Some("byte".to_string()); - schemars::schema::Schema::Object(obj) - } - - fn is_referenceable() -> bool { - false - } - } - - #[cfg(test)] - mod tests { - use std::convert::TryFrom; - - use super::Base64Data; - #[test] - fn test_base64_try_from() { - assert!(Base64Data::try_from("aGVsbG8=").is_ok()); - assert!(Base64Data::try_from("abcdefghij").is_err()); - } - } -} - -#[cfg(feature = "requests")] -pub mod multipart { - #![doc = " Multipart form data types."] - #[doc = " An attachement to a multipart form."] - #[derive(Debug, Clone, PartialEq, Eq, Hash)] - pub struct Attachment { - #[doc = " The name of the field."] - pub name: String, - #[doc = " The filename of the attachment."] - pub filename: Option, - #[doc = " The content type of the attachment."] - pub content_type: Option, - #[doc = " The data of the attachment."] - pub data: Vec, - } - - impl std::convert::TryFrom for reqwest::multipart::Part { - type Error = reqwest::Error; - fn try_from(attachment: Attachment) -> Result { - let mut part = reqwest::multipart::Part::bytes(attachment.data); - if let Some(filename) = attachment.filename { - part = part.file_name(filename); - } - if let Some(content_type) = attachment.content_type { - part = part.mime_str(&content_type)?; - } - Ok(part) - } - } - - impl std::convert::TryFrom for Attachment { - type Error = std::io::Error; - fn try_from(path: std::path::PathBuf) -> Result { - let filename = path - .file_name() - .ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") - })? - .to_str() - .ok_or_else(|| { - std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename") - })? - .to_string(); - let content_type = mime_guess::from_path(&path).first_raw(); - let data = std::fs::read(path)?; - Ok(Attachment { - name: "file".to_string(), - filename: Some(filename), - content_type: content_type.map(|s| s.to_string()), - data, - }) - } - } -} - -#[cfg(feature = "requests")] -pub mod paginate { - #![doc = " Utility functions used for pagination."] - use anyhow::Result; - #[doc = " A trait for types that allow pagination."] - pub trait Pagination { - #[doc = " The item that is paginated."] - type Item: serde::de::DeserializeOwned; - #[doc = " Returns true if the response has more pages."] - fn has_more_pages(&self) -> bool; - #[doc = " Returns the next page token."] - fn next_page_token(&self) -> Option; - #[doc = " Modify a request to get the next page."] - fn next_page( - &self, - req: reqwest::Request, - ) -> Result; - #[doc = " Get the items from a page."] - fn items(&self) -> Vec; - } -} - -pub mod phone_number { - #![doc = " A library to implement phone numbers for our database and JSON serialization and \ - deserialization."] - use std::str::FromStr; - - use schemars::JsonSchema; - #[doc = " A phone number."] - #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)] - pub struct PhoneNumber(pub Option); - impl From for PhoneNumber { - fn from(id: phonenumber::PhoneNumber) -> PhoneNumber { - PhoneNumber(Some(id)) - } - } - - impl AsRef> for PhoneNumber { - fn as_ref(&self) -> &Option { - &self.0 - } - } - - impl std::ops::Deref for PhoneNumber { - type Target = Option; - fn deref(&self) -> &Self::Target { - &self.0 - } - } - - impl serde::ser::Serialize for PhoneNumber { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - serializer.serialize_str(&self.to_string()) - } - } - - impl<'de> serde::de::Deserialize<'de> for PhoneNumber { - fn deserialize(deserializer: D) -> Result - where - D: serde::de::Deserializer<'de>, - { - let s = String::deserialize(deserializer).unwrap_or_default(); - PhoneNumber::from_str(&s).map_err(serde::de::Error::custom) - } - } - - impl std::str::FromStr for PhoneNumber { - type Err = anyhow::Error; - fn from_str(s: &str) -> Result { - if s.trim().is_empty() { - return Ok(PhoneNumber(None)); - } - let s = if !s.trim().starts_with('+') { - format!("+1{s}") - } else { - s.to_string() - } - .replace(['-', '(', ')', ' '], ""); - Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err( - |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e), - )?))) - } - } - - impl std::fmt::Display for PhoneNumber { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let s = if let Some(phone) = &self.0 { - phone - .format() - .mode(phonenumber::Mode::International) - .to_string() - } else { - String::new() - }; - write!(f, "{}", s) - } - } - - impl JsonSchema for PhoneNumber { - fn schema_name() -> String { - "PhoneNumber".to_string() - } - - fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { - let mut obj = gen.root_schema_for::().schema; - obj.format = Some("phone".to_string()); - schemars::schema::Schema::Object(obj) - } - - fn is_referenceable() -> bool { - false - } - } - - #[cfg(test)] - mod test { - use pretty_assertions::assert_eq; - - use super::PhoneNumber; - #[test] - fn test_parse_phone_number() { - let mut phone = "+1-555-555-5555"; - let mut phone_parsed: PhoneNumber = - serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); - assert_eq!(phone_parsed, expected); - let mut expected_str = "+1 555-555-5555"; - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = "555-555-5555"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - assert_eq!(phone_parsed, expected); - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = "+1 555-555-5555"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - assert_eq!(phone_parsed, expected); - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = "5555555555"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - assert_eq!(phone_parsed, expected); - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = "(510) 864-1234"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap())); - assert_eq!(phone_parsed, expected); - expected_str = "+1 510-864-1234"; - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = "(510)8641234"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - assert_eq!(phone_parsed, expected); - expected_str = "+1 510-864-1234"; - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - phone = ""; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - assert_eq!(phone_parsed, PhoneNumber(None)); - assert_eq!("", serde_json::json!(phone_parsed)); - phone = "+49 30 1234 1234"; - phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap(); - expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap())); - assert_eq!(phone_parsed, expected); - expected_str = "+49 30 12341234"; - assert_eq!(expected_str, serde_json::json!(phone_parsed)); - } - } -} - -#[cfg(feature = "requests")] -pub mod error { - #![doc = " Error methods."] - #[doc = " Error produced by generated client methods."] - pub enum Error { - #[doc = " The request did not conform to API requirements."] - InvalidRequest(String), - #[cfg(feature = "retry")] - #[doc = " A server error either due to the data, or with the connection."] - CommunicationError(reqwest_middleware::Error), - #[doc = " A request error, caused when building the request."] - RequestError(reqwest::Error), - #[doc = " An expected response whose deserialization failed."] - SerdeError { - #[doc = " The error."] - error: format_serde_error::SerdeError, - #[doc = " The response status."] - status: reqwest::StatusCode, - }, - #[doc = " An expected error response."] - InvalidResponsePayload { - #[cfg(feature = "retry")] - #[doc = " The error."] - error: reqwest_middleware::Error, - #[cfg(not(feature = "retry"))] - #[doc = " The error."] - error: reqwest::Error, - #[doc = " The full response."] - response: reqwest::Response, - }, - #[doc = " An error from the server."] - Server { - #[doc = " The text from the body."] - body: String, - #[doc = " The response status."] - status: reqwest::StatusCode, - }, - #[doc = " A response not listed in the API description. This may represent a"] - #[doc = " success or failure response; check `status().is_success()`."] - UnexpectedResponse(reqwest::Response), - } - - impl Error { - #[doc = " Returns the status code, if the error was generated from a response."] - pub fn status(&self) -> Option { - match self { - Error::InvalidRequest(_) => None, - Error::RequestError(e) => e.status(), - #[cfg(feature = "retry")] - Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(), - #[cfg(feature = "retry")] - Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None, - Error::SerdeError { error: _, status } => Some(*status), - Error::InvalidResponsePayload { error: _, response } => Some(response.status()), - Error::Server { body: _, status } => Some(*status), - Error::UnexpectedResponse(r) => Some(r.status()), - } - } - - #[doc = " Creates a new error from a response status and a serde error."] - pub fn from_serde_error( - e: format_serde_error::SerdeError, - status: reqwest::StatusCode, - ) -> Self { - Self::SerdeError { error: e, status } - } - } - - #[cfg(feature = "retry")] - impl From for Error { - fn from(e: reqwest_middleware::Error) -> Self { - Self::CommunicationError(e) - } - } - - impl From for Error { - fn from(e: reqwest::Error) -> Self { - Self::RequestError(e) - } - } - - impl From for Error { - fn from(e: serde_json::Error) -> Self { - Self::SerdeError { - error: format_serde_error::SerdeError::new(String::new(), e), - status: reqwest::StatusCode::INTERNAL_SERVER_ERROR, - } - } - } - - impl std::fmt::Display for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Error::InvalidRequest(s) => { - write!(f, "Invalid Request: {}", s) - } - #[cfg(feature = "retry")] - Error::CommunicationError(e) => { - write!(f, "Communication Error: {}", e) - } - Error::RequestError(e) => { - write!(f, "Request Error: {}", e) - } - Error::SerdeError { error, status: _ } => { - write!(f, "Serde Error: {}", error) - } - Error::InvalidResponsePayload { error, response: _ } => { - write!(f, "Invalid Response Payload: {}", error) - } - Error::Server { body, status } => { - write!(f, "Server Error: {} {}", status, body) - } - Error::UnexpectedResponse(r) => { - write!(f, "Unexpected Response: {:?}", r) - } - } - } - } - - impl std::fmt::Debug for Error { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::fmt::Display::fmt(self, f) - } - } - - impl std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - #[cfg(feature = "retry")] - Error::CommunicationError(e) => Some(e), - Error::SerdeError { error, status: _ } => Some(error), - Error::InvalidResponsePayload { error, response: _ } => Some(error), - _ => None, - } - } - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Meta { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub redacted_fields: Option>, -} - -impl std::fmt::Display for Meta { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Meta { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(redacted_fields) = &self.redacted_fields { - format!("{:?}", redacted_fields).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["redacted_fields".into()] - } -} - -#[doc = "Meta information for the response."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct MetaResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, -} - -impl std::fmt::Display for MetaResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for MetaResponse { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["meta".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct RedactedFieldsRedactedFields { - #[doc = "The name for the redacted field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The reason for the redaction"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, -} - -impl std::fmt::Display for RedactedFieldsRedactedFields { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for RedactedFieldsRedactedFields { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(reason) = &self.reason { - format!("{:?}", reason).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "reason".into()] - } -} - -#[doc = "A list of redacted fields."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct RedactedFields { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub redacted_fields: Option>, -} - -impl std::fmt::Display for RedactedFields { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for RedactedFields { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(redacted_fields) = &self.redacted_fields { - format!("{:?}", redacted_fields).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["redacted_fields".into()] - } -} - -#[doc = "Info about the redacted fields."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct RedactedField { - #[doc = "The name for the redacted field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The reason for the redaction"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, -} - -impl std::fmt::Display for RedactedField { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for RedactedField { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(reason) = &self.reason { - format!("{:?}", reason).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "reason".into()] - } -} - -#[doc = "The status of the leave request."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Status { - #[serde(rename = "PENDING")] - #[display("PENDING")] - Pending, - #[serde(rename = "APPROVED")] - #[display("APPROVED")] - Approved, - #[serde(rename = "REJECTED")] - #[display("REJECTED")] - Rejected, - #[serde(rename = "CANCELED")] - #[display("CANCELED")] - Canceled, -} - -#[doc = "LeaveRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct LeaveRequest { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The ID of the worker associated with the leave request."] - pub worker_id: String, - #[doc = "The worker associated with the leave request.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub worker: Option, - #[doc = "The ID of the worker who requested the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requester_id: Option, - #[doc = "The worker who requested the leave request.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requester: Option, - #[doc = "The status of the leave request."] - pub status: Status, - #[doc = "The start time of the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The comments associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option, - #[doc = "The number of minutes requested for the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number_of_minutes_requested: Option, - #[doc = "The ID of the leave policy associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub leave_policy_id: Option, - #[doc = "The ID of the leave type associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub leave_type_id: Option, - #[doc = "The leave type associated with the leave request.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub leave_type: Option, - #[doc = "The reason for the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason_for_leave: Option, - #[doc = "The ID of the worker who reviewed the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reviewer_id: Option, - #[doc = "The worker who reviewed the leave request.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reviewer: Option, - #[doc = "The timestamp the leave request was reviewed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reviewed_at: Option, - #[doc = "The specific dates taken off and the amount of time taken off for each one."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub days_take_off: Option, - #[doc = "Whether the leave request is managed by an external system."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_managed_by_external_system: Option, -} - -impl std::fmt::Display for LeaveRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for LeaveRequest { - const LENGTH: usize = 21; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.worker_id.clone().into(), - if let Some(worker) = &self.worker { - format!("{:?}", worker).into() - } else { - String::new().into() - }, - if let Some(requester_id) = &self.requester_id { - format!("{:?}", requester_id).into() - } else { - String::new().into() - }, - if let Some(requester) = &self.requester { - format!("{:?}", requester).into() - } else { - String::new().into() - }, - format!("{:?}", self.status).into(), - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(comments) = &self.comments { - format!("{:?}", comments).into() - } else { - String::new().into() - }, - if let Some(number_of_minutes_requested) = &self.number_of_minutes_requested { - format!("{:?}", number_of_minutes_requested).into() - } else { - String::new().into() - }, - if let Some(leave_policy_id) = &self.leave_policy_id { - format!("{:?}", leave_policy_id).into() - } else { - String::new().into() - }, - if let Some(leave_type_id) = &self.leave_type_id { - format!("{:?}", leave_type_id).into() - } else { - String::new().into() - }, - if let Some(leave_type) = &self.leave_type { - format!("{:?}", leave_type).into() - } else { - String::new().into() - }, - if let Some(reason_for_leave) = &self.reason_for_leave { - format!("{:?}", reason_for_leave).into() - } else { - String::new().into() - }, - if let Some(reviewer_id) = &self.reviewer_id { - format!("{:?}", reviewer_id).into() - } else { - String::new().into() - }, - if let Some(reviewer) = &self.reviewer { - format!("{:?}", reviewer).into() - } else { - String::new().into() - }, - if let Some(reviewed_at) = &self.reviewed_at { - format!("{:?}", reviewed_at).into() - } else { - String::new().into() - }, - if let Some(days_take_off) = &self.days_take_off { - format!("{:?}", days_take_off).into() - } else { - String::new().into() - }, - if let Some(is_managed_by_external_system) = &self.is_managed_by_external_system { - format!("{:?}", is_managed_by_external_system).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "worker_id".into(), - "worker".into(), - "requester_id".into(), - "requester".into(), - "status".into(), - "start_time".into(), - "end_time".into(), - "comments".into(), - "number_of_minutes_requested".into(), - "leave_policy_id".into(), - "leave_type_id".into(), - "leave_type".into(), - "reason_for_leave".into(), - "reviewer_id".into(), - "reviewer".into(), - "reviewed_at".into(), - "days_take_off".into(), - "is_managed_by_external_system".into(), - ] - } -} - -#[doc = "LeaveRequestRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct LeaveRequestRequest { - #[doc = "The ID of the worker associated with the leave request."] - pub worker_id: String, - #[doc = "The ID of the worker who requested the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub requester_id: Option, - #[doc = "The status of the leave request."] - pub status: Status, - #[doc = "The start time of the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The comments associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option, - #[doc = "The number of minutes requested for the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number_of_minutes_requested: Option, - #[doc = "The ID of the leave policy associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub leave_policy_id: Option, - #[doc = "The ID of the leave type associated with the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub leave_type_id: Option, - #[doc = "The reason for the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason_for_leave: Option, - #[doc = "The ID of the worker who reviewed the leave request."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reviewer_id: Option, - #[doc = "The timestamp the leave request was reviewed."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reviewed_at: Option, - #[doc = "The specific dates taken off and the amount of time taken off for each one."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub days_take_off: Option, - #[doc = "Whether the leave request is managed by an external system."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_managed_by_external_system: Option, -} - -impl std::fmt::Display for LeaveRequestRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for LeaveRequestRequest { - const LENGTH: usize = 14; - fn fields(&self) -> Vec> { - vec![ - self.worker_id.clone().into(), - if let Some(requester_id) = &self.requester_id { - format!("{:?}", requester_id).into() - } else { - String::new().into() - }, - format!("{:?}", self.status).into(), - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(comments) = &self.comments { - format!("{:?}", comments).into() - } else { - String::new().into() - }, - if let Some(number_of_minutes_requested) = &self.number_of_minutes_requested { - format!("{:?}", number_of_minutes_requested).into() - } else { - String::new().into() - }, - if let Some(leave_policy_id) = &self.leave_policy_id { - format!("{:?}", leave_policy_id).into() - } else { - String::new().into() - }, - if let Some(leave_type_id) = &self.leave_type_id { - format!("{:?}", leave_type_id).into() - } else { - String::new().into() - }, - if let Some(reason_for_leave) = &self.reason_for_leave { - format!("{:?}", reason_for_leave).into() - } else { - String::new().into() - }, - if let Some(reviewer_id) = &self.reviewer_id { - format!("{:?}", reviewer_id).into() - } else { - String::new().into() - }, - if let Some(reviewed_at) = &self.reviewed_at { - format!("{:?}", reviewed_at).into() - } else { - String::new().into() - }, - if let Some(days_take_off) = &self.days_take_off { - format!("{:?}", days_take_off).into() - } else { - String::new().into() - }, - if let Some(is_managed_by_external_system) = &self.is_managed_by_external_system { - format!("{:?}", is_managed_by_external_system).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "worker_id".into(), - "requester_id".into(), - "status".into(), - "start_time".into(), - "end_time".into(), - "comments".into(), - "number_of_minutes_requested".into(), - "leave_policy_id".into(), - "leave_type_id".into(), - "reason_for_leave".into(), - "reviewer_id".into(), - "reviewed_at".into(), - "days_take_off".into(), - "is_managed_by_external_system".into(), - ] - } -} - -#[doc = "DayOff."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct DayOff { - #[doc = "The date of the day off."] - pub date: String, - #[doc = "The number of minutes taken off for the day."] - pub number_of_minutes_taken_off: f64, -} - -impl std::fmt::Display for DayOff { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for DayOff { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.date.clone().into(), - format!("{:?}", self.number_of_minutes_taken_off).into(), - ] - } - - fn headers() -> Vec> { - vec!["date".into(), "number_of_minutes_taken_off".into()] - } -} - -#[doc = "DayOffRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct DayOffRequest { - #[doc = "The date of the day off."] - pub date: String, - #[doc = "The number of minutes taken off for the day."] - pub number_of_minutes_taken_off: f64, -} - -impl std::fmt::Display for DayOffRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for DayOffRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.date.clone().into(), - format!("{:?}", self.number_of_minutes_taken_off).into(), - ] - } - - fn headers() -> Vec> { - vec!["date".into(), "number_of_minutes_taken_off".into()] - } -} - -#[doc = "The worker's country."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "The worker's status within the organization."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerStatus { - #[serde(rename = "HIRED")] - #[display("HIRED")] - Hired, - #[serde(rename = "ACCEPTED")] - #[display("ACCEPTED")] - Accepted, - #[serde(rename = "ACTIVE")] - #[display("ACTIVE")] - Active, - #[serde(rename = "TERMINATED")] - #[display("TERMINATED")] - Terminated, -} - -#[doc = "The gender of the worker, if specified."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Gender { - #[serde(rename = "MALE")] - #[display("MALE")] - Male, - #[serde(rename = "FEMALE")] - #[display("FEMALE")] - Female, - #[serde(rename = "NONBINARY")] - #[display("NONBINARY")] - Nonbinary, - #[serde(rename = "UNDETERMINED")] - #[display("UNDETERMINED")] - Undetermined, - #[serde(rename = "DIVERSE")] - #[display("DIVERSE")] - Diverse, - #[serde(rename = "DOES_NOT_APPLY")] - #[display("DOES_NOT_APPLY")] - DoesNotApply, -} - -#[doc = "The identified race of the worker, if specified."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Race { - #[serde(rename = "BLACK")] - #[display("BLACK")] - Black, - #[serde(rename = "BROWN")] - #[display("BROWN")] - Brown, - #[serde(rename = "CHINESE")] - #[display("CHINESE")] - Chinese, - #[serde(rename = "EURASIAN")] - #[display("EURASIAN")] - Eurasian, - #[serde(rename = "INDIAN")] - #[display("INDIAN")] - Indian, - #[serde(rename = "INDIGENOUS")] - #[display("INDIGENOUS")] - Indigenous, - #[serde(rename = "WHITE")] - #[display("WHITE")] - White, - #[serde(rename = "YELLOW")] - #[display("YELLOW")] - Yellow, - #[serde(rename = "NOT_INFORMED")] - #[display("NOT_INFORMED")] - NotInformed, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "The identified ethnicity of the worker, if specified."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Ethnicity { - #[serde(rename = "HISPANIC_OR_LATINO")] - #[display("HISPANIC_OR_LATINO")] - HispanicOrLatino, - #[serde(rename = "WHITE")] - #[display("WHITE")] - White, - #[serde(rename = "BLACK_OR_AFRICAN_AMERICAN")] - #[display("BLACK_OR_AFRICAN_AMERICAN")] - BlackOrAfricanAmerican, - #[serde(rename = "NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER")] - #[display("NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER")] - NativeHawaiianOrOtherPacificIslander, - #[serde(rename = "ASIAN")] - #[display("ASIAN")] - Asian, - #[serde(rename = "AMERICAN_INDIAN_OR_ALASKA_NATIVE")] - #[display("AMERICAN_INDIAN_OR_ALASKA_NATIVE")] - AmericanIndianOrAlaskaNative, - #[serde(rename = "TWO_OR_MORE_RACES")] - #[display("TWO_OR_MORE_RACES")] - TwoOrMoreRaces, - #[serde(rename = "DECLINE_TO_SELF_IDENTIFY")] - #[display("DECLINE_TO_SELF_IDENTIFY")] - DeclineToSelfIdentify, -} - -#[doc = "The countries that the worker has citizenship in."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Citizenship { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "Worker."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Worker { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The worker's associated user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[doc = "The worker's associated user.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user: Option, - #[doc = "The worker's associated legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_entity_id: Option, - #[doc = "The worker's associated legal entity.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_entity: Option, - #[doc = "The worker's country."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, - #[doc = "The start date of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[doc = "The end date of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[doc = "The worker's number within the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option, - #[doc = "The worker's associated work email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "The worker's associated personal email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub personal_email: Option, - #[doc = "The worker's status within the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The location that the worker is mapped to for tax purposes. In the case that a \ - worker is remote, the location's type is remote."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "The worker's employment type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub employment_type_id: Option, - #[doc = "The worker's employment type.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub employment_type: Option, - #[doc = "The gender of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gender: Option, - #[doc = "The worker's date of birth."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub date_of_birth: Option, - #[doc = "The identified race of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub race: Option, - #[doc = "The identified ethnicity of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ethnicity: Option, - #[doc = "The countries that the worker has citizenship in."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub citizenship: Option, - #[doc = "The compensation package for the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation_id: Option, - #[doc = "The compensation package for the worker.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation: Option, - #[doc = "The worker's assigned department."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub department_id: Option, - #[doc = "The worker's assigned department.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub department: Option, - #[doc = "The worker's assigned teams."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teams_id: Option, - #[doc = "The worker's assigned teams.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teams: Option, - #[doc = "The worker's title."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[doc = "The level of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level_id: Option, - #[doc = "The level of the worker.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "The details of the worker's termination, if applicable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub termination_details: Option, - #[doc = "Custom fields for the worker"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, -} - -impl std::fmt::Display for Worker { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Worker { - const LENGTH: usize = 33; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(user_id) = &self.user_id { - format!("{:?}", user_id).into() - } else { - String::new().into() - }, - if let Some(user) = &self.user { - format!("{:?}", user).into() - } else { - String::new().into() - }, - if let Some(legal_entity_id) = &self.legal_entity_id { - format!("{:?}", legal_entity_id).into() - } else { - String::new().into() - }, - if let Some(legal_entity) = &self.legal_entity { - format!("{:?}", legal_entity).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() - } else { - String::new().into() - }, - if let Some(number) = &self.number { - format!("{:?}", number).into() - } else { - String::new().into() - }, - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() - } else { - String::new().into() - }, - if let Some(personal_email) = &self.personal_email { - format!("{:?}", personal_email).into() - } else { - String::new().into() - }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(location) = &self.location { - format!("{:?}", location).into() - } else { - String::new().into() - }, - if let Some(employment_type_id) = &self.employment_type_id { - format!("{:?}", employment_type_id).into() - } else { - String::new().into() - }, - if let Some(employment_type) = &self.employment_type { - format!("{:?}", employment_type).into() - } else { - String::new().into() - }, - if let Some(gender) = &self.gender { - format!("{:?}", gender).into() - } else { - String::new().into() - }, - if let Some(date_of_birth) = &self.date_of_birth { - format!("{:?}", date_of_birth).into() - } else { - String::new().into() - }, - if let Some(race) = &self.race { - format!("{:?}", race).into() - } else { - String::new().into() - }, - if let Some(ethnicity) = &self.ethnicity { - format!("{:?}", ethnicity).into() - } else { - String::new().into() - }, - if let Some(citizenship) = &self.citizenship { - format!("{:?}", citizenship).into() - } else { - String::new().into() - }, - if let Some(compensation_id) = &self.compensation_id { - format!("{:?}", compensation_id).into() - } else { - String::new().into() - }, - if let Some(compensation) = &self.compensation { - format!("{:?}", compensation).into() - } else { - String::new().into() - }, - if let Some(department_id) = &self.department_id { - format!("{:?}", department_id).into() - } else { - String::new().into() - }, - if let Some(department) = &self.department { - format!("{:?}", department).into() - } else { - String::new().into() - }, - if let Some(teams_id) = &self.teams_id { - format!("{:?}", teams_id).into() - } else { - String::new().into() - }, - if let Some(teams) = &self.teams { - format!("{:?}", teams).into() - } else { - String::new().into() - }, - if let Some(title) = &self.title { - format!("{:?}", title).into() - } else { - String::new().into() - }, - if let Some(level_id) = &self.level_id { - format!("{:?}", level_id).into() - } else { - String::new().into() - }, - if let Some(level) = &self.level { - format!("{:?}", level).into() - } else { - String::new().into() - }, - if let Some(termination_details) = &self.termination_details { - format!("{:?}", termination_details).into() - } else { - String::new().into() - }, - if let Some(custom_fields) = &self.custom_fields { - format!("{:?}", custom_fields).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "user_id".into(), - "user".into(), - "legal_entity_id".into(), - "legal_entity".into(), - "country".into(), - "start_date".into(), - "end_date".into(), - "number".into(), - "work_email".into(), - "personal_email".into(), - "status".into(), - "location".into(), - "employment_type_id".into(), - "employment_type".into(), - "gender".into(), - "date_of_birth".into(), - "race".into(), - "ethnicity".into(), - "citizenship".into(), - "compensation_id".into(), - "compensation".into(), - "department_id".into(), - "department".into(), - "teams_id".into(), - "teams".into(), - "title".into(), - "level_id".into(), - "level".into(), - "termination_details".into(), - "custom_fields".into(), - ] - } -} - -#[doc = "The worker's country."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerRequestCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "The worker's status within the organization."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerRequestStatus { - #[serde(rename = "HIRED")] - #[display("HIRED")] - Hired, - #[serde(rename = "ACCEPTED")] - #[display("ACCEPTED")] - Accepted, - #[serde(rename = "ACTIVE")] - #[display("ACTIVE")] - Active, - #[serde(rename = "TERMINATED")] - #[display("TERMINATED")] - Terminated, -} - -#[doc = "WorkerRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct WorkerRequest { - #[doc = "The worker's associated user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[doc = "The worker's associated legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_entity_id: Option, - #[doc = "The worker's country."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, - #[doc = "The start date of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[doc = "The end date of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[doc = "The worker's number within the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub number: Option, - #[doc = "The worker's associated work email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "The worker's associated personal email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub personal_email: Option, - #[doc = "The worker's status within the organization."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The location that the worker is mapped to for tax purposes. In the case that a \ - worker is remote, the location's type is remote."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub location: Option, - #[doc = "The worker's employment type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub employment_type_id: Option, - #[doc = "The gender of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gender: Option, - #[doc = "The worker's date of birth."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub date_of_birth: Option, - #[doc = "The identified race of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub race: Option, - #[doc = "The identified ethnicity of the worker, if specified."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ethnicity: Option, - #[doc = "The countries that the worker has citizenship in."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub citizenship: Option, - #[doc = "The compensation package for the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation_id: Option, - #[doc = "The worker's assigned department."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub department_id: Option, - #[doc = "The worker's assigned teams."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teams_id: Option, - #[doc = "The worker's title."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[doc = "The level of the worker."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level_id: Option, - #[doc = "The details of the worker's termination, if applicable."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub termination_details: Option, -} - -impl std::fmt::Display for WorkerRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for WorkerRequest { - const LENGTH: usize = 22; - fn fields(&self) -> Vec> { - vec![ - if let Some(user_id) = &self.user_id { - format!("{:?}", user_id).into() - } else { - String::new().into() - }, - if let Some(legal_entity_id) = &self.legal_entity_id { - format!("{:?}", legal_entity_id).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() - } else { - String::new().into() - }, - if let Some(number) = &self.number { - format!("{:?}", number).into() - } else { - String::new().into() - }, - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() - } else { - String::new().into() - }, - if let Some(personal_email) = &self.personal_email { - format!("{:?}", personal_email).into() - } else { - String::new().into() - }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(location) = &self.location { - format!("{:?}", location).into() - } else { - String::new().into() - }, - if let Some(employment_type_id) = &self.employment_type_id { - format!("{:?}", employment_type_id).into() - } else { - String::new().into() - }, - if let Some(gender) = &self.gender { - format!("{:?}", gender).into() - } else { - String::new().into() - }, - if let Some(date_of_birth) = &self.date_of_birth { - format!("{:?}", date_of_birth).into() - } else { - String::new().into() - }, - if let Some(race) = &self.race { - format!("{:?}", race).into() - } else { - String::new().into() - }, - if let Some(ethnicity) = &self.ethnicity { - format!("{:?}", ethnicity).into() - } else { - String::new().into() - }, - if let Some(citizenship) = &self.citizenship { - format!("{:?}", citizenship).into() - } else { - String::new().into() - }, - if let Some(compensation_id) = &self.compensation_id { - format!("{:?}", compensation_id).into() - } else { - String::new().into() - }, - if let Some(department_id) = &self.department_id { - format!("{:?}", department_id).into() - } else { - String::new().into() - }, - if let Some(teams_id) = &self.teams_id { - format!("{:?}", teams_id).into() - } else { - String::new().into() - }, - if let Some(title) = &self.title { - format!("{:?}", title).into() - } else { - String::new().into() - }, - if let Some(level_id) = &self.level_id { - format!("{:?}", level_id).into() - } else { - String::new().into() - }, - if let Some(termination_details) = &self.termination_details { - format!("{:?}", termination_details).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "user_id".into(), - "legal_entity_id".into(), - "country".into(), - "start_date".into(), - "end_date".into(), - "number".into(), - "work_email".into(), - "personal_email".into(), - "status".into(), - "location".into(), - "employment_type_id".into(), - "gender".into(), - "date_of_birth".into(), - "race".into(), - "ethnicity".into(), - "citizenship".into(), - "compensation_id".into(), - "department_id".into(), - "teams_id".into(), - "title".into(), - "level_id".into(), - "termination_details".into(), - ] - } -} - -#[doc = "The termination type indicates whether the termination was voluntary or involuntary."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Type { - #[serde(rename = "VOLUNTARY")] - #[display("VOLUNTARY")] - Voluntary, - #[serde(rename = "INVOLUNTARY")] - #[display("INVOLUNTARY")] - Involuntary, - #[serde(rename = "RETIREMENT")] - #[display("RETIREMENT")] - Retirement, - #[serde(rename = "DEATH")] - #[display("DEATH")] - Death, - #[serde(rename = "ABANDONMENT")] - #[display("ABANDONMENT")] - Abandonment, - #[serde(rename = "OFFER_DECLINED")] - #[display("OFFER_DECLINED")] - OfferDeclined, - #[serde(rename = "RESCIND")] - #[display("RESCIND")] - Rescind, - #[serde(rename = "RENEGE")] - #[display("RENEGE")] - Renege, -} - -#[doc = "TerminationDetails."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TerminationDetails { - #[doc = "The termination type indicates whether the termination was voluntary or involuntary."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "This is a description that will be custom to each Rippling company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, -} - -impl std::fmt::Display for TerminationDetails { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TerminationDetails { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(reason) = &self.reason { - format!("{:?}", reason).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["type_".into(), "reason".into()] - } -} - -#[doc = "TerminationDetailsRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TerminationDetailsRequest { - #[doc = "The termination type indicates whether the termination was voluntary or involuntary."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "This is a description that will be custom to each Rippling company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, -} - -impl std::fmt::Display for TerminationDetailsRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TerminationDetailsRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(reason) = &self.reason { - format!("{:?}", reason).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["type_".into(), "reason".into()] - } -} - -#[doc = "Level."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Level { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the level. Must be unique within the company or organization."] - pub name: String, - #[doc = "The parent level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent level.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, - #[doc = "Global level is used to track the seniority of levels. The higher up a level is \ - placed on the page, the more senior and higher-ranked the level. Global level is \ - used in workflows, policies, and reports that use the level attribute (e.g., you can \ - use Level Lookup to set up a workflow that notifies the nearest person in an \ - worker's management chain at or above the specified level)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub global_level: Option, - #[doc = "The description of the level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The rank of the level within its track."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option, - #[doc = "The track associated with the level, if it's not a global level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub track_id: Option, - #[doc = "The track associated with the level, if it's not a global level.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub track: Option, -} - -impl std::fmt::Display for Level { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Level { - const LENGTH: usize = 11; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - if let Some(global_level) = &self.global_level { - format!("{:?}", global_level).into() - } else { - String::new().into() - }, - if let Some(description) = &self.description { - format!("{:?}", description).into() - } else { - String::new().into() - }, - if let Some(rank) = &self.rank { - format!("{:?}", rank).into() - } else { - String::new().into() - }, - if let Some(track_id) = &self.track_id { - format!("{:?}", track_id).into() - } else { - String::new().into() - }, - if let Some(track) = &self.track { - format!("{:?}", track).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "parent_id".into(), - "parent".into(), - "global_level".into(), - "description".into(), - "rank".into(), - "track_id".into(), - "track".into(), - ] - } -} - -#[doc = "LevelRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct LevelRequest { - #[doc = "The name of the level. Must be unique within the company or organization."] - pub name: String, - #[doc = "The parent level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "Global level is used to track the seniority of levels. The higher up a level is \ - placed on the page, the more senior and higher-ranked the level. Global level is \ - used in workflows, policies, and reports that use the level attribute (e.g., you can \ - use Level Lookup to set up a workflow that notifies the nearest person in an \ - worker's management chain at or above the specified level)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub global_level: Option, - #[doc = "The description of the level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "The rank of the level within its track."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option, - #[doc = "The track associated with the level, if it's not a global level."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub track_id: Option, -} - -impl std::fmt::Display for LevelRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for LevelRequest { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(global_level) = &self.global_level { - format!("{:?}", global_level).into() - } else { - String::new().into() - }, - if let Some(description) = &self.description { - format!("{:?}", description).into() - } else { - String::new().into() - }, - if let Some(rank) = &self.rank { - format!("{:?}", rank).into() - } else { - String::new().into() - }, - if let Some(track_id) = &self.track_id { - format!("{:?}", track_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "name".into(), - "parent_id".into(), - "global_level".into(), - "description".into(), - "rank".into(), - "track_id".into(), - ] - } -} - -#[doc = "Track."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Track { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the track. Must be unique within the company or organization."] - pub name: String, -} - -impl std::fmt::Display for Track { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Track { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - ] - } -} - -#[doc = "TrackRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TrackRequest { - #[doc = "The name of the track. Must be unique within the company or organization."] - pub name: String, -} - -impl std::fmt::Display for TrackRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TrackRequest { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![self.name.clone().into()] - } - - fn headers() -> Vec> { - vec!["name".into()] - } -} - -#[doc = "Team."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Team { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The parent team"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent team\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option>, - #[doc = "The name of the team."] - pub name: String, -} - -impl std::fmt::Display for Team { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Team { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "parent_id".into(), - "parent".into(), - "name".into(), - ] - } -} - -#[doc = "TeamRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TeamRequest { - #[doc = "The parent team"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The name of the team."] - pub name: String, -} - -impl std::fmt::Display for TeamRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TeamRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec!["parent_id".into(), "name".into()] - } -} - -#[doc = "Department."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Department { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the department."] - pub name: String, - #[doc = "The parent department."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent department.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option>, -} - -impl std::fmt::Display for Department { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Department { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "parent_id".into(), - "parent".into(), - ] - } -} - -#[doc = "DepartmentRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct DepartmentRequest { - #[doc = "The name of the department."] - pub name: String, - #[doc = "The parent department."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, -} - -impl std::fmt::Display for DepartmentRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for DepartmentRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "parent_id".into()] - } -} - -#[doc = "Compensation."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Compensation { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The worker's ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub worker_id: Option, - #[doc = "The worker's annual compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub annual_compensation: Option, - #[doc = "The worker's annual salary equivalent, for insurance purposes. It will be equal to \ - the worker's annual compensation, except for owners that are receiving no \ - cashcompensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub annual_salary_equivalent: Option, - #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ - with fixed compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hourly_wage: Option, - #[doc = "The worker's monthly compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub monthly_compensation: Option, - #[doc = "The worker's on-target commission."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub on_target_commission: Option, - #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ - with fixed compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub relocation_reimbursement: Option, - #[doc = "The worker's signing bonus."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub signing_bonus: Option, - #[doc = "The worker's target annual bonus amount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target_annual_bonus: Option, - #[doc = "The worker's weekly compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub weekly_compensation: Option, - #[doc = "The worker's target annual bonus as a percent of annual compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target_annual_bonus_percent: Option, - #[doc = "The worker's bonus schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bonus_schedule: Option, - #[doc = "The payment type for an worker's compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payment_type: Option, - #[doc = "The payment terms for an worker's compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payment_terms: Option, -} - -impl std::fmt::Display for Compensation { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Compensation { - const LENGTH: usize = 17; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(worker_id) = &self.worker_id { - format!("{:?}", worker_id).into() - } else { - String::new().into() - }, - if let Some(annual_compensation) = &self.annual_compensation { - format!("{:?}", annual_compensation).into() - } else { - String::new().into() - }, - if let Some(annual_salary_equivalent) = &self.annual_salary_equivalent { - format!("{:?}", annual_salary_equivalent).into() - } else { - String::new().into() - }, - if let Some(hourly_wage) = &self.hourly_wage { - format!("{:?}", hourly_wage).into() - } else { - String::new().into() - }, - if let Some(monthly_compensation) = &self.monthly_compensation { - format!("{:?}", monthly_compensation).into() - } else { - String::new().into() - }, - if let Some(on_target_commission) = &self.on_target_commission { - format!("{:?}", on_target_commission).into() - } else { - String::new().into() - }, - if let Some(relocation_reimbursement) = &self.relocation_reimbursement { - format!("{:?}", relocation_reimbursement).into() - } else { - String::new().into() - }, - if let Some(signing_bonus) = &self.signing_bonus { - format!("{:?}", signing_bonus).into() - } else { - String::new().into() - }, - if let Some(target_annual_bonus) = &self.target_annual_bonus { - format!("{:?}", target_annual_bonus).into() - } else { - String::new().into() - }, - if let Some(weekly_compensation) = &self.weekly_compensation { - format!("{:?}", weekly_compensation).into() - } else { - String::new().into() - }, - if let Some(target_annual_bonus_percent) = &self.target_annual_bonus_percent { - format!("{:?}", target_annual_bonus_percent).into() - } else { - String::new().into() - }, - if let Some(bonus_schedule) = &self.bonus_schedule { - format!("{:?}", bonus_schedule).into() - } else { - String::new().into() - }, - if let Some(payment_type) = &self.payment_type { - format!("{:?}", payment_type).into() - } else { - String::new().into() - }, - if let Some(payment_terms) = &self.payment_terms { - format!("{:?}", payment_terms).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "worker_id".into(), - "annual_compensation".into(), - "annual_salary_equivalent".into(), - "hourly_wage".into(), - "monthly_compensation".into(), - "on_target_commission".into(), - "relocation_reimbursement".into(), - "signing_bonus".into(), - "target_annual_bonus".into(), - "weekly_compensation".into(), - "target_annual_bonus_percent".into(), - "bonus_schedule".into(), - "payment_type".into(), - "payment_terms".into(), - ] - } -} - -#[doc = "CompensationRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CompensationRequest { - #[doc = "The worker's ID."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub worker_id: Option, - #[doc = "The worker's annual compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub annual_compensation: Option, - #[doc = "The worker's annual salary equivalent, for insurance purposes. It will be equal to \ - the worker's annual compensation, except for owners that are receiving no \ - cashcompensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub annual_salary_equivalent: Option, - #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ - with fixed compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hourly_wage: Option, - #[doc = "The worker's monthly compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub monthly_compensation: Option, - #[doc = "The worker's on-target commission."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub on_target_commission: Option, - #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ - with fixed compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub relocation_reimbursement: Option, - #[doc = "The worker's signing bonus."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub signing_bonus: Option, - #[doc = "The worker's target annual bonus amount."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target_annual_bonus: Option, - #[doc = "The worker's weekly compensation. This calculation assumes 40-hour work weeks for \ - workers with an hourly wage."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub weekly_compensation: Option, - #[doc = "The worker's target annual bonus as a percent of annual compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub target_annual_bonus_percent: Option, - #[doc = "The worker's bonus schedule."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bonus_schedule: Option, - #[doc = "The payment type for an worker's compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payment_type: Option, - #[doc = "The payment terms for an worker's compensation."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub payment_terms: Option, -} - -impl std::fmt::Display for CompensationRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CompensationRequest { - const LENGTH: usize = 14; - fn fields(&self) -> Vec> { - vec![ - if let Some(worker_id) = &self.worker_id { - format!("{:?}", worker_id).into() - } else { - String::new().into() - }, - if let Some(annual_compensation) = &self.annual_compensation { - format!("{:?}", annual_compensation).into() - } else { - String::new().into() - }, - if let Some(annual_salary_equivalent) = &self.annual_salary_equivalent { - format!("{:?}", annual_salary_equivalent).into() - } else { - String::new().into() - }, - if let Some(hourly_wage) = &self.hourly_wage { - format!("{:?}", hourly_wage).into() - } else { - String::new().into() - }, - if let Some(monthly_compensation) = &self.monthly_compensation { - format!("{:?}", monthly_compensation).into() - } else { - String::new().into() - }, - if let Some(on_target_commission) = &self.on_target_commission { - format!("{:?}", on_target_commission).into() - } else { - String::new().into() - }, - if let Some(relocation_reimbursement) = &self.relocation_reimbursement { - format!("{:?}", relocation_reimbursement).into() - } else { - String::new().into() - }, - if let Some(signing_bonus) = &self.signing_bonus { - format!("{:?}", signing_bonus).into() - } else { - String::new().into() - }, - if let Some(target_annual_bonus) = &self.target_annual_bonus { - format!("{:?}", target_annual_bonus).into() - } else { - String::new().into() - }, - if let Some(weekly_compensation) = &self.weekly_compensation { - format!("{:?}", weekly_compensation).into() - } else { - String::new().into() - }, - if let Some(target_annual_bonus_percent) = &self.target_annual_bonus_percent { - format!("{:?}", target_annual_bonus_percent).into() - } else { - String::new().into() - }, - if let Some(bonus_schedule) = &self.bonus_schedule { - format!("{:?}", bonus_schedule).into() - } else { - String::new().into() - }, - if let Some(payment_type) = &self.payment_type { - format!("{:?}", payment_type).into() - } else { - String::new().into() - }, - if let Some(payment_terms) = &self.payment_terms { - format!("{:?}", payment_terms).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "worker_id".into(), - "annual_compensation".into(), - "annual_salary_equivalent".into(), - "hourly_wage".into(), - "monthly_compensation".into(), - "on_target_commission".into(), - "relocation_reimbursement".into(), - "signing_bonus".into(), - "target_annual_bonus".into(), - "weekly_compensation".into(), - "target_annual_bonus_percent".into(), - "bonus_schedule".into(), - "payment_type".into(), - "payment_terms".into(), - ] - } -} - -#[doc = "Currency."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Currency { - #[doc = "The currency type, ex: USD, EUR, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub currency_type: Option, - #[doc = "The decimal amount for the currency."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} - -impl std::fmt::Display for Currency { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Currency { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(currency_type) = &self.currency_type { - format!("{:?}", currency_type).into() - } else { - String::new().into() - }, - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["currency_type".into(), "value".into()] - } -} - -#[doc = "CurrencyRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CurrencyRequest { - #[doc = "The currency type, ex: USD, EUR, etc."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub currency_type: Option, - #[doc = "The decimal amount for the currency."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, -} - -impl std::fmt::Display for CurrencyRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CurrencyRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(currency_type) = &self.currency_type { - format!("{:?}", currency_type).into() - } else { - String::new().into() - }, - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["currency_type".into(), "value".into()] - } -} - -#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and are \ - not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ - managed by an employer, work under the employer's direct supervision and control, and are \ - protected by law for wages and employment rights."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CompanyEmploymentTypeType { - #[serde(rename = "CONTRACTOR")] - #[display("CONTRACTOR")] - Contractor, - #[serde(rename = "EMPLOYEE")] - #[display("EMPLOYEE")] - Employee, -} - -#[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are paid a \ - fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour worked."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CompensationTimePeriod { - #[serde(rename = "HOURLY")] - #[display("HOURLY")] - Hourly, - #[serde(rename = "SALARIED")] - #[display("SALARIED")] - Salaried, -} - -#[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 hours \ - per week. Full-time workers will typically be eligible for benefits. * `PART-TIME`: \ - Part-time is less than 30 hours per week. These workers may be eligible for benefits, \ - depending on company settings and hours worked. * `TEMPORARY`: These workers are hired on \ - a temporary basis. You can specify how each worker with this employment type will be paid \ - individually."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum AmountWorked { - #[serde(rename = "PART-TIME")] - #[display("PART-TIME")] - PartTime, - #[serde(rename = "FULL-TIME")] - #[display("FULL-TIME")] - FullTime, - #[serde(rename = "TEMPORARY")] - #[display("TEMPORARY")] - Temporary, -} - -#[doc = "CompanyEmploymentType."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CompanyEmploymentType { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The display label of the employment type."] - pub label: String, - #[doc = "The name of the employment type for non-custom employment types."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and \ - are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ - and managed by an employer, work under the employer's direct supervision and \ - control, and are protected by law for wages and employment rights."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ - paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ - worked."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation_time_period: Option, - #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ - hours per week. Full-time workers will typically be eligible for benefits. * \ - `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ - for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ - workers are hired on a temporary basis. You can specify how each worker with this \ - employment type will be paid individually."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount_worked: Option, -} - -impl std::fmt::Display for CompanyEmploymentType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CompanyEmploymentType { - const LENGTH: usize = 8; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.label.clone().into(), - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(compensation_time_period) = &self.compensation_time_period { - format!("{:?}", compensation_time_period).into() - } else { - String::new().into() - }, - if let Some(amount_worked) = &self.amount_worked { - format!("{:?}", amount_worked).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "label".into(), - "name".into(), - "type_".into(), - "compensation_time_period".into(), - "amount_worked".into(), - ] - } -} - -#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and are \ - not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ - managed by an employer, work under the employer's direct supervision and control, and are \ - protected by law for wages and employment rights."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CompanyEmploymentTypeRequestType { - #[serde(rename = "CONTRACTOR")] - #[display("CONTRACTOR")] - Contractor, - #[serde(rename = "EMPLOYEE")] - #[display("EMPLOYEE")] - Employee, -} - -#[doc = "CompanyEmploymentTypeRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CompanyEmploymentTypeRequest { - #[doc = "The display label of the employment type."] - pub label: String, - #[doc = "The name of the employment type for non-custom employment types."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and \ - are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ - and managed by an employer, work under the employer's direct supervision and \ - control, and are protected by law for wages and employment rights."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ - paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ - worked."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation_time_period: Option, - #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ - hours per week. Full-time workers will typically be eligible for benefits. * \ - `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ - for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ - workers are hired on a temporary basis. You can specify how each worker with this \ - employment type will be paid individually."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount_worked: Option, -} - -impl std::fmt::Display for CompanyEmploymentTypeRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CompanyEmploymentTypeRequest { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - self.label.clone().into(), - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(compensation_time_period) = &self.compensation_time_period { - format!("{:?}", compensation_time_period).into() - } else { - String::new().into() - }, - if let Some(amount_worked) = &self.amount_worked { - format!("{:?}", amount_worked).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "label".into(), - "name".into(), - "type_".into(), - "compensation_time_period".into(), - "amount_worked".into(), - ] - } -} - -#[doc = "The type of location."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerLocationType { - #[serde(rename = "REMOTE")] - #[display("REMOTE")] - Remote, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, -} - -#[doc = "WorkerLocation."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct WorkerLocation { - #[doc = "The type of location."] - #[serde(rename = "type")] - pub type_: WorkerLocationType, - #[doc = "The work location, if the worker isn't remote."] - pub work_location_id: String, -} - -impl std::fmt::Display for WorkerLocation { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for WorkerLocation { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - format!("{:?}", self.type_).into(), - self.work_location_id.clone().into(), - ] - } - - fn headers() -> Vec> { - vec!["type_".into(), "work_location_id".into()] - } -} - -#[doc = "The type of location."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum WorkerLocationRequestType { - #[serde(rename = "REMOTE")] - #[display("REMOTE")] - Remote, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, -} - -#[doc = "WorkerLocationRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct WorkerLocationRequest { - #[doc = "The type of location."] - #[serde(rename = "type")] - pub type_: WorkerLocationRequestType, - #[doc = "The work location, if the worker isn't remote."] - pub work_location_id: String, -} - -impl std::fmt::Display for WorkerLocationRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for WorkerLocationRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - format!("{:?}", self.type_).into(), - self.work_location_id.clone().into(), - ] - } - - fn headers() -> Vec> { - vec!["type_".into(), "work_location_id".into()] - } -} - -#[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered the \ - ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a subsidiary, \ - fully or partially held by another. * `BRANCH`: The legal entity is considered a branch, \ - associated with a parent legal entity."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum EntityLevel { - #[serde(rename = "PARENT")] - #[display("PARENT")] - Parent, - #[serde(rename = "SUBSIDIARY")] - #[display("SUBSIDIARY")] - Subsidiary, - #[serde(rename = "BRANCH")] - #[display("BRANCH")] - Branch, -} - -#[doc = "The legal entity management type in the case of an employer of record (EOR) or \ - professional employment organization (PEO). * `PEO`: The legal entity is considered a \ - Professional Employment Organization (PEO). * `EOR`: The legal entity is considered an \ - Employer of Record (EOR)."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum ManagementType { - #[serde(rename = "PEO")] - #[display("PEO")] - Peo, - #[serde(rename = "EOR")] - #[display("EOR")] - Eor, -} - -#[doc = "LegalEntity."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct LegalEntity { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The tax identifier for the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tax_identifier: Option, - #[doc = "The country the legal entity is based in."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, - #[doc = "The legal name of the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_name: Option, - #[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered \ - the ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a \ - subsidiary, fully or partially held by another. * `BRANCH`: The legal entity is \ - considered a branch, associated with a parent legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub entity_level: Option, - #[doc = "The registration date of the entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub registration_date: Option, - #[doc = "The mailing address of the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mailing_address: Option
, - #[doc = "The physical address of the legal entity, if it differs from the mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_address: Option
, - #[doc = "The parent legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent legal entity.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option>, - #[doc = "The legal entity management type in the case of an employer of record (EOR) or \ - professional employment organization (PEO). * `PEO`: The legal entity is considered \ - a Professional Employment Organization (PEO). * `EOR`: The legal entity is \ - considered an Employer of Record (EOR)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub management_type: Option, - #[doc = "The company or organization associated with the legal entity"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company_id: Option, -} - -impl std::fmt::Display for LegalEntity { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for LegalEntity { - const LENGTH: usize = 14; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(tax_identifier) = &self.tax_identifier { - format!("{:?}", tax_identifier).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - if let Some(legal_name) = &self.legal_name { - format!("{:?}", legal_name).into() - } else { - String::new().into() - }, - if let Some(entity_level) = &self.entity_level { - format!("{:?}", entity_level).into() - } else { - String::new().into() - }, - if let Some(registration_date) = &self.registration_date { - format!("{:?}", registration_date).into() - } else { - String::new().into() - }, - if let Some(mailing_address) = &self.mailing_address { - format!("{:?}", mailing_address).into() - } else { - String::new().into() - }, - if let Some(physical_address) = &self.physical_address { - format!("{:?}", physical_address).into() - } else { - String::new().into() - }, - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - if let Some(management_type) = &self.management_type { - format!("{:?}", management_type).into() - } else { - String::new().into() - }, - if let Some(company_id) = &self.company_id { - format!("{:?}", company_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "tax_identifier".into(), - "country".into(), - "legal_name".into(), - "entity_level".into(), - "registration_date".into(), - "mailing_address".into(), - "physical_address".into(), - "parent_id".into(), - "parent".into(), - "management_type".into(), - "company_id".into(), - ] - } -} - -#[doc = "LegalEntityRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct LegalEntityRequest { - #[doc = "The tax identifier for the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tax_identifier: Option, - #[doc = "The country the legal entity is based in."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, - #[doc = "The legal name of the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_name: Option, - #[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered \ - the ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a \ - subsidiary, fully or partially held by another. * `BRANCH`: The legal entity is \ - considered a branch, associated with a parent legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub entity_level: Option, - #[doc = "The registration date of the entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub registration_date: Option, - #[doc = "The mailing address of the legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mailing_address: Option
, - #[doc = "The physical address of the legal entity, if it differs from the mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_address: Option
, - #[doc = "The parent legal entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The legal entity management type in the case of an employer of record (EOR) or \ - professional employment organization (PEO). * `PEO`: The legal entity is considered \ - a Professional Employment Organization (PEO). * `EOR`: The legal entity is \ - considered an Employer of Record (EOR)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub management_type: Option, - #[doc = "The company or organization associated with the legal entity"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company_id: Option, -} - -impl std::fmt::Display for LegalEntityRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for LegalEntityRequest { - const LENGTH: usize = 10; - fn fields(&self) -> Vec> { - vec![ - if let Some(tax_identifier) = &self.tax_identifier { - format!("{:?}", tax_identifier).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - if let Some(legal_name) = &self.legal_name { - format!("{:?}", legal_name).into() - } else { - String::new().into() - }, - if let Some(entity_level) = &self.entity_level { - format!("{:?}", entity_level).into() - } else { - String::new().into() - }, - if let Some(registration_date) = &self.registration_date { - format!("{:?}", registration_date).into() - } else { - String::new().into() - }, - if let Some(mailing_address) = &self.mailing_address { - format!("{:?}", mailing_address).into() - } else { - String::new().into() - }, - if let Some(physical_address) = &self.physical_address { - format!("{:?}", physical_address).into() - } else { - String::new().into() - }, - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(management_type) = &self.management_type { - format!("{:?}", management_type).into() - } else { - String::new().into() - }, - if let Some(company_id) = &self.company_id { - format!("{:?}", company_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "tax_identifier".into(), - "country".into(), - "legal_name".into(), - "entity_level".into(), - "registration_date".into(), - "mailing_address".into(), - "physical_address".into(), - "parent_id".into(), - "management_type".into(), - "company_id".into(), - ] - } -} - -#[doc = "Company."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Company { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The company's ultimate holding entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_legal_entity_id: Option, - #[doc = "A list of the company's entities."] - pub legal_entities_id: String, - #[doc = "A list of the company's entities.\n\nExpandable field"] - pub legal_entities: LegalEntity, - #[doc = "The physical address of the holding entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_address: Option
, - #[doc = "The email address used when registering this company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub primary_email: Option, - #[doc = "The legal name of the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_name: Option, - #[doc = "The doing business as name for the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub doing_business_as_name: Option, - #[doc = "The phone number for the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone: Option, - #[doc = "The name of the company."] - pub name: String, -} - -impl std::fmt::Display for Company { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Company { - const LENGTH: usize = 12; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(parent_legal_entity_id) = &self.parent_legal_entity_id { - format!("{:?}", parent_legal_entity_id).into() - } else { - String::new().into() - }, - self.legal_entities_id.clone().into(), - format!("{:?}", self.legal_entities).into(), - if let Some(physical_address) = &self.physical_address { - format!("{:?}", physical_address).into() - } else { - String::new().into() - }, - if let Some(primary_email) = &self.primary_email { - format!("{:?}", primary_email).into() - } else { - String::new().into() - }, - if let Some(legal_name) = &self.legal_name { - format!("{:?}", legal_name).into() - } else { - String::new().into() - }, - if let Some(doing_business_as_name) = &self.doing_business_as_name { - format!("{:?}", doing_business_as_name).into() - } else { - String::new().into() - }, - if let Some(phone) = &self.phone { - format!("{:?}", phone).into() - } else { - String::new().into() - }, - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "parent_legal_entity_id".into(), - "legal_entities_id".into(), - "legal_entities".into(), - "physical_address".into(), - "primary_email".into(), - "legal_name".into(), - "doing_business_as_name".into(), - "phone".into(), - "name".into(), - ] - } -} - -#[doc = "CompanyRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CompanyRequest { - #[doc = "The company's ultimate holding entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_legal_entity_id: Option, - #[doc = "A list of the company's entities."] - pub legal_entities_id: String, - #[doc = "The physical address of the holding entity."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_address: Option
, - #[doc = "The email address used when registering this company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub primary_email: Option, - #[doc = "The legal name of the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legal_name: Option, - #[doc = "The doing business as name for the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub doing_business_as_name: Option, - #[doc = "The phone number for the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone: Option, - #[doc = "The name of the company."] - pub name: String, -} - -impl std::fmt::Display for CompanyRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CompanyRequest { - const LENGTH: usize = 8; - fn fields(&self) -> Vec> { - vec![ - if let Some(parent_legal_entity_id) = &self.parent_legal_entity_id { - format!("{:?}", parent_legal_entity_id).into() - } else { - String::new().into() - }, - self.legal_entities_id.clone().into(), - if let Some(physical_address) = &self.physical_address { - format!("{:?}", physical_address).into() - } else { - String::new().into() - }, - if let Some(primary_email) = &self.primary_email { - format!("{:?}", primary_email).into() - } else { - String::new().into() - }, - if let Some(legal_name) = &self.legal_name { - format!("{:?}", legal_name).into() - } else { - String::new().into() - }, - if let Some(doing_business_as_name) = &self.doing_business_as_name { - format!("{:?}", doing_business_as_name).into() - } else { - String::new().into() - }, - if let Some(phone) = &self.phone { - format!("{:?}", phone).into() - } else { - String::new().into() - }, - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "parent_legal_entity_id".into(), - "legal_entities_id".into(), - "physical_address".into(), - "primary_email".into(), - "legal_name".into(), - "doing_business_as_name".into(), - "phone".into(), - "name".into(), - ] - } -} - -#[doc = "The classification of the address."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum AddressType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum AddressCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "Address."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Address { - #[doc = "The classification of the address."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The formatted mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The full street address component, which may include house number, street name, P.O. \ - box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ - 4.1.2.."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub street_address: Option, - #[doc = "The city or locality component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locality: Option, - #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub region: Option, - #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, -} - -impl std::fmt::Display for Address { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Address { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(street_address) = &self.street_address { - format!("{:?}", street_address).into() - } else { - String::new().into() - }, - if let Some(locality) = &self.locality { - format!("{:?}", locality).into() - } else { - String::new().into() - }, - if let Some(region) = &self.region { - format!("{:?}", region).into() - } else { - String::new().into() - }, - if let Some(postal_code) = &self.postal_code { - format!("{:?}", postal_code).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "type_".into(), - "formatted".into(), - "street_address".into(), - "locality".into(), - "region".into(), - "postal_code".into(), - "country".into(), - ] - } -} - -#[doc = "The classification of the address."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum AddressRequestType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum AddressRequestCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "AddressRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct AddressRequest { - #[doc = "The classification of the address."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The formatted mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The full street address component, which may include house number, street name, P.O. \ - box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ - 4.1.2.."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub street_address: Option, - #[doc = "The city or locality component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locality: Option, - #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub region: Option, - #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, -} - -impl std::fmt::Display for AddressRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for AddressRequest { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(street_address) = &self.street_address { - format!("{:?}", street_address).into() - } else { - String::new().into() - }, - if let Some(locality) = &self.locality { - format!("{:?}", locality).into() - } else { - String::new().into() - }, - if let Some(region) = &self.region { - format!("{:?}", region).into() - } else { - String::new().into() - }, - if let Some(postal_code) = &self.postal_code { - format!("{:?}", postal_code).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "type_".into(), - "formatted".into(), - "street_address".into(), - "locality".into(), - "region".into(), - "postal_code".into(), - "country".into(), - ] - } -} - -#[doc = "The code of the country."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Code { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "Country."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Country { - #[doc = "The code of the country."] - pub code: Code, -} - -impl std::fmt::Display for Country { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Country { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![format!("{:?}", self.code).into()] - } - - fn headers() -> Vec> { - vec!["code".into()] - } -} - -#[doc = "CountryRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CountryRequest { - #[doc = "The code of the country."] - pub code: Code, -} - -impl std::fmt::Display for CountryRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CountryRequest { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![format!("{:?}", self.code).into()] - } - - fn headers() -> Vec> { - vec!["code".into()] - } -} - -#[doc = "User."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct User { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Whether the user is able to access company resources, typically when they are in \ - actively engaged with the company and not after off-boarding."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option, - #[doc = "The unique identifier across Rippling used by the User for direct authentication \ - into their associated company. Globally unique."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "The user's name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The display name of the user using either the concatenated preferred given and \ - family name or username depending on availability."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The user's email addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub emails: Option, - #[doc = "The user's phone numbers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_numbers: Option, - #[doc = "The user's addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub addresses: Option, - #[doc = "The user's photos."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub photos: Option, - #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ - Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - #[doc = "The User's default location for purposes of localization of currency, date time \ - format, or numerical representations pursuant to RFC5646."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locale: Option, - #[doc = "The User's current time zone in IANA database Olson format"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} - -impl std::fmt::Display for User { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for User { - const LENGTH: usize = 14; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(active) = &self.active { - format!("{:?}", active).into() - } else { - String::new().into() - }, - if let Some(username) = &self.username { - format!("{:?}", username).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(display_name) = &self.display_name { - format!("{:?}", display_name).into() - } else { - String::new().into() - }, - if let Some(emails) = &self.emails { - format!("{:?}", emails).into() - } else { - String::new().into() - }, - if let Some(phone_numbers) = &self.phone_numbers { - format!("{:?}", phone_numbers).into() - } else { - String::new().into() - }, - if let Some(addresses) = &self.addresses { - format!("{:?}", addresses).into() - } else { - String::new().into() - }, - if let Some(photos) = &self.photos { - format!("{:?}", photos).into() - } else { - String::new().into() - }, - if let Some(preferred_language) = &self.preferred_language { - format!("{:?}", preferred_language).into() - } else { - String::new().into() - }, - if let Some(locale) = &self.locale { - format!("{:?}", locale).into() - } else { - String::new().into() - }, - if let Some(timezone) = &self.timezone { - format!("{:?}", timezone).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "active".into(), - "username".into(), - "name".into(), - "display_name".into(), - "emails".into(), - "phone_numbers".into(), - "addresses".into(), - "photos".into(), - "preferred_language".into(), - "locale".into(), - "timezone".into(), - ] - } -} - -#[doc = "UserRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserRequest { - #[doc = "Whether the user is able to access company resources, typically when they are in \ - actively engaged with the company and not after off-boarding."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option, - #[doc = "The unique identifier across Rippling used by the User for direct authentication \ - into their associated company. Globally unique."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "The user's name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The display name of the user using either the concatenated preferred given and \ - family name or username depending on availability."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The user's email addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub emails: Option, - #[doc = "The user's phone numbers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_numbers: Option, - #[doc = "The user's addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub addresses: Option, - #[doc = "The user's photos."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub photos: Option, - #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ - Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - #[doc = "The User's default location for purposes of localization of currency, date time \ - format, or numerical representations pursuant to RFC5646."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locale: Option, - #[doc = "The User's current time zone in IANA database Olson format"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} - -impl std::fmt::Display for UserRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserRequest { - const LENGTH: usize = 11; - fn fields(&self) -> Vec> { - vec![ - if let Some(active) = &self.active { - format!("{:?}", active).into() - } else { - String::new().into() - }, - if let Some(username) = &self.username { - format!("{:?}", username).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(display_name) = &self.display_name { - format!("{:?}", display_name).into() - } else { - String::new().into() - }, - if let Some(emails) = &self.emails { - format!("{:?}", emails).into() - } else { - String::new().into() - }, - if let Some(phone_numbers) = &self.phone_numbers { - format!("{:?}", phone_numbers).into() - } else { - String::new().into() - }, - if let Some(addresses) = &self.addresses { - format!("{:?}", addresses).into() - } else { - String::new().into() - }, - if let Some(photos) = &self.photos { - format!("{:?}", photos).into() - } else { - String::new().into() - }, - if let Some(preferred_language) = &self.preferred_language { - format!("{:?}", preferred_language).into() - } else { - String::new().into() - }, - if let Some(locale) = &self.locale { - format!("{:?}", locale).into() - } else { - String::new().into() - }, - if let Some(timezone) = &self.timezone { - format!("{:?}", timezone).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "active".into(), - "username".into(), - "name".into(), - "display_name".into(), - "emails".into(), - "phone_numbers".into(), - "addresses".into(), - "photos".into(), - "preferred_language".into(), - "locale".into(), - "timezone".into(), - ] - } -} - -#[doc = "The classification of the photo."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserPhotoType { - #[serde(rename = "PHOTO")] - #[display("PHOTO")] - Photo, - #[serde(rename = "THUMBNAIL")] - #[display("THUMBNAIL")] - Thumbnail, -} - -#[doc = "UserPhoto."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserPhoto { - #[doc = "The URL of the photo."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the photo."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl std::fmt::Display for UserPhoto { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserPhoto { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into()] - } -} - -#[doc = "The classification of the photo."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserPhotoRequestType { - #[serde(rename = "PHOTO")] - #[display("PHOTO")] - Photo, - #[serde(rename = "THUMBNAIL")] - #[display("THUMBNAIL")] - Thumbnail, -} - -#[doc = "UserPhotoRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserPhotoRequest { - #[doc = "The URL of the photo."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the photo."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl std::fmt::Display for UserPhotoRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserPhotoRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into()] - } -} - -#[doc = "The classification of the address."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserAddressType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserAddressCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "UserAddress."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserAddress { - #[doc = "The classification of the address."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The formatted mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The full street address component, which may include house number, street name, P.O. \ - box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ - 4.1.2.."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub street_address: Option, - #[doc = "The city or locality component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locality: Option, - #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub region: Option, - #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, -} - -impl std::fmt::Display for UserAddress { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserAddress { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(street_address) = &self.street_address { - format!("{:?}", street_address).into() - } else { - String::new().into() - }, - if let Some(locality) = &self.locality { - format!("{:?}", locality).into() - } else { - String::new().into() - }, - if let Some(region) = &self.region { - format!("{:?}", region).into() - } else { - String::new().into() - }, - if let Some(postal_code) = &self.postal_code { - format!("{:?}", postal_code).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "type_".into(), - "formatted".into(), - "street_address".into(), - "locality".into(), - "region".into(), - "postal_code".into(), - "country".into(), - ] - } -} - -#[doc = "The classification of the address."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserAddressRequestType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserAddressRequestCountry { - #[serde(rename = "AF")] - #[display("AF")] - Af, - #[serde(rename = "AX")] - #[display("AX")] - Ax, - #[serde(rename = "AL")] - #[display("AL")] - Al, - #[serde(rename = "DZ")] - #[display("DZ")] - Dz, - #[serde(rename = "AS")] - #[display("AS")] - As, - #[serde(rename = "AD")] - #[display("AD")] - Ad, - #[serde(rename = "AO")] - #[display("AO")] - Ao, - #[serde(rename = "AI")] - #[display("AI")] - Ai, - #[serde(rename = "AQ")] - #[display("AQ")] - Aq, - #[serde(rename = "AG")] - #[display("AG")] - Ag, - #[serde(rename = "AR")] - #[display("AR")] - Ar, - #[serde(rename = "AM")] - #[display("AM")] - Am, - #[serde(rename = "AW")] - #[display("AW")] - Aw, - #[serde(rename = "AU")] - #[display("AU")] - Au, - #[serde(rename = "AT")] - #[display("AT")] - At, - #[serde(rename = "AZ")] - #[display("AZ")] - Az, - #[serde(rename = "BS")] - #[display("BS")] - Bs, - #[serde(rename = "BH")] - #[display("BH")] - Bh, - #[serde(rename = "BD")] - #[display("BD")] - Bd, - #[serde(rename = "BB")] - #[display("BB")] - Bb, - #[serde(rename = "BY")] - #[display("BY")] - By, - #[serde(rename = "BE")] - #[display("BE")] - Be, - #[serde(rename = "BZ")] - #[display("BZ")] - Bz, - #[serde(rename = "BJ")] - #[display("BJ")] - Bj, - #[serde(rename = "BM")] - #[display("BM")] - Bm, - #[serde(rename = "BT")] - #[display("BT")] - Bt, - #[serde(rename = "BO")] - #[display("BO")] - Bo, - #[serde(rename = "BQ")] - #[display("BQ")] - Bq, - #[serde(rename = "BA")] - #[display("BA")] - Ba, - #[serde(rename = "BW")] - #[display("BW")] - Bw, - #[serde(rename = "BV")] - #[display("BV")] - Bv, - #[serde(rename = "BR")] - #[display("BR")] - Br, - #[serde(rename = "IO")] - #[display("IO")] - Io, - #[serde(rename = "BN")] - #[display("BN")] - Bn, - #[serde(rename = "BG")] - #[display("BG")] - Bg, - #[serde(rename = "BF")] - #[display("BF")] - Bf, - #[serde(rename = "BI")] - #[display("BI")] - Bi, - #[serde(rename = "CV")] - #[display("CV")] - Cv, - #[serde(rename = "KH")] - #[display("KH")] - Kh, - #[serde(rename = "CM")] - #[display("CM")] - Cm, - #[serde(rename = "CA")] - #[display("CA")] - Ca, - #[serde(rename = "KY")] - #[display("KY")] - Ky, - #[serde(rename = "CF")] - #[display("CF")] - Cf, - #[serde(rename = "TD")] - #[display("TD")] - Td, - #[serde(rename = "CL")] - #[display("CL")] - Cl, - #[serde(rename = "CN")] - #[display("CN")] - Cn, - #[serde(rename = "CX")] - #[display("CX")] - Cx, - #[serde(rename = "CC")] - #[display("CC")] - Cc, - #[serde(rename = "CO")] - #[display("CO")] - Co, - #[serde(rename = "KM")] - #[display("KM")] - Km, - #[serde(rename = "CG")] - #[display("CG")] - Cg, - #[serde(rename = "CD")] - #[display("CD")] - Cd, - #[serde(rename = "CK")] - #[display("CK")] - Ck, - #[serde(rename = "CR")] - #[display("CR")] - Cr, - #[serde(rename = "CI")] - #[display("CI")] - Ci, - #[serde(rename = "HR")] - #[display("HR")] - Hr, - #[serde(rename = "CW")] - #[display("CW")] - Cw, - #[serde(rename = "CY")] - #[display("CY")] - Cy, - #[serde(rename = "CZ")] - #[display("CZ")] - Cz, - #[serde(rename = "DK")] - #[display("DK")] - Dk, - #[serde(rename = "DJ")] - #[display("DJ")] - Dj, - #[serde(rename = "DM")] - #[display("DM")] - Dm, - #[serde(rename = "DO")] - #[display("DO")] - Do, - #[serde(rename = "EC")] - #[display("EC")] - Ec, - #[serde(rename = "EG")] - #[display("EG")] - Eg, - #[serde(rename = "SV")] - #[display("SV")] - Sv, - #[serde(rename = "GQ")] - #[display("GQ")] - Gq, - #[serde(rename = "ER")] - #[display("ER")] - Er, - #[serde(rename = "EE")] - #[display("EE")] - Ee, - #[serde(rename = "SZ")] - #[display("SZ")] - Sz, - #[serde(rename = "ET")] - #[display("ET")] - Et, - #[serde(rename = "FK")] - #[display("FK")] - Fk, - #[serde(rename = "FO")] - #[display("FO")] - Fo, - #[serde(rename = "FJ")] - #[display("FJ")] - Fj, - #[serde(rename = "FI")] - #[display("FI")] - Fi, - #[serde(rename = "FR")] - #[display("FR")] - Fr, - #[serde(rename = "GF")] - #[display("GF")] - Gf, - #[serde(rename = "PF")] - #[display("PF")] - Pf, - #[serde(rename = "TF")] - #[display("TF")] - Tf, - #[serde(rename = "GA")] - #[display("GA")] - Ga, - #[serde(rename = "GM")] - #[display("GM")] - Gm, - #[serde(rename = "GE")] - #[display("GE")] - Ge, - #[serde(rename = "DE")] - #[display("DE")] - De, - #[serde(rename = "GH")] - #[display("GH")] - Gh, - #[serde(rename = "GI")] - #[display("GI")] - Gi, - #[serde(rename = "GR")] - #[display("GR")] - Gr, - #[serde(rename = "GL")] - #[display("GL")] - Gl, - #[serde(rename = "GD")] - #[display("GD")] - Gd, - #[serde(rename = "GP")] - #[display("GP")] - Gp, - #[serde(rename = "GU")] - #[display("GU")] - Gu, - #[serde(rename = "GT")] - #[display("GT")] - Gt, - #[serde(rename = "GG")] - #[display("GG")] - Gg, - #[serde(rename = "GN")] - #[display("GN")] - Gn, - #[serde(rename = "GW")] - #[display("GW")] - Gw, - #[serde(rename = "GY")] - #[display("GY")] - Gy, - #[serde(rename = "HT")] - #[display("HT")] - Ht, - #[serde(rename = "HM")] - #[display("HM")] - Hm, - #[serde(rename = "VA")] - #[display("VA")] - Va, - #[serde(rename = "HN")] - #[display("HN")] - Hn, - #[serde(rename = "HK")] - #[display("HK")] - Hk, - #[serde(rename = "HU")] - #[display("HU")] - Hu, - #[serde(rename = "IS")] - #[display("IS")] - Is, - #[serde(rename = "IN")] - #[display("IN")] - In, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "IQ")] - #[display("IQ")] - Iq, - #[serde(rename = "IE")] - #[display("IE")] - Ie, - #[serde(rename = "IM")] - #[display("IM")] - Im, - #[serde(rename = "IL")] - #[display("IL")] - Il, - #[serde(rename = "IT")] - #[display("IT")] - It, - #[serde(rename = "JM")] - #[display("JM")] - Jm, - #[serde(rename = "JP")] - #[display("JP")] - Jp, - #[serde(rename = "JE")] - #[display("JE")] - Je, - #[serde(rename = "JO")] - #[display("JO")] - Jo, - #[serde(rename = "KZ")] - #[display("KZ")] - Kz, - #[serde(rename = "KE")] - #[display("KE")] - Ke, - #[serde(rename = "KI")] - #[display("KI")] - Ki, - #[serde(rename = "KR")] - #[display("KR")] - Kr, - #[serde(rename = "XK")] - #[display("XK")] - Xk, - #[serde(rename = "KW")] - #[display("KW")] - Kw, - #[serde(rename = "KG")] - #[display("KG")] - Kg, - #[serde(rename = "LA")] - #[display("LA")] - La, - #[serde(rename = "LV")] - #[display("LV")] - Lv, - #[serde(rename = "LB")] - #[display("LB")] - Lb, - #[serde(rename = "LS")] - #[display("LS")] - Ls, - #[serde(rename = "LR")] - #[display("LR")] - Lr, - #[serde(rename = "LY")] - #[display("LY")] - Ly, - #[serde(rename = "LI")] - #[display("LI")] - Li, - #[serde(rename = "LT")] - #[display("LT")] - Lt, - #[serde(rename = "LU")] - #[display("LU")] - Lu, - #[serde(rename = "MO")] - #[display("MO")] - Mo, - #[serde(rename = "MG")] - #[display("MG")] - Mg, - #[serde(rename = "MW")] - #[display("MW")] - Mw, - #[serde(rename = "MY")] - #[display("MY")] - My, - #[serde(rename = "MV")] - #[display("MV")] - Mv, - #[serde(rename = "ML")] - #[display("ML")] - Ml, - #[serde(rename = "MT")] - #[display("MT")] - Mt, - #[serde(rename = "MH")] - #[display("MH")] - Mh, - #[serde(rename = "MQ")] - #[display("MQ")] - Mq, - #[serde(rename = "MR")] - #[display("MR")] - Mr, - #[serde(rename = "MU")] - #[display("MU")] - Mu, - #[serde(rename = "YT")] - #[display("YT")] - Yt, - #[serde(rename = "MX")] - #[display("MX")] - Mx, - #[serde(rename = "FM")] - #[display("FM")] - Fm, - #[serde(rename = "MD")] - #[display("MD")] - Md, - #[serde(rename = "MC")] - #[display("MC")] - Mc, - #[serde(rename = "MN")] - #[display("MN")] - Mn, - #[serde(rename = "ME")] - #[display("ME")] - Me, - #[serde(rename = "MS")] - #[display("MS")] - Ms, - #[serde(rename = "MA")] - #[display("MA")] - Ma, - #[serde(rename = "MZ")] - #[display("MZ")] - Mz, - #[serde(rename = "MM")] - #[display("MM")] - Mm, - #[serde(rename = "NA")] - #[display("NA")] - Na, - #[serde(rename = "NR")] - #[display("NR")] - Nr, - #[serde(rename = "NP")] - #[display("NP")] - Np, - #[serde(rename = "NL")] - #[display("NL")] - Nl, - #[serde(rename = "AN")] - #[display("AN")] - An, - #[serde(rename = "NC")] - #[display("NC")] - Nc, - #[serde(rename = "NZ")] - #[display("NZ")] - Nz, - #[serde(rename = "NI")] - #[display("NI")] - Ni, - #[serde(rename = "NE")] - #[display("NE")] - Ne, - #[serde(rename = "NG")] - #[display("NG")] - Ng, - #[serde(rename = "NU")] - #[display("NU")] - Nu, - #[serde(rename = "NF")] - #[display("NF")] - Nf, - #[serde(rename = "MK")] - #[display("MK")] - Mk, - #[serde(rename = "MP")] - #[display("MP")] - Mp, - #[serde(rename = "NO")] - #[display("NO")] - No, - #[serde(rename = "OM")] - #[display("OM")] - Om, - #[serde(rename = "PK")] - #[display("PK")] - Pk, - #[serde(rename = "PW")] - #[display("PW")] - Pw, - #[serde(rename = "PS")] - #[display("PS")] - Ps, - #[serde(rename = "PA")] - #[display("PA")] - Pa, - #[serde(rename = "PG")] - #[display("PG")] - Pg, - #[serde(rename = "PY")] - #[display("PY")] - Py, - #[serde(rename = "PE")] - #[display("PE")] - Pe, - #[serde(rename = "PH")] - #[display("PH")] - Ph, - #[serde(rename = "PN")] - #[display("PN")] - Pn, - #[serde(rename = "PL")] - #[display("PL")] - Pl, - #[serde(rename = "PT")] - #[display("PT")] - Pt, - #[serde(rename = "PR")] - #[display("PR")] - Pr, - #[serde(rename = "QA")] - #[display("QA")] - Qa, - #[serde(rename = "RO")] - #[display("RO")] - Ro, - #[serde(rename = "RU")] - #[display("RU")] - Ru, - #[serde(rename = "RW")] - #[display("RW")] - Rw, - #[serde(rename = "RE")] - #[display("RE")] - Re, - #[serde(rename = "BL")] - #[display("BL")] - Bl, - #[serde(rename = "SH")] - #[display("SH")] - Sh, - #[serde(rename = "KN")] - #[display("KN")] - Kn, - #[serde(rename = "LC")] - #[display("LC")] - Lc, - #[serde(rename = "MF")] - #[display("MF")] - Mf, - #[serde(rename = "PM")] - #[display("PM")] - Pm, - #[serde(rename = "VC")] - #[display("VC")] - Vc, - #[serde(rename = "WS")] - #[display("WS")] - Ws, - #[serde(rename = "SM")] - #[display("SM")] - Sm, - #[serde(rename = "ST")] - #[display("ST")] - St, - #[serde(rename = "SA")] - #[display("SA")] - Sa, - #[serde(rename = "SN")] - #[display("SN")] - Sn, - #[serde(rename = "RS")] - #[display("RS")] - Rs, - #[serde(rename = "SC")] - #[display("SC")] - Sc, - #[serde(rename = "SL")] - #[display("SL")] - Sl, - #[serde(rename = "SG")] - #[display("SG")] - Sg, - #[serde(rename = "SX")] - #[display("SX")] - Sx, - #[serde(rename = "SK")] - #[display("SK")] - Sk, - #[serde(rename = "SI")] - #[display("SI")] - Si, - #[serde(rename = "SB")] - #[display("SB")] - Sb, - #[serde(rename = "SO")] - #[display("SO")] - So, - #[serde(rename = "ZA")] - #[display("ZA")] - Za, - #[serde(rename = "GS")] - #[display("GS")] - Gs, - #[serde(rename = "SS")] - #[display("SS")] - Ss, - #[serde(rename = "ES")] - #[display("ES")] - Es, - #[serde(rename = "LK")] - #[display("LK")] - Lk, - #[serde(rename = "SD")] - #[display("SD")] - Sd, - #[serde(rename = "SR")] - #[display("SR")] - Sr, - #[serde(rename = "SJ")] - #[display("SJ")] - Sj, - #[serde(rename = "SE")] - #[display("SE")] - Se, - #[serde(rename = "CH")] - #[display("CH")] - Ch, - #[serde(rename = "TW")] - #[display("TW")] - Tw, - #[serde(rename = "TJ")] - #[display("TJ")] - Tj, - #[serde(rename = "TZ")] - #[display("TZ")] - Tz, - #[serde(rename = "TH")] - #[display("TH")] - Th, - #[serde(rename = "TL")] - #[display("TL")] - Tl, - #[serde(rename = "TG")] - #[display("TG")] - Tg, - #[serde(rename = "TK")] - #[display("TK")] - Tk, - #[serde(rename = "TO")] - #[display("TO")] - To, - #[serde(rename = "TT")] - #[display("TT")] - Tt, - #[serde(rename = "TN")] - #[display("TN")] - Tn, - #[serde(rename = "TR")] - #[display("TR")] - Tr, - #[serde(rename = "TM")] - #[display("TM")] - Tm, - #[serde(rename = "TC")] - #[display("TC")] - Tc, - #[serde(rename = "TV")] - #[display("TV")] - Tv, - #[serde(rename = "UG")] - #[display("UG")] - Ug, - #[serde(rename = "UA")] - #[display("UA")] - Ua, - #[serde(rename = "AE")] - #[display("AE")] - Ae, - #[serde(rename = "GB")] - #[display("GB")] - Gb, - #[serde(rename = "US")] - #[display("US")] - Us, - #[serde(rename = "UM")] - #[display("UM")] - Um, - #[serde(rename = "UY")] - #[display("UY")] - Uy, - #[serde(rename = "UZ")] - #[display("UZ")] - Uz, - #[serde(rename = "VU")] - #[display("VU")] - Vu, - #[serde(rename = "VE")] - #[display("VE")] - Ve, - #[serde(rename = "VN")] - #[display("VN")] - Vn, - #[serde(rename = "VG")] - #[display("VG")] - Vg, - #[serde(rename = "VI")] - #[display("VI")] - Vi, - #[serde(rename = "WF")] - #[display("WF")] - Wf, - #[serde(rename = "EH")] - #[display("EH")] - Eh, - #[serde(rename = "YE")] - #[display("YE")] - Ye, - #[serde(rename = "ZM")] - #[display("ZM")] - Zm, - #[serde(rename = "ZW")] - #[display("ZW")] - Zw, -} - -#[doc = "UserAddressRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserAddressRequest { - #[doc = "The classification of the address."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The formatted mailing address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The full street address component, which may include house number, street name, P.O. \ - box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ - 4.1.2.."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub street_address: Option, - #[doc = "The city or locality component."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locality: Option, - #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub region: Option, - #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, -} - -impl std::fmt::Display for UserAddressRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserAddressRequest { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(street_address) = &self.street_address { - format!("{:?}", street_address).into() - } else { - String::new().into() - }, - if let Some(locality) = &self.locality { - format!("{:?}", locality).into() - } else { - String::new().into() - }, - if let Some(region) = &self.region { - format!("{:?}", region).into() - } else { - String::new().into() - }, - if let Some(postal_code) = &self.postal_code { - format!("{:?}", postal_code).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "type_".into(), - "formatted".into(), - "street_address".into(), - "locality".into(), - "region".into(), - "postal_code".into(), - "country".into(), - ] - } -} - -#[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserPhoneNumberType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "MOBILE")] - #[display("MOBILE")] - Mobile, - #[serde(rename = "FAX")] - #[display("FAX")] - Fax, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "UserPhoneNumber."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserPhoneNumber { - #[doc = "The canonical global phone number pursuant to RFC3966."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The display value of the phone number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, -} - -impl std::fmt::Display for UserPhoneNumber { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserPhoneNumber { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(display) = &self.display { - format!("{:?}", display).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into(), "display".into()] - } -} - -#[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum UserPhoneNumberRequestType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "MOBILE")] - #[display("MOBILE")] - Mobile, - #[serde(rename = "FAX")] - #[display("FAX")] - Fax, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "UserPhoneNumberRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserPhoneNumberRequest { - #[doc = "The canonical global phone number pursuant to RFC3966."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The display value of the phone number."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, -} - -impl std::fmt::Display for UserPhoneNumberRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserPhoneNumberRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(display) = &self.display { - format!("{:?}", display).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into(), "display".into()] - } -} - -#[doc = "The classification of the email."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum EmailType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "Email."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Email { - #[doc = "A valid email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the email."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The display value of the email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, -} - -impl std::fmt::Display for Email { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Email { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(display) = &self.display { - format!("{:?}", display).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into(), "display".into()] - } -} - -#[doc = "The classification of the email."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum EmailRequestType { - #[serde(rename = "HOME")] - #[display("HOME")] - Home, - #[serde(rename = "WORK")] - #[display("WORK")] - Work, - #[serde(rename = "OTHER")] - #[display("OTHER")] - Other, -} - -#[doc = "EmailRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct EmailRequest { - #[doc = "A valid email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub value: Option, - #[doc = "The classification of the email."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The display value of the email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display: Option, -} - -impl std::fmt::Display for EmailRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for EmailRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(value) = &self.value { - format!("{:?}", value).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(display) = &self.display { - format!("{:?}", display).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["value".into(), "type_".into(), "display".into()] - } -} - -#[doc = "UserName."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserName { - #[doc = "The user's full name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The given legal name of the user, or first name in most Western languages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub given_name: Option, - #[doc = "The middle name(s) of the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub middle_name: Option, - #[doc = "The legal family name of the user, or last name in most Western languages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family_name: Option, - #[doc = "The preferred given name, or first name in most Western languages, by the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_given_name: Option, - #[doc = "The preferred family name, or last name in most Western languages, by the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_family_name: Option, -} - -impl std::fmt::Display for UserName { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserName { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(given_name) = &self.given_name { - format!("{:?}", given_name).into() - } else { - String::new().into() - }, - if let Some(middle_name) = &self.middle_name { - format!("{:?}", middle_name).into() - } else { - String::new().into() - }, - if let Some(family_name) = &self.family_name { - format!("{:?}", family_name).into() - } else { - String::new().into() - }, - if let Some(preferred_given_name) = &self.preferred_given_name { - format!("{:?}", preferred_given_name).into() - } else { - String::new().into() - }, - if let Some(preferred_family_name) = &self.preferred_family_name { - format!("{:?}", preferred_family_name).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "formatted".into(), - "given_name".into(), - "middle_name".into(), - "family_name".into(), - "preferred_given_name".into(), - "preferred_family_name".into(), - ] - } -} - -#[doc = "UserNameRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct UserNameRequest { - #[doc = "The user's full name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub formatted: Option, - #[doc = "The given legal name of the user, or first name in most Western languages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub given_name: Option, - #[doc = "The middle name(s) of the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub middle_name: Option, - #[doc = "The legal family name of the user, or last name in most Western languages."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub family_name: Option, - #[doc = "The preferred given name, or first name in most Western languages, by the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_given_name: Option, - #[doc = "The preferred family name, or last name in most Western languages, by the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_family_name: Option, -} - -impl std::fmt::Display for UserNameRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for UserNameRequest { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - if let Some(formatted) = &self.formatted { - format!("{:?}", formatted).into() - } else { - String::new().into() - }, - if let Some(given_name) = &self.given_name { - format!("{:?}", given_name).into() - } else { - String::new().into() - }, - if let Some(middle_name) = &self.middle_name { - format!("{:?}", middle_name).into() - } else { - String::new().into() - }, - if let Some(family_name) = &self.family_name { - format!("{:?}", family_name).into() - } else { - String::new().into() - }, - if let Some(preferred_given_name) = &self.preferred_given_name { - format!("{:?}", preferred_given_name).into() - } else { - String::new().into() - }, - if let Some(preferred_family_name) = &self.preferred_family_name { - format!("{:?}", preferred_family_name).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "formatted".into(), - "given_name".into(), - "middle_name".into(), - "family_name".into(), - "preferred_given_name".into(), - "preferred_family_name".into(), - ] - } -} - -#[doc = "Application status"] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum ApplicationStatus { - #[serde(rename = "ACTIVE")] - #[display("ACTIVE")] - Active, - #[serde(rename = "REJECTED")] - #[display("REJECTED")] - Rejected, - #[serde(rename = "HIRED")] - #[display("HIRED")] - Hired, - #[serde(rename = "ARCHIVED")] - #[display("ARCHIVED")] - Archived, -} - -#[doc = "Application."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Application { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Application status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Application stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, - #[doc = "Application creation date"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub applied_at: Option, - #[doc = "Job requisition ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "Job requisition\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job: Option, - #[doc = "Application url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl std::fmt::Display for Application { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Application { - const LENGTH: usize = 9; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(stage) = &self.stage { - format!("{:?}", stage).into() - } else { - String::new().into() - }, - if let Some(applied_at) = &self.applied_at { - format!("{:?}", applied_at).into() - } else { - String::new().into() - }, - if let Some(job_id) = &self.job_id { - format!("{:?}", job_id).into() - } else { - String::new().into() - }, - if let Some(job) = &self.job { - format!("{:?}", job).into() - } else { - String::new().into() - }, - if let Some(url) = &self.url { - format!("{:?}", url).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "status".into(), - "stage".into(), - "applied_at".into(), - "job_id".into(), - "job".into(), - "url".into(), - ] - } -} - -#[doc = "Application status"] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum ApplicationRequestStatus { - #[serde(rename = "ACTIVE")] - #[display("ACTIVE")] - Active, - #[serde(rename = "REJECTED")] - #[display("REJECTED")] - Rejected, - #[serde(rename = "HIRED")] - #[display("HIRED")] - Hired, - #[serde(rename = "ARCHIVED")] - #[display("ARCHIVED")] - Archived, -} - -#[doc = "ApplicationRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ApplicationRequest { - #[doc = "Application status"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "Application stage"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stage: Option, - #[doc = "Application creation date"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub applied_at: Option, - #[doc = "Job requisition ID"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_id: Option, - #[doc = "Application url"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl std::fmt::Display for ApplicationRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ApplicationRequest { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(stage) = &self.stage { - format!("{:?}", stage).into() - } else { - String::new().into() - }, - if let Some(applied_at) = &self.applied_at { - format!("{:?}", applied_at).into() - } else { - String::new().into() - }, - if let Some(job_id) = &self.job_id { - format!("{:?}", job_id).into() - } else { - String::new().into() - }, - if let Some(url) = &self.url { - format!("{:?}", url).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "status".into(), - "stage".into(), - "applied_at".into(), - "job_id".into(), - "url".into(), - ] - } -} - -#[doc = "Job requisition status"] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum JobRequisitionStatus { - #[serde(rename = "OPEN")] - #[display("OPEN")] - Open, - #[serde(rename = "CLOSED")] - #[display("CLOSED")] - Closed, - #[serde(rename = "PUBLISHED")] - #[display("PUBLISHED")] - Published, - #[serde(rename = "DRAFT")] - #[display("DRAFT")] - Draft, - #[serde(rename = "ARCHIVED")] - #[display("ARCHIVED")] - Archived, -} - -#[doc = "JobRequisition."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobRequisition { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Job requisition name"] - pub name: String, - #[doc = "Job requisition status"] - pub status: JobRequisitionStatus, -} - -impl std::fmt::Display for JobRequisition { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobRequisition { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - format!("{:?}", self.status).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "status".into(), - ] - } -} - -#[doc = "Job requisition status"] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum JobRequisitionRequestStatus { - #[serde(rename = "OPEN")] - #[display("OPEN")] - Open, - #[serde(rename = "CLOSED")] - #[display("CLOSED")] - Closed, - #[serde(rename = "PUBLISHED")] - #[display("PUBLISHED")] - Published, - #[serde(rename = "DRAFT")] - #[display("DRAFT")] - Draft, - #[serde(rename = "ARCHIVED")] - #[display("ARCHIVED")] - Archived, -} - -#[doc = "JobRequisitionRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobRequisitionRequest { - #[doc = "Job requisition name"] - pub name: String, - #[doc = "Job requisition status"] - pub status: JobRequisitionRequestStatus, -} - -impl std::fmt::Display for JobRequisitionRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobRequisitionRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - format!("{:?}", self.status).into(), - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "status".into()] - } -} - -#[doc = "Candidate."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Candidate { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Candidate first name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_name: Option, - #[doc = "Candidate last name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last_name: Option, - #[doc = "Candidate email"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option, - #[doc = "Candidate phone number"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_number: Option, - #[doc = "Candidate timezone"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} - -impl std::fmt::Display for Candidate { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Candidate { - const LENGTH: usize = 8; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(first_name) = &self.first_name { - format!("{:?}", first_name).into() - } else { - String::new().into() - }, - if let Some(last_name) = &self.last_name { - format!("{:?}", last_name).into() - } else { - String::new().into() - }, - if let Some(email) = &self.email { - format!("{:?}", email).into() - } else { - String::new().into() - }, - if let Some(phone_number) = &self.phone_number { - format!("{:?}", phone_number).into() - } else { - String::new().into() - }, - if let Some(timezone) = &self.timezone { - format!("{:?}", timezone).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "first_name".into(), - "last_name".into(), - "email".into(), - "phone_number".into(), - "timezone".into(), - ] - } -} - -#[doc = "CandidateRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CandidateRequest { - #[doc = "Candidate first name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_name: Option, - #[doc = "Candidate last name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub last_name: Option, - #[doc = "Candidate email"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option, - #[doc = "Candidate phone number"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_number: Option, - #[doc = "Candidate timezone"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} - -impl std::fmt::Display for CandidateRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CandidateRequest { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - if let Some(first_name) = &self.first_name { - format!("{:?}", first_name).into() - } else { - String::new().into() - }, - if let Some(last_name) = &self.last_name { - format!("{:?}", last_name).into() - } else { - String::new().into() - }, - if let Some(email) = &self.email { - format!("{:?}", email).into() - } else { - String::new().into() - }, - if let Some(phone_number) = &self.phone_number { - format!("{:?}", phone_number).into() - } else { - String::new().into() - }, - if let Some(timezone) = &self.timezone { - format!("{:?}", timezone).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "first_name".into(), - "last_name".into(), - "email".into(), - "phone_number".into(), - "timezone".into(), - ] - } -} - -#[doc = "The data type of the custom field."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CustomFieldType { - #[serde(rename = "TEXT")] - #[display("TEXT")] - Text, - #[serde(rename = "DATE")] - #[display("DATE")] - Date, - #[serde(rename = "NUMBER")] - #[display("NUMBER")] - Number, - #[serde(rename = "CURRENCY")] - #[display("CURRENCY")] - Currency, - #[serde(rename = "PERCENTAGE")] - #[display("PERCENTAGE")] - Percentage, - #[serde(rename = "SELECT")] - #[display("SELECT")] - Select, - #[serde(rename = "FILE")] - #[display("FILE")] - File, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "RADIO")] - #[display("RADIO")] - Radio, - #[serde(rename = "TEXTAREA")] - #[display("TEXTAREA")] - Textarea, - #[serde(rename = "RANGE")] - #[display("RANGE")] - Range, - #[serde(rename = "REFERENCE_ID")] - #[display("REFERENCE_ID")] - ReferenceId, - #[serde(rename = "BOOLEAN")] - #[display("BOOLEAN")] - Boolean, - #[serde(rename = "ADDRESS")] - #[display("ADDRESS")] - Address, - #[serde(rename = "OG_REFERENCE_FIELD")] - #[display("OG_REFERENCE_FIELD")] - OgReferenceField, - #[serde(rename = "NATIVE_EDGE")] - #[display("NATIVE_EDGE")] - NativeEdge, - #[serde(rename = "DATETIME")] - #[display("DATETIME")] - Datetime, - #[serde(rename = "EMAIL")] - #[display("EMAIL")] - Email, - #[serde(rename = "URL")] - #[display("URL")] - Url, -} - -#[doc = "CustomField."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CustomField { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the custom field."] - pub name: String, - #[doc = "The description of the custom field."] - pub description: String, - #[doc = "Whether the custom field is required."] - pub required: bool, - #[doc = "The data type of the custom field."] - #[serde(rename = "type")] - pub type_: CustomFieldType, -} - -impl std::fmt::Display for CustomField { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CustomField { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - self.description.clone().into(), - format!("{:?}", self.required).into(), - format!("{:?}", self.type_).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "description".into(), - "required".into(), - "type_".into(), - ] - } -} - -#[doc = "The data type of the custom field."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CustomFieldRequestType { - #[serde(rename = "TEXT")] - #[display("TEXT")] - Text, - #[serde(rename = "DATE")] - #[display("DATE")] - Date, - #[serde(rename = "NUMBER")] - #[display("NUMBER")] - Number, - #[serde(rename = "CURRENCY")] - #[display("CURRENCY")] - Currency, - #[serde(rename = "PERCENTAGE")] - #[display("PERCENTAGE")] - Percentage, - #[serde(rename = "SELECT")] - #[display("SELECT")] - Select, - #[serde(rename = "FILE")] - #[display("FILE")] - File, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "RADIO")] - #[display("RADIO")] - Radio, - #[serde(rename = "TEXTAREA")] - #[display("TEXTAREA")] - Textarea, - #[serde(rename = "RANGE")] - #[display("RANGE")] - Range, - #[serde(rename = "REFERENCE_ID")] - #[display("REFERENCE_ID")] - ReferenceId, - #[serde(rename = "BOOLEAN")] - #[display("BOOLEAN")] - Boolean, - #[serde(rename = "ADDRESS")] - #[display("ADDRESS")] - Address, - #[serde(rename = "OG_REFERENCE_FIELD")] - #[display("OG_REFERENCE_FIELD")] - OgReferenceField, - #[serde(rename = "NATIVE_EDGE")] - #[display("NATIVE_EDGE")] - NativeEdge, - #[serde(rename = "DATETIME")] - #[display("DATETIME")] - Datetime, - #[serde(rename = "EMAIL")] - #[display("EMAIL")] - Email, - #[serde(rename = "URL")] - #[display("URL")] - Url, -} - -#[doc = "CustomFieldRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct CustomFieldRequest { - #[doc = "The name of the custom field."] - pub name: String, - #[doc = "The description of the custom field."] - pub description: String, - #[doc = "Whether the custom field is required."] - pub required: bool, - #[doc = "The data type of the custom field."] - #[serde(rename = "type")] - pub type_: CustomFieldRequestType, -} - -impl std::fmt::Display for CustomFieldRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for CustomFieldRequest { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - self.description.clone().into(), - format!("{:?}", self.required).into(), - format!("{:?}", self.type_).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "name".into(), - "description".into(), - "required".into(), - "type_".into(), - ] - } -} - -#[doc = "JobCode."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobCode { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the job dimension."] - pub name: String, - #[doc = "The ID of the job dimension this job code belongs to."] - pub job_dimension_id: String, - #[doc = "The job dimension this job code belongs to.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_dimension: Option, - #[doc = "The unique identifier of the job code in an outside system."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub external_id: Option, - #[doc = "The ID of the job roster group."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub group_id: Option, -} - -impl std::fmt::Display for JobCode { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobCode { - const LENGTH: usize = 8; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - self.job_dimension_id.clone().into(), - if let Some(job_dimension) = &self.job_dimension { - format!("{:?}", job_dimension).into() - } else { - String::new().into() - }, - if let Some(external_id) = &self.external_id { - format!("{:?}", external_id).into() - } else { - String::new().into() - }, - if let Some(group_id) = &self.group_id { - format!("{:?}", group_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "job_dimension_id".into(), - "job_dimension".into(), - "external_id".into(), - "group_id".into(), - ] - } -} - -#[doc = "JobCodeRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobCodeRequest { - #[doc = "The name of the job dimension."] - pub name: String, - #[doc = "The ID of the job dimension this job code belongs to."] - pub job_dimension_id: String, - #[doc = "The unique identifier of the job code in an outside system."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub external_id: Option, -} - -impl std::fmt::Display for JobCodeRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobCodeRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - self.job_dimension_id.clone().into(), - if let Some(external_id) = &self.external_id { - format!("{:?}", external_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "name".into(), - "job_dimension_id".into(), - "external_id".into(), - ] - } -} - -#[doc = "JobDimension."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobDimension { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the job dimension"] - pub name: String, - #[doc = "The unique identifier of the job dimension in a third party system"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub external_id: Option, -} - -impl std::fmt::Display for JobDimension { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobDimension { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - if let Some(external_id) = &self.external_id { - format!("{:?}", external_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "external_id".into(), - ] - } -} - -#[doc = "JobDimensionRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobDimensionRequest { - #[doc = "The name of the job dimension"] - pub name: String, - #[doc = "The unique identifier of the job dimension in a third party system"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub external_id: Option, -} - -impl std::fmt::Display for JobDimensionRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobDimensionRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - if let Some(external_id) = &self.external_id { - format!("{:?}", external_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "external_id".into()] - } -} - -#[doc = "TimeCard."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeCard { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The ID of the worker associated with the time card."] - pub worker_id: String, - #[doc = "The worker associated with the time card.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub worker: Option, - #[doc = "The pay period associated with the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_period: Option, - #[doc = "The summary of the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option, -} - -impl std::fmt::Display for TimeCard { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeCard { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.worker_id.clone().into(), - if let Some(worker) = &self.worker { - format!("{:?}", worker).into() - } else { - String::new().into() - }, - if let Some(pay_period) = &self.pay_period { - format!("{:?}", pay_period).into() - } else { - String::new().into() - }, - if let Some(summary) = &self.summary { - format!("{:?}", summary).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "worker_id".into(), - "worker".into(), - "pay_period".into(), - "summary".into(), - ] - } -} - -#[doc = "TimeCardRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeCardRequest { - #[doc = "The ID of the worker associated with the time card."] - pub worker_id: String, - #[doc = "The pay period associated with the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_period: Option, - #[doc = "The summary of the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summary: Option, -} - -impl std::fmt::Display for TimeCardRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeCardRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - self.worker_id.clone().into(), - if let Some(pay_period) = &self.pay_period { - format!("{:?}", pay_period).into() - } else { - String::new().into() - }, - if let Some(summary) = &self.summary { - format!("{:?}", summary).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["worker_id".into(), "pay_period".into(), "summary".into()] - } -} - -#[doc = "TimeCardSummary."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeCardSummary { - #[doc = "The earnings for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub earnings: Option, - #[doc = "The amount of hours worked for each job code for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hours_worked_by_job_code: Option, - #[doc = "The premiums for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub premiums: Option, - #[doc = "The approved hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approved_hours: Option, - #[doc = "The paid hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub paid_hours: Option, - #[doc = "The total hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_hours: Option, - #[doc = "The total paid time off hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_paid_time_off_hours: Option, - #[doc = "The total holiday hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_holiday_hours: Option, - #[doc = "The total unpaid time off hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_unpaid_time_off_hours: Option, - #[doc = "The total number of regular hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub regular_hours: Option, - #[doc = "The total number of overtime hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overtime_hours: Option, - #[doc = "The total number of doubletime hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_overtime_hours: Option, -} - -impl std::fmt::Display for TimeCardSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeCardSummary { - const LENGTH: usize = 12; - fn fields(&self) -> Vec> { - vec![ - if let Some(earnings) = &self.earnings { - format!("{:?}", earnings).into() - } else { - String::new().into() - }, - if let Some(hours_worked_by_job_code) = &self.hours_worked_by_job_code { - format!("{:?}", hours_worked_by_job_code).into() - } else { - String::new().into() - }, - if let Some(premiums) = &self.premiums { - format!("{:?}", premiums).into() - } else { - String::new().into() - }, - if let Some(approved_hours) = &self.approved_hours { - format!("{:?}", approved_hours).into() - } else { - String::new().into() - }, - if let Some(paid_hours) = &self.paid_hours { - format!("{:?}", paid_hours).into() - } else { - String::new().into() - }, - if let Some(total_hours) = &self.total_hours { - format!("{:?}", total_hours).into() - } else { - String::new().into() - }, - if let Some(total_paid_time_off_hours) = &self.total_paid_time_off_hours { - format!("{:?}", total_paid_time_off_hours).into() - } else { - String::new().into() - }, - if let Some(total_holiday_hours) = &self.total_holiday_hours { - format!("{:?}", total_holiday_hours).into() - } else { - String::new().into() - }, - if let Some(total_unpaid_time_off_hours) = &self.total_unpaid_time_off_hours { - format!("{:?}", total_unpaid_time_off_hours).into() - } else { - String::new().into() - }, - if let Some(regular_hours) = &self.regular_hours { - format!("{:?}", regular_hours).into() - } else { - String::new().into() - }, - if let Some(overtime_hours) = &self.overtime_hours { - format!("{:?}", overtime_hours).into() - } else { - String::new().into() - }, - if let Some(double_overtime_hours) = &self.double_overtime_hours { - format!("{:?}", double_overtime_hours).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "earnings".into(), - "hours_worked_by_job_code".into(), - "premiums".into(), - "approved_hours".into(), - "paid_hours".into(), - "total_hours".into(), - "total_paid_time_off_hours".into(), - "total_holiday_hours".into(), - "total_unpaid_time_off_hours".into(), - "regular_hours".into(), - "overtime_hours".into(), - "double_overtime_hours".into(), - ] - } -} - -#[doc = "TimeCardSummaryRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeCardSummaryRequest { - #[doc = "The earnings for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub earnings: Option, - #[doc = "The amount of hours worked for each job code for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hours_worked_by_job_code: Option, - #[doc = "The premiums for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub premiums: Option, - #[doc = "The approved hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub approved_hours: Option, - #[doc = "The paid hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub paid_hours: Option, - #[doc = "The total hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_hours: Option, - #[doc = "The total paid time off hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_paid_time_off_hours: Option, - #[doc = "The total holiday hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_holiday_hours: Option, - #[doc = "The total unpaid time off hours for the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_unpaid_time_off_hours: Option, - #[doc = "The total number of regular hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub regular_hours: Option, - #[doc = "The total number of overtime hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub overtime_hours: Option, - #[doc = "The total number of doubletime hours worked during the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_overtime_hours: Option, -} - -impl std::fmt::Display for TimeCardSummaryRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeCardSummaryRequest { - const LENGTH: usize = 12; - fn fields(&self) -> Vec> { - vec![ - if let Some(earnings) = &self.earnings { - format!("{:?}", earnings).into() - } else { - String::new().into() - }, - if let Some(hours_worked_by_job_code) = &self.hours_worked_by_job_code { - format!("{:?}", hours_worked_by_job_code).into() - } else { - String::new().into() - }, - if let Some(premiums) = &self.premiums { - format!("{:?}", premiums).into() - } else { - String::new().into() - }, - if let Some(approved_hours) = &self.approved_hours { - format!("{:?}", approved_hours).into() - } else { - String::new().into() - }, - if let Some(paid_hours) = &self.paid_hours { - format!("{:?}", paid_hours).into() - } else { - String::new().into() - }, - if let Some(total_hours) = &self.total_hours { - format!("{:?}", total_hours).into() - } else { - String::new().into() - }, - if let Some(total_paid_time_off_hours) = &self.total_paid_time_off_hours { - format!("{:?}", total_paid_time_off_hours).into() - } else { - String::new().into() - }, - if let Some(total_holiday_hours) = &self.total_holiday_hours { - format!("{:?}", total_holiday_hours).into() - } else { - String::new().into() - }, - if let Some(total_unpaid_time_off_hours) = &self.total_unpaid_time_off_hours { - format!("{:?}", total_unpaid_time_off_hours).into() - } else { - String::new().into() - }, - if let Some(regular_hours) = &self.regular_hours { - format!("{:?}", regular_hours).into() - } else { - String::new().into() - }, - if let Some(overtime_hours) = &self.overtime_hours { - format!("{:?}", overtime_hours).into() - } else { - String::new().into() - }, - if let Some(double_overtime_hours) = &self.double_overtime_hours { - format!("{:?}", double_overtime_hours).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "earnings".into(), - "hours_worked_by_job_code".into(), - "premiums".into(), - "approved_hours".into(), - "paid_hours".into(), - "total_hours".into(), - "total_paid_time_off_hours".into(), - "total_holiday_hours".into(), - "total_unpaid_time_off_hours".into(), - "regular_hours".into(), - "overtime_hours".into(), - "double_overtime_hours".into(), - ] - } -} - -#[doc = "JobCodeSummary."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobCodeSummary { - #[doc = "List of job code ids that this summary is tracking hours for."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_code_ids: Option, - #[doc = "List of job codes that this summary is tracking hours for.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_codes: Option, - #[doc = "The total hours worked for the job codes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hours_worked: Option, -} - -impl std::fmt::Display for JobCodeSummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobCodeSummary { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(job_code_ids) = &self.job_code_ids { - format!("{:?}", job_code_ids).into() - } else { - String::new().into() - }, - if let Some(job_codes) = &self.job_codes { - format!("{:?}", job_codes).into() - } else { - String::new().into() - }, - if let Some(hours_worked) = &self.hours_worked { - format!("{:?}", hours_worked).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "job_code_ids".into(), - "job_codes".into(), - "hours_worked".into(), - ] - } -} - -#[doc = "JobCodeSummaryRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobCodeSummaryRequest { - #[doc = "List of job code ids that this summary is tracking hours for."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_code_ids: Option, - #[doc = "The total hours worked for the job codes."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hours_worked: Option, -} - -impl std::fmt::Display for JobCodeSummaryRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobCodeSummaryRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(job_code_ids) = &self.job_code_ids { - format!("{:?}", job_code_ids).into() - } else { - String::new().into() - }, - if let Some(hours_worked) = &self.hours_worked { - format!("{:?}", hours_worked).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["job_code_ids".into(), "hours_worked".into()] - } -} - -#[doc = "PayPeriod."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct PayPeriod { - #[doc = "The start date of the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[doc = "The end date of the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[doc = "The ID of the pay schedule associated with the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_schedule_id: Option, -} - -impl std::fmt::Display for PayPeriod { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for PayPeriod { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() - } else { - String::new().into() - }, - if let Some(pay_schedule_id) = &self.pay_schedule_id { - format!("{:?}", pay_schedule_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_date".into(), - "end_date".into(), - "pay_schedule_id".into(), - ] - } -} - -#[doc = "PayPeriodRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct PayPeriodRequest { - #[doc = "The start date of the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[doc = "The end date of the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[doc = "The ID of the pay schedule associated with the pay period."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_schedule_id: Option, -} - -impl std::fmt::Display for PayPeriodRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for PayPeriodRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() - } else { - String::new().into() - }, - if let Some(pay_schedule_id) = &self.pay_schedule_id { - format!("{:?}", pay_schedule_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_date".into(), - "end_date".into(), - "pay_schedule_id".into(), - ] - } -} - -#[doc = "ShiftInput."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ShiftInput { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The creator id associated with the shift input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option, - #[doc = "The creator associated with the shift input.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator: Option, - #[doc = "Name of the shift unit."] - pub name: String, - #[doc = "Prompt for the shift unit."] - pub prompt: String, - #[doc = "Type of shift unit."] - #[serde(rename = "type")] - pub type_: String, - #[doc = "Two letter string designating country code which the shift input is associated."] - pub country_code: String, - #[doc = "The party that manages this shift input"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub managed_by: Option, -} - -impl std::fmt::Display for ShiftInput { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ShiftInput { - const LENGTH: usize = 10; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(creator_id) = &self.creator_id { - format!("{:?}", creator_id).into() - } else { - String::new().into() - }, - if let Some(creator) = &self.creator { - format!("{:?}", creator).into() - } else { - String::new().into() - }, - self.name.clone().into(), - self.prompt.clone().into(), - self.type_.clone().into(), - self.country_code.clone().into(), - if let Some(managed_by) = &self.managed_by { - format!("{:?}", managed_by).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "creator_id".into(), - "creator".into(), - "name".into(), - "prompt".into(), - "type_".into(), - "country_code".into(), - "managed_by".into(), - ] - } -} - -#[doc = "ShiftInputRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ShiftInputRequest { - #[doc = "The creator id associated with the shift input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option, - #[doc = "Name of the shift unit."] - pub name: String, - #[doc = "Prompt for the shift unit."] - pub prompt: String, - #[doc = "Type of shift unit."] - #[serde(rename = "type")] - pub type_: String, - #[doc = "Two letter string designating country code which the shift input is associated."] - pub country_code: String, -} - -impl std::fmt::Display for ShiftInputRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ShiftInputRequest { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - if let Some(creator_id) = &self.creator_id { - format!("{:?}", creator_id).into() - } else { - String::new().into() - }, - self.name.clone().into(), - self.prompt.clone().into(), - self.type_.clone().into(), - self.country_code.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "creator_id".into(), - "name".into(), - "prompt".into(), - "type_".into(), - "country_code".into(), - ] - } -} - -#[doc = "The status of the time entry."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum TimeEntryStatus { - #[serde(rename = "DRAFT")] - #[display("DRAFT")] - Draft, - #[serde(rename = "APPROVED")] - #[display("APPROVED")] - Approved, - #[serde(rename = "PAID")] - #[display("PAID")] - Paid, - #[serde(rename = "FINALIZED")] - #[display("FINALIZED")] - Finalized, -} - -#[doc = "TimeEntry."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntry { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The ID of the worker associated with the time entry."] - pub worker_id: String, - #[doc = "The worker associated with the time entry.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub worker: Option, - #[doc = "The start time of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The comments associated with the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option, - #[doc = "The job shifts worked during the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_shifts: Option, - #[doc = "The breaks taken during the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub breaks: Option, - #[doc = "A summary of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub time_entry_summary: Option, - #[doc = "The ID of the time card associated with the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub time_card_id: Option, - #[doc = "The time card associated with the time entry.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub time_card: Option, - #[doc = "The tags associated with the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The unique key of the time entry in an outside system. If set, no other time entry \ - with the same key can be created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub idempotency_key: Option, - #[doc = "Whether the time entry should create an extra hours run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub create_extra_hours_run: Option, - #[doc = "The status of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The pay period associated with the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_period: Option, - #[doc = "Arbitrary shift inputs collected on the time entry"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub shift_input_values: Option, -} - -impl std::fmt::Display for TimeEntry { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntry { - const LENGTH: usize = 19; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.worker_id.clone().into(), - if let Some(worker) = &self.worker { - format!("{:?}", worker).into() - } else { - String::new().into() - }, - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(comments) = &self.comments { - format!("{:?}", comments).into() - } else { - String::new().into() - }, - if let Some(job_shifts) = &self.job_shifts { - format!("{:?}", job_shifts).into() - } else { - String::new().into() - }, - if let Some(breaks) = &self.breaks { - format!("{:?}", breaks).into() - } else { - String::new().into() - }, - if let Some(time_entry_summary) = &self.time_entry_summary { - format!("{:?}", time_entry_summary).into() - } else { - String::new().into() - }, - if let Some(time_card_id) = &self.time_card_id { - format!("{:?}", time_card_id).into() - } else { - String::new().into() - }, - if let Some(time_card) = &self.time_card { - format!("{:?}", time_card).into() - } else { - String::new().into() - }, - if let Some(tags) = &self.tags { - format!("{:?}", tags).into() - } else { - String::new().into() - }, - if let Some(idempotency_key) = &self.idempotency_key { - format!("{:?}", idempotency_key).into() - } else { - String::new().into() - }, - if let Some(create_extra_hours_run) = &self.create_extra_hours_run { - format!("{:?}", create_extra_hours_run).into() - } else { - String::new().into() - }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(pay_period) = &self.pay_period { - format!("{:?}", pay_period).into() - } else { - String::new().into() - }, - if let Some(shift_input_values) = &self.shift_input_values { - format!("{:?}", shift_input_values).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "worker_id".into(), - "worker".into(), - "start_time".into(), - "end_time".into(), - "comments".into(), - "job_shifts".into(), - "breaks".into(), - "time_entry_summary".into(), - "time_card_id".into(), - "time_card".into(), - "tags".into(), - "idempotency_key".into(), - "create_extra_hours_run".into(), - "status".into(), - "pay_period".into(), - "shift_input_values".into(), - ] - } -} - -#[doc = "The status of the time entry."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum TimeEntryRequestStatus { - #[serde(rename = "DRAFT")] - #[display("DRAFT")] - Draft, - #[serde(rename = "APPROVED")] - #[display("APPROVED")] - Approved, - #[serde(rename = "PAID")] - #[display("PAID")] - Paid, - #[serde(rename = "FINALIZED")] - #[display("FINALIZED")] - Finalized, -} - -#[doc = "TimeEntryRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntryRequest { - #[doc = "The ID of the worker associated with the time entry."] - pub worker_id: String, - #[doc = "The duration of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, - #[doc = "The comments associated with the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option, - #[doc = "The job shifts worked during the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_shifts: Option, - #[doc = "The breaks taken during the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub breaks: Option, - #[doc = "The tags associated with the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tags: Option, - #[doc = "The unique key of the time entry in an outside system. If set, no other time entry \ - with the same key can be created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub idempotency_key: Option, - #[doc = "Whether the time entry should create an extra hours run."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub create_extra_hours_run: Option, - #[doc = "The status of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[doc = "The pay period associated with the time card."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pay_period: Option, - #[doc = "Arbitrary shift inputs collected on the time entry"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub shift_input_values: Option, -} - -impl std::fmt::Display for TimeEntryRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntryRequest { - const LENGTH: usize = 11; - fn fields(&self) -> Vec> { - vec![ - self.worker_id.clone().into(), - if let Some(duration) = &self.duration { - format!("{:?}", duration).into() - } else { - String::new().into() - }, - if let Some(comments) = &self.comments { - format!("{:?}", comments).into() - } else { - String::new().into() - }, - if let Some(job_shifts) = &self.job_shifts { - format!("{:?}", job_shifts).into() - } else { - String::new().into() - }, - if let Some(breaks) = &self.breaks { - format!("{:?}", breaks).into() - } else { - String::new().into() - }, - if let Some(tags) = &self.tags { - format!("{:?}", tags).into() - } else { - String::new().into() - }, - if let Some(idempotency_key) = &self.idempotency_key { - format!("{:?}", idempotency_key).into() - } else { - String::new().into() - }, - if let Some(create_extra_hours_run) = &self.create_extra_hours_run { - format!("{:?}", create_extra_hours_run).into() - } else { - String::new().into() - }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(pay_period) = &self.pay_period { - format!("{:?}", pay_period).into() - } else { - String::new().into() - }, - if let Some(shift_input_values) = &self.shift_input_values { - format!("{:?}", shift_input_values).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "worker_id".into(), - "duration".into(), - "comments".into(), - "job_shifts".into(), - "breaks".into(), - "tags".into(), - "idempotency_key".into(), - "create_extra_hours_run".into(), - "status".into(), - "pay_period".into(), - "shift_input_values".into(), - ] - } -} - -#[doc = "ShiftInputValue."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ShiftInputValue { - #[doc = "The id of the relevant shift input"] - pub shift_input_id: String, - #[doc = "The value of the shift input."] - pub value: serde_json::Value, - #[doc = "The role that last added/updated this input.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option, - #[doc = "The id of the role that last added/updated this input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author_id: Option, -} - -impl std::fmt::Display for ShiftInputValue { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ShiftInputValue { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - self.shift_input_id.clone().into(), - format!("{:?}", self.value).into(), - if let Some(author) = &self.author { - format!("{:?}", author).into() - } else { - String::new().into() - }, - if let Some(author_id) = &self.author_id { - format!("{:?}", author_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "shift_input_id".into(), - "value".into(), - "author".into(), - "author_id".into(), - ] - } -} - -#[doc = "ShiftInputValueRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ShiftInputValueRequest { - #[doc = "The id of the relevant shift input"] - pub shift_input_id: String, - #[doc = "The value of the shift input."] - pub value: serde_json::Value, - #[doc = "The id of the role that last added/updated this input."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author_id: Option, -} - -impl std::fmt::Display for ShiftInputValueRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ShiftInputValueRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - self.shift_input_id.clone().into(), - format!("{:?}", self.value).into(), - if let Some(author_id) = &self.author_id { - format!("{:?}", author_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["shift_input_id".into(), "value".into(), "author_id".into()] - } -} - -#[doc = "\nDTO used to store the summary of a TimeEntry\n"] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntrySummary { - #[doc = "The number of overtime hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub over_time_hours: Option, - #[doc = "The number of double overtime hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_over_time_hours: Option, - #[doc = "The number of regular hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub regular_hours: Option, - #[doc = "The duration of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, -} - -impl std::fmt::Display for TimeEntrySummary { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntrySummary { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - if let Some(over_time_hours) = &self.over_time_hours { - format!("{:?}", over_time_hours).into() - } else { - String::new().into() - }, - if let Some(double_over_time_hours) = &self.double_over_time_hours { - format!("{:?}", double_over_time_hours).into() - } else { - String::new().into() - }, - if let Some(regular_hours) = &self.regular_hours { - format!("{:?}", regular_hours).into() - } else { - String::new().into() - }, - if let Some(duration) = &self.duration { - format!("{:?}", duration).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "over_time_hours".into(), - "double_over_time_hours".into(), - "regular_hours".into(), - "duration".into(), - ] - } -} - -#[doc = "\nDTO used to store the summary of a TimeEntry\n"] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntrySummaryRequest { - #[doc = "The number of overtime hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub over_time_hours: Option, - #[doc = "The number of double overtime hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_over_time_hours: Option, - #[doc = "The number of regular hours worked during this time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub regular_hours: Option, - #[doc = "The duration of the time entry."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub duration: Option, -} - -impl std::fmt::Display for TimeEntrySummaryRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntrySummaryRequest { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - if let Some(over_time_hours) = &self.over_time_hours { - format!("{:?}", over_time_hours).into() - } else { - String::new().into() - }, - if let Some(double_over_time_hours) = &self.double_over_time_hours { - format!("{:?}", double_over_time_hours).into() - } else { - String::new().into() - }, - if let Some(regular_hours) = &self.regular_hours { - format!("{:?}", regular_hours).into() - } else { - String::new().into() - }, - if let Some(duration) = &self.duration { - format!("{:?}", duration).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "over_time_hours".into(), - "double_over_time_hours".into(), - "regular_hours".into(), - "duration".into(), - ] - } -} - -#[doc = "Break."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Break { - #[doc = "The start time of the break."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the break."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The original start time of the break. If the startTime field has been rounded then \ - this contain the start time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_start_time: Option, - #[doc = "The original end time of the break. If the endTime field has been rounded then this \ - contain the end time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_end_time: Option, - #[doc = "The ID of the break type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub break_type_id: Option, - #[doc = "The break type.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub break_type: Option, -} - -impl std::fmt::Display for Break { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Break { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(original_start_time) = &self.original_start_time { - format!("{:?}", original_start_time).into() - } else { - String::new().into() - }, - if let Some(original_end_time) = &self.original_end_time { - format!("{:?}", original_end_time).into() - } else { - String::new().into() - }, - if let Some(break_type_id) = &self.break_type_id { - format!("{:?}", break_type_id).into() - } else { - String::new().into() - }, - if let Some(break_type) = &self.break_type { - format!("{:?}", break_type).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_time".into(), - "end_time".into(), - "original_start_time".into(), - "original_end_time".into(), - "break_type_id".into(), - "break_type".into(), - ] - } -} - -#[doc = "BreakRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct BreakRequest { - #[doc = "The start time of the break."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the break."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The ID of the break type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub break_type_id: Option, -} - -impl std::fmt::Display for BreakRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for BreakRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(break_type_id) = &self.break_type_id { - format!("{:?}", break_type_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_time".into(), - "end_time".into(), - "break_type_id".into(), - ] - } -} - -#[doc = "BreakType."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct BreakType { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Description of the break type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Whether the break is paid."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_paid: Option, - #[doc = "Whether the break counts towards hours worked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_over_time_eligible: Option, -} - -impl std::fmt::Display for BreakType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for BreakType { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(description) = &self.description { - format!("{:?}", description).into() - } else { - String::new().into() - }, - if let Some(is_paid) = &self.is_paid { - format!("{:?}", is_paid).into() - } else { - String::new().into() - }, - if let Some(is_over_time_eligible) = &self.is_over_time_eligible { - format!("{:?}", is_over_time_eligible).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "description".into(), - "is_paid".into(), - "is_over_time_eligible".into(), - ] - } -} - -#[doc = "BreakTypeRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct BreakTypeRequest { - #[doc = "Description of the break type."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Whether the break is paid."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_paid: Option, - #[doc = "Whether the break counts towards hours worked"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_over_time_eligible: Option, -} - -impl std::fmt::Display for BreakTypeRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for BreakTypeRequest { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(description) = &self.description { - format!("{:?}", description).into() - } else { - String::new().into() - }, - if let Some(is_paid) = &self.is_paid { - format!("{:?}", is_paid).into() - } else { - String::new().into() - }, - if let Some(is_over_time_eligible) = &self.is_over_time_eligible { - format!("{:?}", is_over_time_eligible).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "description".into(), - "is_paid".into(), - "is_over_time_eligible".into(), - ] - } -} - -#[doc = "JobShift."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobShift { - #[doc = "The start time of the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The original start time of the job shift. If the startTime field has been rounded \ - then this contain the start time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_start_time: Option, - #[doc = "The original end time of the job shift. If the endTime field has been rounded then \ - this contain the end time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_end_time: Option, - #[doc = "The IDs of the job codes associated with the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_code_ids: Option, - #[doc = "The job codes associated with the job shift.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_codes: Option, - #[doc = "Whether the job shift was entered as a duration in hours table"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_hours_only_input: Option, -} - -impl std::fmt::Display for JobShift { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobShift { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(original_start_time) = &self.original_start_time { - format!("{:?}", original_start_time).into() - } else { - String::new().into() - }, - if let Some(original_end_time) = &self.original_end_time { - format!("{:?}", original_end_time).into() - } else { - String::new().into() - }, - if let Some(job_code_ids) = &self.job_code_ids { - format!("{:?}", job_code_ids).into() - } else { - String::new().into() - }, - if let Some(job_codes) = &self.job_codes { - format!("{:?}", job_codes).into() - } else { - String::new().into() - }, - if let Some(is_hours_only_input) = &self.is_hours_only_input { - format!("{:?}", is_hours_only_input).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_time".into(), - "end_time".into(), - "original_start_time".into(), - "original_end_time".into(), - "job_code_ids".into(), - "job_codes".into(), - "is_hours_only_input".into(), - ] - } -} - -#[doc = "JobShiftRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct JobShiftRequest { - #[doc = "The start time of the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_time: Option, - #[doc = "The end time of the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_time: Option, - #[doc = "The original start time of the job shift. If the startTime field has been rounded \ - then this contain the start time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_start_time: Option, - #[doc = "The original end time of the job shift. If the endTime field has been rounded then \ - this contain the end time before the rounding occured."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub original_end_time: Option, - #[doc = "The IDs of the job codes associated with the job shift."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub job_code_ids: Option, - #[doc = "Whether the job shift was entered as a duration in hours table"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub is_hours_only_input: Option, -} - -impl std::fmt::Display for JobShiftRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for JobShiftRequest { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - if let Some(start_time) = &self.start_time { - format!("{:?}", start_time).into() - } else { - String::new().into() - }, - if let Some(end_time) = &self.end_time { - format!("{:?}", end_time).into() - } else { - String::new().into() - }, - if let Some(original_start_time) = &self.original_start_time { - format!("{:?}", original_start_time).into() - } else { - String::new().into() - }, - if let Some(original_end_time) = &self.original_end_time { - format!("{:?}", original_end_time).into() - } else { - String::new().into() - }, - if let Some(job_code_ids) = &self.job_code_ids { - format!("{:?}", job_code_ids).into() - } else { - String::new().into() - }, - if let Some(is_hours_only_input) = &self.is_hours_only_input { - format!("{:?}", is_hours_only_input).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "start_time".into(), - "end_time".into(), - "original_start_time".into(), - "original_end_time".into(), - "job_code_ids".into(), - "is_hours_only_input".into(), - ] - } -} - -#[doc = "TimeEntryComment."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntryComment { - #[doc = "The time the comment was created."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub created_at: Option, - #[doc = "The ID of the worker who made of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author_id: Option, - #[doc = "The worker who made the comment.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub author: Option, - #[doc = "The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option, -} - -impl std::fmt::Display for TimeEntryComment { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntryComment { - const LENGTH: usize = 4; - fn fields(&self) -> Vec> { - vec![ - if let Some(created_at) = &self.created_at { - format!("{:?}", created_at).into() - } else { - String::new().into() - }, - if let Some(author_id) = &self.author_id { - format!("{:?}", author_id).into() - } else { - String::new().into() - }, - if let Some(author) = &self.author { - format!("{:?}", author).into() - } else { - String::new().into() - }, - if let Some(text) = &self.text { - format!("{:?}", text).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "created_at".into(), - "author_id".into(), - "author".into(), - "text".into(), - ] - } -} - -#[doc = "TimeEntryCommentRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct TimeEntryCommentRequest { - #[doc = "The text of the comment."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub text: Option, -} - -impl std::fmt::Display for TimeEntryCommentRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for TimeEntryCommentRequest { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(text) = &self.text { - format!("{:?}", text).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["text".into()] - } -} - -#[doc = "EntitlementModel."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct EntitlementModel { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Description of the entitlement"] - pub description: String, - #[doc = "Display name of the entitlement"] - pub display_name: String, -} - -impl std::fmt::Display for EntitlementModel { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for EntitlementModel { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.description.clone().into(), - self.display_name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec!["id".into(), "description".into(), "display_name".into()] - } -} - -#[doc = "EntitlementModelRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct EntitlementModelRequest { - #[doc = "Description of the entitlement"] - pub description: String, - #[doc = "Display name of the entitlement"] - pub display_name: String, -} - -impl std::fmt::Display for EntitlementModelRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for EntitlementModelRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.description.clone().into(), - self.display_name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec!["description".into(), "display_name".into()] - } -} - -#[doc = "Ssome."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Ssome { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The user's work email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "The company ID of the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company_id: Option, - #[doc = "The company of the user.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company: Option, -} - -impl std::fmt::Display for Ssome { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Ssome { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() - } else { - String::new().into() - }, - if let Some(company_id) = &self.company_id { - format!("{:?}", company_id).into() - } else { - String::new().into() - }, - if let Some(company) = &self.company { - format!("{:?}", company).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "work_email".into(), - "company_id".into(), - "company".into(), - ] - } -} - -#[doc = "SsomeRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct SsomeRequest { - #[doc = "The user's work email address."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "The company ID of the user."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company_id: Option, -} - -impl std::fmt::Display for SsomeRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for SsomeRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() - } else { - String::new().into() - }, - if let Some(company_id) = &self.company_id { - format!("{:?}", company_id).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["work_email".into(), "company_id".into()] - } -} - -#[doc = "WorkLocation."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct WorkLocation { - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the work location."] - pub name: String, - #[doc = "The address for the work location."] - pub address: Address, -} - -impl std::fmt::Display for WorkLocation { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for WorkLocation { - const LENGTH: usize = 5; - fn fields(&self) -> Vec> { - vec![ - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - format!("{:?}", self.address).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "address".into(), - ] - } -} - -#[doc = "WorkLocationRequest."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct WorkLocationRequest { - #[doc = "The name of the work location."] - pub name: String, - #[doc = "The address for the work location."] - pub address: Address, -} - -impl std::fmt::Display for WorkLocationRequest { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for WorkLocationRequest { - const LENGTH: usize = 2; - fn fields(&self) -> Vec> { - vec![ - self.name.clone().into(), - format!("{:?}", self.address).into(), - ] - } - - fn headers() -> Vec> { - vec!["name".into(), "address".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListDepartmentsResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListDepartmentsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListDepartmentsResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct GetDepartmentsResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the department."] - pub name: String, - #[doc = "The parent department."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent department.\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, -} - -impl std::fmt::Display for GetDepartmentsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetDepartmentsResponse { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "meta".into(), - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "parent_id".into(), - "parent".into(), - ] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListEmploymentTypesResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListEmploymentTypesResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListEmploymentTypesResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and are \ - not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ - managed by an employer, work under the employer's direct supervision and control, and are \ - protected by law for wages and employment rights."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum GetEmploymentTypesResponseType { - #[serde(rename = "CONTRACTOR")] - #[display("CONTRACTOR")] - Contractor, - #[serde(rename = "EMPLOYEE")] - #[display("EMPLOYEE")] - Employee, -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct GetEmploymentTypesResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The display label of the employment type."] - pub label: String, - #[doc = "The name of the employment type for non-custom employment types."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ - self-employed workers who provide services on a short-term or per-project basis and \ - are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ - and managed by an employer, work under the employer's direct supervision and \ - control, and are protected by law for wages and employment rights."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ - paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ - worked."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub compensation_time_period: Option, - #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ - hours per week. Full-time workers will typically be eligible for benefits. * \ - `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ - for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ - workers are hired on a temporary basis. You can specify how each worker with this \ - employment type will be paid individually."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub amount_worked: Option, -} - -impl std::fmt::Display for GetEmploymentTypesResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetEmploymentTypesResponse { - const LENGTH: usize = 9; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.label.clone().into(), - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(compensation_time_period) = &self.compensation_time_period { - format!("{:?}", compensation_time_period).into() - } else { - String::new().into() - }, - if let Some(amount_worked) = &self.amount_worked { - format!("{:?}", amount_worked).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "meta".into(), - "id".into(), - "created_at".into(), - "updated_at".into(), - "label".into(), - "name".into(), - "type_".into(), - "compensation_time_period".into(), - "amount_worked".into(), - ] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListTeamsResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListTeamsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListTeamsResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct GetTeamsResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The parent team"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[doc = "The parent team\n\nExpandable field"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, - #[doc = "The name of the team."] - pub name: String, -} - -impl std::fmt::Display for GetTeamsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetTeamsResponse { - const LENGTH: usize = 7; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(parent_id) = &self.parent_id { - format!("{:?}", parent_id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() - } else { - String::new().into() - }, - self.name.clone().into(), - ] - } - - fn headers() -> Vec> { - vec![ - "meta".into(), - "id".into(), - "created_at".into(), - "updated_at".into(), - "parent_id".into(), - "parent".into(), - "name".into(), - ] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListWorkLocationsResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListWorkLocationsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListWorkLocationsResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct GetWorkLocationsResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "The name of the work location."] - pub name: String, - #[doc = "The address for the work location."] - pub address: Address, -} - -impl std::fmt::Display for GetWorkLocationsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetWorkLocationsResponse { - const LENGTH: usize = 6; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - self.name.clone().into(), - format!("{:?}", self.address).into(), - ] - } - - fn headers() -> Vec> { - vec![ - "meta".into(), - "id".into(), - "created_at".into(), - "updated_at".into(), - "name".into(), - "address".into(), - ] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListWorkersResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListWorkersResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListWorkersResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListUsersResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListUsersResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListUsersResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct GetUsersResponse { - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[doc = "Identifier field"] - pub id: String, - #[doc = "Record creation date"] - pub created_at: String, - #[doc = "Record update date"] - pub updated_at: String, - #[doc = "Whether the user is able to access company resources, typically when they are in \ - actively engaged with the company and not after off-boarding."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub active: Option, - #[doc = "The unique identifier across Rippling used by the User for direct authentication \ - into their associated company. Globally unique."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub username: Option, - #[doc = "The user's name."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The display name of the user using either the concatenated preferred given and \ - family name or username depending on availability."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The user's email addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub emails: Option, - #[doc = "The user's phone numbers."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone_numbers: Option, - #[doc = "The user's addresses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub addresses: Option, - #[doc = "The user's photos."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub photos: Option, - #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ - Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - #[doc = "The User's default location for purposes of localization of currency, date time \ - format, or numerical representations pursuant to RFC5646."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub locale: Option, - #[doc = "The User's current time zone in IANA database Olson format"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} - -impl std::fmt::Display for GetUsersResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetUsersResponse { - const LENGTH: usize = 15; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - self.id.clone().into(), - self.created_at.clone().into(), - self.updated_at.clone().into(), - if let Some(active) = &self.active { - format!("{:?}", active).into() - } else { - String::new().into() - }, - if let Some(username) = &self.username { - format!("{:?}", username).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(display_name) = &self.display_name { - format!("{:?}", display_name).into() - } else { - String::new().into() - }, - if let Some(emails) = &self.emails { - format!("{:?}", emails).into() - } else { - String::new().into() - }, - if let Some(phone_numbers) = &self.phone_numbers { - format!("{:?}", phone_numbers).into() - } else { - String::new().into() - }, - if let Some(addresses) = &self.addresses { - format!("{:?}", addresses).into() - } else { - String::new().into() - }, - if let Some(photos) = &self.photos { - format!("{:?}", photos).into() - } else { - String::new().into() - }, - if let Some(preferred_language) = &self.preferred_language { - format!("{:?}", preferred_language).into() - } else { - String::new().into() - }, - if let Some(locale) = &self.locale { - format!("{:?}", locale).into() - } else { - String::new().into() - }, - if let Some(timezone) = &self.timezone { - format!("{:?}", timezone).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec![ - "meta".into(), - "id".into(), - "created_at".into(), - "updated_at".into(), - "active".into(), - "username".into(), - "name".into(), - "display_name".into(), - "emails".into(), - "phone_numbers".into(), - "addresses".into(), - "photos".into(), - "preferred_language".into(), - "locale".into(), - "timezone".into(), - ] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListCompaniesResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListCompaniesResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListCompaniesResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListEntitlementsResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListEntitlementsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListEntitlementsResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} - -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct ListCustomFieldsResponse { - #[doc = "A list of redacted fields."] - #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] - pub meta: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, - #[doc = "A link to the next page of responses."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub next_link: Option, -} - -impl std::fmt::Display for ListCustomFieldsResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for ListCustomFieldsResponse { - const LENGTH: usize = 3; - fn fields(&self) -> Vec> { - vec![ - if let Some(meta) = &self.meta { - format!("{:?}", meta).into() - } else { - String::new().into() - }, - if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }, - if let Some(next_link) = &self.next_link { - format!("{:?}", next_link).into() - } else { - String::new().into() - }, - ] - } - - fn headers() -> Vec> { - vec!["meta".into(), "results".into(), "next_link".into()] - } -} diff --git a/rippling/README.md b/rippling/README.md index ef4278c..30d9969 100644 --- a/rippling/README.md +++ b/rippling/README.md @@ -6,31 +6,11 @@ A fully generated & opinionated API client for the Rippling API. ## API Details -Using Rippling's API requires either an API key or an access token retrieved from an OAuth exchange. Each is tied to a single Rippling Company. +Documentation for the Rippling Platform API. -If you are a partner building an integration to Rippling,you can use [Rippling's Installation Guide](https://developer.rippling.com/docs/rippling-api/fucwnbc121hiu-installation-guide) to learn how to retrieve an access token to start using Rippling APIs. -If you are a customer, you can go [here](https://developer.rippling.com/docs/rippling-api/9rw6guf819r5f-introduction-for-customers) to learn create your API keys to start using Rippling APIs. -### Using the Interactive Documentation -Rippling's Documentation Portal allows you to test the API endpoints directly within the documentation. To do so, provide your API key or Access Token as a header parameter with the form Authorization Bearer: Bearer. - -[API Terms of Service](https://app.rippling.com/developer/tos) - -### Contact - - -| name | email | -|----|----| -| Rippling Support | support@rippling.com | - -### License - - -| name | -|----| -| MIT | ## Client Details diff --git a/rippling/rippling-api.rs.patch.json b/rippling/rippling-api.rs.patch.json index 0aa5499..5f47a9e 100644 --- a/rippling/rippling-api.rs.patch.json +++ b/rippling/rippling-api.rs.patch.json @@ -9,234 +9,130 @@ }, { "op": "add", - "path": "/paths/~1platform~1api~1app_detail~1app_matching_users/get/x-rust", + "path": "/paths/~1companies/get/x-rust", "value": { - "example": "/// GET Matching App Users\n/// \n/// Returns matching users and their app IDs based on the app handles.\n/// \n/// Note: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`: CSV of app handles. See GET /app_detail/app_handles\n/// \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", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/application_management/struct.ApplicationManagement.html#method.get_app_app_matching_users" + "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`\n/// - `order_by: Option`\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/~1platform~1api~1ats_candidates~1push_candidate/post/x-rust", + "path": "/paths/~1custom-fields/get/x-rust", "value": { - "example": "/// POST New Candidate\n/// \n/// Pushes 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/// \n/// NOTE: This endpoint is NOT available for use with Rippling customer API Keys.\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", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/ats/struct.Ats.html#method.post_candidates_push_candidate" + "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`\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/~1platform~1api~1companies~1current/get/x-rust", + "path": "/paths/~1departments/get/x-rust", "value": { - "example": "/// GET Current Company\n/// \n/// Returns 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.\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", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get" + "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`\n/// - `order_by: Option`\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/~1platform~1api~1company_activity/get/x-rust", + "path": "/paths/~1departments~1{id}/get/x-rust", "value": { - "example": "/// GET Company Activity\n/// \n/// Retrieves the activity for a given company.\n/// \n/// The 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/// \n/// The general sequence of steps to leverage the next parameter:\n/// \n/// 1. Issue an initial request using startDate with a value set to some date in the last 90 days\n/// 2. Retrieve the next page of events through the next value from the response data.\n/// 3. Issue the paginated request\n/// 4. Retrieve the next page of events through the next value from the response data\n/// 5. Pause and repeat the previous step\n/// \n/// \n/// **Parameters:**\n/// \n/// - `end_date: Option`: Timestamp to list activity before (inclusive).\n/// - `limit: Option`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n/// - `next: Option`: Specifies the pagination cursor to the next page\n/// - `start_date: Option`: Timestamp to list activity after (inclusive). This should be less than 90 days from now. Defaults to 90 days.\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", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_company_activity" + "example": "/// Retrieve a specific department\n/// \n/// Retrieve a specific department\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option`\n/// - `id: &'astr`: ID of the resource to return (required)\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 \"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/~1platform~1api~1company_leave_types/get/x-rust", + "path": "/paths/~1employment-types/get/x-rust", "value": { - "example": "/// GET Company Leave Types\n/// \n/// Retrieves the current company leave types. The query can be filtered by managedBy field.\n/// \n/// **Parameters:**\n/// \n/// - `managed_by: Option`\nasync fn example_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_company_leave_types(Some(\"some-string\".to_string()))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_company_leave_types" + "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`\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/~1platform~1api~1custom_fields/get/x-rust", + "path": "/paths/~1employment-types~1{id}/get/x-rust", "value": { - "example": "/// GET Custom Fields\n/// \n/// Returns the custom fields for the given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_custom_fields(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_custom_fields" + "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_api::Client::new_from_env();\n let result: rippling_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-api/latest/rippling-api/employment_types/struct.EmploymentTypes.html#method.get" } }, { "op": "add", - "path": "/paths/~1platform~1api~1departments/get/x-rust", + "path": "/paths/~1entitlements/get/x-rust", "value": { - "example": "/// GET Departments\n/// \n/// Returns a list of departments for the given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_departments() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec> = client\n .companies()\n .get_departments(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_departments" + "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/~1platform~1api~1employees/get/x-rust", + "path": "/paths/~1sso-me/get/x-rust", "value": { - "example": "/// GET Employees\n/// \n/// Retrieves the list of active employees currently provisioned within the application. The fields retrieved depend on the employee scopes that you have access to for your access token or API key. The only guarenteed fields include id, personalEmail, and roleState.\n/// \n/// For optimal performance, ensure pagination is used via our limit and offset parameters. Pagination should be set to a maximum of 100.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_employees_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .employees()\n .get(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/employees/struct.Employees.html#method.get" + "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`\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/~1platform~1api~1employees~1include_terminated/get/x-rust", + "path": "/paths/~1teams/get/x-rust", "value": { - "example": "/// GET Employees (Including Terminated)\n/// \n/// This endpoint is similar to the active employees endpoint, but instead, it includes both active and terminated employees.\n/// \n/// For optimal performance, ensure pagination is used via our limit and offset parameters. Pagination should be set to a maximum of 100.\n/// \n/// **Parameters:**\n/// \n/// - `ein: Option`: Employer identification number, also known as the Federal Emplower Identification Number or the Federal Tax Identification Number.\n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\n/// - `send_all_roles: Option`: For integrations that rely on provisioning, this parameter can be used to identify non provisioned roles for compliance purposes. TRUE will return every employee from the company (bypassing any access rules).\nasync fn example_employees_get_include_terminated() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .employees()\n .get_include_terminated(Some(4 as i64), Some(4 as i64), Some(4 as i64), Some(false))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/employees/struct.Employees.html#method.get_include_terminated" + "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`\n/// - `order_by: Option`\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/~1platform~1api~1employees~1{employeeId}/get/x-rust", + "path": "/paths/~1teams~1{id}/get/x-rust", "value": { - "example": "/// GET Employee\n/// \n/// Retrieves the information for a single employee based on the scopes that your API key or access token have access to.\n/// \n/// **Parameters:**\n/// \n/// - `employee_id: &'astr`: Unique identifier for the employee within Rippling. (required)\nasync fn example_employees_get_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Employee = client.employees().get_id(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/employees/struct.Employees.html#method.get_id" + "example": "/// Retrieve a specific team\n/// \n/// Retrieve a specific team\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option`\n/// - `id: &'astr`: ID of the resource to return (required)\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 \"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/~1platform~1api~1groups/get/x-rust", + "path": "/paths/~1users/get/x-rust", "value": { - "example": "/// GET Groups\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Lists the current third-party groups for an organization.\nasync fn example_groups_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client.groups().get().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.get" + "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`\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/~1platform~1api~1groups/post/x-rust", + "path": "/paths/~1users~1{id}/get/x-rust", "value": { - "example": "/// POST Groups\n/// \n/// Creates a generic group, that can be associated within the third-party application.\nasync fn example_groups_post() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .post(&rippling_api::types::PostGroupsRequestBody {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![\"some-string\".to_string()]),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.post" + "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_api::Client::new_from_env();\n let result: rippling_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-api/latest/rippling-api/users/struct.Users.html#method.get" } }, { "op": "add", - "path": "/paths/~1platform~1api~1groups~1{groupId}/delete/x-rust", + "path": "/paths/~1work-locations/get/x-rust", "value": { - "example": "/// DELETE Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Deletes the specified group.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_delete_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n client.groups().delete_id(4 as i64).await?;\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.delete_id" + "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`\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/~1platform~1api~1groups~1{groupId}/get/x-rust", + "path": "/paths/~1work-locations~1{id}/get/x-rust", "value": { - "example": "/// GET Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_get_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .get_id(\n 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.get_id" + "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_api::Client::new_from_env();\n let result: rippling_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-api/latest/rippling-api/work_locations/struct.WorkLocations.html#method.get" } }, { "op": "add", - "path": "/paths/~1platform~1api~1groups~1{groupId}/patch/x-rust", + "path": "/paths/~1workers/get/x-rust", "value": { - "example": "/// PATCH Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_patch_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .patch_id(\n 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.patch_id" + "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`\n/// - `filter: Option`\n/// - `order_by: Option`\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/~1platform~1api~1groups~1{groupId}/put/x-rust", + "path": "/paths/~1workers~1{id}/get/x-rust", "value": { - "example": "/// PUT Group\n/// \n/// Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.\n/// \n/// Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.\n/// \n/// **Parameters:**\n/// \n/// - `group_id: i64`: Unique identifier for the group within Rippling. (required)\nasync fn example_groups_put_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::Group = client\n .groups()\n .put_id(\n 4 as i64,\n &rippling_api::types::GroupUpdatePayload {\n name: Some(\"some-string\".to_string()),\n spoke_id: Some(\"some-string\".to_string()),\n users: Some(vec![serde_json::Value::String(\"some-string\".to_string())]),\n version: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/groups/struct.Groups.html#method.put_id" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_balances/get/x-rust", - "value": { - "example": "/// GET Leave Balances\n/// \n/// Retrieves the leave balances for employees\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offset the returned values\nasync fn example_leaves_get_balances() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetLeaveBalancesResponse = client\n .leaves()\n .get_balances(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.get_balances" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_balances~1{role}/get/x-rust", - "value": { - "example": "/// GET Leave Balance\n/// \n/// Retrieves the leave balances for a given role. A role represents 1 employee. An employee can work at 1 and only 1 company.\n/// \n/// **Parameters:**\n/// \n/// - `role: &'astr`: This is the unique role ID of the employee. It corresponds to the IDs returned in the Get/employees endpoint (required)\nasync fn example_leaves_get_balance() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::GetLeaveBalanceResponse =\n client.leaves().get_balance(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.get_balance" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_requests/get/x-rust", - "value": { - "example": "/// GET Leave Requests\n/// \n/// Retrieves the current leave requests.The query can be filtered by a number of specific query parameters.\n/// \n/// **Parameters:**\n/// \n/// - `end_date: Option`: End date of leave.\n/// - `from: Option`: Filter to capture whether the leave request overlaps with a date range.\n/// - `id: Option`\n/// - `leave_policy: Option`\n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\n/// - `processed_by: Option`\n/// - `requested_by: Option`\n/// - `role: Option`\n/// - `start_date: Option`: Start date of leave.\n/// - `status: Option`\n/// - `to: Option`: Filter to capture whether the leave request overlaps with a date range.\nasync fn example_leaves_get_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .get_requests(\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\n Some(\"some-string\".to_string()),\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/leaves/struct.Leaves.html#method.get_requests" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_requests/post/x-rust", - "value": { - "example": "/// POST Leave Request\n/// \n/// Create a leave request. This endpoint is currently in alpha and should not be used by default. Only TILT managed requests can have a status other than PENDING.\nasync fn example_leaves_post_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::LeaveRequest = client\n .leaves()\n .post_requests(&rippling_api::types::PostLeaveRequestsRequestBody {\n role: \"some-string\".to_string(),\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: \"some-string\".to_string(),\n end_date: \"some-string\".to_string(),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n company_leave_type: \"some-string\".to_string(),\n leave_policy: \"some-string\".to_string(),\n reason_for_leave: Some(\"some-string\".to_string()),\n managed_by: Some(\"some-string\".to_string()),\n external_id: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.post_requests" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_requests~1{id}/patch/x-rust", - "value": { - "example": "/// PATCH Leave Request\n/// \n/// Update an existing leave request. With the exception of TILT-managed leave requests, updates are restricted based on status; APPROVED requests can not be updated with different dates, and the status itself can not be updated. Use the process endpoint to update the status of a PENDING request. For other updates, use the cancel endpoint to cancel the request, and create a new request with the updated information.\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: Unique identifier of the leave request being modified (required)\nasync fn example_leaves_patch_requests_request_id() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .leaves()\n .patch_requests_request_id(\n \"some-string\",\n &rippling_api::types::PatchLeaveRequestsLeaveRequestIdRequestBody {\n requested_by: Some(\"some-string\".to_string()),\n status: Some(\"some-string\".to_string()),\n start_date: Some(\"some-string\".to_string()),\n end_date: Some(\"some-string\".to_string()),\n start_date_start_time: Some(\"some-string\".to_string()),\n end_date_end_time: Some(\"some-string\".to_string()),\n start_date_custom_hours: Some(\"some-string\".to_string()),\n end_date_custom_hours: Some(\"some-string\".to_string()),\n reason_for_leave: Some(\"some-string\".to_string()),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.patch_requests_request_id" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_requests~1{id}~1cancel/post/x-rust", - "value": { - "example": "/// POST Cancel Leave Request\n/// \n/// Cancel a leave request.\n/// \n/// **Parameters:**\n/// \n/// - `id: &'astr`: Unique identifier of the leave request being canceled. (required)\nasync fn example_leaves_cancel_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::LeaveRequest = client.leaves().cancel_requests(\"some-string\").await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.cancel_requests" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1leave_requests~1{id}~1process/post/x-rust", - "value": { - "example": "/// POST Process Leave Request\n/// \n/// Approve or decline a leave request. Only pending requests can be processed (approved / declined). Only an admin or manager is capable of taking action on a request.\n/// \n/// **Parameters:**\n/// \n/// - `action: crate::types::Action`: The action to be taken on the leave request. Can be either approved or declined. (required)\n/// - `id: &'astr`: Unique identifier of the leave request being processed. (required)\nasync fn example_leaves_process_requests() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::LeaveRequest = client\n .leaves()\n .process_requests(rippling_api::types::Action::Decline, \"some-string\")\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/leaves/struct.Leaves.html#method.process_requests" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1levels/get/x-rust", - "value": { - "example": "/// GET Levels\n/// \n/// Retrieves the levels for the company. Levels are set positions for an organization, such as Manager, or Executive.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_levels() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_levels(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_levels" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1mark_app_installed/post/x-rust", - "value": { - "example": "/// Mark App Installed\n/// \n/// This 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/// \n/// Please note, hitting any other endpoint should mark your app as installed as well.\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", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/application_management/struct.ApplicationManagement.html#method.post_mark_app_installed" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1me/get/x-rust", - "value": { - "example": "/// GCurrent User\n/// \n/// Retrieves basic information about the Rippling user whose access token you're using. This is generally used for the SSO flow.\nasync fn example_current_user_get_me() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_api::types::AuthenticatedUserMe = client.current_user().get_me().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/current_user/struct.CurrentUser.html#method.get_me" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1saml~1idp_metadata/get/x-rust", - "value": { - "example": "/// GET SAML Metadata\n/// \n/// Returns a SAML IDP metadata file for the current app integration. Note that this endpoint is only accessible using a token associated with an app integration that has SAML enabled; otherwise it returns a 404 error.\n/// \n/// Rippling's SAML Metadata is per customer app installation. It is not the same across all customers. It is not the same if the customer uninstalls and reinstalls your app. Any time a new app is installed, unique SAML Metadata will be generated specific to that app.\nasync fn example_saml_get_idp_metadata() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: String = client.saml().get_idp_metadata().await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/saml/struct.Saml.html#method.get_idp_metadata" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1teams/get/x-rust", - "value": { - "example": "/// GET Teams\n/// \n/// Retrieves the list of teams for the company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_teams() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_teams(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_teams" - } - }, - { - "op": "add", - "path": "/paths/~1platform~1api~1work_locations/get/x-rust", - "value": { - "example": "/// GET Work Locations\n/// \n/// Returns the list of work locations for a given company.\n/// \n/// **Parameters:**\n/// \n/// - `limit: Option`: Sets a limit on the returned values\n/// - `offset: Option`: Offsets the returned values\nasync fn example_companies_get_work_locations() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: Vec = client\n .companies()\n .get_work_locations(Some(4 as i64), Some(4 as i64))\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n", - "libDocsLink": "https://docs.rs/rippling-api/latest/rippling-api/companies/struct.Companies.html#method.get_work_locations" + "example": "/// Retrieve a specific worker\n/// \n/// Retrieve a specific worker\n/// \n/// **Parameters:**\n/// \n/// - `expand: Option`\n/// - `id: &'astr`: ID of the resource to return (required)\nasync fn example_workers_get() -> anyhow::Result<()> {\n let client = rippling_api::Client::new_from_env();\n let result: rippling_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-api/latest/rippling-api/workers/struct.Workers.html#method.get" } } ] \ No newline at end of file diff --git a/rippling/src/companies.rs b/rippling/src/companies.rs index 4fc0dc8..ecb46f6 100644 --- a/rippling/src/companies.rs +++ b/rippling/src/companies.rs @@ -12,358 +12,25 @@ impl Companies { 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_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```"] + #[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`\n- `order_by: Option`\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 get<'a>(&'a self) -> Result { - let mut req = self.client.client.request( - http::Method::GET, - &format!( - "{}/{}", - self.client.base_url, "platform/api/companies/current" - ), - ); - req = req.bearer_auth(&self.client.token); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[doc = "GET Departments\n\nReturns a list of departments for the given \ - company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ - values\n- `offset: Option`: 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> = 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, - limit: Option, - offset: Option, - ) -> Result>, crate::types::error::Error> { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "platform/api/departments"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = limit { - query_params.push(("limit", format!("{}", p))); - } - - if let Some(p) = offset { - query_params.push(("offset", format!("{}", p))); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[doc = "GET Work Locations\n\nReturns the list of work locations for a given \ - company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ - values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync \ - fn example_companies_get_work_locations() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = 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] - pub async fn get_work_locations<'a>( - &'a self, - limit: Option, - offset: Option, - ) -> Result, crate::types::error::Error> { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "platform/api/work_locations"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = limit { - query_params.push(("limit", format!("{}", p))); - } - - if let Some(p) = offset { - query_params.push(("offset", format!("{}", p))); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[doc = "GET Custom Fields\n\nReturns the custom fields for the given \ - company.\n\n**Parameters:**\n\n- `limit: Option`: Sets a limit on the returned \ - values\n- `offset: Option`: Offsets the returned values\n\n```rust,no_run\nasync \ - fn example_companies_get_custom_fields() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = 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] - pub async fn get_custom_fields<'a>( - &'a self, - limit: Option, - offset: Option, - ) -> Result, crate::types::error::Error> { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "platform/api/custom_fields"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = limit { - query_params.push(("limit", format!("{}", p))); - } - - if let Some(p) = offset { - query_params.push(("offset", format!("{}", p))); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[doc = "GET Teams\n\nRetrieves the list of teams for the company.\n\n**Parameters:**\n\n- \ - `limit: Option`: Sets a limit on the returned values\n- `offset: Option`: \ - 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 = 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, - limit: Option, - offset: Option, - ) -> Result, crate::types::error::Error> { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "platform/api/teams"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = limit { - query_params.push(("limit", format!("{}", p))); - } - - if let Some(p) = offset { - query_params.push(("offset", format!("{}", p))); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[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`: Sets a limit on the returned values\n- `offset: Option`: Offsets \ - 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 = 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] - pub async fn get_levels<'a>( - &'a self, - limit: Option, - offset: Option, - ) -> Result, crate::types::error::Error> { - let mut req = self.client.client.request( - http::Method::GET, - &format!("{}/{}", self.client.base_url, "platform/api/levels"), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = limit { - query_params.push(("limit", format!("{}", p))); - } - - if let Some(p) = offset { - query_params.push(("offset", format!("{}", p))); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[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`\n\n```rust,no_run\nasync fn \ - example_companies_get_company_leave_types() -> anyhow::Result<()> {\n let client = \ - rippling_api::Client::new_from_env();\n let result: \ - Vec = client\n .companies()\n \ - .get_company_leave_types(Some(\"some-string\".to_string()))\n .await?;\n \ - println!(\"{:?}\", result);\n Ok(())\n}\n```"] - #[tracing::instrument] - pub async fn get_company_leave_types<'a>( + pub async fn list<'a>( &'a self, - managed_by: Option, - ) -> Result, crate::types::error::Error> { + expand: Option, + order_by: Option, + ) -> Result { let mut req = self.client.client.request( http::Method::GET, - &format!( - "{}/{}", - self.client.base_url, "platform/api/company_leave_types" - ), + &format!("{}/{}", self.client.base_url, "companies"), ); req = req.bearer_auth(&self.client.token); let mut query_params = vec![]; - if let Some(p) = managed_by { - query_params.push(("managedBy", p)); - } - - req = req.query(&query_params); - let resp = req.send().await?; - let status = resp.status(); - if status.is_success() { - let text = resp.text().await.unwrap_or_default(); - serde_json::from_str(&text).map_err(|err| { - crate::types::error::Error::from_serde_error( - format_serde_error::SerdeError::new(text.to_string(), err), - status, - ) - }) - } else { - let text = resp.text().await.unwrap_or_default(); - return Err(crate::types::error::Error::Server { - body: text.to_string(), - status, - }); - } - } - - #[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`: Timestamp to list activity before (inclusive).\n- `limit: Option`: Specifies the number of results to page (maximum: 1000) (default: 1000)\n- `next: Option`: Specifies the pagination cursor to the next page\n- `start_date: Option`: 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, - end_date: Option, - limit: Option, - next: Option, - start_date: Option, - ) -> Result { - let mut req = self.client.client.request( - http::Method::GET, - &format!( - "{}/{}", - self.client.base_url, "platform/api/company_activity" - ), - ); - req = req.bearer_auth(&self.client.token); - let mut query_params = vec![]; - if let Some(p) = end_date { - query_params.push(("endDate", format!("{}", p))); - } - - if let Some(p) = limit { - query_params.push(("limit", p)); - } - - if let Some(p) = next { - query_params.push(("next", p)); + if let Some(p) = expand { + query_params.push(("expand", p)); } - if let Some(p) = start_date { - query_params.push(("startDate", format!("{}", p))); + if let Some(p) = order_by { + query_params.push(("order_by", p)); } req = req.query(&query_params); diff --git a/rippling-beta/src/custom_fields.rs b/rippling/src/custom_fields.rs similarity index 72% rename from rippling-beta/src/custom_fields.rs rename to rippling/src/custom_fields.rs index 1bdb6a9..1c3a297 100644 --- a/rippling-beta/src/custom_fields.rs +++ b/rippling/src/custom_fields.rs @@ -12,7 +12,13 @@ impl CustomFields { Self { client } } - #[doc = "List custom fields\n\nA 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`\n\n```rust,no_run\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```"] + #[doc = "List custom fields\n\nA 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`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, diff --git a/rippling-beta/src/departments.rs b/rippling/src/departments.rs similarity index 76% rename from rippling-beta/src/departments.rs rename to rippling/src/departments.rs index 2b7b25d..8cd2144 100644 --- a/rippling-beta/src/departments.rs +++ b/rippling/src/departments.rs @@ -12,7 +12,7 @@ impl Departments { Self { client } } - #[doc = "List departments\n\nA 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`\n- `order_by: Option`\n\n```rust,no_run\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```"] + #[doc = "List departments\n\nA 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`\n- `order_by: Option`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -53,7 +53,15 @@ impl Departments { } } - #[doc = "Retrieve a specific department\n\nRetrieve a specific department\n\n**Parameters:**\n\n- `expand: Option`\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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```"] + #[doc = "Retrieve a specific department\n\nRetrieve a specific \ + department\n\n**Parameters:**\n\n- `expand: Option`\n- `id: &'astr`: ID of \ + the resource to return (required)\n\n```rust,no_run\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 \ + \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )\n .await?;\n \ + println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get<'a>( &'a self, diff --git a/rippling-beta/src/employment_types.rs b/rippling/src/employment_types.rs similarity index 70% rename from rippling-beta/src/employment_types.rs rename to rippling/src/employment_types.rs index ae3f18e..0e90425 100644 --- a/rippling-beta/src/employment_types.rs +++ b/rippling/src/employment_types.rs @@ -12,7 +12,13 @@ impl EmploymentTypes { Self { client } } - #[doc = "List employment types\n\nA 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`\n\n```rust,no_run\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```"] + #[doc = "List employment types\n\nA 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`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -48,7 +54,13 @@ impl EmploymentTypes { } } - #[doc = "Retrieve a specific employment type\n\nRetrieve a specific employment type\n\n**Parameters:**\n\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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```"] + #[doc = "Retrieve a specific employment type\n\nRetrieve a specific employment \ + type\n\n**Parameters:**\n\n- `id: &'astr`: ID of the resource to return \ + (required)\n\n```rust,no_run\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(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n \ + .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get<'a>( &'a self, diff --git a/rippling-beta/src/entitlements.rs b/rippling/src/entitlements.rs similarity index 84% rename from rippling-beta/src/entitlements.rs rename to rippling/src/entitlements.rs index 1395d25..9b9be0f 100644 --- a/rippling-beta/src/entitlements.rs +++ b/rippling/src/entitlements.rs @@ -12,7 +12,7 @@ impl Entitlements { Self { client } } - #[doc = "List entitlements\n\nA List of entitlements\n- Requires: `API Tier 1`\n\n```rust,no_run\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```"] + #[doc = "List entitlements\n\nA List of entitlements\n- Requires: `API Tier 1`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, diff --git a/rippling/src/lib.rs b/rippling/src/lib.rs index c8baeb9..911a5fe 100644 --- a/rippling/src/lib.rs +++ b/rippling/src/lib.rs @@ -4,31 +4,11 @@ //! //! ## API Details //! -//! Using Rippling's API requires either an API key or an access token retrieved from an OAuth exchange. Each is tied to a single Rippling Company. +//! Documentation for the Rippling Platform API. //! -//! If you are a partner building an integration to Rippling,you can use [Rippling's Installation Guide](https://developer.rippling.com/docs/rippling-api/fucwnbc121hiu-installation-guide) to learn how to retrieve an access token to start using Rippling APIs. //! -//! If you are a customer, you can go [here](https://developer.rippling.com/docs/rippling-api/9rw6guf819r5f-introduction-for-customers) to learn create your API keys to start using Rippling APIs. //! -//! ### Using the Interactive Documentation //! -//! Rippling's Documentation Portal allows you to test the API endpoints directly within the documentation. To do so, provide your API key or Access Token as a header parameter with the form Authorization Bearer: Bearer. -//! -//! [API Terms of Service](https://app.rippling.com/developer/tos) -//! -//! ### Contact -//! -//! -//! | name | email | -//! |----|----| -//! | Rippling Support | support@rippling.com | -//! -//! ### License -//! -//! -//! | name | -//! |----| -//! | MIT | //! //! //! ## Client Details @@ -74,27 +54,41 @@ #![allow(clippy::too_many_arguments)] #![cfg_attr(docsrs, feature(doc_cfg))] -#[cfg(feature = "requests")] -pub mod application_management; -#[cfg(feature = "requests")] -pub mod ats; +/// Companies on Rippling. #[cfg(feature = "requests")] pub mod companies; +/// Custom fields defined by the company. #[cfg(feature = "requests")] -pub mod current_user; +pub mod custom_fields; +/// Departments used by the company. #[cfg(feature = "requests")] -pub mod employees; +pub mod departments; +/// Employment types used by the company. #[cfg(feature = "requests")] -pub mod groups; +pub mod employment_types; +/// Availability of API features to the company or Partners. #[cfg(feature = "requests")] -pub mod leaves; +pub mod entitlements; +/// Provides the user's SSO information. +#[cfg(feature = "requests")] +pub mod me; mod methods; +/// Teams at the company. #[cfg(feature = "requests")] -pub mod saml; +pub mod teams; #[cfg(test)] mod tests; pub mod types; +/// Users of the company. +#[cfg(feature = "requests")] +pub mod users; pub mod utils; +/// Work locations used by the company. +#[cfg(feature = "requests")] +pub mod work_locations; +/// Workers who work or have worked at the company. +#[cfg(feature = "requests")] +pub mod workers; #[cfg(feature = "requests")] use std::env; @@ -174,7 +168,7 @@ impl Client { .build(); Client { token: token.to_string(), - base_url: "https://api.rippling.com".to_string(), + base_url: "https://rest.ripplingapis.com".to_string(), client, client_http1_only, @@ -188,7 +182,7 @@ impl Client { match (builder_http.build(), builder_websocket.build()) { (Ok(c), Ok(c1)) => Client { token: token.to_string(), - base_url: "https://api.rippling.com".to_string(), + base_url: "https://rest.ripplingapis.com".to_string(), client: c, client_http1_only: c1, @@ -226,7 +220,7 @@ impl Client { .build(); Client { token: token.to_string(), - base_url: "https://api.rippling.com".to_string(), + base_url: "https://rest.ripplingapis.com".to_string(), client, } @@ -239,7 +233,7 @@ impl Client { match builder_http.build() { Ok(c) => Client { token: token.to_string(), - base_url: "https://api.rippling.com".to_string(), + base_url: "https://rest.ripplingapis.com".to_string(), client: c, }, @@ -277,7 +271,7 @@ impl Client { Self::new_from_reqwest(token, client) } - /// Set the base URL for the client to something other than the default: . + /// Set the base URL for the client to something other than the default: . #[tracing::instrument] pub fn set_base_url(&mut self, base_url: H) where @@ -330,43 +324,53 @@ impl Client { Ok(RequestBuilder(req)) } - /// Return a reference to an interface that provides access to Companies operations. - pub fn companies(&self) -> companies::Companies { - companies::Companies::new(self.clone()) + /// Employment types used by the company. + pub fn employment_types(&self) -> employment_types::EmploymentTypes { + employment_types::EmploymentTypes::new(self.clone()) + } + + /// Teams at the company. + pub fn teams(&self) -> teams::Teams { + teams::Teams::new(self.clone()) + } + + /// Availability of API features to the company or Partners. + pub fn entitlements(&self) -> entitlements::Entitlements { + entitlements::Entitlements::new(self.clone()) } - /// Return a reference to an interface that provides access to Employees operations. - pub fn employees(&self) -> employees::Employees { - employees::Employees::new(self.clone()) + /// Users of the company. + pub fn users(&self) -> users::Users { + users::Users::new(self.clone()) } - /// Return a reference to an interface that provides access to Groups operations. - pub fn groups(&self) -> groups::Groups { - groups::Groups::new(self.clone()) + /// Workers who work or have worked at the company. + pub fn workers(&self) -> workers::Workers { + workers::Workers::new(self.clone()) } - /// Return a reference to an interface that provides access to SAML operations. - pub fn saml(&self) -> saml::Saml { - saml::Saml::new(self.clone()) + /// Departments used by the company. + pub fn departments(&self) -> departments::Departments { + departments::Departments::new(self.clone()) } - /// Return a reference to an interface that provides access to Current User operations. - pub fn current_user(&self) -> current_user::CurrentUser { - current_user::CurrentUser::new(self.clone()) + /// Work locations used by the company. + pub fn work_locations(&self) -> work_locations::WorkLocations { + work_locations::WorkLocations::new(self.clone()) } - /// Return a reference to an interface that provides access to ATS operations. - pub fn ats(&self) -> ats::Ats { - ats::Ats::new(self.clone()) + /// Companies on Rippling. + pub fn companies(&self) -> companies::Companies { + companies::Companies::new(self.clone()) } - /// Return a reference to an interface that provides access to Application Management operations. - pub fn application_management(&self) -> application_management::ApplicationManagement { - application_management::ApplicationManagement::new(self.clone()) + /// Custom fields defined by the company. + pub fn custom_fields(&self) -> custom_fields::CustomFields { + custom_fields::CustomFields::new(self.clone()) } - /// Return a reference to an interface that provides access to Leaves operations. - pub fn leaves(&self) -> leaves::Leaves { - leaves::Leaves::new(self.clone()) + /// Provides the user's SSO information. + pub fn me(&self) -> me::Me { + me::Me::new(self.clone()) } } diff --git a/rippling-beta/src/me.rs b/rippling/src/me.rs similarity index 73% rename from rippling-beta/src/me.rs rename to rippling/src/me.rs index 52cbcb8..f643fa4 100644 --- a/rippling-beta/src/me.rs +++ b/rippling/src/me.rs @@ -12,7 +12,13 @@ impl Me { Self { client } } - #[doc = "Retrieve my SSO information\n\nSSO information of the current user\n- Requires: `API Tier 1`\n- Expandable fields: `company`\n\n**Parameters:**\n\n- `expand: Option`\n\n```rust,no_run\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```"] + #[doc = "Retrieve my SSO information\n\nSSO information of the current user\n- Requires: `API \ + Tier 1`\n- Expandable fields: `company`\n\n**Parameters:**\n\n- `expand: \ + Option`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list_sso<'a>( &'a self, diff --git a/rippling-beta/src/teams.rs b/rippling/src/teams.rs similarity index 75% rename from rippling-beta/src/teams.rs rename to rippling/src/teams.rs index 630d2ad..a5196f0 100644 --- a/rippling-beta/src/teams.rs +++ b/rippling/src/teams.rs @@ -12,15 +12,7 @@ impl Teams { Self { client } } - #[doc = "List teams\n\nA 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`\n- `order_by: Option`\n\n```rust,no_run\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```"] + #[doc = "List teams\n\nA 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`\n- `order_by: Option`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -61,7 +53,7 @@ impl Teams { } } - #[doc = "Retrieve a specific team\n\nRetrieve a specific team\n\n**Parameters:**\n\n- `expand: Option`\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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```"] + #[doc = "Retrieve a specific team\n\nRetrieve a specific team\n\n**Parameters:**\n\n- `expand: Option`\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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 \"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\",\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get<'a>( &'a self, diff --git a/rippling/src/types.rs b/rippling/src/types.rs index 32a7e21..c743651 100644 --- a/rippling/src/types.rs +++ b/rippling/src/types.rs @@ -492,7 +492,11442 @@ pub mod error { } } -#[doc = "An ENUM of employment type"] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Meta { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub redacted_fields: Option>, +} + +impl std::fmt::Display for Meta { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Meta { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(redacted_fields) = &self.redacted_fields { + format!("{:?}", redacted_fields).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["redacted_fields".into()] + } +} + +#[doc = "Meta information for the response."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct MetaResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, +} + +impl std::fmt::Display for MetaResponse { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for MetaResponse { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["meta".into()] + } +} + +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct RedactedFieldsRedactedFields { + #[doc = "The name for the redacted field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The reason for the redaction"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +impl std::fmt::Display for RedactedFieldsRedactedFields { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for RedactedFieldsRedactedFields { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(reason) = &self.reason { + format!("{:?}", reason).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "reason".into()] + } +} + +#[doc = "A list of redacted fields."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct RedactedFields { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub redacted_fields: Option>, +} + +impl std::fmt::Display for RedactedFields { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for RedactedFields { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(redacted_fields) = &self.redacted_fields { + format!("{:?}", redacted_fields).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["redacted_fields".into()] + } +} + +#[doc = "Info about the redacted fields."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct RedactedField { + #[doc = "The name for the redacted field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The reason for the redaction"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +impl std::fmt::Display for RedactedField { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for RedactedField { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(reason) = &self.reason { + format!("{:?}", reason).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "reason".into()] + } +} + +#[doc = "The status of the leave request."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Status { + #[serde(rename = "PENDING")] + #[display("PENDING")] + Pending, + #[serde(rename = "APPROVED")] + #[display("APPROVED")] + Approved, + #[serde(rename = "REJECTED")] + #[display("REJECTED")] + Rejected, + #[serde(rename = "CANCELED")] + #[display("CANCELED")] + Canceled, +} + +#[doc = "LeaveRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LeaveRequest { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The ID of the worker associated with the leave request."] + pub worker_id: String, + #[doc = "The worker associated with the leave request.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub worker: Option, + #[doc = "The ID of the worker who requested the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requester_id: Option, + #[doc = "The worker who requested the leave request.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requester: Option, + #[doc = "The status of the leave request."] + pub status: Status, + #[doc = "The start time of the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The end time of the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The comments associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option, + #[doc = "The number of minutes requested for the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number_of_minutes_requested: Option, + #[doc = "The ID of the leave policy associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub leave_policy_id: Option, + #[doc = "The ID of the leave type associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub leave_type_id: Option, + #[doc = "The leave type associated with the leave request.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub leave_type: Option, + #[doc = "The reason for the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason_for_leave: Option, + #[doc = "The ID of the worker who reviewed the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reviewer_id: Option, + #[doc = "The worker who reviewed the leave request.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reviewer: Option, + #[doc = "The timestamp the leave request was reviewed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reviewed_at: Option, + #[doc = "The specific dates taken off and the amount of time taken off for each one."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_take_off: Option, + #[doc = "Whether the leave request is managed by an external system."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_managed_by_external_system: Option, +} + +impl std::fmt::Display for LeaveRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LeaveRequest { + const LENGTH: usize = 21; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.worker_id.clone().into(), + if let Some(worker) = &self.worker { + format!("{:?}", worker).into() + } else { + String::new().into() + }, + if let Some(requester_id) = &self.requester_id { + format!("{:?}", requester_id).into() + } else { + String::new().into() + }, + if let Some(requester) = &self.requester { + format!("{:?}", requester).into() + } else { + String::new().into() + }, + format!("{:?}", self.status).into(), + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(comments) = &self.comments { + format!("{:?}", comments).into() + } else { + String::new().into() + }, + if let Some(number_of_minutes_requested) = &self.number_of_minutes_requested { + format!("{:?}", number_of_minutes_requested).into() + } else { + String::new().into() + }, + if let Some(leave_policy_id) = &self.leave_policy_id { + format!("{:?}", leave_policy_id).into() + } else { + String::new().into() + }, + if let Some(leave_type_id) = &self.leave_type_id { + format!("{:?}", leave_type_id).into() + } else { + String::new().into() + }, + if let Some(leave_type) = &self.leave_type { + format!("{:?}", leave_type).into() + } else { + String::new().into() + }, + if let Some(reason_for_leave) = &self.reason_for_leave { + format!("{:?}", reason_for_leave).into() + } else { + String::new().into() + }, + if let Some(reviewer_id) = &self.reviewer_id { + format!("{:?}", reviewer_id).into() + } else { + String::new().into() + }, + if let Some(reviewer) = &self.reviewer { + format!("{:?}", reviewer).into() + } else { + String::new().into() + }, + if let Some(reviewed_at) = &self.reviewed_at { + format!("{:?}", reviewed_at).into() + } else { + String::new().into() + }, + if let Some(days_take_off) = &self.days_take_off { + format!("{:?}", days_take_off).into() + } else { + String::new().into() + }, + if let Some(is_managed_by_external_system) = &self.is_managed_by_external_system { + format!("{:?}", is_managed_by_external_system).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "worker_id".into(), + "worker".into(), + "requester_id".into(), + "requester".into(), + "status".into(), + "start_time".into(), + "end_time".into(), + "comments".into(), + "number_of_minutes_requested".into(), + "leave_policy_id".into(), + "leave_type_id".into(), + "leave_type".into(), + "reason_for_leave".into(), + "reviewer_id".into(), + "reviewer".into(), + "reviewed_at".into(), + "days_take_off".into(), + "is_managed_by_external_system".into(), + ] + } +} + +#[doc = "LeaveRequestRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LeaveRequestRequest { + #[doc = "The ID of the worker associated with the leave request."] + pub worker_id: String, + #[doc = "The ID of the worker who requested the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub requester_id: Option, + #[doc = "The status of the leave request."] + pub status: Status, + #[doc = "The start time of the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The end time of the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The comments associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub comments: Option, + #[doc = "The number of minutes requested for the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number_of_minutes_requested: Option, + #[doc = "The ID of the leave policy associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub leave_policy_id: Option, + #[doc = "The ID of the leave type associated with the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub leave_type_id: Option, + #[doc = "The reason for the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason_for_leave: Option, + #[doc = "The ID of the worker who reviewed the leave request."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reviewer_id: Option, + #[doc = "The timestamp the leave request was reviewed."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reviewed_at: Option, + #[doc = "The specific dates taken off and the amount of time taken off for each one."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub days_take_off: Option, + #[doc = "Whether the leave request is managed by an external system."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_managed_by_external_system: Option, +} + +impl std::fmt::Display for LeaveRequestRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LeaveRequestRequest { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + self.worker_id.clone().into(), + if let Some(requester_id) = &self.requester_id { + format!("{:?}", requester_id).into() + } else { + String::new().into() + }, + format!("{:?}", self.status).into(), + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(comments) = &self.comments { + format!("{:?}", comments).into() + } else { + String::new().into() + }, + if let Some(number_of_minutes_requested) = &self.number_of_minutes_requested { + format!("{:?}", number_of_minutes_requested).into() + } else { + String::new().into() + }, + if let Some(leave_policy_id) = &self.leave_policy_id { + format!("{:?}", leave_policy_id).into() + } else { + String::new().into() + }, + if let Some(leave_type_id) = &self.leave_type_id { + format!("{:?}", leave_type_id).into() + } else { + String::new().into() + }, + if let Some(reason_for_leave) = &self.reason_for_leave { + format!("{:?}", reason_for_leave).into() + } else { + String::new().into() + }, + if let Some(reviewer_id) = &self.reviewer_id { + format!("{:?}", reviewer_id).into() + } else { + String::new().into() + }, + if let Some(reviewed_at) = &self.reviewed_at { + format!("{:?}", reviewed_at).into() + } else { + String::new().into() + }, + if let Some(days_take_off) = &self.days_take_off { + format!("{:?}", days_take_off).into() + } else { + String::new().into() + }, + if let Some(is_managed_by_external_system) = &self.is_managed_by_external_system { + format!("{:?}", is_managed_by_external_system).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "worker_id".into(), + "requester_id".into(), + "status".into(), + "start_time".into(), + "end_time".into(), + "comments".into(), + "number_of_minutes_requested".into(), + "leave_policy_id".into(), + "leave_type_id".into(), + "reason_for_leave".into(), + "reviewer_id".into(), + "reviewed_at".into(), + "days_take_off".into(), + "is_managed_by_external_system".into(), + ] + } +} + +#[doc = "DayOff."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct DayOff { + #[doc = "The date of the day off."] + pub date: String, + #[doc = "The number of minutes taken off for the day."] + pub number_of_minutes_taken_off: f64, +} + +impl std::fmt::Display for DayOff { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for DayOff { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.date.clone().into(), + format!("{:?}", self.number_of_minutes_taken_off).into(), + ] + } + + fn headers() -> Vec> { + vec!["date".into(), "number_of_minutes_taken_off".into()] + } +} + +#[doc = "DayOffRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct DayOffRequest { + #[doc = "The date of the day off."] + pub date: String, + #[doc = "The number of minutes taken off for the day."] + pub number_of_minutes_taken_off: f64, +} + +impl std::fmt::Display for DayOffRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for DayOffRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.date.clone().into(), + format!("{:?}", self.number_of_minutes_taken_off).into(), + ] + } + + fn headers() -> Vec> { + vec!["date".into(), "number_of_minutes_taken_off".into()] + } +} + +#[doc = "The worker's country."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "The worker's status within the organization."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerStatus { + #[serde(rename = "HIRED")] + #[display("HIRED")] + Hired, + #[serde(rename = "ACCEPTED")] + #[display("ACCEPTED")] + Accepted, + #[serde(rename = "ACTIVE")] + #[display("ACTIVE")] + Active, + #[serde(rename = "TERMINATED")] + #[display("TERMINATED")] + Terminated, +} + +#[doc = "The gender of the worker, if specified."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Gender { + #[serde(rename = "MALE")] + #[display("MALE")] + Male, + #[serde(rename = "FEMALE")] + #[display("FEMALE")] + Female, + #[serde(rename = "NONBINARY")] + #[display("NONBINARY")] + Nonbinary, + #[serde(rename = "UNDETERMINED")] + #[display("UNDETERMINED")] + Undetermined, + #[serde(rename = "DIVERSE")] + #[display("DIVERSE")] + Diverse, + #[serde(rename = "DOES_NOT_APPLY")] + #[display("DOES_NOT_APPLY")] + DoesNotApply, +} + +#[doc = "The identified race of the worker, if specified."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Race { + #[serde(rename = "BLACK")] + #[display("BLACK")] + Black, + #[serde(rename = "BROWN")] + #[display("BROWN")] + Brown, + #[serde(rename = "CHINESE")] + #[display("CHINESE")] + Chinese, + #[serde(rename = "EURASIAN")] + #[display("EURASIAN")] + Eurasian, + #[serde(rename = "INDIAN")] + #[display("INDIAN")] + Indian, + #[serde(rename = "INDIGENOUS")] + #[display("INDIGENOUS")] + Indigenous, + #[serde(rename = "WHITE")] + #[display("WHITE")] + White, + #[serde(rename = "YELLOW")] + #[display("YELLOW")] + Yellow, + #[serde(rename = "NOT_INFORMED")] + #[display("NOT_INFORMED")] + NotInformed, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "The identified ethnicity of the worker, if specified."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Ethnicity { + #[serde(rename = "HISPANIC_OR_LATINO")] + #[display("HISPANIC_OR_LATINO")] + HispanicOrLatino, + #[serde(rename = "WHITE")] + #[display("WHITE")] + White, + #[serde(rename = "BLACK_OR_AFRICAN_AMERICAN")] + #[display("BLACK_OR_AFRICAN_AMERICAN")] + BlackOrAfricanAmerican, + #[serde(rename = "NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER")] + #[display("NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER")] + NativeHawaiianOrOtherPacificIslander, + #[serde(rename = "ASIAN")] + #[display("ASIAN")] + Asian, + #[serde(rename = "AMERICAN_INDIAN_OR_ALASKA_NATIVE")] + #[display("AMERICAN_INDIAN_OR_ALASKA_NATIVE")] + AmericanIndianOrAlaskaNative, + #[serde(rename = "TWO_OR_MORE_RACES")] + #[display("TWO_OR_MORE_RACES")] + TwoOrMoreRaces, + #[serde(rename = "DECLINE_TO_SELF_IDENTIFY")] + #[display("DECLINE_TO_SELF_IDENTIFY")] + DeclineToSelfIdentify, +} + +#[doc = "The countries that the worker has citizenship in."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Citizenship { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "Worker."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Worker { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The worker's associated user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, + #[doc = "The worker's associated user.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user: Option, + #[doc = "The worker's associated legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_entity_id: Option, + #[doc = "The worker's associated legal entity.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_entity: Option, + #[doc = "The worker's country."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "The start date of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "The end date of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The worker's number within the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option, + #[doc = "The worker's associated work email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub work_email: Option, + #[doc = "The worker's associated personal email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub personal_email: Option, + #[doc = "The worker's status within the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The location that the worker is mapped to for tax purposes. In the case that a \ + worker is remote, the location's type is remote."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The worker's employment type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employment_type_id: Option, + #[doc = "The worker's employment type.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employment_type: Option, + #[doc = "The gender of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gender: Option, + #[doc = "The worker's date of birth."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + #[doc = "The identified race of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub race: Option, + #[doc = "The identified ethnicity of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ethnicity: Option, + #[doc = "The countries that the worker has citizenship in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub citizenship: Option, + #[doc = "The compensation package for the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation_id: Option, + #[doc = "The compensation package for the worker.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation: Option, + #[doc = "The worker's assigned department."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub department_id: Option, + #[doc = "The worker's assigned department.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub department: Option, + #[doc = "The worker's assigned teams."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub teams_id: Option, + #[doc = "The worker's assigned teams.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub teams: Option, + #[doc = "The worker's title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The level of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level_id: Option, + #[doc = "The level of the worker.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[doc = "The details of the worker's termination, if applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub termination_details: Option, + #[doc = "Custom fields for the worker"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub custom_fields: Option>, +} + +impl std::fmt::Display for Worker { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Worker { + const LENGTH: usize = 33; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(user_id) = &self.user_id { + format!("{:?}", user_id).into() + } else { + String::new().into() + }, + if let Some(user) = &self.user { + format!("{:?}", user).into() + } else { + String::new().into() + }, + if let Some(legal_entity_id) = &self.legal_entity_id { + format!("{:?}", legal_entity_id).into() + } else { + String::new().into() + }, + if let Some(legal_entity) = &self.legal_entity { + format!("{:?}", legal_entity).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(number) = &self.number { + format!("{:?}", number).into() + } else { + String::new().into() + }, + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() + } else { + String::new().into() + }, + if let Some(personal_email) = &self.personal_email { + format!("{:?}", personal_email).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(location) = &self.location { + format!("{:?}", location).into() + } else { + String::new().into() + }, + if let Some(employment_type_id) = &self.employment_type_id { + format!("{:?}", employment_type_id).into() + } else { + String::new().into() + }, + if let Some(employment_type) = &self.employment_type { + format!("{:?}", employment_type).into() + } else { + String::new().into() + }, + if let Some(gender) = &self.gender { + format!("{:?}", gender).into() + } else { + String::new().into() + }, + if let Some(date_of_birth) = &self.date_of_birth { + format!("{:?}", date_of_birth).into() + } else { + String::new().into() + }, + if let Some(race) = &self.race { + format!("{:?}", race).into() + } else { + String::new().into() + }, + if let Some(ethnicity) = &self.ethnicity { + format!("{:?}", ethnicity).into() + } else { + String::new().into() + }, + if let Some(citizenship) = &self.citizenship { + format!("{:?}", citizenship).into() + } else { + String::new().into() + }, + if let Some(compensation_id) = &self.compensation_id { + format!("{:?}", compensation_id).into() + } else { + String::new().into() + }, + if let Some(compensation) = &self.compensation { + format!("{:?}", compensation).into() + } else { + String::new().into() + }, + if let Some(department_id) = &self.department_id { + format!("{:?}", department_id).into() + } else { + String::new().into() + }, + if let Some(department) = &self.department { + format!("{:?}", department).into() + } else { + String::new().into() + }, + if let Some(teams_id) = &self.teams_id { + format!("{:?}", teams_id).into() + } else { + String::new().into() + }, + if let Some(teams) = &self.teams { + format!("{:?}", teams).into() + } else { + String::new().into() + }, + if let Some(title) = &self.title { + format!("{:?}", title).into() + } else { + String::new().into() + }, + if let Some(level_id) = &self.level_id { + format!("{:?}", level_id).into() + } else { + String::new().into() + }, + if let Some(level) = &self.level { + format!("{:?}", level).into() + } else { + String::new().into() + }, + if let Some(termination_details) = &self.termination_details { + format!("{:?}", termination_details).into() + } else { + String::new().into() + }, + if let Some(custom_fields) = &self.custom_fields { + format!("{:?}", custom_fields).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "user_id".into(), + "user".into(), + "legal_entity_id".into(), + "legal_entity".into(), + "country".into(), + "start_date".into(), + "end_date".into(), + "number".into(), + "work_email".into(), + "personal_email".into(), + "status".into(), + "location".into(), + "employment_type_id".into(), + "employment_type".into(), + "gender".into(), + "date_of_birth".into(), + "race".into(), + "ethnicity".into(), + "citizenship".into(), + "compensation_id".into(), + "compensation".into(), + "department_id".into(), + "department".into(), + "teams_id".into(), + "teams".into(), + "title".into(), + "level_id".into(), + "level".into(), + "termination_details".into(), + "custom_fields".into(), + ] + } +} + +#[doc = "The worker's country."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerRequestCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "The worker's status within the organization."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerRequestStatus { + #[serde(rename = "HIRED")] + #[display("HIRED")] + Hired, + #[serde(rename = "ACCEPTED")] + #[display("ACCEPTED")] + Accepted, + #[serde(rename = "ACTIVE")] + #[display("ACTIVE")] + Active, + #[serde(rename = "TERMINATED")] + #[display("TERMINATED")] + Terminated, +} + +#[doc = "WorkerRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct WorkerRequest { + #[doc = "The worker's associated user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub user_id: Option, + #[doc = "The worker's associated legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_entity_id: Option, + #[doc = "The worker's country."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "The start date of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "The end date of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The worker's number within the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option, + #[doc = "The worker's associated work email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub work_email: Option, + #[doc = "The worker's associated personal email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub personal_email: Option, + #[doc = "The worker's status within the organization."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The location that the worker is mapped to for tax purposes. In the case that a \ + worker is remote, the location's type is remote."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub location: Option, + #[doc = "The worker's employment type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub employment_type_id: Option, + #[doc = "The gender of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gender: Option, + #[doc = "The worker's date of birth."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub date_of_birth: Option, + #[doc = "The identified race of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub race: Option, + #[doc = "The identified ethnicity of the worker, if specified."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub ethnicity: Option, + #[doc = "The countries that the worker has citizenship in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub citizenship: Option, + #[doc = "The compensation package for the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation_id: Option, + #[doc = "The worker's assigned department."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub department_id: Option, + #[doc = "The worker's assigned teams."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub teams_id: Option, + #[doc = "The worker's title."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[doc = "The level of the worker."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub level_id: Option, + #[doc = "The details of the worker's termination, if applicable."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub termination_details: Option, +} + +impl std::fmt::Display for WorkerRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for WorkerRequest { + const LENGTH: usize = 22; + fn fields(&self) -> Vec> { + vec![ + if let Some(user_id) = &self.user_id { + format!("{:?}", user_id).into() + } else { + String::new().into() + }, + if let Some(legal_entity_id) = &self.legal_entity_id { + format!("{:?}", legal_entity_id).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() + } else { + String::new().into() + }, + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() + } else { + String::new().into() + }, + if let Some(number) = &self.number { + format!("{:?}", number).into() + } else { + String::new().into() + }, + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() + } else { + String::new().into() + }, + if let Some(personal_email) = &self.personal_email { + format!("{:?}", personal_email).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(location) = &self.location { + format!("{:?}", location).into() + } else { + String::new().into() + }, + if let Some(employment_type_id) = &self.employment_type_id { + format!("{:?}", employment_type_id).into() + } else { + String::new().into() + }, + if let Some(gender) = &self.gender { + format!("{:?}", gender).into() + } else { + String::new().into() + }, + if let Some(date_of_birth) = &self.date_of_birth { + format!("{:?}", date_of_birth).into() + } else { + String::new().into() + }, + if let Some(race) = &self.race { + format!("{:?}", race).into() + } else { + String::new().into() + }, + if let Some(ethnicity) = &self.ethnicity { + format!("{:?}", ethnicity).into() + } else { + String::new().into() + }, + if let Some(citizenship) = &self.citizenship { + format!("{:?}", citizenship).into() + } else { + String::new().into() + }, + if let Some(compensation_id) = &self.compensation_id { + format!("{:?}", compensation_id).into() + } else { + String::new().into() + }, + if let Some(department_id) = &self.department_id { + format!("{:?}", department_id).into() + } else { + String::new().into() + }, + if let Some(teams_id) = &self.teams_id { + format!("{:?}", teams_id).into() + } else { + String::new().into() + }, + if let Some(title) = &self.title { + format!("{:?}", title).into() + } else { + String::new().into() + }, + if let Some(level_id) = &self.level_id { + format!("{:?}", level_id).into() + } else { + String::new().into() + }, + if let Some(termination_details) = &self.termination_details { + format!("{:?}", termination_details).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "user_id".into(), + "legal_entity_id".into(), + "country".into(), + "start_date".into(), + "end_date".into(), + "number".into(), + "work_email".into(), + "personal_email".into(), + "status".into(), + "location".into(), + "employment_type_id".into(), + "gender".into(), + "date_of_birth".into(), + "race".into(), + "ethnicity".into(), + "citizenship".into(), + "compensation_id".into(), + "department_id".into(), + "teams_id".into(), + "title".into(), + "level_id".into(), + "termination_details".into(), + ] + } +} + +#[doc = "The termination type indicates whether the termination was voluntary or involuntary."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Type { + #[serde(rename = "VOLUNTARY")] + #[display("VOLUNTARY")] + Voluntary, + #[serde(rename = "INVOLUNTARY")] + #[display("INVOLUNTARY")] + Involuntary, + #[serde(rename = "RETIREMENT")] + #[display("RETIREMENT")] + Retirement, + #[serde(rename = "DEATH")] + #[display("DEATH")] + Death, + #[serde(rename = "ABANDONMENT")] + #[display("ABANDONMENT")] + Abandonment, + #[serde(rename = "OFFER_DECLINED")] + #[display("OFFER_DECLINED")] + OfferDeclined, + #[serde(rename = "RESCIND")] + #[display("RESCIND")] + Rescind, + #[serde(rename = "RENEGE")] + #[display("RENEGE")] + Renege, +} + +#[doc = "TerminationDetails."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TerminationDetails { + #[doc = "The termination type indicates whether the termination was voluntary or involuntary."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "This is a description that will be custom to each Rippling company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +impl std::fmt::Display for TerminationDetails { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TerminationDetails { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(reason) = &self.reason { + format!("{:?}", reason).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["type_".into(), "reason".into()] + } +} + +#[doc = "TerminationDetailsRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TerminationDetailsRequest { + #[doc = "The termination type indicates whether the termination was voluntary or involuntary."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "This is a description that will be custom to each Rippling company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub reason: Option, +} + +impl std::fmt::Display for TerminationDetailsRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TerminationDetailsRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(reason) = &self.reason { + format!("{:?}", reason).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["type_".into(), "reason".into()] + } +} + +#[doc = "Level."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Level { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the level. Must be unique within the company or organization."] + pub name: String, + #[doc = "The parent level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent level.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, + #[doc = "Global level is used to track the seniority of levels. The higher up a level is \ + placed on the page, the more senior and higher-ranked the level. Global level is \ + used in workflows, policies, and reports that use the level attribute (e.g., you can \ + use Level Lookup to set up a workflow that notifies the nearest person in an \ + worker's management chain at or above the specified level)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub global_level: Option, + #[doc = "The description of the level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rank of the level within its track."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[doc = "The track associated with the level, if it's not a global level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub track_id: Option, + #[doc = "The track associated with the level, if it's not a global level.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub track: Option, +} + +impl std::fmt::Display for Level { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Level { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + if let Some(global_level) = &self.global_level { + format!("{:?}", global_level).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(rank) = &self.rank { + format!("{:?}", rank).into() + } else { + String::new().into() + }, + if let Some(track_id) = &self.track_id { + format!("{:?}", track_id).into() + } else { + String::new().into() + }, + if let Some(track) = &self.track { + format!("{:?}", track).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "parent_id".into(), + "parent".into(), + "global_level".into(), + "description".into(), + "rank".into(), + "track_id".into(), + "track".into(), + ] + } +} + +#[doc = "LevelRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LevelRequest { + #[doc = "The name of the level. Must be unique within the company or organization."] + pub name: String, + #[doc = "The parent level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "Global level is used to track the seniority of levels. The higher up a level is \ + placed on the page, the more senior and higher-ranked the level. Global level is \ + used in workflows, policies, and reports that use the level attribute (e.g., you can \ + use Level Lookup to set up a workflow that notifies the nearest person in an \ + worker's management chain at or above the specified level)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub global_level: Option, + #[doc = "The description of the level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub description: Option, + #[doc = "The rank of the level within its track."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[doc = "The track associated with the level, if it's not a global level."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub track_id: Option, +} + +impl std::fmt::Display for LevelRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LevelRequest { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(global_level) = &self.global_level { + format!("{:?}", global_level).into() + } else { + String::new().into() + }, + if let Some(description) = &self.description { + format!("{:?}", description).into() + } else { + String::new().into() + }, + if let Some(rank) = &self.rank { + format!("{:?}", rank).into() + } else { + String::new().into() + }, + if let Some(track_id) = &self.track_id { + format!("{:?}", track_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "parent_id".into(), + "global_level".into(), + "description".into(), + "rank".into(), + "track_id".into(), + ] + } +} + +#[doc = "Track."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Track { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the track. Must be unique within the company or organization."] + pub name: String, +} + +impl std::fmt::Display for Track { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Track { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + ] + } +} + +#[doc = "TrackRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TrackRequest { + #[doc = "The name of the track. Must be unique within the company or organization."] + pub name: String, +} + +impl std::fmt::Display for TrackRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TrackRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![self.name.clone().into()] + } + + fn headers() -> Vec> { + vec!["name".into()] + } +} + +#[doc = "Team."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Team { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The parent team"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent team\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option>, + #[doc = "The name of the team."] + pub name: String, +} + +impl std::fmt::Display for Team { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Team { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + self.name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "parent_id".into(), + "parent".into(), + "name".into(), + ] + } +} + +#[doc = "TeamRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TeamRequest { + #[doc = "The parent team"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The name of the team."] + pub name: String, +} + +impl std::fmt::Display for TeamRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TeamRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + self.name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec!["parent_id".into(), "name".into()] + } +} + +#[doc = "Department."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Department { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the department."] + pub name: String, + #[doc = "The parent department."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent department.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option>, +} + +impl std::fmt::Display for Department { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Department { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "parent_id".into(), + "parent".into(), + ] + } +} + +#[doc = "DepartmentRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct DepartmentRequest { + #[doc = "The name of the department."] + pub name: String, + #[doc = "The parent department."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, +} + +impl std::fmt::Display for DepartmentRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for DepartmentRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "parent_id".into()] + } +} + +#[doc = "Compensation."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Compensation { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The worker's ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub worker_id: Option, + #[doc = "The worker's annual compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub annual_compensation: Option, + #[doc = "The worker's annual salary equivalent, for insurance purposes. It will be equal to \ + the worker's annual compensation, except for owners that are receiving no \ + cashcompensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub annual_salary_equivalent: Option, + #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ + with fixed compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hourly_wage: Option, + #[doc = "The worker's monthly compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub monthly_compensation: Option, + #[doc = "The worker's on-target commission."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub on_target_commission: Option, + #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ + with fixed compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub relocation_reimbursement: Option, + #[doc = "The worker's signing bonus."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signing_bonus: Option, + #[doc = "The worker's target annual bonus amount."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target_annual_bonus: Option, + #[doc = "The worker's weekly compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weekly_compensation: Option, + #[doc = "The worker's target annual bonus as a percent of annual compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target_annual_bonus_percent: Option, + #[doc = "The worker's bonus schedule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bonus_schedule: Option, + #[doc = "The payment type for an worker's compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payment_type: Option, + #[doc = "The payment terms for an worker's compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payment_terms: Option, +} + +impl std::fmt::Display for Compensation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Compensation { + const LENGTH: usize = 17; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(worker_id) = &self.worker_id { + format!("{:?}", worker_id).into() + } else { + String::new().into() + }, + if let Some(annual_compensation) = &self.annual_compensation { + format!("{:?}", annual_compensation).into() + } else { + String::new().into() + }, + if let Some(annual_salary_equivalent) = &self.annual_salary_equivalent { + format!("{:?}", annual_salary_equivalent).into() + } else { + String::new().into() + }, + if let Some(hourly_wage) = &self.hourly_wage { + format!("{:?}", hourly_wage).into() + } else { + String::new().into() + }, + if let Some(monthly_compensation) = &self.monthly_compensation { + format!("{:?}", monthly_compensation).into() + } else { + String::new().into() + }, + if let Some(on_target_commission) = &self.on_target_commission { + format!("{:?}", on_target_commission).into() + } else { + String::new().into() + }, + if let Some(relocation_reimbursement) = &self.relocation_reimbursement { + format!("{:?}", relocation_reimbursement).into() + } else { + String::new().into() + }, + if let Some(signing_bonus) = &self.signing_bonus { + format!("{:?}", signing_bonus).into() + } else { + String::new().into() + }, + if let Some(target_annual_bonus) = &self.target_annual_bonus { + format!("{:?}", target_annual_bonus).into() + } else { + String::new().into() + }, + if let Some(weekly_compensation) = &self.weekly_compensation { + format!("{:?}", weekly_compensation).into() + } else { + String::new().into() + }, + if let Some(target_annual_bonus_percent) = &self.target_annual_bonus_percent { + format!("{:?}", target_annual_bonus_percent).into() + } else { + String::new().into() + }, + if let Some(bonus_schedule) = &self.bonus_schedule { + format!("{:?}", bonus_schedule).into() + } else { + String::new().into() + }, + if let Some(payment_type) = &self.payment_type { + format!("{:?}", payment_type).into() + } else { + String::new().into() + }, + if let Some(payment_terms) = &self.payment_terms { + format!("{:?}", payment_terms).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "worker_id".into(), + "annual_compensation".into(), + "annual_salary_equivalent".into(), + "hourly_wage".into(), + "monthly_compensation".into(), + "on_target_commission".into(), + "relocation_reimbursement".into(), + "signing_bonus".into(), + "target_annual_bonus".into(), + "weekly_compensation".into(), + "target_annual_bonus_percent".into(), + "bonus_schedule".into(), + "payment_type".into(), + "payment_terms".into(), + ] + } +} + +#[doc = "CompensationRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CompensationRequest { + #[doc = "The worker's ID."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub worker_id: Option, + #[doc = "The worker's annual compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub annual_compensation: Option, + #[doc = "The worker's annual salary equivalent, for insurance purposes. It will be equal to \ + the worker's annual compensation, except for owners that are receiving no \ + cashcompensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub annual_salary_equivalent: Option, + #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ + with fixed compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hourly_wage: Option, + #[doc = "The worker's monthly compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub monthly_compensation: Option, + #[doc = "The worker's on-target commission."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub on_target_commission: Option, + #[doc = "The worker's hourly wage. This calculation assumes 40-hour work weeks for workers \ + with fixed compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub relocation_reimbursement: Option, + #[doc = "The worker's signing bonus."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub signing_bonus: Option, + #[doc = "The worker's target annual bonus amount."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target_annual_bonus: Option, + #[doc = "The worker's weekly compensation. This calculation assumes 40-hour work weeks for \ + workers with an hourly wage."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub weekly_compensation: Option, + #[doc = "The worker's target annual bonus as a percent of annual compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub target_annual_bonus_percent: Option, + #[doc = "The worker's bonus schedule."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bonus_schedule: Option, + #[doc = "The payment type for an worker's compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payment_type: Option, + #[doc = "The payment terms for an worker's compensation."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub payment_terms: Option, +} + +impl std::fmt::Display for CompensationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CompensationRequest { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + if let Some(worker_id) = &self.worker_id { + format!("{:?}", worker_id).into() + } else { + String::new().into() + }, + if let Some(annual_compensation) = &self.annual_compensation { + format!("{:?}", annual_compensation).into() + } else { + String::new().into() + }, + if let Some(annual_salary_equivalent) = &self.annual_salary_equivalent { + format!("{:?}", annual_salary_equivalent).into() + } else { + String::new().into() + }, + if let Some(hourly_wage) = &self.hourly_wage { + format!("{:?}", hourly_wage).into() + } else { + String::new().into() + }, + if let Some(monthly_compensation) = &self.monthly_compensation { + format!("{:?}", monthly_compensation).into() + } else { + String::new().into() + }, + if let Some(on_target_commission) = &self.on_target_commission { + format!("{:?}", on_target_commission).into() + } else { + String::new().into() + }, + if let Some(relocation_reimbursement) = &self.relocation_reimbursement { + format!("{:?}", relocation_reimbursement).into() + } else { + String::new().into() + }, + if let Some(signing_bonus) = &self.signing_bonus { + format!("{:?}", signing_bonus).into() + } else { + String::new().into() + }, + if let Some(target_annual_bonus) = &self.target_annual_bonus { + format!("{:?}", target_annual_bonus).into() + } else { + String::new().into() + }, + if let Some(weekly_compensation) = &self.weekly_compensation { + format!("{:?}", weekly_compensation).into() + } else { + String::new().into() + }, + if let Some(target_annual_bonus_percent) = &self.target_annual_bonus_percent { + format!("{:?}", target_annual_bonus_percent).into() + } else { + String::new().into() + }, + if let Some(bonus_schedule) = &self.bonus_schedule { + format!("{:?}", bonus_schedule).into() + } else { + String::new().into() + }, + if let Some(payment_type) = &self.payment_type { + format!("{:?}", payment_type).into() + } else { + String::new().into() + }, + if let Some(payment_terms) = &self.payment_terms { + format!("{:?}", payment_terms).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "worker_id".into(), + "annual_compensation".into(), + "annual_salary_equivalent".into(), + "hourly_wage".into(), + "monthly_compensation".into(), + "on_target_commission".into(), + "relocation_reimbursement".into(), + "signing_bonus".into(), + "target_annual_bonus".into(), + "weekly_compensation".into(), + "target_annual_bonus_percent".into(), + "bonus_schedule".into(), + "payment_type".into(), + "payment_terms".into(), + ] + } +} + +#[doc = "Currency."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Currency { + #[doc = "The currency type, ex: USD, EUR, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency_type: Option, + #[doc = "The decimal amount for the currency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +impl std::fmt::Display for Currency { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Currency { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(currency_type) = &self.currency_type { + format!("{:?}", currency_type).into() + } else { + String::new().into() + }, + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["currency_type".into(), "value".into()] + } +} + +#[doc = "CurrencyRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CurrencyRequest { + #[doc = "The currency type, ex: USD, EUR, etc."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub currency_type: Option, + #[doc = "The decimal amount for the currency."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, +} + +impl std::fmt::Display for CurrencyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CurrencyRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(currency_type) = &self.currency_type { + format!("{:?}", currency_type).into() + } else { + String::new().into() + }, + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["currency_type".into(), "value".into()] + } +} + +#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and are \ + not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ + managed by an employer, work under the employer's direct supervision and control, and are \ + protected by law for wages and employment rights."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CompanyEmploymentTypeType { + #[serde(rename = "CONTRACTOR")] + #[display("CONTRACTOR")] + Contractor, + #[serde(rename = "EMPLOYEE")] + #[display("EMPLOYEE")] + Employee, +} + +#[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are paid a \ + fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour worked."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CompensationTimePeriod { + #[serde(rename = "HOURLY")] + #[display("HOURLY")] + Hourly, + #[serde(rename = "SALARIED")] + #[display("SALARIED")] + Salaried, +} + +#[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 hours \ + per week. Full-time workers will typically be eligible for benefits. * `PART-TIME`: \ + Part-time is less than 30 hours per week. These workers may be eligible for benefits, \ + depending on company settings and hours worked. * `TEMPORARY`: These workers are hired on \ + a temporary basis. You can specify how each worker with this employment type will be paid \ + individually."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AmountWorked { + #[serde(rename = "PART-TIME")] + #[display("PART-TIME")] + PartTime, + #[serde(rename = "FULL-TIME")] + #[display("FULL-TIME")] + FullTime, + #[serde(rename = "TEMPORARY")] + #[display("TEMPORARY")] + Temporary, +} + +#[doc = "CompanyEmploymentType."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CompanyEmploymentType { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The display label of the employment type."] + pub label: String, + #[doc = "The name of the employment type for non-custom employment types."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and \ + are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ + and managed by an employer, work under the employer's direct supervision and \ + control, and are protected by law for wages and employment rights."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ + paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ + worked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation_time_period: Option, + #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ + hours per week. Full-time workers will typically be eligible for benefits. * \ + `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ + for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ + workers are hired on a temporary basis. You can specify how each worker with this \ + employment type will be paid individually."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount_worked: Option, +} + +impl std::fmt::Display for CompanyEmploymentType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CompanyEmploymentType { + const LENGTH: usize = 8; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.label.clone().into(), + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(compensation_time_period) = &self.compensation_time_period { + format!("{:?}", compensation_time_period).into() + } else { + String::new().into() + }, + if let Some(amount_worked) = &self.amount_worked { + format!("{:?}", amount_worked).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "label".into(), + "name".into(), + "type_".into(), + "compensation_time_period".into(), + "amount_worked".into(), + ] + } +} + +#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and are \ + not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ + managed by an employer, work under the employer's direct supervision and control, and are \ + protected by law for wages and employment rights."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum CompanyEmploymentTypeRequestType { + #[serde(rename = "CONTRACTOR")] + #[display("CONTRACTOR")] + Contractor, + #[serde(rename = "EMPLOYEE")] + #[display("EMPLOYEE")] + Employee, +} + +#[doc = "CompanyEmploymentTypeRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CompanyEmploymentTypeRequest { + #[doc = "The display label of the employment type."] + pub label: String, + #[doc = "The name of the employment type for non-custom employment types."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and \ + are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ + and managed by an employer, work under the employer's direct supervision and \ + control, and are protected by law for wages and employment rights."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ + paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ + worked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation_time_period: Option, + #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ + hours per week. Full-time workers will typically be eligible for benefits. * \ + `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ + for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ + workers are hired on a temporary basis. You can specify how each worker with this \ + employment type will be paid individually."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub amount_worked: Option, +} + +impl std::fmt::Display for CompanyEmploymentTypeRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CompanyEmploymentTypeRequest { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + self.label.clone().into(), + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(compensation_time_period) = &self.compensation_time_period { + format!("{:?}", compensation_time_period).into() + } else { + String::new().into() + }, + if let Some(amount_worked) = &self.amount_worked { + format!("{:?}", amount_worked).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "label".into(), + "name".into(), + "type_".into(), + "compensation_time_period".into(), + "amount_worked".into(), + ] + } +} + +#[doc = "The type of location."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerLocationType { + #[serde(rename = "REMOTE")] + #[display("REMOTE")] + Remote, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, +} + +#[doc = "WorkerLocation."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct WorkerLocation { + #[doc = "The type of location."] + #[serde(rename = "type")] + pub type_: WorkerLocationType, + #[doc = "The work location, if the worker isn't remote."] + pub work_location_id: String, +} + +impl std::fmt::Display for WorkerLocation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for WorkerLocation { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.type_).into(), + self.work_location_id.clone().into(), + ] + } + + fn headers() -> Vec> { + vec!["type_".into(), "work_location_id".into()] + } +} + +#[doc = "The type of location."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum WorkerLocationRequestType { + #[serde(rename = "REMOTE")] + #[display("REMOTE")] + Remote, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, +} + +#[doc = "WorkerLocationRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct WorkerLocationRequest { + #[doc = "The type of location."] + #[serde(rename = "type")] + pub type_: WorkerLocationRequestType, + #[doc = "The work location, if the worker isn't remote."] + pub work_location_id: String, +} + +impl std::fmt::Display for WorkerLocationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for WorkerLocationRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + format!("{:?}", self.type_).into(), + self.work_location_id.clone().into(), + ] + } + + fn headers() -> Vec> { + vec!["type_".into(), "work_location_id".into()] + } +} + +#[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered the \ + ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a subsidiary, \ + fully or partially held by another. * `BRANCH`: The legal entity is considered a branch, \ + associated with a parent legal entity."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum EntityLevel { + #[serde(rename = "PARENT")] + #[display("PARENT")] + Parent, + #[serde(rename = "SUBSIDIARY")] + #[display("SUBSIDIARY")] + Subsidiary, + #[serde(rename = "BRANCH")] + #[display("BRANCH")] + Branch, +} + +#[doc = "The legal entity management type in the case of an employer of record (EOR) or \ + professional employment organization (PEO). * `PEO`: The legal entity is considered a \ + Professional Employment Organization (PEO). * `EOR`: The legal entity is considered an \ + Employer of Record (EOR)."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ManagementType { + #[serde(rename = "PEO")] + #[display("PEO")] + Peo, + #[serde(rename = "EOR")] + #[display("EOR")] + Eor, +} + +#[doc = "LegalEntity."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LegalEntity { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The tax identifier for the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tax_identifier: Option, + #[doc = "The country the legal entity is based in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "The legal name of the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_name: Option, + #[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered \ + the ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a \ + subsidiary, fully or partially held by another. * `BRANCH`: The legal entity is \ + considered a branch, associated with a parent legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub entity_level: Option, + #[doc = "The registration date of the entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub registration_date: Option, + #[doc = "The mailing address of the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mailing_address: Option
, + #[doc = "The physical address of the legal entity, if it differs from the mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub physical_address: Option
, + #[doc = "The parent legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent legal entity.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option>, + #[doc = "The legal entity management type in the case of an employer of record (EOR) or \ + professional employment organization (PEO). * `PEO`: The legal entity is considered \ + a Professional Employment Organization (PEO). * `EOR`: The legal entity is \ + considered an Employer of Record (EOR)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub management_type: Option, + #[doc = "The company or organization associated with the legal entity"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub company_id: Option, +} + +impl std::fmt::Display for LegalEntity { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LegalEntity { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(tax_identifier) = &self.tax_identifier { + format!("{:?}", tax_identifier).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(legal_name) = &self.legal_name { + format!("{:?}", legal_name).into() + } else { + String::new().into() + }, + if let Some(entity_level) = &self.entity_level { + format!("{:?}", entity_level).into() + } else { + String::new().into() + }, + if let Some(registration_date) = &self.registration_date { + format!("{:?}", registration_date).into() + } else { + String::new().into() + }, + if let Some(mailing_address) = &self.mailing_address { + format!("{:?}", mailing_address).into() + } else { + String::new().into() + }, + if let Some(physical_address) = &self.physical_address { + format!("{:?}", physical_address).into() + } else { + String::new().into() + }, + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() + } else { + String::new().into() + }, + if let Some(management_type) = &self.management_type { + format!("{:?}", management_type).into() + } else { + String::new().into() + }, + if let Some(company_id) = &self.company_id { + format!("{:?}", company_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "tax_identifier".into(), + "country".into(), + "legal_name".into(), + "entity_level".into(), + "registration_date".into(), + "mailing_address".into(), + "physical_address".into(), + "parent_id".into(), + "parent".into(), + "management_type".into(), + "company_id".into(), + ] + } +} + +#[doc = "LegalEntityRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct LegalEntityRequest { + #[doc = "The tax identifier for the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tax_identifier: Option, + #[doc = "The country the legal entity is based in."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, + #[doc = "The legal name of the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_name: Option, + #[doc = "The legal entity's level in a hierarchy. * `PARENT`: The legal entity is considered \ + the ultimate holding entity. * `SUBSIDIARY`: The legal entity is considered a \ + subsidiary, fully or partially held by another. * `BRANCH`: The legal entity is \ + considered a branch, associated with a parent legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub entity_level: Option, + #[doc = "The registration date of the entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub registration_date: Option, + #[doc = "The mailing address of the legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mailing_address: Option
, + #[doc = "The physical address of the legal entity, if it differs from the mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub physical_address: Option
, + #[doc = "The parent legal entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The legal entity management type in the case of an employer of record (EOR) or \ + professional employment organization (PEO). * `PEO`: The legal entity is considered \ + a Professional Employment Organization (PEO). * `EOR`: The legal entity is \ + considered an Employer of Record (EOR)."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub management_type: Option, + #[doc = "The company or organization associated with the legal entity"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub company_id: Option, +} + +impl std::fmt::Display for LegalEntityRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for LegalEntityRequest { + const LENGTH: usize = 10; + fn fields(&self) -> Vec> { + vec![ + if let Some(tax_identifier) = &self.tax_identifier { + format!("{:?}", tax_identifier).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + if let Some(legal_name) = &self.legal_name { + format!("{:?}", legal_name).into() + } else { + String::new().into() + }, + if let Some(entity_level) = &self.entity_level { + format!("{:?}", entity_level).into() + } else { + String::new().into() + }, + if let Some(registration_date) = &self.registration_date { + format!("{:?}", registration_date).into() + } else { + String::new().into() + }, + if let Some(mailing_address) = &self.mailing_address { + format!("{:?}", mailing_address).into() + } else { + String::new().into() + }, + if let Some(physical_address) = &self.physical_address { + format!("{:?}", physical_address).into() + } else { + String::new().into() + }, + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() + } else { + String::new().into() + }, + if let Some(management_type) = &self.management_type { + format!("{:?}", management_type).into() + } else { + String::new().into() + }, + if let Some(company_id) = &self.company_id { + format!("{:?}", company_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "tax_identifier".into(), + "country".into(), + "legal_name".into(), + "entity_level".into(), + "registration_date".into(), + "mailing_address".into(), + "physical_address".into(), + "parent_id".into(), + "management_type".into(), + "company_id".into(), + ] + } +} + +#[doc = "Company."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Company { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The company's ultimate holding entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_legal_entity_id: Option, + #[doc = "A list of the company's entities."] + pub legal_entities_id: String, + #[doc = "A list of the company's entities.\n\nExpandable field"] + pub legal_entities: LegalEntity, + #[doc = "The physical address of the holding entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub physical_address: Option
, + #[doc = "The email address used when registering this company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primary_email: Option, + #[doc = "The legal name of the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_name: Option, + #[doc = "The doing business as name for the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub doing_business_as_name: Option, + #[doc = "The phone number for the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[doc = "The name of the company."] + pub name: String, +} + +impl std::fmt::Display for Company { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Company { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(parent_legal_entity_id) = &self.parent_legal_entity_id { + format!("{:?}", parent_legal_entity_id).into() + } else { + String::new().into() + }, + self.legal_entities_id.clone().into(), + format!("{:?}", self.legal_entities).into(), + if let Some(physical_address) = &self.physical_address { + format!("{:?}", physical_address).into() + } else { + String::new().into() + }, + if let Some(primary_email) = &self.primary_email { + format!("{:?}", primary_email).into() + } else { + String::new().into() + }, + if let Some(legal_name) = &self.legal_name { + format!("{:?}", legal_name).into() + } else { + String::new().into() + }, + if let Some(doing_business_as_name) = &self.doing_business_as_name { + format!("{:?}", doing_business_as_name).into() + } else { + String::new().into() + }, + if let Some(phone) = &self.phone { + format!("{:?}", phone).into() + } else { + String::new().into() + }, + self.name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "parent_legal_entity_id".into(), + "legal_entities_id".into(), + "legal_entities".into(), + "physical_address".into(), + "primary_email".into(), + "legal_name".into(), + "doing_business_as_name".into(), + "phone".into(), + "name".into(), + ] + } +} + +#[doc = "CompanyRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CompanyRequest { + #[doc = "The company's ultimate holding entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_legal_entity_id: Option, + #[doc = "A list of the company's entities."] + pub legal_entities_id: String, + #[doc = "The physical address of the holding entity."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub physical_address: Option
, + #[doc = "The email address used when registering this company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primary_email: Option, + #[doc = "The legal name of the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub legal_name: Option, + #[doc = "The doing business as name for the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub doing_business_as_name: Option, + #[doc = "The phone number for the company."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone: Option, + #[doc = "The name of the company."] + pub name: String, +} + +impl std::fmt::Display for CompanyRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CompanyRequest { + const LENGTH: usize = 8; + fn fields(&self) -> Vec> { + vec![ + if let Some(parent_legal_entity_id) = &self.parent_legal_entity_id { + format!("{:?}", parent_legal_entity_id).into() + } else { + String::new().into() + }, + self.legal_entities_id.clone().into(), + if let Some(physical_address) = &self.physical_address { + format!("{:?}", physical_address).into() + } else { + String::new().into() + }, + if let Some(primary_email) = &self.primary_email { + format!("{:?}", primary_email).into() + } else { + String::new().into() + }, + if let Some(legal_name) = &self.legal_name { + format!("{:?}", legal_name).into() + } else { + String::new().into() + }, + if let Some(doing_business_as_name) = &self.doing_business_as_name { + format!("{:?}", doing_business_as_name).into() + } else { + String::new().into() + }, + if let Some(phone) = &self.phone { + format!("{:?}", phone).into() + } else { + String::new().into() + }, + self.name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec![ + "parent_legal_entity_id".into(), + "legal_entities_id".into(), + "physical_address".into(), + "primary_email".into(), + "legal_name".into(), + "doing_business_as_name".into(), + "phone".into(), + "name".into(), + ] + } +} + +#[doc = "The classification of the address."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AddressType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AddressCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "Address."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Address { + #[doc = "The classification of the address."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The formatted mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The full street address component, which may include house number, street name, P.O. \ + box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ + 4.1.2.."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street_address: Option, + #[doc = "The city or locality component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, +} + +impl std::fmt::Display for Address { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Address { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(street_address) = &self.street_address { + format!("{:?}", street_address).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "type_".into(), + "formatted".into(), + "street_address".into(), + "locality".into(), + "region".into(), + "postal_code".into(), + "country".into(), + ] + } +} + +#[doc = "The classification of the address."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AddressRequestType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum AddressRequestCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "AddressRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct AddressRequest { + #[doc = "The classification of the address."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The formatted mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The full street address component, which may include house number, street name, P.O. \ + box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ + 4.1.2.."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street_address: Option, + #[doc = "The city or locality component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, +} + +impl std::fmt::Display for AddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for AddressRequest { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(street_address) = &self.street_address { + format!("{:?}", street_address).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "type_".into(), + "formatted".into(), + "street_address".into(), + "locality".into(), + "region".into(), + "postal_code".into(), + "country".into(), + ] + } +} + +#[doc = "The code of the country."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum Code { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "Country."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Country { + #[doc = "The code of the country."] + pub code: Code, +} + +impl std::fmt::Display for Country { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Country { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![format!("{:?}", self.code).into()] + } + + fn headers() -> Vec> { + vec!["code".into()] + } +} + +#[doc = "CountryRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CountryRequest { + #[doc = "The code of the country."] + pub code: Code, +} + +impl std::fmt::Display for CountryRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CountryRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![format!("{:?}", self.code).into()] + } + + fn headers() -> Vec> { + vec!["code".into()] + } +} + +#[doc = "User."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct User { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Whether the user is able to access company resources, typically when they are in \ + actively engaged with the company and not after off-boarding."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option, + #[doc = "The unique identifier across Rippling used by the User for direct authentication \ + into their associated company. Globally unique."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The user's name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The display name of the user using either the concatenated preferred given and \ + family name or username depending on availability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The user's email addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The user's phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_numbers: Option, + #[doc = "The user's addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub addresses: Option, + #[doc = "The user's photos."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub photos: Option, + #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ + Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[doc = "The User's default location for purposes of localization of currency, date time \ + format, or numerical representations pursuant to RFC5646."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locale: Option, + #[doc = "The User's current time zone in IANA database Olson format"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} + +impl std::fmt::Display for User { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for User { + const LENGTH: usize = 14; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(active) = &self.active { + format!("{:?}", active).into() + } else { + String::new().into() + }, + if let Some(username) = &self.username { + format!("{:?}", username).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(display_name) = &self.display_name { + format!("{:?}", display_name).into() + } else { + String::new().into() + }, + if let Some(emails) = &self.emails { + format!("{:?}", emails).into() + } else { + String::new().into() + }, + if let Some(phone_numbers) = &self.phone_numbers { + format!("{:?}", phone_numbers).into() + } else { + String::new().into() + }, + if let Some(addresses) = &self.addresses { + format!("{:?}", addresses).into() + } else { + String::new().into() + }, + if let Some(photos) = &self.photos { + format!("{:?}", photos).into() + } else { + String::new().into() + }, + if let Some(preferred_language) = &self.preferred_language { + format!("{:?}", preferred_language).into() + } else { + String::new().into() + }, + if let Some(locale) = &self.locale { + format!("{:?}", locale).into() + } else { + String::new().into() + }, + if let Some(timezone) = &self.timezone { + format!("{:?}", timezone).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "active".into(), + "username".into(), + "name".into(), + "display_name".into(), + "emails".into(), + "phone_numbers".into(), + "addresses".into(), + "photos".into(), + "preferred_language".into(), + "locale".into(), + "timezone".into(), + ] + } +} + +#[doc = "UserRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserRequest { + #[doc = "Whether the user is able to access company resources, typically when they are in \ + actively engaged with the company and not after off-boarding."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option, + #[doc = "The unique identifier across Rippling used by the User for direct authentication \ + into their associated company. Globally unique."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The user's name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The display name of the user using either the concatenated preferred given and \ + family name or username depending on availability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The user's email addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The user's phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_numbers: Option, + #[doc = "The user's addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub addresses: Option, + #[doc = "The user's photos."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub photos: Option, + #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ + Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[doc = "The User's default location for purposes of localization of currency, date time \ + format, or numerical representations pursuant to RFC5646."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locale: Option, + #[doc = "The User's current time zone in IANA database Olson format"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} + +impl std::fmt::Display for UserRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserRequest { + const LENGTH: usize = 11; + fn fields(&self) -> Vec> { + vec![ + if let Some(active) = &self.active { + format!("{:?}", active).into() + } else { + String::new().into() + }, + if let Some(username) = &self.username { + format!("{:?}", username).into() + } else { + String::new().into() + }, + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(display_name) = &self.display_name { + format!("{:?}", display_name).into() + } else { + String::new().into() + }, + if let Some(emails) = &self.emails { + format!("{:?}", emails).into() + } else { + String::new().into() + }, + if let Some(phone_numbers) = &self.phone_numbers { + format!("{:?}", phone_numbers).into() + } else { + String::new().into() + }, + if let Some(addresses) = &self.addresses { + format!("{:?}", addresses).into() + } else { + String::new().into() + }, + if let Some(photos) = &self.photos { + format!("{:?}", photos).into() + } else { + String::new().into() + }, + if let Some(preferred_language) = &self.preferred_language { + format!("{:?}", preferred_language).into() + } else { + String::new().into() + }, + if let Some(locale) = &self.locale { + format!("{:?}", locale).into() + } else { + String::new().into() + }, + if let Some(timezone) = &self.timezone { + format!("{:?}", timezone).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "active".into(), + "username".into(), + "name".into(), + "display_name".into(), + "emails".into(), + "phone_numbers".into(), + "addresses".into(), + "photos".into(), + "preferred_language".into(), + "locale".into(), + "timezone".into(), + ] + } +} + +#[doc = "The classification of the photo."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserPhotoType { + #[serde(rename = "PHOTO")] + #[display("PHOTO")] + Photo, + #[serde(rename = "THUMBNAIL")] + #[display("THUMBNAIL")] + Thumbnail, +} + +#[doc = "UserPhoto."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserPhoto { + #[doc = "The URL of the photo."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the photo."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} + +impl std::fmt::Display for UserPhoto { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserPhoto { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into()] + } +} + +#[doc = "The classification of the photo."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserPhotoRequestType { + #[serde(rename = "PHOTO")] + #[display("PHOTO")] + Photo, + #[serde(rename = "THUMBNAIL")] + #[display("THUMBNAIL")] + Thumbnail, +} + +#[doc = "UserPhotoRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserPhotoRequest { + #[doc = "The URL of the photo."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the photo."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, +} + +impl std::fmt::Display for UserPhotoRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserPhotoRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into()] + } +} + +#[doc = "The classification of the address."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserAddressType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserAddressCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "UserAddress."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserAddress { + #[doc = "The classification of the address."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The formatted mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The full street address component, which may include house number, street name, P.O. \ + box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ + 4.1.2.."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street_address: Option, + #[doc = "The city or locality component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, +} + +impl std::fmt::Display for UserAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserAddress { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(street_address) = &self.street_address { + format!("{:?}", street_address).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "type_".into(), + "formatted".into(), + "street_address".into(), + "locality".into(), + "region".into(), + "postal_code".into(), + "country".into(), + ] + } +} + +#[doc = "The classification of the address."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserAddressRequestType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserAddressRequestCountry { + #[serde(rename = "AF")] + #[display("AF")] + Af, + #[serde(rename = "AX")] + #[display("AX")] + Ax, + #[serde(rename = "AL")] + #[display("AL")] + Al, + #[serde(rename = "DZ")] + #[display("DZ")] + Dz, + #[serde(rename = "AS")] + #[display("AS")] + As, + #[serde(rename = "AD")] + #[display("AD")] + Ad, + #[serde(rename = "AO")] + #[display("AO")] + Ao, + #[serde(rename = "AI")] + #[display("AI")] + Ai, + #[serde(rename = "AQ")] + #[display("AQ")] + Aq, + #[serde(rename = "AG")] + #[display("AG")] + Ag, + #[serde(rename = "AR")] + #[display("AR")] + Ar, + #[serde(rename = "AM")] + #[display("AM")] + Am, + #[serde(rename = "AW")] + #[display("AW")] + Aw, + #[serde(rename = "AU")] + #[display("AU")] + Au, + #[serde(rename = "AT")] + #[display("AT")] + At, + #[serde(rename = "AZ")] + #[display("AZ")] + Az, + #[serde(rename = "BS")] + #[display("BS")] + Bs, + #[serde(rename = "BH")] + #[display("BH")] + Bh, + #[serde(rename = "BD")] + #[display("BD")] + Bd, + #[serde(rename = "BB")] + #[display("BB")] + Bb, + #[serde(rename = "BY")] + #[display("BY")] + By, + #[serde(rename = "BE")] + #[display("BE")] + Be, + #[serde(rename = "BZ")] + #[display("BZ")] + Bz, + #[serde(rename = "BJ")] + #[display("BJ")] + Bj, + #[serde(rename = "BM")] + #[display("BM")] + Bm, + #[serde(rename = "BT")] + #[display("BT")] + Bt, + #[serde(rename = "BO")] + #[display("BO")] + Bo, + #[serde(rename = "BQ")] + #[display("BQ")] + Bq, + #[serde(rename = "BA")] + #[display("BA")] + Ba, + #[serde(rename = "BW")] + #[display("BW")] + Bw, + #[serde(rename = "BV")] + #[display("BV")] + Bv, + #[serde(rename = "BR")] + #[display("BR")] + Br, + #[serde(rename = "IO")] + #[display("IO")] + Io, + #[serde(rename = "BN")] + #[display("BN")] + Bn, + #[serde(rename = "BG")] + #[display("BG")] + Bg, + #[serde(rename = "BF")] + #[display("BF")] + Bf, + #[serde(rename = "BI")] + #[display("BI")] + Bi, + #[serde(rename = "CV")] + #[display("CV")] + Cv, + #[serde(rename = "KH")] + #[display("KH")] + Kh, + #[serde(rename = "CM")] + #[display("CM")] + Cm, + #[serde(rename = "CA")] + #[display("CA")] + Ca, + #[serde(rename = "KY")] + #[display("KY")] + Ky, + #[serde(rename = "CF")] + #[display("CF")] + Cf, + #[serde(rename = "TD")] + #[display("TD")] + Td, + #[serde(rename = "CL")] + #[display("CL")] + Cl, + #[serde(rename = "CN")] + #[display("CN")] + Cn, + #[serde(rename = "CX")] + #[display("CX")] + Cx, + #[serde(rename = "CC")] + #[display("CC")] + Cc, + #[serde(rename = "CO")] + #[display("CO")] + Co, + #[serde(rename = "KM")] + #[display("KM")] + Km, + #[serde(rename = "CG")] + #[display("CG")] + Cg, + #[serde(rename = "CD")] + #[display("CD")] + Cd, + #[serde(rename = "CK")] + #[display("CK")] + Ck, + #[serde(rename = "CR")] + #[display("CR")] + Cr, + #[serde(rename = "CI")] + #[display("CI")] + Ci, + #[serde(rename = "HR")] + #[display("HR")] + Hr, + #[serde(rename = "CW")] + #[display("CW")] + Cw, + #[serde(rename = "CY")] + #[display("CY")] + Cy, + #[serde(rename = "CZ")] + #[display("CZ")] + Cz, + #[serde(rename = "DK")] + #[display("DK")] + Dk, + #[serde(rename = "DJ")] + #[display("DJ")] + Dj, + #[serde(rename = "DM")] + #[display("DM")] + Dm, + #[serde(rename = "DO")] + #[display("DO")] + Do, + #[serde(rename = "EC")] + #[display("EC")] + Ec, + #[serde(rename = "EG")] + #[display("EG")] + Eg, + #[serde(rename = "SV")] + #[display("SV")] + Sv, + #[serde(rename = "GQ")] + #[display("GQ")] + Gq, + #[serde(rename = "ER")] + #[display("ER")] + Er, + #[serde(rename = "EE")] + #[display("EE")] + Ee, + #[serde(rename = "SZ")] + #[display("SZ")] + Sz, + #[serde(rename = "ET")] + #[display("ET")] + Et, + #[serde(rename = "FK")] + #[display("FK")] + Fk, + #[serde(rename = "FO")] + #[display("FO")] + Fo, + #[serde(rename = "FJ")] + #[display("FJ")] + Fj, + #[serde(rename = "FI")] + #[display("FI")] + Fi, + #[serde(rename = "FR")] + #[display("FR")] + Fr, + #[serde(rename = "GF")] + #[display("GF")] + Gf, + #[serde(rename = "PF")] + #[display("PF")] + Pf, + #[serde(rename = "TF")] + #[display("TF")] + Tf, + #[serde(rename = "GA")] + #[display("GA")] + Ga, + #[serde(rename = "GM")] + #[display("GM")] + Gm, + #[serde(rename = "GE")] + #[display("GE")] + Ge, + #[serde(rename = "DE")] + #[display("DE")] + De, + #[serde(rename = "GH")] + #[display("GH")] + Gh, + #[serde(rename = "GI")] + #[display("GI")] + Gi, + #[serde(rename = "GR")] + #[display("GR")] + Gr, + #[serde(rename = "GL")] + #[display("GL")] + Gl, + #[serde(rename = "GD")] + #[display("GD")] + Gd, + #[serde(rename = "GP")] + #[display("GP")] + Gp, + #[serde(rename = "GU")] + #[display("GU")] + Gu, + #[serde(rename = "GT")] + #[display("GT")] + Gt, + #[serde(rename = "GG")] + #[display("GG")] + Gg, + #[serde(rename = "GN")] + #[display("GN")] + Gn, + #[serde(rename = "GW")] + #[display("GW")] + Gw, + #[serde(rename = "GY")] + #[display("GY")] + Gy, + #[serde(rename = "HT")] + #[display("HT")] + Ht, + #[serde(rename = "HM")] + #[display("HM")] + Hm, + #[serde(rename = "VA")] + #[display("VA")] + Va, + #[serde(rename = "HN")] + #[display("HN")] + Hn, + #[serde(rename = "HK")] + #[display("HK")] + Hk, + #[serde(rename = "HU")] + #[display("HU")] + Hu, + #[serde(rename = "IS")] + #[display("IS")] + Is, + #[serde(rename = "IN")] + #[display("IN")] + In, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "IQ")] + #[display("IQ")] + Iq, + #[serde(rename = "IE")] + #[display("IE")] + Ie, + #[serde(rename = "IM")] + #[display("IM")] + Im, + #[serde(rename = "IL")] + #[display("IL")] + Il, + #[serde(rename = "IT")] + #[display("IT")] + It, + #[serde(rename = "JM")] + #[display("JM")] + Jm, + #[serde(rename = "JP")] + #[display("JP")] + Jp, + #[serde(rename = "JE")] + #[display("JE")] + Je, + #[serde(rename = "JO")] + #[display("JO")] + Jo, + #[serde(rename = "KZ")] + #[display("KZ")] + Kz, + #[serde(rename = "KE")] + #[display("KE")] + Ke, + #[serde(rename = "KI")] + #[display("KI")] + Ki, + #[serde(rename = "KR")] + #[display("KR")] + Kr, + #[serde(rename = "XK")] + #[display("XK")] + Xk, + #[serde(rename = "KW")] + #[display("KW")] + Kw, + #[serde(rename = "KG")] + #[display("KG")] + Kg, + #[serde(rename = "LA")] + #[display("LA")] + La, + #[serde(rename = "LV")] + #[display("LV")] + Lv, + #[serde(rename = "LB")] + #[display("LB")] + Lb, + #[serde(rename = "LS")] + #[display("LS")] + Ls, + #[serde(rename = "LR")] + #[display("LR")] + Lr, + #[serde(rename = "LY")] + #[display("LY")] + Ly, + #[serde(rename = "LI")] + #[display("LI")] + Li, + #[serde(rename = "LT")] + #[display("LT")] + Lt, + #[serde(rename = "LU")] + #[display("LU")] + Lu, + #[serde(rename = "MO")] + #[display("MO")] + Mo, + #[serde(rename = "MG")] + #[display("MG")] + Mg, + #[serde(rename = "MW")] + #[display("MW")] + Mw, + #[serde(rename = "MY")] + #[display("MY")] + My, + #[serde(rename = "MV")] + #[display("MV")] + Mv, + #[serde(rename = "ML")] + #[display("ML")] + Ml, + #[serde(rename = "MT")] + #[display("MT")] + Mt, + #[serde(rename = "MH")] + #[display("MH")] + Mh, + #[serde(rename = "MQ")] + #[display("MQ")] + Mq, + #[serde(rename = "MR")] + #[display("MR")] + Mr, + #[serde(rename = "MU")] + #[display("MU")] + Mu, + #[serde(rename = "YT")] + #[display("YT")] + Yt, + #[serde(rename = "MX")] + #[display("MX")] + Mx, + #[serde(rename = "FM")] + #[display("FM")] + Fm, + #[serde(rename = "MD")] + #[display("MD")] + Md, + #[serde(rename = "MC")] + #[display("MC")] + Mc, + #[serde(rename = "MN")] + #[display("MN")] + Mn, + #[serde(rename = "ME")] + #[display("ME")] + Me, + #[serde(rename = "MS")] + #[display("MS")] + Ms, + #[serde(rename = "MA")] + #[display("MA")] + Ma, + #[serde(rename = "MZ")] + #[display("MZ")] + Mz, + #[serde(rename = "MM")] + #[display("MM")] + Mm, + #[serde(rename = "NA")] + #[display("NA")] + Na, + #[serde(rename = "NR")] + #[display("NR")] + Nr, + #[serde(rename = "NP")] + #[display("NP")] + Np, + #[serde(rename = "NL")] + #[display("NL")] + Nl, + #[serde(rename = "AN")] + #[display("AN")] + An, + #[serde(rename = "NC")] + #[display("NC")] + Nc, + #[serde(rename = "NZ")] + #[display("NZ")] + Nz, + #[serde(rename = "NI")] + #[display("NI")] + Ni, + #[serde(rename = "NE")] + #[display("NE")] + Ne, + #[serde(rename = "NG")] + #[display("NG")] + Ng, + #[serde(rename = "NU")] + #[display("NU")] + Nu, + #[serde(rename = "NF")] + #[display("NF")] + Nf, + #[serde(rename = "MK")] + #[display("MK")] + Mk, + #[serde(rename = "MP")] + #[display("MP")] + Mp, + #[serde(rename = "NO")] + #[display("NO")] + No, + #[serde(rename = "OM")] + #[display("OM")] + Om, + #[serde(rename = "PK")] + #[display("PK")] + Pk, + #[serde(rename = "PW")] + #[display("PW")] + Pw, + #[serde(rename = "PS")] + #[display("PS")] + Ps, + #[serde(rename = "PA")] + #[display("PA")] + Pa, + #[serde(rename = "PG")] + #[display("PG")] + Pg, + #[serde(rename = "PY")] + #[display("PY")] + Py, + #[serde(rename = "PE")] + #[display("PE")] + Pe, + #[serde(rename = "PH")] + #[display("PH")] + Ph, + #[serde(rename = "PN")] + #[display("PN")] + Pn, + #[serde(rename = "PL")] + #[display("PL")] + Pl, + #[serde(rename = "PT")] + #[display("PT")] + Pt, + #[serde(rename = "PR")] + #[display("PR")] + Pr, + #[serde(rename = "QA")] + #[display("QA")] + Qa, + #[serde(rename = "RO")] + #[display("RO")] + Ro, + #[serde(rename = "RU")] + #[display("RU")] + Ru, + #[serde(rename = "RW")] + #[display("RW")] + Rw, + #[serde(rename = "RE")] + #[display("RE")] + Re, + #[serde(rename = "BL")] + #[display("BL")] + Bl, + #[serde(rename = "SH")] + #[display("SH")] + Sh, + #[serde(rename = "KN")] + #[display("KN")] + Kn, + #[serde(rename = "LC")] + #[display("LC")] + Lc, + #[serde(rename = "MF")] + #[display("MF")] + Mf, + #[serde(rename = "PM")] + #[display("PM")] + Pm, + #[serde(rename = "VC")] + #[display("VC")] + Vc, + #[serde(rename = "WS")] + #[display("WS")] + Ws, + #[serde(rename = "SM")] + #[display("SM")] + Sm, + #[serde(rename = "ST")] + #[display("ST")] + St, + #[serde(rename = "SA")] + #[display("SA")] + Sa, + #[serde(rename = "SN")] + #[display("SN")] + Sn, + #[serde(rename = "RS")] + #[display("RS")] + Rs, + #[serde(rename = "SC")] + #[display("SC")] + Sc, + #[serde(rename = "SL")] + #[display("SL")] + Sl, + #[serde(rename = "SG")] + #[display("SG")] + Sg, + #[serde(rename = "SX")] + #[display("SX")] + Sx, + #[serde(rename = "SK")] + #[display("SK")] + Sk, + #[serde(rename = "SI")] + #[display("SI")] + Si, + #[serde(rename = "SB")] + #[display("SB")] + Sb, + #[serde(rename = "SO")] + #[display("SO")] + So, + #[serde(rename = "ZA")] + #[display("ZA")] + Za, + #[serde(rename = "GS")] + #[display("GS")] + Gs, + #[serde(rename = "SS")] + #[display("SS")] + Ss, + #[serde(rename = "ES")] + #[display("ES")] + Es, + #[serde(rename = "LK")] + #[display("LK")] + Lk, + #[serde(rename = "SD")] + #[display("SD")] + Sd, + #[serde(rename = "SR")] + #[display("SR")] + Sr, + #[serde(rename = "SJ")] + #[display("SJ")] + Sj, + #[serde(rename = "SE")] + #[display("SE")] + Se, + #[serde(rename = "CH")] + #[display("CH")] + Ch, + #[serde(rename = "TW")] + #[display("TW")] + Tw, + #[serde(rename = "TJ")] + #[display("TJ")] + Tj, + #[serde(rename = "TZ")] + #[display("TZ")] + Tz, + #[serde(rename = "TH")] + #[display("TH")] + Th, + #[serde(rename = "TL")] + #[display("TL")] + Tl, + #[serde(rename = "TG")] + #[display("TG")] + Tg, + #[serde(rename = "TK")] + #[display("TK")] + Tk, + #[serde(rename = "TO")] + #[display("TO")] + To, + #[serde(rename = "TT")] + #[display("TT")] + Tt, + #[serde(rename = "TN")] + #[display("TN")] + Tn, + #[serde(rename = "TR")] + #[display("TR")] + Tr, + #[serde(rename = "TM")] + #[display("TM")] + Tm, + #[serde(rename = "TC")] + #[display("TC")] + Tc, + #[serde(rename = "TV")] + #[display("TV")] + Tv, + #[serde(rename = "UG")] + #[display("UG")] + Ug, + #[serde(rename = "UA")] + #[display("UA")] + Ua, + #[serde(rename = "AE")] + #[display("AE")] + Ae, + #[serde(rename = "GB")] + #[display("GB")] + Gb, + #[serde(rename = "US")] + #[display("US")] + Us, + #[serde(rename = "UM")] + #[display("UM")] + Um, + #[serde(rename = "UY")] + #[display("UY")] + Uy, + #[serde(rename = "UZ")] + #[display("UZ")] + Uz, + #[serde(rename = "VU")] + #[display("VU")] + Vu, + #[serde(rename = "VE")] + #[display("VE")] + Ve, + #[serde(rename = "VN")] + #[display("VN")] + Vn, + #[serde(rename = "VG")] + #[display("VG")] + Vg, + #[serde(rename = "VI")] + #[display("VI")] + Vi, + #[serde(rename = "WF")] + #[display("WF")] + Wf, + #[serde(rename = "EH")] + #[display("EH")] + Eh, + #[serde(rename = "YE")] + #[display("YE")] + Ye, + #[serde(rename = "ZM")] + #[display("ZM")] + Zm, + #[serde(rename = "ZW")] + #[display("ZW")] + Zw, +} + +#[doc = "UserAddressRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserAddressRequest { + #[doc = "The classification of the address."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The formatted mailing address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The full street address component, which may include house number, street name, P.O. \ + box, and multi-line extended street address information, pursuant to SCIM RFC 7643 \ + 4.1.2.."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub street_address: Option, + #[doc = "The city or locality component."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locality: Option, + #[doc = "The state or region component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub region: Option, + #[doc = "The zip code or postal code component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub postal_code: Option, + #[doc = "The country component, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub country: Option, +} + +impl std::fmt::Display for UserAddressRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserAddressRequest { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(street_address) = &self.street_address { + format!("{:?}", street_address).into() + } else { + String::new().into() + }, + if let Some(locality) = &self.locality { + format!("{:?}", locality).into() + } else { + String::new().into() + }, + if let Some(region) = &self.region { + format!("{:?}", region).into() + } else { + String::new().into() + }, + if let Some(postal_code) = &self.postal_code { + format!("{:?}", postal_code).into() + } else { + String::new().into() + }, + if let Some(country) = &self.country { + format!("{:?}", country).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "type_".into(), + "formatted".into(), + "street_address".into(), + "locality".into(), + "region".into(), + "postal_code".into(), + "country".into(), + ] + } +} + +#[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserPhoneNumberType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "MOBILE")] + #[display("MOBILE")] + Mobile, + #[serde(rename = "FAX")] + #[display("FAX")] + Fax, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "UserPhoneNumber."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserPhoneNumber { + #[doc = "The canonical global phone number pursuant to RFC3966."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The display value of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} + +impl std::fmt::Display for UserPhoneNumber { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserPhoneNumber { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(display) = &self.display { + format!("{:?}", display).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into(), "display".into()] + } +} + +#[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum UserPhoneNumberRequestType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "MOBILE")] + #[display("MOBILE")] + Mobile, + #[serde(rename = "FAX")] + #[display("FAX")] + Fax, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "UserPhoneNumberRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserPhoneNumberRequest { + #[doc = "The canonical global phone number pursuant to RFC3966."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the phone number, pursuant to SCIM RFC 7643 4.1.2."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The display value of the phone number."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} + +impl std::fmt::Display for UserPhoneNumberRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserPhoneNumberRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(display) = &self.display { + format!("{:?}", display).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into(), "display".into()] + } +} + +#[doc = "The classification of the email."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum EmailType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "Email."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Email { + #[doc = "A valid email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the email."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The display value of the email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} + +impl std::fmt::Display for Email { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Email { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(display) = &self.display { + format!("{:?}", display).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into(), "display".into()] + } +} + +#[doc = "The classification of the email."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum EmailRequestType { + #[serde(rename = "HOME")] + #[display("HOME")] + Home, + #[serde(rename = "WORK")] + #[display("WORK")] + Work, + #[serde(rename = "OTHER")] + #[display("OTHER")] + Other, +} + +#[doc = "EmailRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct EmailRequest { + #[doc = "A valid email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[doc = "The classification of the email."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The display value of the email address."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display: Option, +} + +impl std::fmt::Display for EmailRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for EmailRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(value) = &self.value { + format!("{:?}", value).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() + } else { + String::new().into() + }, + if let Some(display) = &self.display { + format!("{:?}", display).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["value".into(), "type_".into(), "display".into()] + } +} + +#[doc = "UserName."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserName { + #[doc = "The user's full name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The given legal name of the user, or first name in most Western languages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub given_name: Option, + #[doc = "The middle name(s) of the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub middle_name: Option, + #[doc = "The legal family name of the user, or last name in most Western languages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family_name: Option, + #[doc = "The preferred given name, or first name in most Western languages, by the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_given_name: Option, + #[doc = "The preferred family name, or last name in most Western languages, by the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_family_name: Option, +} + +impl std::fmt::Display for UserName { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserName { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(given_name) = &self.given_name { + format!("{:?}", given_name).into() + } else { + String::new().into() + }, + if let Some(middle_name) = &self.middle_name { + format!("{:?}", middle_name).into() + } else { + String::new().into() + }, + if let Some(family_name) = &self.family_name { + format!("{:?}", family_name).into() + } else { + String::new().into() + }, + if let Some(preferred_given_name) = &self.preferred_given_name { + format!("{:?}", preferred_given_name).into() + } else { + String::new().into() + }, + if let Some(preferred_family_name) = &self.preferred_family_name { + format!("{:?}", preferred_family_name).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "formatted".into(), + "given_name".into(), + "middle_name".into(), + "family_name".into(), + "preferred_given_name".into(), + "preferred_family_name".into(), + ] + } +} + +#[doc = "UserNameRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct UserNameRequest { + #[doc = "The user's full name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub formatted: Option, + #[doc = "The given legal name of the user, or first name in most Western languages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub given_name: Option, + #[doc = "The middle name(s) of the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub middle_name: Option, + #[doc = "The legal family name of the user, or last name in most Western languages."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub family_name: Option, + #[doc = "The preferred given name, or first name in most Western languages, by the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_given_name: Option, + #[doc = "The preferred family name, or last name in most Western languages, by the user."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_family_name: Option, +} + +impl std::fmt::Display for UserNameRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for UserNameRequest { + const LENGTH: usize = 6; + fn fields(&self) -> Vec> { + vec![ + if let Some(formatted) = &self.formatted { + format!("{:?}", formatted).into() + } else { + String::new().into() + }, + if let Some(given_name) = &self.given_name { + format!("{:?}", given_name).into() + } else { + String::new().into() + }, + if let Some(middle_name) = &self.middle_name { + format!("{:?}", middle_name).into() + } else { + String::new().into() + }, + if let Some(family_name) = &self.family_name { + format!("{:?}", family_name).into() + } else { + String::new().into() + }, + if let Some(preferred_given_name) = &self.preferred_given_name { + format!("{:?}", preferred_given_name).into() + } else { + String::new().into() + }, + if let Some(preferred_family_name) = &self.preferred_family_name { + format!("{:?}", preferred_family_name).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "formatted".into(), + "given_name".into(), + "middle_name".into(), + "family_name".into(), + "preferred_given_name".into(), + "preferred_family_name".into(), + ] + } +} + +#[doc = "Application status"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ApplicationStatus { + #[serde(rename = "ACTIVE")] + #[display("ACTIVE")] + Active, + #[serde(rename = "REJECTED")] + #[display("REJECTED")] + Rejected, + #[serde(rename = "HIRED")] + #[display("HIRED")] + Hired, + #[serde(rename = "ARCHIVED")] + #[display("ARCHIVED")] + Archived, +} + +#[doc = "Application."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Application { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Application status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Application stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stage: Option, + #[doc = "Application creation date"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub applied_at: Option, + #[doc = "Job requisition ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_id: Option, + #[doc = "Job requisition\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job: Option, + #[doc = "Application url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl std::fmt::Display for Application { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Application { + const LENGTH: usize = 9; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(stage) = &self.stage { + format!("{:?}", stage).into() + } else { + String::new().into() + }, + if let Some(applied_at) = &self.applied_at { + format!("{:?}", applied_at).into() + } else { + String::new().into() + }, + if let Some(job_id) = &self.job_id { + format!("{:?}", job_id).into() + } else { + String::new().into() + }, + if let Some(job) = &self.job { + format!("{:?}", job).into() + } else { + String::new().into() + }, + if let Some(url) = &self.url { + format!("{:?}", url).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "status".into(), + "stage".into(), + "applied_at".into(), + "job_id".into(), + "job".into(), + "url".into(), + ] + } +} + +#[doc = "Application status"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum ApplicationRequestStatus { + #[serde(rename = "ACTIVE")] + #[display("ACTIVE")] + Active, + #[serde(rename = "REJECTED")] + #[display("REJECTED")] + Rejected, + #[serde(rename = "HIRED")] + #[display("HIRED")] + Hired, + #[serde(rename = "ARCHIVED")] + #[display("ARCHIVED")] + Archived, +} + +#[doc = "ApplicationRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct ApplicationRequest { + #[doc = "Application status"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "Application stage"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub stage: Option, + #[doc = "Application creation date"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub applied_at: Option, + #[doc = "Job requisition ID"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_id: Option, + #[doc = "Application url"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl std::fmt::Display for ApplicationRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for ApplicationRequest { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(status) = &self.status { + format!("{:?}", status).into() + } else { + String::new().into() + }, + if let Some(stage) = &self.stage { + format!("{:?}", stage).into() + } else { + String::new().into() + }, + if let Some(applied_at) = &self.applied_at { + format!("{:?}", applied_at).into() + } else { + String::new().into() + }, + if let Some(job_id) = &self.job_id { + format!("{:?}", job_id).into() + } else { + String::new().into() + }, + if let Some(url) = &self.url { + format!("{:?}", url).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "status".into(), + "stage".into(), + "applied_at".into(), + "job_id".into(), + "url".into(), + ] + } +} + +#[doc = "Job requisition status"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum JobRequisitionStatus { + #[serde(rename = "OPEN")] + #[display("OPEN")] + Open, + #[serde(rename = "CLOSED")] + #[display("CLOSED")] + Closed, + #[serde(rename = "PUBLISHED")] + #[display("PUBLISHED")] + Published, + #[serde(rename = "DRAFT")] + #[display("DRAFT")] + Draft, + #[serde(rename = "ARCHIVED")] + #[display("ARCHIVED")] + Archived, +} + +#[doc = "JobRequisition."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct JobRequisition { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Job requisition name"] + pub name: String, + #[doc = "Job requisition status"] + pub status: JobRequisitionStatus, +} + +impl std::fmt::Display for JobRequisition { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobRequisition { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + format!("{:?}", self.status).into(), + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "status".into(), + ] + } +} + +#[doc = "Job requisition status"] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum JobRequisitionRequestStatus { + #[serde(rename = "OPEN")] + #[display("OPEN")] + Open, + #[serde(rename = "CLOSED")] + #[display("CLOSED")] + Closed, + #[serde(rename = "PUBLISHED")] + #[display("PUBLISHED")] + Published, + #[serde(rename = "DRAFT")] + #[display("DRAFT")] + Draft, + #[serde(rename = "ARCHIVED")] + #[display("ARCHIVED")] + Archived, +} + +#[doc = "JobRequisitionRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct JobRequisitionRequest { + #[doc = "Job requisition name"] + pub name: String, + #[doc = "Job requisition status"] + pub status: JobRequisitionRequestStatus, +} + +impl std::fmt::Display for JobRequisitionRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobRequisitionRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + format!("{:?}", self.status).into(), + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "status".into()] + } +} + +#[doc = "Candidate."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct Candidate { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Candidate first name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[doc = "Candidate last name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[doc = "Candidate email"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + #[doc = "Candidate phone number"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + #[doc = "Candidate timezone"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} + +impl std::fmt::Display for Candidate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for Candidate { + const LENGTH: usize = 8; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(first_name) = &self.first_name { + format!("{:?}", first_name).into() + } else { + String::new().into() + }, + if let Some(last_name) = &self.last_name { + format!("{:?}", last_name).into() + } else { + String::new().into() + }, + if let Some(email) = &self.email { + format!("{:?}", email).into() + } else { + String::new().into() + }, + if let Some(phone_number) = &self.phone_number { + format!("{:?}", phone_number).into() + } else { + String::new().into() + }, + if let Some(timezone) = &self.timezone { + format!("{:?}", timezone).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "first_name".into(), + "last_name".into(), + "email".into(), + "phone_number".into(), + "timezone".into(), + ] + } +} + +#[doc = "CandidateRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CandidateRequest { + #[doc = "Candidate first name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[doc = "Candidate last name"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[doc = "Candidate email"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub email: Option, + #[doc = "Candidate phone number"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + #[doc = "Candidate timezone"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} + +impl std::fmt::Display for CandidateRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CandidateRequest { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + if let Some(first_name) = &self.first_name { + format!("{:?}", first_name).into() + } else { + String::new().into() + }, + if let Some(last_name) = &self.last_name { + format!("{:?}", last_name).into() + } else { + String::new().into() + }, + if let Some(email) = &self.email { + format!("{:?}", email).into() + } else { + String::new().into() + }, + if let Some(phone_number) = &self.phone_number { + format!("{:?}", phone_number).into() + } else { + String::new().into() + }, + if let Some(timezone) = &self.timezone { + format!("{:?}", timezone).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "first_name".into(), + "last_name".into(), + "email".into(), + "phone_number".into(), + "timezone".into(), + ] + } +} + +#[doc = "The data type of the custom field."] #[derive( serde :: Serialize, serde :: Deserialize, @@ -506,28 +11941,127 @@ pub mod error { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum EmploymentType { - #[serde(rename = "CONTRACTOR")] - #[display("CONTRACTOR")] - Contractor, - #[serde(rename = "SALARIED_FT")] - #[display("SALARIED_FT")] - SalariedFt, - #[serde(rename = "SALARIED_PT")] - #[display("SALARIED_PT")] - SalariedPt, - #[serde(rename = "HOURLY_FT")] - #[display("HOURLY_FT")] - HourlyFt, - #[serde(rename = "HOURLY_PT")] - #[display("HOURLY_PT")] - HourlyPt, - #[serde(rename = "TEMP")] - #[display("TEMP")] - Temp, -} - -#[doc = "The employee's gender"] +pub enum CustomFieldType { + #[serde(rename = "TEXT")] + #[display("TEXT")] + Text, + #[serde(rename = "DATE")] + #[display("DATE")] + Date, + #[serde(rename = "NUMBER")] + #[display("NUMBER")] + Number, + #[serde(rename = "CURRENCY")] + #[display("CURRENCY")] + Currency, + #[serde(rename = "PERCENTAGE")] + #[display("PERCENTAGE")] + Percentage, + #[serde(rename = "SELECT")] + #[display("SELECT")] + Select, + #[serde(rename = "FILE")] + #[display("FILE")] + File, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "RADIO")] + #[display("RADIO")] + Radio, + #[serde(rename = "TEXTAREA")] + #[display("TEXTAREA")] + Textarea, + #[serde(rename = "RANGE")] + #[display("RANGE")] + Range, + #[serde(rename = "REFERENCE_ID")] + #[display("REFERENCE_ID")] + ReferenceId, + #[serde(rename = "BOOLEAN")] + #[display("BOOLEAN")] + Boolean, + #[serde(rename = "ADDRESS")] + #[display("ADDRESS")] + Address, + #[serde(rename = "OG_REFERENCE_FIELD")] + #[display("OG_REFERENCE_FIELD")] + OgReferenceField, + #[serde(rename = "NATIVE_EDGE")] + #[display("NATIVE_EDGE")] + NativeEdge, + #[serde(rename = "DATETIME")] + #[display("DATETIME")] + Datetime, + #[serde(rename = "EMAIL")] + #[display("EMAIL")] + Email, + #[serde(rename = "URL")] + #[display("URL")] + Url, +} + +#[doc = "CustomField."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CustomField { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the custom field."] + pub name: String, + #[doc = "The description of the custom field."] + pub description: String, + #[doc = "Whether the custom field is required."] + pub required: bool, + #[doc = "The data type of the custom field."] + #[serde(rename = "type")] + pub type_: CustomFieldType, +} + +impl std::fmt::Display for CustomField { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CustomField { + const LENGTH: usize = 7; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + self.description.clone().into(), + format!("{:?}", self.required).into(), + format!("{:?}", self.type_).into(), + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "description".into(), + "required".into(), + "type_".into(), + ] + } +} + +#[doc = "The data type of the custom field."] #[derive( serde :: Serialize, serde :: Deserialize, @@ -541,223 +12075,362 @@ pub enum EmploymentType { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Gender { - #[serde(rename = "MALE")] - #[display("MALE")] - Male, - #[serde(rename = "FEMALE")] - #[display("FEMALE")] - Female, +pub enum CustomFieldRequestType { + #[serde(rename = "TEXT")] + #[display("TEXT")] + Text, + #[serde(rename = "DATE")] + #[display("DATE")] + Date, + #[serde(rename = "NUMBER")] + #[display("NUMBER")] + Number, + #[serde(rename = "CURRENCY")] + #[display("CURRENCY")] + Currency, + #[serde(rename = "PERCENTAGE")] + #[display("PERCENTAGE")] + Percentage, + #[serde(rename = "SELECT")] + #[display("SELECT")] + Select, + #[serde(rename = "FILE")] + #[display("FILE")] + File, + #[serde(rename = "ID")] + #[display("ID")] + Id, + #[serde(rename = "RADIO")] + #[display("RADIO")] + Radio, + #[serde(rename = "TEXTAREA")] + #[display("TEXTAREA")] + Textarea, + #[serde(rename = "RANGE")] + #[display("RANGE")] + Range, + #[serde(rename = "REFERENCE_ID")] + #[display("REFERENCE_ID")] + ReferenceId, + #[serde(rename = "BOOLEAN")] + #[display("BOOLEAN")] + Boolean, + #[serde(rename = "ADDRESS")] + #[display("ADDRESS")] + Address, + #[serde(rename = "OG_REFERENCE_FIELD")] + #[display("OG_REFERENCE_FIELD")] + OgReferenceField, + #[serde(rename = "NATIVE_EDGE")] + #[display("NATIVE_EDGE")] + NativeEdge, + #[serde(rename = "DATETIME")] + #[display("DATETIME")] + Datetime, + #[serde(rename = "EMAIL")] + #[display("EMAIL")] + Email, + #[serde(rename = "URL")] + #[display("URL")] + Url, +} + +#[doc = "CustomFieldRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct CustomFieldRequest { + #[doc = "The name of the custom field."] + pub name: String, + #[doc = "The description of the custom field."] + pub description: String, + #[doc = "Whether the custom field is required."] + pub required: bool, + #[doc = "The data type of the custom field."] + #[serde(rename = "type")] + pub type_: CustomFieldRequestType, +} + +impl std::fmt::Display for CustomFieldRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for CustomFieldRequest { + const LENGTH: usize = 4; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + self.description.clone().into(), + format!("{:?}", self.required).into(), + format!("{:?}", self.type_).into(), + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "description".into(), + "required".into(), + "type_".into(), + ] + } +} + +#[doc = "JobCode."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct JobCode { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the job dimension."] + pub name: String, + #[doc = "The ID of the job dimension this job code belongs to."] + pub job_dimension_id: String, + #[doc = "The job dimension this job code belongs to.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_dimension: Option, + #[doc = "The unique identifier of the job code in an outside system."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub external_id: Option, + #[doc = "The ID of the job roster group."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub group_id: Option, +} + +impl std::fmt::Display for JobCode { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobCode { + const LENGTH: usize = 8; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + self.job_dimension_id.clone().into(), + if let Some(job_dimension) = &self.job_dimension { + format!("{:?}", job_dimension).into() + } else { + String::new().into() + }, + if let Some(external_id) = &self.external_id { + format!("{:?}", external_id).into() + } else { + String::new().into() + }, + if let Some(group_id) = &self.group_id { + format!("{:?}", group_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "job_dimension_id".into(), + "job_dimension".into(), + "external_id".into(), + "group_id".into(), + ] + } +} + +#[doc = "JobCodeRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct JobCodeRequest { + #[doc = "The name of the job dimension."] + pub name: String, + #[doc = "The ID of the job dimension this job code belongs to."] + pub job_dimension_id: String, + #[doc = "The unique identifier of the job code in an outside system."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub external_id: Option, +} + +impl std::fmt::Display for JobCodeRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobCodeRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + self.job_dimension_id.clone().into(), + if let Some(external_id) = &self.external_id { + format!("{:?}", external_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "name".into(), + "job_dimension_id".into(), + "external_id".into(), + ] + } } -#[doc = "The employee's identified gender"] +#[doc = "JobDimension."] #[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum IdentifiedGender { - #[serde(rename = "MALE")] - #[display("MALE")] - Male, - #[serde(rename = "FEMALE")] - #[display("FEMALE")] - Female, - #[serde(rename = "NONBINARY")] - #[display("NONBINARY")] - Nonbinary, +pub struct JobDimension { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the job dimension"] + pub name: String, + #[doc = "The unique identifier of the job dimension in a third party system"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub external_id: Option, +} + +impl std::fmt::Display for JobDimension { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobDimension { + const LENGTH: usize = 5; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + if let Some(external_id) = &self.external_id { + format!("{:?}", external_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "external_id".into(), + ] + } } -#[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \ - individual. An offer has not been made and they have not started working at the \ - company.\n\nHIRED: An offer has been made but they have not accepted or started \ - yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \ - started yet.\n\nACTIVE: The employee currently works at the company and their start date \ - is today or in the past.\n\nTERMINATED: The employee is no longer active."] +#[doc = "JobDimensionRequest."] #[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum RoleState { - #[serde(rename = "INIT")] - #[display("INIT")] - Init, - #[serde(rename = "HIRED")] - #[display("HIRED")] - Hired, - #[serde(rename = "ACCEPTED")] - #[display("ACCEPTED")] - Accepted, - #[serde(rename = "ACTIVE")] - #[display("ACTIVE")] - Active, - #[serde(rename = "TERMINATED")] - #[display("TERMINATED")] - Terminated, +pub struct JobDimensionRequest { + #[doc = "The name of the job dimension"] + pub name: String, + #[doc = "The unique identifier of the job dimension in a third party system"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub external_id: Option, +} + +impl std::fmt::Display for JobDimensionRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for JobDimensionRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.name.clone().into(), + if let Some(external_id) = &self.external_id { + format!("{:?}", external_id).into() + } else { + String::new().into() + }, + ] + } + + fn headers() -> Vec> { + vec!["name".into(), "external_id".into()] + } } -#[doc = "An employee model object."] +#[doc = "TimeCard."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Employee { - #[doc = "This is the unique role ID of the employee. A role ID exists per 1 and only 1 \ - company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "This is the unique user ID of the employee. A userID can span across 1 or many \ - companies."] - #[serde(rename = "userId", default, skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[doc = "Full name of the employee"] +pub struct TimeCard { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The ID of the worker associated with the time card."] + pub worker_id: String, + #[doc = "The worker associated with the time card.\n\nExpandable field"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "preferredFirstName", - default, - skip_serializing_if = "Option::is_none" - )] - pub preferred_first_name: Option, - #[serde( - rename = "preferredLastName", - default, - skip_serializing_if = "Option::is_none" - )] - pub preferred_last_name: Option, - #[doc = "First name of the employee"] - #[serde(rename = "firstName", default, skip_serializing_if = "Option::is_none")] - pub first_name: Option, - #[doc = "Last name of the employee"] - #[serde(rename = "lastName", default, skip_serializing_if = "Option::is_none")] - pub last_name: Option, - #[doc = "An ENUM of employment type"] - #[serde( - rename = "employmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub employment_type: Option, - #[doc = "The employee's work title"] + pub worker: Option, + #[doc = "The pay period associated with the time card."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[doc = "The employee's gender"] + pub pay_period: Option, + #[doc = "The summary of the time card."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub gender: Option, - #[doc = "The employee's identified gender"] - #[serde( - rename = "identifiedGender", - default, - skip_serializing_if = "Option::is_none" - )] - pub identified_gender: Option, - #[doc = "The employee's department name"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub department: Option, - #[doc = "An address object as stored within Rippling."] - #[serde( - rename = "workLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_location: Option
, - #[doc = "The work location nickname"] - #[serde( - rename = "worklocationNickname", - default, - skip_serializing_if = "Option::is_none" - )] - pub worklocation_nickname: Option, - #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] - pub spoke_id: Option, - #[doc = "The employee's end date"] - #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[doc = "The employee's role status - roleState meanings:\n\nINIT: An initial record of an \ - individual. An offer has not been made and they have not started working at the \ - company.\n\nHIRED: An offer has been made but they have not accepted or started \ - yet.\n\nACCEPTED: An offer has been made and they have accepted, but they have not \ - started yet.\n\nACTIVE: The employee currently works at the company and their start \ - date is today or in the past.\n\nTERMINATED: The employee is no longer active."] - #[serde(rename = "roleState", default, skip_serializing_if = "Option::is_none")] - pub role_state: Option, - #[doc = "The employee's work email"] - #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "The unique identifier of the employee's manager. This value can be null."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub manager: Option, - #[doc = "custom_fields."] - #[serde( - rename = "customFields", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_fields: Option, - #[doc = "Whether the employee is an international employee or not."] - #[serde( - rename = "isInternational", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_international: Option, - #[doc = "Whether the employee is a manger"] - #[serde(rename = "isManager", default, skip_serializing_if = "Option::is_none")] - pub is_manager: Option, - #[doc = "The employee's weekly work schedule"] - #[serde( - rename = "workSchedule", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_schedule: Option, - #[doc = "Whether the employee's job is remote"] - #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")] - pub is_remote: Option, - #[doc = "This indicates the sequential employee number within their company. This number \ - continues to grow as each employee is onboarded. i.e if you are the 65th employee to \ - join the company with 32 active employees, the employeeNumber would be 65."] - #[serde( - rename = "employeeNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub employee_number: Option, - #[doc = "The level of the employee"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[doc = "An array of the teams that the employee is on"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teams: Option>, - #[doc = "The photo of the employee stored in Rippling"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub photo: Option, - #[doc = "The small photo of the employee stored in Rippling"] - #[serde( - rename = "smallPhoto", - default, - skip_serializing_if = "Option::is_none" - )] - pub small_photo: Option, -} - -impl std::fmt::Display for Employee { + pub summary: Option, +} + +impl std::fmt::Display for TimeCard { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -768,152 +12441,348 @@ impl std::fmt::Display for Employee { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Employee { - const LENGTH: usize = 29; +impl tabled::Tabled for TimeCard { + const LENGTH: usize = 7; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.worker_id.clone().into(), + if let Some(worker) = &self.worker { + format!("{:?}", worker).into() } else { String::new().into() }, - if let Some(user_id) = &self.user_id { - format!("{:?}", user_id).into() + if let Some(pay_period) = &self.pay_period { + format!("{:?}", pay_period).into() } else { String::new().into() }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(summary) = &self.summary { + format!("{:?}", summary).into() } else { String::new().into() }, - if let Some(preferred_first_name) = &self.preferred_first_name { - format!("{:?}", preferred_first_name).into() + ] + } + + fn headers() -> Vec> { + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "worker_id".into(), + "worker".into(), + "pay_period".into(), + "summary".into(), + ] + } +} + +#[doc = "TimeCardRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TimeCardRequest { + #[doc = "The ID of the worker associated with the time card."] + pub worker_id: String, + #[doc = "The pay period associated with the time card."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pay_period: Option, + #[doc = "The summary of the time card."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub summary: Option, +} + +impl std::fmt::Display for TimeCardRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TimeCardRequest { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + self.worker_id.clone().into(), + if let Some(pay_period) = &self.pay_period { + format!("{:?}", pay_period).into() } else { String::new().into() }, - if let Some(preferred_last_name) = &self.preferred_last_name { - format!("{:?}", preferred_last_name).into() + if let Some(summary) = &self.summary { + format!("{:?}", summary).into() } else { String::new().into() }, - if let Some(first_name) = &self.first_name { - format!("{:?}", first_name).into() + ] + } + + fn headers() -> Vec> { + vec!["worker_id".into(), "pay_period".into(), "summary".into()] + } +} + +#[doc = "TimeCardSummary."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TimeCardSummary { + #[doc = "The earnings for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub earnings: Option, + #[doc = "The amount of hours worked for each job code for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hours_worked_by_job_code: Option, + #[doc = "The premiums for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub premiums: Option, + #[doc = "The approved hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approved_hours: Option, + #[doc = "The paid hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub paid_hours: Option, + #[doc = "The total hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_hours: Option, + #[doc = "The total paid time off hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_paid_time_off_hours: Option, + #[doc = "The total holiday hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_holiday_hours: Option, + #[doc = "The total unpaid time off hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_unpaid_time_off_hours: Option, + #[doc = "The total number of regular hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regular_hours: Option, + #[doc = "The total number of overtime hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overtime_hours: Option, + #[doc = "The total number of doubletime hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub double_overtime_hours: Option, +} + +impl std::fmt::Display for TimeCardSummary { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TimeCardSummary { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + if let Some(earnings) = &self.earnings { + format!("{:?}", earnings).into() } else { String::new().into() }, - if let Some(last_name) = &self.last_name { - format!("{:?}", last_name).into() + if let Some(hours_worked_by_job_code) = &self.hours_worked_by_job_code { + format!("{:?}", hours_worked_by_job_code).into() } else { String::new().into() }, - if let Some(employment_type) = &self.employment_type { - format!("{:?}", employment_type).into() + if let Some(premiums) = &self.premiums { + format!("{:?}", premiums).into() } else { String::new().into() }, - if let Some(title) = &self.title { - format!("{:?}", title).into() + if let Some(approved_hours) = &self.approved_hours { + format!("{:?}", approved_hours).into() } else { String::new().into() }, - if let Some(gender) = &self.gender { - format!("{:?}", gender).into() + if let Some(paid_hours) = &self.paid_hours { + format!("{:?}", paid_hours).into() } else { String::new().into() }, - if let Some(identified_gender) = &self.identified_gender { - format!("{:?}", identified_gender).into() + if let Some(total_hours) = &self.total_hours { + format!("{:?}", total_hours).into() } else { String::new().into() }, - if let Some(department) = &self.department { - format!("{:?}", department).into() + if let Some(total_paid_time_off_hours) = &self.total_paid_time_off_hours { + format!("{:?}", total_paid_time_off_hours).into() } else { String::new().into() }, - if let Some(work_location) = &self.work_location { - format!("{:?}", work_location).into() + if let Some(total_holiday_hours) = &self.total_holiday_hours { + format!("{:?}", total_holiday_hours).into() } else { String::new().into() }, - if let Some(worklocation_nickname) = &self.worklocation_nickname { - format!("{:?}", worklocation_nickname).into() + if let Some(total_unpaid_time_off_hours) = &self.total_unpaid_time_off_hours { + format!("{:?}", total_unpaid_time_off_hours).into() } else { String::new().into() }, - if let Some(spoke_id) = &self.spoke_id { - format!("{:?}", spoke_id).into() + if let Some(regular_hours) = &self.regular_hours { + format!("{:?}", regular_hours).into() } else { String::new().into() }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() + if let Some(overtime_hours) = &self.overtime_hours { + format!("{:?}", overtime_hours).into() } else { String::new().into() }, - if let Some(role_state) = &self.role_state { - format!("{:?}", role_state).into() + if let Some(double_overtime_hours) = &self.double_overtime_hours { + format!("{:?}", double_overtime_hours).into() } else { String::new().into() }, - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() + ] + } + + fn headers() -> Vec> { + vec![ + "earnings".into(), + "hours_worked_by_job_code".into(), + "premiums".into(), + "approved_hours".into(), + "paid_hours".into(), + "total_hours".into(), + "total_paid_time_off_hours".into(), + "total_holiday_hours".into(), + "total_unpaid_time_off_hours".into(), + "regular_hours".into(), + "overtime_hours".into(), + "double_overtime_hours".into(), + ] + } +} + +#[doc = "TimeCardSummaryRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TimeCardSummaryRequest { + #[doc = "The earnings for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub earnings: Option, + #[doc = "The amount of hours worked for each job code for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hours_worked_by_job_code: Option, + #[doc = "The premiums for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub premiums: Option, + #[doc = "The approved hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub approved_hours: Option, + #[doc = "The paid hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub paid_hours: Option, + #[doc = "The total hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_hours: Option, + #[doc = "The total paid time off hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_paid_time_off_hours: Option, + #[doc = "The total holiday hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_holiday_hours: Option, + #[doc = "The total unpaid time off hours for the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub total_unpaid_time_off_hours: Option, + #[doc = "The total number of regular hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regular_hours: Option, + #[doc = "The total number of overtime hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub overtime_hours: Option, + #[doc = "The total number of doubletime hours worked during the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub double_overtime_hours: Option, +} + +impl std::fmt::Display for TimeCardSummaryRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TimeCardSummaryRequest { + const LENGTH: usize = 12; + fn fields(&self) -> Vec> { + vec![ + if let Some(earnings) = &self.earnings { + format!("{:?}", earnings).into() } else { String::new().into() }, - if let Some(manager) = &self.manager { - format!("{:?}", manager).into() + if let Some(hours_worked_by_job_code) = &self.hours_worked_by_job_code { + format!("{:?}", hours_worked_by_job_code).into() } else { String::new().into() }, - if let Some(custom_fields) = &self.custom_fields { - format!("{:?}", custom_fields).into() + if let Some(premiums) = &self.premiums { + format!("{:?}", premiums).into() } else { String::new().into() }, - if let Some(is_international) = &self.is_international { - format!("{:?}", is_international).into() + if let Some(approved_hours) = &self.approved_hours { + format!("{:?}", approved_hours).into() } else { String::new().into() }, - if let Some(is_manager) = &self.is_manager { - format!("{:?}", is_manager).into() + if let Some(paid_hours) = &self.paid_hours { + format!("{:?}", paid_hours).into() } else { String::new().into() }, - if let Some(work_schedule) = &self.work_schedule { - format!("{:?}", work_schedule).into() + if let Some(total_hours) = &self.total_hours { + format!("{:?}", total_hours).into() } else { String::new().into() }, - if let Some(is_remote) = &self.is_remote { - format!("{:?}", is_remote).into() + if let Some(total_paid_time_off_hours) = &self.total_paid_time_off_hours { + format!("{:?}", total_paid_time_off_hours).into() } else { String::new().into() }, - if let Some(employee_number) = &self.employee_number { - format!("{:?}", employee_number).into() + if let Some(total_holiday_hours) = &self.total_holiday_hours { + format!("{:?}", total_holiday_hours).into() } else { String::new().into() }, - if let Some(level) = &self.level { - format!("{:?}", level).into() + if let Some(total_unpaid_time_off_hours) = &self.total_unpaid_time_off_hours { + format!("{:?}", total_unpaid_time_off_hours).into() } else { String::new().into() }, - if let Some(teams) = &self.teams { - format!("{:?}", teams).into() + if let Some(regular_hours) = &self.regular_hours { + format!("{:?}", regular_hours).into() } else { String::new().into() }, - if let Some(photo) = &self.photo { - format!("{:?}", photo).into() + if let Some(overtime_hours) = &self.overtime_hours { + format!("{:?}", overtime_hours).into() } else { String::new().into() }, - if let Some(small_photo) = &self.small_photo { - format!("{:?}", small_photo).into() + if let Some(double_overtime_hours) = &self.double_overtime_hours { + format!("{:?}", double_overtime_hours).into() } else { String::new().into() }, @@ -922,54 +12791,39 @@ impl tabled::Tabled for Employee { fn headers() -> Vec> { vec![ - "id".into(), - "user_id".into(), - "name".into(), - "preferred_first_name".into(), - "preferred_last_name".into(), - "first_name".into(), - "last_name".into(), - "employment_type".into(), - "title".into(), - "gender".into(), - "identified_gender".into(), - "department".into(), - "work_location".into(), - "worklocation_nickname".into(), - "spoke_id".into(), - "end_date".into(), - "role_state".into(), - "work_email".into(), - "manager".into(), - "custom_fields".into(), - "is_international".into(), - "is_manager".into(), - "work_schedule".into(), - "is_remote".into(), - "employee_number".into(), - "level".into(), - "teams".into(), - "photo".into(), - "small_photo".into(), + "earnings".into(), + "hours_worked_by_job_code".into(), + "premiums".into(), + "approved_hours".into(), + "paid_hours".into(), + "total_hours".into(), + "total_paid_time_off_hours".into(), + "total_holiday_hours".into(), + "total_unpaid_time_off_hours".into(), + "regular_hours".into(), + "overtime_hours".into(), + "double_overtime_hours".into(), ] } } -#[doc = "A work location object."] +#[doc = "JobCodeSummary."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct WorkLocation { +pub struct JobCodeSummary { + #[doc = "List of job code ids that this summary is tracking hours for."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, + pub job_code_ids: Option, + #[doc = "List of job codes that this summary is tracking hours for.\n\nExpandable field"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub nickname: Option, - #[doc = "An address object as stored within Rippling."] + pub job_codes: Option, + #[doc = "The total hours worked for the job codes."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option
, + pub hours_worked: Option, } -impl std::fmt::Display for WorkLocation { +impl std::fmt::Display for JobCodeSummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -980,22 +12834,22 @@ impl std::fmt::Display for WorkLocation { } #[cfg(feature = "tabled")] -impl tabled::Tabled for WorkLocation { +impl tabled::Tabled for JobCodeSummary { const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + if let Some(job_code_ids) = &self.job_code_ids { + format!("{:?}", job_code_ids).into() } else { String::new().into() }, - if let Some(nickname) = &self.nickname { - format!("{:?}", nickname).into() + if let Some(job_codes) = &self.job_codes { + format!("{:?}", job_codes).into() } else { String::new().into() }, - if let Some(address) = &self.address { - format!("{:?}", address).into() + if let Some(hours_worked) = &self.hours_worked { + format!("{:?}", hours_worked).into() } else { String::new().into() }, @@ -1003,59 +12857,28 @@ impl tabled::Tabled for WorkLocation { } fn headers() -> Vec> { - vec!["id".into(), "nickname".into(), "address".into()] + vec![ + "job_code_ids".into(), + "job_codes".into(), + "hours_worked".into(), + ] } } +#[doc = "JobCodeSummaryRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct SteLocationCode { - #[serde( - rename = "locationCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub location_code: Option, - #[serde(rename = "stateCode", default, skip_serializing_if = "Option::is_none")] - pub state_code: Option, - #[serde( - rename = "countyCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub county_code: Option, - #[serde(rename = "cityCode", default, skip_serializing_if = "Option::is_none")] - pub city_code: Option, - #[serde( - rename = "schoolCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub school_code: Option, - #[serde( - rename = "municipalityCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub municipality_code: Option, - #[serde(rename = "psdCode", default, skip_serializing_if = "Option::is_none")] - pub psd_code: Option, - #[serde( - rename = "transitDistrictCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub transit_district_code: Option, - #[serde( - rename = "isOverridden", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_overridden: Option, -} - -impl std::fmt::Display for SteLocationCode { +pub struct JobCodeSummaryRequest { + #[doc = "List of job code ids that this summary is tracking hours for."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_code_ids: Option, + #[doc = "The total hours worked for the job codes."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub hours_worked: Option, +} + +impl std::fmt::Display for JobCodeSummaryRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1066,52 +12889,71 @@ impl std::fmt::Display for SteLocationCode { } #[cfg(feature = "tabled")] -impl tabled::Tabled for SteLocationCode { - const LENGTH: usize = 9; +impl tabled::Tabled for JobCodeSummaryRequest { + const LENGTH: usize = 2; fn fields(&self) -> Vec> { vec![ - if let Some(location_code) = &self.location_code { - format!("{:?}", location_code).into() - } else { - String::new().into() - }, - if let Some(state_code) = &self.state_code { - format!("{:?}", state_code).into() - } else { - String::new().into() - }, - if let Some(county_code) = &self.county_code { - format!("{:?}", county_code).into() - } else { - String::new().into() - }, - if let Some(city_code) = &self.city_code { - format!("{:?}", city_code).into() - } else { - String::new().into() - }, - if let Some(school_code) = &self.school_code { - format!("{:?}", school_code).into() + if let Some(job_code_ids) = &self.job_code_ids { + format!("{:?}", job_code_ids).into() } else { String::new().into() }, - if let Some(municipality_code) = &self.municipality_code { - format!("{:?}", municipality_code).into() + if let Some(hours_worked) = &self.hours_worked { + format!("{:?}", hours_worked).into() } else { String::new().into() }, - if let Some(psd_code) = &self.psd_code { - format!("{:?}", psd_code).into() + ] + } + + fn headers() -> Vec> { + vec!["job_code_ids".into(), "hours_worked".into()] + } +} + +#[doc = "PayPeriod."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct PayPeriod { + #[doc = "The start date of the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_date: Option, + #[doc = "The end date of the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_date: Option, + #[doc = "The ID of the pay schedule associated with the pay period."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pay_schedule_id: Option, +} + +impl std::fmt::Display for PayPeriod { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for PayPeriod { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() } else { String::new().into() }, - if let Some(transit_district_code) = &self.transit_district_code { - format!("{:?}", transit_district_code).into() + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() } else { String::new().into() }, - if let Some(is_overridden) = &self.is_overridden { - format!("{:?}", is_overridden).into() + if let Some(pay_schedule_id) = &self.pay_schedule_id { + format!("{:?}", pay_schedule_id).into() } else { String::new().into() }, @@ -1120,57 +12962,30 @@ impl tabled::Tabled for SteLocationCode { fn headers() -> Vec> { vec![ - "location_code".into(), - "state_code".into(), - "county_code".into(), - "city_code".into(), - "school_code".into(), - "municipality_code".into(), - "psd_code".into(), - "transit_district_code".into(), - "is_overridden".into(), + "start_date".into(), + "end_date".into(), + "pay_schedule_id".into(), ] } } -#[doc = "An address object as stored within Rippling."] +#[doc = "PayPeriodRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Address { - #[serde( - rename = "streetLine1", - default, - skip_serializing_if = "Option::is_none" - )] - pub street_line_1: Option, - #[serde( - rename = "streetLine2", - default, - skip_serializing_if = "Option::is_none" - )] - pub street_line_2: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub zip: Option, +pub struct PayPeriodRequest { + #[doc = "The start date of the pay period."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub city: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub state: Option, + pub start_date: Option, + #[doc = "The end date of the pay period."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, + pub end_date: Option, + #[doc = "The ID of the pay schedule associated with the pay period."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone: Option, - #[serde(rename = "isRemote", default, skip_serializing_if = "Option::is_none")] - pub is_remote: Option, - #[serde( - rename = "steLocationCode", - default, - skip_serializing_if = "Option::is_none" - )] - pub ste_location_code: Option, + pub pay_schedule_id: Option, } -impl std::fmt::Display for Address { +impl std::fmt::Display for PayPeriodRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1181,52 +12996,22 @@ impl std::fmt::Display for Address { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Address { - const LENGTH: usize = 9; +impl tabled::Tabled for PayPeriodRequest { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(street_line_1) = &self.street_line_1 { - format!("{:?}", street_line_1).into() - } else { - String::new().into() - }, - if let Some(street_line_2) = &self.street_line_2 { - format!("{:?}", street_line_2).into() - } else { - String::new().into() - }, - if let Some(zip) = &self.zip { - format!("{:?}", zip).into() - } else { - String::new().into() - }, - if let Some(city) = &self.city { - format!("{:?}", city).into() - } else { - String::new().into() - }, - if let Some(state) = &self.state { - format!("{:?}", state).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() - } else { - String::new().into() - }, - if let Some(phone) = &self.phone { - format!("{:?}", phone).into() + if let Some(start_date) = &self.start_date { + format!("{:?}", start_date).into() } else { String::new().into() }, - if let Some(is_remote) = &self.is_remote { - format!("{:?}", is_remote).into() + if let Some(end_date) = &self.end_date { + format!("{:?}", end_date).into() } else { String::new().into() }, - if let Some(ste_location_code) = &self.ste_location_code { - format!("{:?}", ste_location_code).into() + if let Some(pay_schedule_id) = &self.pay_schedule_id { + format!("{:?}", pay_schedule_id).into() } else { String::new().into() }, @@ -1235,40 +13020,45 @@ impl tabled::Tabled for Address { fn headers() -> Vec> { vec![ - "street_line_1".into(), - "street_line_2".into(), - "zip".into(), - "city".into(), - "state".into(), - "country".into(), - "phone".into(), - "is_remote".into(), - "ste_location_code".into(), + "start_date".into(), + "end_date".into(), + "pay_schedule_id".into(), ] } } +#[doc = "ShiftInput."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Group { - #[doc = "User-readable name of a Rippling group."] +pub struct ShiftInput { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The creator id associated with the shift input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Your id for the group; this should a unique string identifier."] - #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] - pub spoke_id: Option, - #[doc = "The version unique identifier of the group."] + pub creator_id: Option, + #[doc = "The creator associated with the shift input.\n\nExpandable field"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, - #[doc = "An array of employee Rippling ids."] + pub creator: Option, + #[doc = "Name of the shift unit."] + pub name: String, + #[doc = "Prompt for the shift unit."] + pub prompt: String, + #[doc = "Type of shift unit."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Two letter string designating country code which the shift input is associated."] + pub country_code: String, + #[doc = "The party that manages this shift input"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub users: Option>, + pub managed_by: Option, } -impl std::fmt::Display for Group { +impl std::fmt::Display for ShiftInput { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1279,32 +13069,29 @@ impl std::fmt::Display for Group { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Group { - const LENGTH: usize = 5; +impl tabled::Tabled for ShiftInput { + const LENGTH: usize = 10; fn fields(&self) -> Vec> { vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - if let Some(spoke_id) = &self.spoke_id { - format!("{:?}", spoke_id).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(creator_id) = &self.creator_id { + format!("{:?}", creator_id).into() } else { String::new().into() }, - if let Some(version) = &self.version { - format!("{:?}", version).into() + if let Some(creator) = &self.creator { + format!("{:?}", creator).into() } else { String::new().into() }, - if let Some(users) = &self.users { - format!("{:?}", users).into() + self.name.clone().into(), + self.prompt.clone().into(), + self.type_.clone().into(), + self.country_code.clone().into(), + if let Some(managed_by) = &self.managed_by { + format!("{:?}", managed_by).into() } else { String::new().into() }, @@ -1313,32 +13100,40 @@ impl tabled::Tabled for Group { fn headers() -> Vec> { vec![ - "name".into(), "id".into(), - "spoke_id".into(), - "version".into(), - "users".into(), + "created_at".into(), + "updated_at".into(), + "creator_id".into(), + "creator".into(), + "name".into(), + "prompt".into(), + "type_".into(), + "country_code".into(), + "managed_by".into(), ] } } -#[doc = "A company department object."] +#[doc = "ShiftInputRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Department { - #[doc = "Name of the department"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "Unique identifier of the department"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "id of the parent department, if one exists"] +pub struct ShiftInputRequest { + #[doc = "The creator id associated with the shift input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, -} - -impl std::fmt::Display for Department { + pub creator_id: Option, + #[doc = "Name of the shift unit."] + pub name: String, + #[doc = "Prompt for the shift unit."] + pub prompt: String, + #[doc = "Type of shift unit."] + #[serde(rename = "type")] + pub type_: String, + #[doc = "Two letter string designating country code which the shift input is associated."] + pub country_code: String, +} + +impl std::fmt::Display for ShiftInputRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1349,34 +13144,34 @@ impl std::fmt::Display for Department { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Department { - const LENGTH: usize = 3; +impl tabled::Tabled for ShiftInputRequest { + const LENGTH: usize = 5; fn fields(&self) -> Vec> { vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() + if let Some(creator_id) = &self.creator_id { + format!("{:?}", creator_id).into() } else { String::new().into() }, + self.name.clone().into(), + self.prompt.clone().into(), + self.type_.clone().into(), + self.country_code.clone().into(), ] } fn headers() -> Vec> { - vec!["name".into(), "id".into(), "parent".into()] + vec![ + "creator_id".into(), + "name".into(), + "prompt".into(), + "type_".into(), + "country_code".into(), + ] } } -#[doc = "Denotes the type of the custom field."] +#[doc = "The status of the time entry."] #[derive( serde :: Serialize, serde :: Deserialize, @@ -1390,59 +13185,83 @@ impl tabled::Tabled for Department { )] #[cfg_attr(feature = "clap", derive(clap::ValueEnum))] #[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Type { - #[serde(rename = "TEXT")] - #[display("TEXT")] - Text, - #[serde(rename = "DATE")] - #[display("DATE")] - Date, - #[serde(rename = "NUMBER")] - #[display("NUMBER")] - Number, - #[serde(rename = "CURRENCY")] - #[display("CURRENCY")] - Currency, - #[serde(rename = "PERCENTAGE")] - #[display("PERCENTAGE")] - Percentage, - #[serde(rename = "SELECT")] - #[display("SELECT")] - Select, - #[serde(rename = "FILE")] - #[display("FILE")] - File, - #[serde(rename = "ID")] - #[display("ID")] - Id, - #[serde(rename = "RADIO")] - #[display("RADIO")] - Radio, - #[serde(rename = "TEXTAREA")] - #[display("TEXTAREA")] - Textarea, +pub enum TimeEntryStatus { + #[serde(rename = "DRAFT")] + #[display("DRAFT")] + Draft, + #[serde(rename = "APPROVED")] + #[display("APPROVED")] + Approved, + #[serde(rename = "PAID")] + #[display("PAID")] + Paid, + #[serde(rename = "FINALIZED")] + #[display("FINALIZED")] + Finalized, } -#[doc = "A Custom Fields object within Rippling."] +#[doc = "TimeEntry."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct CustomFields { - #[doc = "The identifier of the specific custom field."] - #[serde(rename = "Id", default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Denotes the type of the custom field."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "The title of the custom field."] +pub struct TimeEntry { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The ID of the worker associated with the time entry."] + pub worker_id: String, + #[doc = "The worker associated with the time entry.\n\nExpandable field"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[doc = "Denotes whether the custom field is or is not mandatory"] + pub worker: Option, + #[doc = "The start time of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The end time of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The comments associated with the time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub required: Option, + pub comments: Option, + #[doc = "The job shifts worked during the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_shifts: Option, + #[doc = "The breaks taken during the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub breaks: Option, + #[doc = "A summary of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time_entry_summary: Option, + #[doc = "The ID of the time card associated with the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time_card_id: Option, + #[doc = "The time card associated with the time entry.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time_card: Option, + #[doc = "The tags associated with the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The unique key of the time entry in an outside system. If set, no other time entry \ + with the same key can be created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub idempotency_key: Option, + #[doc = "Whether the time entry should create an extra hours run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub create_extra_hours_run: Option, + #[doc = "The status of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The pay period associated with the time card."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pay_period: Option, + #[doc = "Arbitrary shift inputs collected on the time entry"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub shift_input_values: Option, } -impl std::fmt::Display for CustomFields { +impl std::fmt::Display for TimeEntry { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1453,27 +13272,86 @@ impl std::fmt::Display for CustomFields { } #[cfg(feature = "tabled")] -impl tabled::Tabled for CustomFields { - const LENGTH: usize = 4; +impl tabled::Tabled for TimeEntry { + const LENGTH: usize = 19; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.worker_id.clone().into(), + if let Some(worker) = &self.worker { + format!("{:?}", worker).into() } else { String::new().into() }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(comments) = &self.comments { + format!("{:?}", comments).into() + } else { + String::new().into() + }, + if let Some(job_shifts) = &self.job_shifts { + format!("{:?}", job_shifts).into() + } else { + String::new().into() + }, + if let Some(breaks) = &self.breaks { + format!("{:?}", breaks).into() + } else { + String::new().into() + }, + if let Some(time_entry_summary) = &self.time_entry_summary { + format!("{:?}", time_entry_summary).into() + } else { + String::new().into() + }, + if let Some(time_card_id) = &self.time_card_id { + format!("{:?}", time_card_id).into() + } else { + String::new().into() + }, + if let Some(time_card) = &self.time_card { + format!("{:?}", time_card).into() + } else { + String::new().into() + }, + if let Some(tags) = &self.tags { + format!("{:?}", tags).into() + } else { + String::new().into() + }, + if let Some(idempotency_key) = &self.idempotency_key { + format!("{:?}", idempotency_key).into() + } else { + String::new().into() + }, + if let Some(create_extra_hours_run) = &self.create_extra_hours_run { + format!("{:?}", create_extra_hours_run).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() } else { String::new().into() }, - if let Some(title) = &self.title { - format!("{:?}", title).into() + if let Some(pay_period) = &self.pay_period { + format!("{:?}", pay_period).into() } else { String::new().into() }, - if let Some(required) = &self.required { - format!("{:?}", required).into() + if let Some(shift_input_values) = &self.shift_input_values { + format!("{:?}", shift_input_values).into() } else { String::new().into() }, @@ -1483,46 +13361,98 @@ impl tabled::Tabled for CustomFields { fn headers() -> Vec> { vec![ "id".into(), - "type_".into(), - "title".into(), - "required".into(), + "created_at".into(), + "updated_at".into(), + "worker_id".into(), + "worker".into(), + "start_time".into(), + "end_time".into(), + "comments".into(), + "job_shifts".into(), + "breaks".into(), + "time_entry_summary".into(), + "time_card_id".into(), + "time_card".into(), + "tags".into(), + "idempotency_key".into(), + "create_extra_hours_run".into(), + "status".into(), + "pay_period".into(), + "shift_input_values".into(), ] } } -#[doc = "A company object as represented within Rippling."] +#[doc = "The status of the time entry."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum TimeEntryRequestStatus { + #[serde(rename = "DRAFT")] + #[display("DRAFT")] + Draft, + #[serde(rename = "APPROVED")] + #[display("APPROVED")] + Approved, + #[serde(rename = "PAID")] + #[display("PAID")] + Paid, + #[serde(rename = "FINALIZED")] + #[display("FINALIZED")] + Finalized, +} + +#[doc = "TimeEntryRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Company { +pub struct TimeEntryRequest { + #[doc = "The ID of the worker associated with the time entry."] + pub worker_id: String, + #[doc = "The duration of the time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "An address object as stored within Rippling."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub address: Option
, - #[serde( - rename = "workLocations", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_locations: Option>, - #[serde( - rename = "primaryEmail", - default, - skip_serializing_if = "Option::is_none" - )] - pub primary_email: Option, + pub duration: Option, + #[doc = "The comments associated with the time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub phone: Option, + pub comments: Option, + #[doc = "The job shifts worked during the time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "This model represents the legal entities inside of a given company. Legal entities \ - based in Canada (CA) are currently supported at this time."] + pub job_shifts: Option, + #[doc = "The breaks taken during the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub breaks: Option, + #[doc = "The tags associated with the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[doc = "The unique key of the time entry in an outside system. If set, no other time entry \ + with the same key can be created."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub idempotency_key: Option, + #[doc = "Whether the time entry should create an extra hours run."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub create_extra_hours_run: Option, + #[doc = "The status of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, + #[doc = "The pay period associated with the time card."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pay_period: Option, + #[doc = "Arbitrary shift inputs collected on the time entry"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub entities: Option, + pub shift_input_values: Option, } -impl std::fmt::Display for Company { +impl std::fmt::Display for TimeEntryRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1533,42 +13463,58 @@ impl std::fmt::Display for Company { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Company { - const LENGTH: usize = 7; +impl tabled::Tabled for TimeEntryRequest { + const LENGTH: usize = 11; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + self.worker_id.clone().into(), + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() } else { String::new().into() }, - if let Some(address) = &self.address { - format!("{:?}", address).into() + if let Some(comments) = &self.comments { + format!("{:?}", comments).into() } else { String::new().into() }, - if let Some(work_locations) = &self.work_locations { - format!("{:?}", work_locations).into() + if let Some(job_shifts) = &self.job_shifts { + format!("{:?}", job_shifts).into() } else { String::new().into() }, - if let Some(primary_email) = &self.primary_email { - format!("{:?}", primary_email).into() + if let Some(breaks) = &self.breaks { + format!("{:?}", breaks).into() } else { String::new().into() }, - if let Some(phone) = &self.phone { - format!("{:?}", phone).into() + if let Some(tags) = &self.tags { + format!("{:?}", tags).into() } else { String::new().into() }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(idempotency_key) = &self.idempotency_key { + format!("{:?}", idempotency_key).into() + } else { + String::new().into() + }, + if let Some(create_extra_hours_run) = &self.create_extra_hours_run { + format!("{:?}", create_extra_hours_run).into() + } else { + String::new().into() + }, + if let Some(status) = &self.status { + format!("{:?}", status).into() } else { String::new().into() }, - if let Some(entities) = &self.entities { - format!("{:?}", entities).into() + if let Some(pay_period) = &self.pay_period { + format!("{:?}", pay_period).into() + } else { + String::new().into() + }, + if let Some(shift_input_values) = &self.shift_input_values { + format!("{:?}", shift_input_values).into() } else { String::new().into() }, @@ -1577,85 +13523,39 @@ impl tabled::Tabled for Company { fn headers() -> Vec> { vec![ - "id".into(), - "address".into(), - "work_locations".into(), - "primary_email".into(), - "phone".into(), - "name".into(), - "entities".into(), + "worker_id".into(), + "duration".into(), + "comments".into(), + "job_shifts".into(), + "breaks".into(), + "tags".into(), + "idempotency_key".into(), + "create_extra_hours_run".into(), + "status".into(), + "pay_period".into(), + "shift_input_values".into(), ] } } -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Status { - #[serde(rename = "PENDING")] - #[display("PENDING")] - Pending, - #[serde(rename = "APPROVED")] - #[display("APPROVED")] - Approved, - #[serde(rename = "REJECTED")] - #[display("REJECTED")] - Rejected, - #[serde(rename = "CANCELED")] - #[display("CANCELED")] - Canceled, -} - -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum LeaveTypeUniqueId { - #[serde(rename = "VACATION")] - #[display("VACATION")] - Vacation, - #[serde(rename = "SICK")] - #[display("SICK")] - Sick, - #[serde(rename = "JURY_DUTY")] - #[display("JURY_DUTY")] - JuryDuty, -} - +#[doc = "ShiftInputValue."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Dates { +pub struct ShiftInputValue { + #[doc = "The id of the relevant shift input"] + pub shift_input_id: String, + #[doc = "The value of the shift input."] + pub value: serde_json::Value, + #[doc = "The role that last added/updated this input.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option, + #[doc = "The id of the role that last added/updated this input."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub date: Option, - #[serde( - rename = "numMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub num_minutes: Option, + pub author_id: Option, } -impl std::fmt::Display for Dates { +impl std::fmt::Display for ShiftInputValue { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1666,17 +13566,19 @@ impl std::fmt::Display for Dates { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Dates { - const LENGTH: usize = 2; +impl tabled::Tabled for ShiftInputValue { + const LENGTH: usize = 4; fn fields(&self) -> Vec> { vec![ - if let Some(date) = &self.date { - format!("{:?}", date).into() + self.shift_input_id.clone().into(), + format!("{:?}", self.value).into(), + if let Some(author) = &self.author { + format!("{:?}", author).into() } else { String::new().into() }, - if let Some(num_minutes) = &self.num_minutes { - format!("{:?}", num_minutes).into() + if let Some(author_id) = &self.author_id { + format!("{:?}", author_id).into() } else { String::new().into() }, @@ -1684,57 +13586,30 @@ impl tabled::Tabled for Dates { } fn headers() -> Vec> { - vec!["date".into(), "num_minutes".into()] + vec![ + "shift_input_id".into(), + "value".into(), + "author".into(), + "author_id".into(), + ] } } -#[doc = "This indicates the system that manages the Leave Request. PTO = managed by Rippling's \ - Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = managed by \ - third-party partner Tilt."] +#[doc = "ShiftInputValueRequest."] #[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum ManagedBy { - #[serde(rename = "PTO")] - #[display("PTO")] - Pto, - #[serde(rename = "LEAVES")] - #[display("LEAVES")] - Leaves, - #[serde(rename = "TILT")] - #[display("TILT")] - Tilt, +pub struct ShiftInputValueRequest { + #[doc = "The id of the relevant shift input"] + pub shift_input_id: String, + #[doc = "The value of the shift input."] + pub value: serde_json::Value, + #[doc = "The id of the role that last added/updated this input."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author_id: Option, } -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct PartialDays { - #[serde( - rename = "partialDay", - default, - skip_serializing_if = "Option::is_none" - )] - pub partial_day: Option, - #[serde( - rename = "numMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub num_minutes: Option, -} - -impl std::fmt::Display for PartialDays { +impl std::fmt::Display for ShiftInputValueRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1745,17 +13620,14 @@ impl std::fmt::Display for PartialDays { } #[cfg(feature = "tabled")] -impl tabled::Tabled for PartialDays { - const LENGTH: usize = 2; +impl tabled::Tabled for ShiftInputValueRequest { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(partial_day) = &self.partial_day { - format!("{:?}", partial_day).into() - } else { - String::new().into() - }, - if let Some(num_minutes) = &self.num_minutes { - format!("{:?}", num_minutes).into() + self.shift_input_id.clone().into(), + format!("{:?}", self.value).into(), + if let Some(author_id) = &self.author_id { + format!("{:?}", author_id).into() } else { String::new().into() }, @@ -1763,152 +13635,30 @@ impl tabled::Tabled for PartialDays { } fn headers() -> Vec> { - vec!["partial_day".into(), "num_minutes".into()] + vec!["shift_input_id".into(), "value".into(), "author_id".into()] } } -#[doc = "Leave request object."] +#[doc = "\nDTO used to store the summary of a TimeEntry\n"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct LeaveRequest { - #[doc = "Unique identifier of the leave request."] +pub struct TimeEntrySummary { + #[doc = "The number of overtime hours worked during this time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "createdAt", default, skip_serializing_if = "Option::is_none")] - pub created_at: Option, - #[serde(rename = "updatedAt", default, skip_serializing_if = "Option::is_none")] - pub updated_at: Option, - #[doc = "Unique identifier of the employee who is taking leave."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option, - #[serde(rename = "roleName", default, skip_serializing_if = "Option::is_none")] - pub role_name: Option, - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option, - #[doc = "Unique identifier of the employee who made the request (in most cases this is the \ - same as role)."] - #[serde( - rename = "requestedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by_name: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[serde( - rename = "startDateStartTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_start_time: Option, - #[serde( - rename = "endDateEndTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_end_time: Option, - #[serde( - rename = "startDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_custom_hours: Option, - #[serde( - rename = "endDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_custom_hours: Option, + pub over_time_hours: Option, + #[doc = "The number of double overtime hours worked during this time entry."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub comments: Option, - #[serde(rename = "numHours", default, skip_serializing_if = "Option::is_none")] - pub num_hours: Option, - #[serde( - rename = "numMinutes", - default, - skip_serializing_if = "Option::is_none" - )] - pub num_minutes: Option, - #[serde( - rename = "leavePolicy", - default, - skip_serializing_if = "Option::is_none" - )] - pub leave_policy: Option, - #[serde( - rename = "leaveTypeUniqueId", - default, - skip_serializing_if = "Option::is_none" - )] - pub leave_type_unique_id: Option, - #[serde( - rename = "policyDisplayName", - default, - skip_serializing_if = "Option::is_none" - )] - pub policy_display_name: Option, - #[serde( - rename = "reasonForLeave", - default, - skip_serializing_if = "Option::is_none" - )] - pub reason_for_leave: Option, - #[serde( - rename = "processedAt", - default, - skip_serializing_if = "Option::is_none" - )] - pub processed_at: Option, - #[doc = "Unique identifier of the employee who approved or rejected the request. This may be \ - null."] - #[serde( - rename = "processedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub processed_by: Option, - #[serde( - rename = "processedByName", - default, - skip_serializing_if = "Option::is_none" - )] - pub processed_by_name: Option, - #[doc = "Timezone of the role. This will be work location timezone, or home timezone for \ - employees without a work location."] - #[serde( - rename = "roleTimezone", - default, - skip_serializing_if = "Option::is_none" - )] - pub role_timezone: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dates: Option>, - #[doc = "If the leave request is paid this will be TRUE. Otherwise, this will be FALSE."] - #[serde(rename = "isPaid", default, skip_serializing_if = "Option::is_none")] - pub is_paid: Option, - #[doc = "This indicates the system that manages the Leave Request. PTO = managed by \ - Rippling's Time Off app. LEAVES = managed by Rippling's Leave Management app. TILT = \ - managed by third-party partner Tilt."] - #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")] - pub managed_by: Option, - #[serde( - rename = "partialDays", - default, - skip_serializing_if = "Option::is_none" - )] - pub partial_days: Option>>, + pub double_over_time_hours: Option, + #[doc = "The number of regular hours worked during this time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regular_hours: Option, + #[doc = "The duration of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, } -impl std::fmt::Display for LeaveRequest { +impl std::fmt::Display for TimeEntrySummary { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -1919,233 +13669,63 @@ impl std::fmt::Display for LeaveRequest { } #[cfg(feature = "tabled")] -impl tabled::Tabled for LeaveRequest { - const LENGTH: usize = 29; +impl tabled::Tabled for TimeEntrySummary { + const LENGTH: usize = 4; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - if let Some(created_at) = &self.created_at { - format!("{:?}", created_at).into() - } else { - String::new().into() - }, - if let Some(updated_at) = &self.updated_at { - format!("{:?}", updated_at).into() - } else { - String::new().into() - }, - if let Some(role) = &self.role { - format!("{:?}", role).into() - } else { - String::new().into() - }, - if let Some(role_name) = &self.role_name { - format!("{:?}", role_name).into() - } else { - String::new().into() - }, - if let Some(requested_by) = &self.requested_by { - format!("{:?}", requested_by).into() - } else { - String::new().into() - }, - if let Some(requested_by_name) = &self.requested_by_name { - format!("{:?}", requested_by_name).into() - } else { - String::new().into() - }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() - } else { - String::new().into() - }, - if let Some(start_date_start_time) = &self.start_date_start_time { - format!("{:?}", start_date_start_time).into() - } else { - String::new().into() - }, - if let Some(end_date_end_time) = &self.end_date_end_time { - format!("{:?}", end_date_end_time).into() + if let Some(over_time_hours) = &self.over_time_hours { + format!("{:?}", over_time_hours).into() } else { String::new().into() }, - if let Some(start_date_custom_hours) = &self.start_date_custom_hours { - format!("{:?}", start_date_custom_hours).into() + if let Some(double_over_time_hours) = &self.double_over_time_hours { + format!("{:?}", double_over_time_hours).into() } else { String::new().into() }, - if let Some(end_date_custom_hours) = &self.end_date_custom_hours { - format!("{:?}", end_date_custom_hours).into() + if let Some(regular_hours) = &self.regular_hours { + format!("{:?}", regular_hours).into() } else { String::new().into() }, - if let Some(comments) = &self.comments { - format!("{:?}", comments).into() - } else { - String::new().into() - }, - if let Some(num_hours) = &self.num_hours { - format!("{:?}", num_hours).into() - } else { - String::new().into() - }, - if let Some(num_minutes) = &self.num_minutes { - format!("{:?}", num_minutes).into() - } else { - String::new().into() - }, - if let Some(leave_policy) = &self.leave_policy { - format!("{:?}", leave_policy).into() - } else { - String::new().into() - }, - if let Some(leave_type_unique_id) = &self.leave_type_unique_id { - format!("{:?}", leave_type_unique_id).into() - } else { - String::new().into() - }, - if let Some(policy_display_name) = &self.policy_display_name { - format!("{:?}", policy_display_name).into() - } else { - String::new().into() - }, - if let Some(reason_for_leave) = &self.reason_for_leave { - format!("{:?}", reason_for_leave).into() - } else { - String::new().into() - }, - if let Some(processed_at) = &self.processed_at { - format!("{:?}", processed_at).into() - } else { - String::new().into() - }, - if let Some(processed_by) = &self.processed_by { - format!("{:?}", processed_by).into() - } else { - String::new().into() - }, - if let Some(processed_by_name) = &self.processed_by_name { - format!("{:?}", processed_by_name).into() - } else { - String::new().into() - }, - if let Some(role_timezone) = &self.role_timezone { - format!("{:?}", role_timezone).into() - } else { - String::new().into() - }, - if let Some(dates) = &self.dates { - format!("{:?}", dates).into() - } else { - String::new().into() - }, - if let Some(is_paid) = &self.is_paid { - format!("{:?}", is_paid).into() - } else { - String::new().into() - }, - if let Some(managed_by) = &self.managed_by { - format!("{:?}", managed_by).into() - } else { - String::new().into() - }, - if let Some(partial_days) = &self.partial_days { - format!("{:?}", partial_days).into() + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() } else { String::new().into() }, ] - } - - fn headers() -> Vec> { - vec![ - "id".into(), - "created_at".into(), - "updated_at".into(), - "role".into(), - "role_name".into(), - "requested_by".into(), - "requested_by_name".into(), - "status".into(), - "start_date".into(), - "end_date".into(), - "start_date_start_time".into(), - "end_date_end_time".into(), - "start_date_custom_hours".into(), - "end_date_custom_hours".into(), - "comments".into(), - "num_hours".into(), - "num_minutes".into(), - "leave_policy".into(), - "leave_type_unique_id".into(), - "policy_display_name".into(), - "reason_for_leave".into(), - "processed_at".into(), - "processed_by".into(), - "processed_by_name".into(), - "role_timezone".into(), - "dates".into(), - "is_paid".into(), - "managed_by".into(), - "partial_days".into(), + } + + fn headers() -> Vec> { + vec![ + "over_time_hours".into(), + "double_over_time_hours".into(), + "regular_hours".into(), + "duration".into(), ] } } -#[doc = "Leave balances object"] +#[doc = "\nDTO used to store the summary of a TimeEntry\n"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct LeaveBalances { - #[doc = "This is the unique role ID of the company leave types. Corresponds to the ids in \ - response of GET Company Leave Types"] - #[serde( - rename = "companyLeaveType", - default, - skip_serializing_if = "Option::is_none" - )] - pub company_leave_type: Option, - #[doc = "true if employee's balance corresponding to the company leave type is unlimited, \ - else false"] - #[serde( - rename = "isBalanceUnlimited", - default, - skip_serializing_if = "Option::is_none" - )] - pub is_balance_unlimited: Option, - #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \ - type with future leave requests considered."] - #[serde( - rename = "balanceWithFutureRequests", - default, - skip_serializing_if = "Option::is_none" - )] - pub balance_with_future_requests: Option, - #[doc = "The remaining balance in minutes for the employee corresponding to the company leave \ - type with future leave requests not considered."] - #[serde( - rename = "balanceWithoutFutureRequests", - default, - skip_serializing_if = "Option::is_none" - )] - pub balance_without_future_requests: Option, -} - -impl std::fmt::Display for LeaveBalances { +pub struct TimeEntrySummaryRequest { + #[doc = "The number of overtime hours worked during this time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub over_time_hours: Option, + #[doc = "The number of double overtime hours worked during this time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub double_over_time_hours: Option, + #[doc = "The number of regular hours worked during this time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub regular_hours: Option, + #[doc = "The duration of the time entry."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub duration: Option, +} + +impl std::fmt::Display for TimeEntrySummaryRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2156,27 +13736,27 @@ impl std::fmt::Display for LeaveBalances { } #[cfg(feature = "tabled")] -impl tabled::Tabled for LeaveBalances { +impl tabled::Tabled for TimeEntrySummaryRequest { const LENGTH: usize = 4; fn fields(&self) -> Vec> { vec![ - if let Some(company_leave_type) = &self.company_leave_type { - format!("{:?}", company_leave_type).into() + if let Some(over_time_hours) = &self.over_time_hours { + format!("{:?}", over_time_hours).into() } else { String::new().into() }, - if let Some(is_balance_unlimited) = &self.is_balance_unlimited { - format!("{:?}", is_balance_unlimited).into() + if let Some(double_over_time_hours) = &self.double_over_time_hours { + format!("{:?}", double_over_time_hours).into() } else { String::new().into() }, - if let Some(balance_with_future_requests) = &self.balance_with_future_requests { - format!("{:?}", balance_with_future_requests).into() + if let Some(regular_hours) = &self.regular_hours { + format!("{:?}", regular_hours).into() } else { String::new().into() }, - if let Some(balance_without_future_requests) = &self.balance_without_future_requests { - format!("{:?}", balance_without_future_requests).into() + if let Some(duration) = &self.duration { + format!("{:?}", duration).into() } else { String::new().into() }, @@ -2185,36 +13765,42 @@ impl tabled::Tabled for LeaveBalances { fn headers() -> Vec> { vec![ - "company_leave_type".into(), - "is_balance_unlimited".into(), - "balance_with_future_requests".into(), - "balance_without_future_requests".into(), + "over_time_hours".into(), + "double_over_time_hours".into(), + "regular_hours".into(), + "duration".into(), ] } } -#[doc = "Company leave request object"] +#[doc = "Break."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct CompanyLeaveType { - #[doc = "Unique identifier of the company leave request"] +pub struct Break { + #[doc = "The start time of the break."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Company leave type key"] - #[serde(rename = "leaveType", default, skip_serializing_if = "Option::is_none")] - pub leave_type: Option, - #[doc = "Company leave type name"] + pub start_time: Option, + #[doc = "The end time of the break."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, + pub end_time: Option, + #[doc = "The original start time of the break. If the startTime field has been rounded then \ + this contain the start time before the rounding occured."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub description: Option, - #[doc = "Is leave type unpaid"] - #[serde(rename = "isUnpaid", default, skip_serializing_if = "Option::is_none")] - pub is_unpaid: Option, + pub original_start_time: Option, + #[doc = "The original end time of the break. If the endTime field has been rounded then this \ + contain the end time before the rounding occured."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub original_end_time: Option, + #[doc = "The ID of the break type."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub break_type_id: Option, + #[doc = "The break type.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub break_type: Option, } -impl std::fmt::Display for CompanyLeaveType { +impl std::fmt::Display for Break { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2225,32 +13811,37 @@ impl std::fmt::Display for CompanyLeaveType { } #[cfg(feature = "tabled")] -impl tabled::Tabled for CompanyLeaveType { - const LENGTH: usize = 5; +impl tabled::Tabled for Break { + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() } else { String::new().into() }, - if let Some(leave_type) = &self.leave_type { - format!("{:?}", leave_type).into() + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() } else { String::new().into() }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(original_start_time) = &self.original_start_time { + format!("{:?}", original_start_time).into() } else { String::new().into() }, - if let Some(description) = &self.description { - format!("{:?}", description).into() + if let Some(original_end_time) = &self.original_end_time { + format!("{:?}", original_end_time).into() + } else { + String::new().into() + }, + if let Some(break_type_id) = &self.break_type_id { + format!("{:?}", break_type_id).into() } else { String::new().into() }, - if let Some(is_unpaid) = &self.is_unpaid { - format!("{:?}", is_unpaid).into() + if let Some(break_type) = &self.break_type { + format!("{:?}", break_type).into() } else { String::new().into() }, @@ -2259,32 +13850,33 @@ impl tabled::Tabled for CompanyLeaveType { fn headers() -> Vec> { vec![ - "id".into(), - "leave_type".into(), - "name".into(), - "description".into(), - "is_unpaid".into(), + "start_time".into(), + "end_time".into(), + "original_start_time".into(), + "original_end_time".into(), + "break_type_id".into(), + "break_type".into(), ] } } -#[doc = "A team is a self-defined group of employees within Rippling."] +#[doc = "BreakRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Team { - #[doc = "The identifier of the team."] +pub struct BreakRequest { + #[doc = "The start time of the break."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "The name of the team."] + pub start_time: Option, + #[doc = "The end time of the break."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The parent team (if this team is a subteam within a larger team)."] + pub end_time: Option, + #[doc = "The ID of the break type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, + pub break_type_id: Option, } -impl std::fmt::Display for Team { +impl std::fmt::Display for BreakRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2295,22 +13887,22 @@ impl std::fmt::Display for Team { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Team { +impl tabled::Tabled for BreakRequest { const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() } else { String::new().into() }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() } else { String::new().into() }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() + if let Some(break_type_id) = &self.break_type_id { + format!("{:?}", break_type_id).into() } else { String::new().into() }, @@ -2318,28 +13910,37 @@ impl tabled::Tabled for Team { } fn headers() -> Vec> { - vec!["id".into(), "name".into(), "parent".into()] + vec![ + "start_time".into(), + "end_time".into(), + "break_type_id".into(), + ] } } -#[doc = "Levels enable for self-defined,company-wide position levels, such as Manager, Engineering \ - Manager, Executive, etc."] +#[doc = "BreakType."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Level { - #[doc = "Unique identifier of the level."] +pub struct BreakType { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Description of the break type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Name of the level."] + pub description: Option, + #[doc = "Whether the break is paid."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The unique identifier of the parent level."] + pub is_paid: Option, + #[doc = "Whether the break counts towards hours worked"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent: Option, + pub is_over_time_eligible: Option, } -impl std::fmt::Display for Level { +impl std::fmt::Display for BreakType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2350,22 +13951,25 @@ impl std::fmt::Display for Level { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Level { - const LENGTH: usize = 3; +impl tabled::Tabled for BreakType { + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(description) = &self.description { + format!("{:?}", description).into() } else { String::new().into() }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(is_paid) = &self.is_paid { + format!("{:?}", is_paid).into() } else { String::new().into() }, - if let Some(parent) = &self.parent { - format!("{:?}", parent).into() + if let Some(is_over_time_eligible) = &self.is_over_time_eligible { + format!("{:?}", is_over_time_eligible).into() } else { String::new().into() }, @@ -2373,27 +13977,34 @@ impl tabled::Tabled for Level { } fn headers() -> Vec> { - vec!["id".into(), "name".into(), "parent".into()] + vec![ + "id".into(), + "created_at".into(), + "updated_at".into(), + "description".into(), + "is_paid".into(), + "is_over_time_eligible".into(), + ] } } -#[doc = "Information about the Rippling user whose token is being used to access Rippling's API."] +#[doc = "BreakTypeRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct AuthenticatedUserMe { - #[doc = "Unied identifier of the user (likely an admin)."] +pub struct BreakTypeRequest { + #[doc = "Description of the break type."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Work email of the user."] - #[serde(rename = "workEmail", default, skip_serializing_if = "Option::is_none")] - pub work_email: Option, - #[doc = "Unique identifier of the company."] + pub description: Option, + #[doc = "Whether the break is paid."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_paid: Option, + #[doc = "Whether the break counts towards hours worked"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub company: Option, + pub is_over_time_eligible: Option, } -impl std::fmt::Display for AuthenticatedUserMe { +impl std::fmt::Display for BreakTypeRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2404,22 +14015,22 @@ impl std::fmt::Display for AuthenticatedUserMe { } #[cfg(feature = "tabled")] -impl tabled::Tabled for AuthenticatedUserMe { +impl tabled::Tabled for BreakTypeRequest { const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + if let Some(description) = &self.description { + format!("{:?}", description).into() } else { String::new().into() }, - if let Some(work_email) = &self.work_email { - format!("{:?}", work_email).into() + if let Some(is_paid) = &self.is_paid { + format!("{:?}", is_paid).into() } else { String::new().into() }, - if let Some(company) = &self.company { - format!("{:?}", company).into() + if let Some(is_over_time_eligible) = &self.is_over_time_eligible { + format!("{:?}", is_over_time_eligible).into() } else { String::new().into() }, @@ -2427,30 +14038,45 @@ impl tabled::Tabled for AuthenticatedUserMe { } fn headers() -> Vec> { - vec!["id".into(), "work_email".into(), "company".into()] + vec![ + "description".into(), + "is_paid".into(), + "is_over_time_eligible".into(), + ] } } -#[doc = "This payload should be used when updating existing groups."] +#[doc = "JobShift."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct GroupUpdatePayload { - #[doc = "The name of the Group."] +pub struct JobShift { + #[doc = "The start time of the job shift."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The external identifier of the Group."] - #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] - pub spoke_id: Option, - #[doc = "The array of users within the Group."] + pub start_time: Option, + #[doc = "The end time of the job shift."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The original start time of the job shift. If the startTime field has been rounded \ + then this contain the start time before the rounding occured."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub original_start_time: Option, + #[doc = "The original end time of the job shift. If the endTime field has been rounded then \ + this contain the end time before the rounding occured."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub users: Option>, - #[doc = "The version identifier of the Group."] + pub original_end_time: Option, + #[doc = "The IDs of the job codes associated with the job shift."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub version: Option, + pub job_code_ids: Option, + #[doc = "The job codes associated with the job shift.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub job_codes: Option, + #[doc = "Whether the job shift was entered as a duration in hours table"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_hours_only_input: Option, } -impl std::fmt::Display for GroupUpdatePayload { +impl std::fmt::Display for JobShift { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2461,27 +14087,42 @@ impl std::fmt::Display for GroupUpdatePayload { } #[cfg(feature = "tabled")] -impl tabled::Tabled for GroupUpdatePayload { - const LENGTH: usize = 4; +impl tabled::Tabled for JobShift { + const LENGTH: usize = 7; fn fields(&self) -> Vec> { vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(original_start_time) = &self.original_start_time { + format!("{:?}", original_start_time).into() } else { String::new().into() }, - if let Some(spoke_id) = &self.spoke_id { - format!("{:?}", spoke_id).into() + if let Some(original_end_time) = &self.original_end_time { + format!("{:?}", original_end_time).into() } else { String::new().into() }, - if let Some(users) = &self.users { - format!("{:?}", users).into() + if let Some(job_code_ids) = &self.job_code_ids { + format!("{:?}", job_code_ids).into() } else { String::new().into() }, - if let Some(version) = &self.version { - format!("{:?}", version).into() + if let Some(job_codes) = &self.job_codes { + format!("{:?}", job_codes).into() + } else { + String::new().into() + }, + if let Some(is_hours_only_input) = &self.is_hours_only_input { + format!("{:?}", is_hours_only_input).into() } else { String::new().into() }, @@ -2490,99 +14131,45 @@ impl tabled::Tabled for GroupUpdatePayload { fn headers() -> Vec> { vec![ - "name".into(), - "spoke_id".into(), - "users".into(), - "version".into(), + "start_time".into(), + "end_time".into(), + "original_start_time".into(), + "original_end_time".into(), + "job_code_ids".into(), + "job_codes".into(), + "is_hours_only_input".into(), ] } } -#[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid once \ - the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per a custom \ - pay period."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum SalaryUnit { - #[serde(rename = "HOUR")] - #[display("HOUR")] - Hour, - #[serde(rename = "DAY")] - #[display("DAY")] - Day, - #[serde(rename = "WEEK")] - #[display("WEEK")] - Week, - #[serde(rename = "MONTH")] - #[display("MONTH")] - Month, - #[serde(rename = "PAY_PERIOD")] - #[display("PAY_PERIOD")] - PayPeriod, -} - -#[doc = "The ENUM type of employment the user will have within Rippling."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum CandidateEmploymentType { - #[serde(rename = "CONTRACTOR")] - #[display("CONTRACTOR")] - Contractor, - #[serde(rename = "SALARIED_PT")] - #[display("SALARIED_PT")] - SalariedPt, - #[serde(rename = "SALARIED_FT")] - #[display("SALARIED_FT")] - SalariedFt, - #[serde(rename = "HOURLY_FT")] - #[display("HOURLY_FT")] - HourlyFt, - #[serde(rename = "HOURLY_PT")] - #[display("HOURLY_PT")] - HourlyPt, - #[serde(rename = "TEMP")] - #[display("TEMP")] - Temp, -} - -#[doc = "An array of json objects containing file names and public file URLs containing documents \ - pertaining to the candidate."] +#[doc = "JobShiftRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Attachments { - #[doc = "The file name."] +pub struct JobShiftRequest { + #[doc = "The start time of the job shift."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub start_time: Option, + #[doc = "The end time of the job shift."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub end_time: Option, + #[doc = "The original start time of the job shift. If the startTime field has been rounded \ + then this contain the start time before the rounding occured."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub original_start_time: Option, + #[doc = "The original end time of the job shift. If the endTime field has been rounded then \ + this contain the end time before the rounding occured."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub file_name: Option, - #[doc = "The public URL and name of a pdf/docx/doc/odt file containing documents pertaining \ - to the candidate."] + pub original_end_time: Option, + #[doc = "The IDs of the job codes associated with the job shift."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub file_url: Option, + pub job_code_ids: Option, + #[doc = "Whether the job shift was entered as a duration in hours table"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub is_hours_only_input: Option, } -impl std::fmt::Display for Attachments { +impl std::fmt::Display for JobShiftRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2593,17 +14180,37 @@ impl std::fmt::Display for Attachments { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Attachments { - const LENGTH: usize = 2; +impl tabled::Tabled for JobShiftRequest { + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ - if let Some(file_name) = &self.file_name { - format!("{:?}", file_name).into() + if let Some(start_time) = &self.start_time { + format!("{:?}", start_time).into() + } else { + String::new().into() + }, + if let Some(end_time) = &self.end_time { + format!("{:?}", end_time).into() + } else { + String::new().into() + }, + if let Some(original_start_time) = &self.original_start_time { + format!("{:?}", original_start_time).into() + } else { + String::new().into() + }, + if let Some(original_end_time) = &self.original_end_time { + format!("{:?}", original_end_time).into() + } else { + String::new().into() + }, + if let Some(job_code_ids) = &self.job_code_ids { + format!("{:?}", job_code_ids).into() } else { String::new().into() }, - if let Some(file_url) = &self.file_url { - format!("{:?}", file_url).into() + if let Some(is_hours_only_input) = &self.is_hours_only_input { + format!("{:?}", is_hours_only_input).into() } else { String::new().into() }, @@ -2611,97 +14218,37 @@ impl tabled::Tabled for Attachments { } fn headers() -> Vec> { - vec!["file_name".into(), "file_url".into()] + vec![ + "start_time".into(), + "end_time".into(), + "original_start_time".into(), + "original_end_time".into(), + "job_code_ids".into(), + "is_hours_only_input".into(), + ] } } -#[doc = "The Rippling candidate model."] +#[doc = "TimeEntryComment."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Candidate { - #[doc = "The candidate's name."] +pub struct TimeEntryComment { + #[doc = "The time the comment was created."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The candidate's email."] + pub created_at: Option, + #[doc = "The ID of the worker who made of the comment."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub email: Option, - #[doc = "The candidate's job title."] - #[serde(rename = "jobTitle", default, skip_serializing_if = "Option::is_none")] - pub job_title: Option, - #[doc = "The candidate's phone number."] - #[serde( - rename = "phoneNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub phone_number: Option, - #[doc = "The unique identifier of the candidate from the ATS."] - #[serde( - rename = "candidateId", - default, - skip_serializing_if = "Option::is_none" - )] - pub candidate_id: Option, - #[doc = "The would-be start date of the candidate."] - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[doc = "An ENUM string value, denoting the frequency at which the candidate should be paid \ - once the role begins. Note, the PAY_PERIOD ENUM implies the candidate is paid as per \ - a custom pay period."] - #[serde( - rename = "salaryUnit", - default, - skip_serializing_if = "Option::is_none" - )] - pub salary_unit: Option, - #[doc = "The decimal value that the candidate gets paid every salaryUnit time period."] - #[serde( - rename = "salaryPerUnit", - default, - skip_serializing_if = "Option::is_none" - )] - pub salary_per_unit: Option, - #[doc = "The bonus cash given to the candidate as a part of a one time payment, with two \ - decimal digit precision."] - #[serde( - rename = "signingBonus", - default, - skip_serializing_if = "Option::is_none" - )] - pub signing_bonus: Option, - #[doc = "A string field of the official currency as listed in ISO 4217."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub currency: Option, - #[doc = "The number of shares that will be given to the candidate."] - #[serde( - rename = "equityShares", - default, - skip_serializing_if = "Option::is_none" - )] - pub equity_shares: Option, - #[doc = "This is the id of the department from GET/departments."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub department: Option, - #[doc = "The ENUM type of employment the user will have within Rippling."] - #[serde( - rename = "employmentType", - default, - skip_serializing_if = "Option::is_none" - )] - pub employment_type: Option, - #[doc = "This is the id of the worklocation from GET/work_locations."] - #[serde( - rename = "workLocation", - default, - skip_serializing_if = "Option::is_none" - )] - pub work_location: Option, - #[serde(default, skip_serializing_if = "Option::is_none")] - pub attachments: Option>, + pub author_id: Option, + #[doc = "The worker who made the comment.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub author: Option, + #[doc = "The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option, } -impl std::fmt::Display for Candidate { +impl std::fmt::Display for TimeEntryComment { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2712,82 +14259,27 @@ impl std::fmt::Display for Candidate { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Candidate { - const LENGTH: usize = 15; +impl tabled::Tabled for TimeEntryComment { + const LENGTH: usize = 4; fn fields(&self) -> Vec> { vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() - } else { - String::new().into() - }, - if let Some(email) = &self.email { - format!("{:?}", email).into() - } else { - String::new().into() - }, - if let Some(job_title) = &self.job_title { - format!("{:?}", job_title).into() - } else { - String::new().into() - }, - if let Some(phone_number) = &self.phone_number { - format!("{:?}", phone_number).into() - } else { - String::new().into() - }, - if let Some(candidate_id) = &self.candidate_id { - format!("{:?}", candidate_id).into() - } else { - String::new().into() - }, - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() - } else { - String::new().into() - }, - if let Some(salary_unit) = &self.salary_unit { - format!("{:?}", salary_unit).into() - } else { - String::new().into() - }, - if let Some(salary_per_unit) = &self.salary_per_unit { - format!("{:?}", salary_per_unit).into() - } else { - String::new().into() - }, - if let Some(signing_bonus) = &self.signing_bonus { - format!("{:?}", signing_bonus).into() - } else { - String::new().into() - }, - if let Some(currency) = &self.currency { - format!("{:?}", currency).into() - } else { - String::new().into() - }, - if let Some(equity_shares) = &self.equity_shares { - format!("{:?}", equity_shares).into() - } else { - String::new().into() - }, - if let Some(department) = &self.department { - format!("{:?}", department).into() + if let Some(created_at) = &self.created_at { + format!("{:?}", created_at).into() } else { String::new().into() }, - if let Some(employment_type) = &self.employment_type { - format!("{:?}", employment_type).into() + if let Some(author_id) = &self.author_id { + format!("{:?}", author_id).into() } else { String::new().into() }, - if let Some(work_location) = &self.work_location { - format!("{:?}", work_location).into() + if let Some(author) = &self.author { + format!("{:?}", author).into() } else { String::new().into() }, - if let Some(attachments) = &self.attachments { - format!("{:?}", attachments).into() + if let Some(text) = &self.text { + format!("{:?}", text).into() } else { String::new().into() }, @@ -2796,48 +14288,148 @@ impl tabled::Tabled for Candidate { fn headers() -> Vec> { vec![ - "name".into(), - "email".into(), - "job_title".into(), - "phone_number".into(), - "candidate_id".into(), - "start_date".into(), - "salary_unit".into(), - "salary_per_unit".into(), - "signing_bonus".into(), - "currency".into(), - "equity_shares".into(), - "department".into(), - "employment_type".into(), - "work_location".into(), - "attachments".into(), + "created_at".into(), + "author_id".into(), + "author".into(), + "text".into(), + ] + } +} + +#[doc = "TimeEntryCommentRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct TimeEntryCommentRequest { + #[doc = "The text of the comment."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub text: Option, +} + +impl std::fmt::Display for TimeEntryCommentRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for TimeEntryCommentRequest { + const LENGTH: usize = 1; + fn fields(&self) -> Vec> { + vec![if let Some(text) = &self.text { + format!("{:?}", text).into() + } else { + String::new().into() + }] + } + + fn headers() -> Vec> { + vec!["text".into()] + } +} + +#[doc = "EntitlementModel."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct EntitlementModel { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Description of the entitlement"] + pub description: String, + #[doc = "Display name of the entitlement"] + pub display_name: String, +} + +impl std::fmt::Display for EntitlementModel { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for EntitlementModel { + const LENGTH: usize = 3; + fn fields(&self) -> Vec> { + vec![ + self.id.clone().into(), + self.description.clone().into(), + self.display_name.clone().into(), + ] + } + + fn headers() -> Vec> { + vec!["id".into(), "description".into(), "display_name".into()] + } +} + +#[doc = "EntitlementModelRequest."] +#[derive( + serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, +)] +pub struct EntitlementModelRequest { + #[doc = "Description of the entitlement"] + pub description: String, + #[doc = "Display name of the entitlement"] + pub display_name: String, +} + +impl std::fmt::Display for EntitlementModelRequest { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { + write!( + f, + "{}", + serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? + ) + } +} + +#[cfg(feature = "tabled")] +impl tabled::Tabled for EntitlementModelRequest { + const LENGTH: usize = 2; + fn fields(&self) -> Vec> { + vec![ + self.description.clone().into(), + self.display_name.clone().into(), ] } + + fn headers() -> Vec> { + vec!["description".into(), "display_name".into()] + } } -#[doc = "Geographic details from where the event was recorded."] +#[doc = "Ssome."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct RequestData { - #[doc = "Event IP addresss."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ip: Option, - #[doc = "City the event was triggered from."] +pub struct Ssome { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The user's work email address."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub city: Option, - #[doc = "Country the event was triggered from."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub country: Option, - #[doc = "Latitude the event was triggered from."] + pub work_email: Option, + #[doc = "The company ID of the user."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub latitude: Option, - #[doc = "Longitude the event was triggered from."] + pub company_id: Option, + #[doc = "The company of the user.\n\nExpandable field"] #[serde(default, skip_serializing_if = "Option::is_none")] - pub longitude: Option, + pub company: Option, } -impl std::fmt::Display for RequestData { +impl std::fmt::Display for Ssome { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2848,32 +14440,25 @@ impl std::fmt::Display for RequestData { } #[cfg(feature = "tabled")] -impl tabled::Tabled for RequestData { - const LENGTH: usize = 5; +impl tabled::Tabled for Ssome { + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ - if let Some(ip) = &self.ip { - format!("{:?}", ip).into() - } else { - String::new().into() - }, - if let Some(city) = &self.city { - format!("{:?}", city).into() - } else { - String::new().into() - }, - if let Some(country) = &self.country { - format!("{:?}", country).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() } else { String::new().into() }, - if let Some(latitude) = &self.latitude { - format!("{:?}", latitude).into() + if let Some(company_id) = &self.company_id { + format!("{:?}", company_id).into() } else { String::new().into() }, - if let Some(longitude) = &self.longitude { - format!("{:?}", longitude).into() + if let Some(company) = &self.company { + format!("{:?}", company).into() } else { String::new().into() }, @@ -2882,66 +14467,30 @@ impl tabled::Tabled for RequestData { fn headers() -> Vec> { vec![ - "ip".into(), - "city".into(), - "country".into(), - "latitude".into(), - "longitude".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "work_email".into(), + "company_id".into(), + "company".into(), ] } } -#[doc = "An ENUM value for the type of object."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum SubjectsType { - #[serde(rename = "ROLE")] - #[display("ROLE")] - Role, - #[serde(rename = "SPOKE")] - #[display("SPOKE")] - Spoke, - #[serde(rename = "RPASS_ITEM")] - #[display("RPASS_ITEM")] - RpassItem, - #[serde(rename = "SPOKE_USER")] - #[display("SPOKE_USER")] - SpokeUser, - #[serde(rename = "GROUP")] - #[display("GROUP")] - Group, -} - +#[doc = "SsomeRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Subjects { - #[doc = "Unique key for the event object."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub instance: Option, - #[doc = "An ENUM value for the type of object."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "Name used within Rippling."] +pub struct SsomeRequest { + #[doc = "The user's work email address."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "Icon used within Rippling."] + pub work_email: Option, + #[doc = "The company ID of the user."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option, + pub company_id: Option, } -impl std::fmt::Display for Subjects { +impl std::fmt::Display for SsomeRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -2952,27 +14501,17 @@ impl std::fmt::Display for Subjects { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Subjects { - const LENGTH: usize = 4; +impl tabled::Tabled for SsomeRequest { + const LENGTH: usize = 2; fn fields(&self) -> Vec> { vec![ - if let Some(instance) = &self.instance { - format!("{:?}", instance).into() - } else { - String::new().into() - }, - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(display_name) = &self.display_name { - format!("{:?}", display_name).into() + if let Some(work_email) = &self.work_email { + format!("{:?}", work_email).into() } else { String::new().into() }, - if let Some(icon) = &self.icon { - format!("{:?}", icon).into() + if let Some(company_id) = &self.company_id { + format!("{:?}", company_id).into() } else { String::new().into() }, @@ -2980,135 +14519,28 @@ impl tabled::Tabled for Subjects { } fn headers() -> Vec> { - vec![ - "instance".into(), - "type_".into(), - "display_name".into(), - "icon".into(), - ] + vec!["work_email".into(), "company_id".into()] } } -#[doc = "An ENUM value for the type of the event."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum EventType { - #[serde(rename = "EXTERNAL_ACCOUNT_CREATE")] - #[display("EXTERNAL_ACCOUNT_CREATE")] - ExternalAccountCreate, - #[serde(rename = "EXTERNAL_ACCOUNT_INVITE")] - #[display("EXTERNAL_ACCOUNT_INVITE")] - ExternalAccountInvite, - #[serde(rename = "EXTERNAL_ACCOUNT_DELETE")] - #[display("EXTERNAL_ACCOUNT_DELETE")] - ExternalAccountDelete, - #[serde(rename = "EXTERNAL_ACCOUNT_SUSPEND")] - #[display("EXTERNAL_ACCOUNT_SUSPEND")] - ExternalAccountSuspend, - #[serde(rename = "EXTERNAL_ACCOUNT_PASSWORD_RESET")] - #[display("EXTERNAL_ACCOUNT_PASSWORD_RESET")] - ExternalAccountPasswordReset, - #[serde(rename = "EXTERNAL_GROUP_ADD")] - #[display("EXTERNAL_GROUP_ADD")] - ExternalGroupAdd, - #[serde(rename = "EXTERNAL_GROUP_REMOVE")] - #[display("EXTERNAL_GROUP_REMOVE")] - ExternalGroupRemove, - #[serde(rename = "EXTERNAL_SSO_GRANT")] - #[display("EXTERNAL_SSO_GRANT")] - ExternalSsoGrant, - #[serde(rename = "EXTERNAL_SSO_REVOKE")] - #[display("EXTERNAL_SSO_REVOKE")] - ExternalSsoRevoke, - #[serde(rename = "EXTERNAL_SSO_SIGNIN")] - #[display("EXTERNAL_SSO_SIGNIN")] - ExternalSsoSignin, - #[serde(rename = "RPASS_ITEM_SHARED")] - #[display("RPASS_ITEM_SHARED")] - RpassItemShared, - #[serde(rename = "RPASS_ITEM_UNSHARED")] - #[display("RPASS_ITEM_UNSHARED")] - RpassItemUnshared, - #[serde(rename = "RPASS_ITEM_USED")] - #[display("RPASS_ITEM_USED")] - RpassItemUsed, - #[serde(rename = "USER_LOGIN_SUCCESS")] - #[display("USER_LOGIN_SUCCESS")] - UserLoginSuccess, - #[serde(rename = "USER_LOGIN_FAILED")] - #[display("USER_LOGIN_FAILED")] - UserLoginFailed, - #[serde(rename = "ACCOUNT_PASSWORD_RESET")] - #[display("ACCOUNT_PASSWORD_RESET")] - AccountPasswordReset, - #[serde(rename = "ACCOUNT_PASSWORD_CHANGED")] - #[display("ACCOUNT_PASSWORD_CHANGED")] - AccountPasswordChanged, - #[serde(rename = "TWO_FACTOR_DEVICE_RESET")] - #[display("TWO_FACTOR_DEVICE_RESET")] - TwoFactorDeviceReset, - #[serde(rename = "EXTERNAL_GROUP_MEMBER_REMOVE")] - #[display("EXTERNAL_GROUP_MEMBER_REMOVE")] - ExternalGroupMemberRemove, -} - -#[doc = "ENUM value for the type of actor."] -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum InitiatorType { - #[serde(rename = "ROLE")] - #[display("ROLE")] - Role, - #[serde(rename = "SYSTEM")] - #[display("SYSTEM")] - System, - #[serde(rename = "EXTERNAL")] - #[display("EXTERNAL")] - External, -} - -#[doc = "The actor of the event."] +#[doc = "WorkLocation."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Initiator { - #[doc = "ENUM value for the type of actor."] - #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] - pub type_: Option, - #[doc = "A unique identifier for the employee that initiated the action, if the type is ROLE."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option, - #[doc = "The name used within Rippling."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub display_name: Option, - #[doc = "The icon used within Rippling."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub icon: Option, +pub struct WorkLocation { + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the work location."] + pub name: String, + #[doc = "The address for the work location."] + pub address: Address, } -impl std::fmt::Display for Initiator { +impl std::fmt::Display for WorkLocation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3119,57 +14551,41 @@ impl std::fmt::Display for Initiator { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Initiator { - const LENGTH: usize = 4; +impl tabled::Tabled for WorkLocation { + const LENGTH: usize = 5; fn fields(&self) -> Vec> { vec![ - if let Some(type_) = &self.type_ { - format!("{:?}", type_).into() - } else { - String::new().into() - }, - if let Some(role) = &self.role { - format!("{:?}", role).into() - } else { - String::new().into() - }, - if let Some(display_name) = &self.display_name { - format!("{:?}", display_name).into() - } else { - String::new().into() - }, - if let Some(icon) = &self.icon { - format!("{:?}", icon).into() - } else { - String::new().into() - }, + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + format!("{:?}", self.address).into(), ] } fn headers() -> Vec> { vec![ - "type_".into(), - "role".into(), - "display_name".into(), - "icon".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "address".into(), ] } } -#[doc = "Reason for the event, tied to the type of eveent."] +#[doc = "WorkLocationRequest."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct EventReason { - #[doc = "Reason for the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reason: Option, - #[doc = "Message of the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub message: Option, +pub struct WorkLocationRequest { + #[doc = "The name of the work location."] + pub name: String, + #[doc = "The address for the work location."] + pub address: Address, } -impl std::fmt::Display for EventReason { +impl std::fmt::Display for WorkLocationRequest { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3180,78 +14596,35 @@ impl std::fmt::Display for EventReason { } #[cfg(feature = "tabled")] -impl tabled::Tabled for EventReason { +impl tabled::Tabled for WorkLocationRequest { const LENGTH: usize = 2; fn fields(&self) -> Vec> { vec![ - if let Some(reason) = &self.reason { - format!("{:?}", reason).into() - } else { - String::new().into() - }, - if let Some(message) = &self.message { - format!("{:?}", message).into() - } else { - String::new().into() - }, + self.name.clone().into(), + format!("{:?}", self.address).into(), ] } fn headers() -> Vec> { - vec!["reason".into(), "message".into()] + vec!["name".into(), "address".into()] } } -#[doc = "The event model for company activity.\n\nPlease note, the event type can be one of the \ - following:\n\n- EXTERNAL_ACCONT_CREATE\n- EXTERNAL_ACCOUNT_INVITE\n- \ - EXTERNAL_ACCOUNT_DELETE\n- EXTERNAL_ACCOUNT_SUSPEND\n- EXTERNAL_ACCOUNT_PASSWORD_RESET\n- \ - EXTERNAL_GROUP_ADD\n- EXTERNAL_GROUP_REMOVE\n- EXTERNAL_GROUP_MEMBER_REMOVE\n- \ - EXTERNAL_GROUP_MEMBER_ADD\n- EXTERNAL_SSO_GRANT\n- EXTERNAL_SSO_REVOKE\n- \ - EXTERNAL_SSO_SIGNIN\n- RPASS_ITEM_SHARED\n- RPASS_ITEM_UNSHARED\n- RPASS_ITEM_USED\n- \ - USER_LOGIN_SUCCESS\n- USER_LOGIN_FAILED\n- ACCOUNT_PASSWORD_RESET\n- \ - ACCOUNT_PASSWORD_CHANGED\n- TWO_FACTOR_DEVICE_RESET\n"] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Event { - #[doc = "Unique identifier of the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[doc = "Geographic details from where the event was recorded."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub request_data: Option, - #[doc = "An array of event identifiers that are linked to the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub linked_events: Option>, - #[doc = "The list of objects of the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subjects: Option>>, - #[doc = "An ENUM value for the type of the event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub event_type: Option, - #[doc = "Timestamp at which the event was recorded."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub timestamp: Option, - #[doc = "Unique identifier for the company."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub company: Option, - #[doc = "Unique identifier for the external application for which the event was recorded. \ - This will be Null for events that don't correspond to an external appliction (e.g. \ - Rippling system and RPass events)."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spoke: Option, - #[doc = "The actor of the event."] +pub struct ListDepartmentsResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub initiator: Option, - #[doc = "Reason for the event, tied to the type of eveent."] + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub event_reason: Option, - #[doc = "Display name for the event, tied to the type of event."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, + pub next_link: Option, } -impl std::fmt::Display for Event { +impl std::fmt::Display for ListDepartmentsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3262,62 +14635,22 @@ impl std::fmt::Display for Event { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Event { - const LENGTH: usize = 11; +impl tabled::Tabled for ListDepartmentsResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() - } else { - String::new().into() - }, - if let Some(request_data) = &self.request_data { - format!("{:?}", request_data).into() - } else { - String::new().into() - }, - if let Some(linked_events) = &self.linked_events { - format!("{:?}", linked_events).into() - } else { - String::new().into() - }, - if let Some(subjects) = &self.subjects { - format!("{:?}", subjects).into() - } else { - String::new().into() - }, - if let Some(event_type) = &self.event_type { - format!("{:?}", event_type).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(timestamp) = &self.timestamp { - format!("{:?}", timestamp).into() + if let Some(results) = &self.results { + format!("{:?}", results).into() } else { String::new().into() }, - if let Some(company) = &self.company { - format!("{:?}", company).into() - } else { - String::new().into() - }, - if let Some(spoke) = &self.spoke { - format!("{:?}", spoke).into() - } else { - String::new().into() - }, - if let Some(initiator) = &self.initiator { - format!("{:?}", initiator).into() - } else { - String::new().into() - }, - if let Some(event_reason) = &self.event_reason { - format!("{:?}", event_reason).into() - } else { - String::new().into() - }, - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3325,42 +14658,33 @@ impl tabled::Tabled for Event { } fn headers() -> Vec> { - vec![ - "id".into(), - "request_data".into(), - "linked_events".into(), - "subjects".into(), - "event_type".into(), - "timestamp".into(), - "company".into(), - "spoke".into(), - "initiator".into(), - "event_reason".into(), - "name".into(), - ] + vec!["meta".into(), "results".into(), "next_link".into()] } } -#[doc = "CustomField."] #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct CustomField { - #[serde( - rename = "customFieldTitle1", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_field_title_1: Option, - #[serde( - rename = "customFieldTitleN", - default, - skip_serializing_if = "Option::is_none" - )] - pub custom_field_title_n: Option, +pub struct GetDepartmentsResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the department."] + pub name: String, + #[doc = "The parent department."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent department.\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, } -impl std::fmt::Display for CustomField { +impl std::fmt::Display for GetDepartmentsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3371,17 +14695,26 @@ impl std::fmt::Display for CustomField { } #[cfg(feature = "tabled")] -impl tabled::Tabled for CustomField { - const LENGTH: usize = 2; +impl tabled::Tabled for GetDepartmentsResponse { + const LENGTH: usize = 7; fn fields(&self) -> Vec> { vec![ - if let Some(custom_field_title_1) = &self.custom_field_title_1 { - format!("{:?}", custom_field_title_1).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() } else { String::new().into() }, - if let Some(custom_field_title_n) = &self.custom_field_title_n { - format!("{:?}", custom_field_title_n).into() + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() } else { String::new().into() }, @@ -3389,27 +14722,33 @@ impl tabled::Tabled for CustomField { } fn headers() -> Vec> { - vec!["custom_field_title_1".into(), "custom_field_title_n".into()] + vec![ + "meta".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "parent_id".into(), + "parent".into(), + ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct EntityInfo { - #[doc = "The legal name of the entity"] - #[serde(rename = "legalName", default, skip_serializing_if = "Option::is_none")] - pub legal_name: Option, - #[doc = "The Canada Business Number"] - #[serde( - rename = "businessNumber", - default, - skip_serializing_if = "Option::is_none" - )] - pub business_number: Option, +pub struct ListEmploymentTypesResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub results: Option>, + #[doc = "A link to the next page of responses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl std::fmt::Display for EntityInfo { +impl std::fmt::Display for ListEmploymentTypesResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3420,17 +14759,22 @@ impl std::fmt::Display for EntityInfo { } #[cfg(feature = "tabled")] -impl tabled::Tabled for EntityInfo { - const LENGTH: usize = 2; +impl tabled::Tabled for ListEmploymentTypesResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(legal_name) = &self.legal_name { - format!("{:?}", legal_name).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + if let Some(results) = &self.results { + format!("{:?}", results).into() } else { String::new().into() }, - if let Some(business_number) = &self.business_number { - format!("{:?}", business_number).into() + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3438,30 +14782,77 @@ impl tabled::Tabled for EntityInfo { } fn headers() -> Vec> { - vec!["legal_name".into(), "business_number".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } +#[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and are \ + not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired and \ + managed by an employer, work under the employer's direct supervision and control, and are \ + protected by law for wages and employment rights."] +#[derive( + serde :: Serialize, + serde :: Deserialize, + PartialEq, + Hash, + Debug, + Clone, + schemars :: JsonSchema, + parse_display :: FromStr, + parse_display :: Display, +)] +#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] +#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] +pub enum GetEmploymentTypesResponseType { + #[serde(rename = "CONTRACTOR")] + #[display("CONTRACTOR")] + Contractor, + #[serde(rename = "EMPLOYEE")] + #[display("EMPLOYEE")] + Employee, +} + #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Ca { - #[doc = "The unique Rippling ID of the legal entity"] +pub struct GetEmploymentTypesResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The display label of the employment type."] + pub label: String, + #[doc = "The name of the employment type for non-custom employment types."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The classification of the worker by the company. * `CONTRACTOR`: Contractors are \ + self-employed workers who provide services on a short-term or per-project basis and \ + are not eligible for tax-withholding or benefits. * `EMPLOYEE`: Employees are hired \ + and managed by an employer, work under the employer's direct supervision and \ + control, and are protected by law for wages and employment rights."] + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[doc = "The compensation period for the employment type. * `SALARIED`: Employees that are \ + paid a fixed amount per year. * `HOURLY`: Employees that are paid a wage per hour \ + worked."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub compensation_time_period: Option, + #[doc = "The amount worked for the employment type. * `FULL-TIME`: Full-time is at least 30 \ + hours per week. Full-time workers will typically be eligible for benefits. * \ + `PART-TIME`: Part-time is less than 30 hours per week. These workers may be eligible \ + for benefits, depending on company settings and hours worked. * `TEMPORARY`: These \ + workers are hired on a temporary basis. You can specify how each worker with this \ + employment type will be paid individually."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde( - rename = "entityInfo", - default, - skip_serializing_if = "Option::is_none" - )] - pub entity_info: Option, - #[doc = "If set to true, the legal entity is Rippling's EOR. If set to false, the legal \ - entity is not on Rippling's EOR."] - #[serde(rename = "isEor", default, skip_serializing_if = "Option::is_none")] - pub is_eor: Option, + pub amount_worked: Option, } -impl std::fmt::Display for Ca { +impl std::fmt::Display for GetEmploymentTypesResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3472,22 +14863,36 @@ impl std::fmt::Display for Ca { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Ca { - const LENGTH: usize = 3; +impl tabled::Tabled for GetEmploymentTypesResponse { + const LENGTH: usize = 9; fn fields(&self) -> Vec> { vec![ - if let Some(id) = &self.id { - format!("{:?}", id).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.label.clone().into(), + if let Some(name) = &self.name { + format!("{:?}", name).into() + } else { + String::new().into() + }, + if let Some(type_) = &self.type_ { + format!("{:?}", type_).into() } else { String::new().into() }, - if let Some(entity_info) = &self.entity_info { - format!("{:?}", entity_info).into() + if let Some(compensation_time_period) = &self.compensation_time_period { + format!("{:?}", compensation_time_period).into() } else { String::new().into() }, - if let Some(is_eor) = &self.is_eor { - format!("{:?}", is_eor).into() + if let Some(amount_worked) = &self.amount_worked { + format!("{:?}", amount_worked).into() } else { String::new().into() }, @@ -3495,64 +14900,35 @@ impl tabled::Tabled for Ca { } fn headers() -> Vec> { - vec!["id".into(), "entity_info".into(), "is_eor".into()] - } -} - -#[doc = "This model represents the legal entities inside of a given company. Legal entities based \ - in Canada (CA) are currently supported at this time."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct Entities { - #[doc = "CA represents Canada."] - #[serde(rename = "CA", default, skip_serializing_if = "Option::is_none")] - pub ca: Option>, -} - -impl std::fmt::Display for Entities { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for Entities { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(ca) = &self.ca { - format!("{:?}", ca).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["ca".into()] + vec![ + "meta".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "label".into(), + "name".into(), + "type_".into(), + "compensation_time_period".into(), + "amount_worked".into(), + ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct PostGroupsRequestBody { - #[doc = "User-readable name of the group."] +pub struct ListTeamsResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[doc = "The unique ID for the group, this can be the unique identifier for the group entity \ - object within your application."] - #[serde(rename = "spokeId", default, skip_serializing_if = "Option::is_none")] - pub spoke_id: Option, - #[doc = "An array of Rippling IDs that will be in the group."] + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub users: Option>, + pub next_link: Option, } -impl std::fmt::Display for PostGroupsRequestBody { +impl std::fmt::Display for ListTeamsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3563,22 +14939,22 @@ impl std::fmt::Display for PostGroupsRequestBody { } #[cfg(feature = "tabled")] -impl tabled::Tabled for PostGroupsRequestBody { +impl tabled::Tabled for ListTeamsResponse { const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(name) = &self.name { - format!("{:?}", name).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(spoke_id) = &self.spoke_id { - format!("{:?}", spoke_id).into() + if let Some(results) = &self.results { + format!("{:?}", results).into() } else { String::new().into() }, - if let Some(users) = &self.users { - format!("{:?}", users).into() + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3586,79 +14962,33 @@ impl tabled::Tabled for PostGroupsRequestBody { } fn headers() -> Vec> { - vec!["name".into(), "spoke_id".into(), "users".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct PostLeaveRequestsRequestBody { - #[doc = "Unique identifier of the employee who is taking leave."] - pub role: String, - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option, - #[doc = "The status to create the leave request in. Only TILT managed requests can take a \ - status other than PENDING."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "startDate")] - pub start_date: String, - #[serde(rename = "endDate")] - pub end_date: String, - #[serde( - rename = "startDateStartTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_start_time: Option, - #[serde( - rename = "endDateEndTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_end_time: Option, - #[serde( - rename = "startDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_custom_hours: Option, - #[serde( - rename = "endDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_custom_hours: Option, - #[doc = "Unique identifier of the company leave type"] - #[serde(rename = "companyLeaveType")] - pub company_leave_type: String, - #[doc = "Unique identifier of the leave policy. Required if request is not managed by TILT"] - #[serde(rename = "leavePolicy")] - pub leave_policy: String, - #[serde( - rename = "reasonForLeave", - default, - skip_serializing_if = "Option::is_none" - )] - pub reason_for_leave: Option, - #[doc = "String identifier for third party that manages this leave request. This may be null."] - #[serde(rename = "managedBy", default, skip_serializing_if = "Option::is_none")] - pub managed_by: Option, - #[doc = "Object id for corresponding leave obejct in third party system. This may be null."] - #[serde( - rename = "externalId", - default, - skip_serializing_if = "Option::is_none" - )] - pub external_id: Option, +pub struct GetTeamsResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The parent team"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[doc = "The parent team\n\nExpandable field"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub parent: Option, + #[doc = "The name of the team."] + pub name: String, } -impl std::fmt::Display for PostLeaveRequestsRequestBody { +impl std::fmt::Display for GetTeamsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3669,79 +14999,41 @@ impl std::fmt::Display for PostLeaveRequestsRequestBody { } #[cfg(feature = "tabled")] -impl tabled::Tabled for PostLeaveRequestsRequestBody { - const LENGTH: usize = 14; +impl tabled::Tabled for GetTeamsResponse { + const LENGTH: usize = 7; fn fields(&self) -> Vec> { vec![ - self.role.clone().into(), - if let Some(requested_by) = &self.requested_by { - format!("{:?}", requested_by).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(status) = &self.status { - format!("{:?}", status).into() - } else { - String::new().into() - }, - self.start_date.clone().into(), - self.end_date.clone().into(), - if let Some(start_date_start_time) = &self.start_date_start_time { - format!("{:?}", start_date_start_time).into() - } else { - String::new().into() - }, - if let Some(end_date_end_time) = &self.end_date_end_time { - format!("{:?}", end_date_end_time).into() - } else { - String::new().into() - }, - if let Some(start_date_custom_hours) = &self.start_date_custom_hours { - format!("{:?}", start_date_custom_hours).into() - } else { - String::new().into() - }, - if let Some(end_date_custom_hours) = &self.end_date_custom_hours { - format!("{:?}", end_date_custom_hours).into() - } else { - String::new().into() - }, - self.company_leave_type.clone().into(), - self.leave_policy.clone().into(), - if let Some(reason_for_leave) = &self.reason_for_leave { - format!("{:?}", reason_for_leave).into() - } else { - String::new().into() - }, - if let Some(managed_by) = &self.managed_by { - format!("{:?}", managed_by).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(parent_id) = &self.parent_id { + format!("{:?}", parent_id).into() } else { String::new().into() }, - if let Some(external_id) = &self.external_id { - format!("{:?}", external_id).into() + if let Some(parent) = &self.parent { + format!("{:?}", parent).into() } else { String::new().into() }, + self.name.clone().into(), ] } fn headers() -> Vec> { vec![ - "role".into(), - "requested_by".into(), - "status".into(), - "start_date".into(), - "end_date".into(), - "start_date_start_time".into(), - "end_date_end_time".into(), - "start_date_custom_hours".into(), - "end_date_custom_hours".into(), - "company_leave_type".into(), - "leave_policy".into(), - "reason_for_leave".into(), - "managed_by".into(), - "external_id".into(), + "meta".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "parent_id".into(), + "parent".into(), + "name".into(), ] } } @@ -3749,15 +15041,18 @@ impl tabled::Tabled for PostLeaveRequestsRequestBody { #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct GetLeaveBalancesResponse { +pub struct ListWorkLocationsResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option, - #[doc = "Leave balances object"] + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub balances: Option, + pub next_link: Option, } -impl std::fmt::Display for GetLeaveBalancesResponse { +impl std::fmt::Display for ListWorkLocationsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3768,17 +15063,22 @@ impl std::fmt::Display for GetLeaveBalancesResponse { } #[cfg(feature = "tabled")] -impl tabled::Tabled for GetLeaveBalancesResponse { - const LENGTH: usize = 2; +impl tabled::Tabled for ListWorkLocationsResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(role) = &self.role { - format!("{:?}", role).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(balances) = &self.balances { - format!("{:?}", balances).into() + if let Some(results) = &self.results { + format!("{:?}", results).into() + } else { + String::new().into() + }, + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3786,22 +15086,29 @@ impl tabled::Tabled for GetLeaveBalancesResponse { } fn headers() -> Vec> { - vec!["role".into(), "balances".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct GetLeaveBalanceResponse { - #[serde(default, skip_serializing_if = "Option::is_none")] - pub role: Option, - #[doc = "Leave balances object"] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub balances: Option, -} - -impl std::fmt::Display for GetLeaveBalanceResponse { +pub struct GetWorkLocationsResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "The name of the work location."] + pub name: String, + #[doc = "The address for the work location."] + pub address: Address, +} + +impl std::fmt::Display for GetWorkLocationsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3812,39 +15119,50 @@ impl std::fmt::Display for GetLeaveBalanceResponse { } #[cfg(feature = "tabled")] -impl tabled::Tabled for GetLeaveBalanceResponse { - const LENGTH: usize = 2; +impl tabled::Tabled for GetWorkLocationsResponse { + const LENGTH: usize = 6; fn fields(&self) -> Vec> { vec![ - if let Some(role) = &self.role { - format!("{:?}", role).into() - } else { - String::new().into() - }, - if let Some(balances) = &self.balances { - format!("{:?}", balances).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + self.name.clone().into(), + format!("{:?}", self.address).into(), ] } fn headers() -> Vec> { - vec!["role".into(), "balances".into()] + vec![ + "meta".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "name".into(), + "address".into(), + ] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Data { +pub struct ListWorkersResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub events: Option>, + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub next: Option, + pub next_link: Option, } -impl std::fmt::Display for Data { +impl std::fmt::Display for ListWorkersResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3855,17 +15173,22 @@ impl std::fmt::Display for Data { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Data { - const LENGTH: usize = 2; +impl tabled::Tabled for ListWorkersResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(events) = &self.events { - format!("{:?}", events).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(next) = &self.next { - format!("{:?}", next).into() + if let Some(results) = &self.results { + format!("{:?}", results).into() + } else { + String::new().into() + }, + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3873,21 +15196,25 @@ impl tabled::Tabled for Data { } fn headers() -> Vec> { - vec!["events".into(), "next".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct GetCompanyActivityResponse { +pub struct ListUsersResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub data: Option, + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub error: Option, + pub next_link: Option, } -impl std::fmt::Display for GetCompanyActivityResponse { +impl std::fmt::Display for ListUsersResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -3898,17 +15225,22 @@ impl std::fmt::Display for GetCompanyActivityResponse { } #[cfg(feature = "tabled")] -impl tabled::Tabled for GetCompanyActivityResponse { - const LENGTH: usize = 2; +impl tabled::Tabled for ListUsersResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(data) = &self.data { - format!("{:?}", data).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + if let Some(results) = &self.results { + format!("{:?}", results).into() } else { String::new().into() }, - if let Some(error) = &self.error { - format!("{:?}", error).into() + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -3916,83 +15248,63 @@ impl tabled::Tabled for GetCompanyActivityResponse { } fn headers() -> Vec> { - vec!["data".into(), "error".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } -#[derive( - serde :: Serialize, - serde :: Deserialize, - PartialEq, - Hash, - Debug, - Clone, - schemars :: JsonSchema, - parse_display :: FromStr, - parse_display :: Display, -)] -#[cfg_attr(feature = "clap", derive(clap::ValueEnum))] -#[cfg_attr(feature = "tabled", derive(tabled::Tabled))] -pub enum Action { - #[serde(rename = "approve")] - #[display("approve")] - Approve, - #[serde(rename = "decline")] - #[display("decline")] - Decline, -} - #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct PatchLeaveRequestsLeaveRequestIdRequestBody { - #[serde( - rename = "requestedBy", - default, - skip_serializing_if = "Option::is_none" - )] - pub requested_by: Option, - #[doc = "Change the status of a request. This is only possible for TILT managed requests."] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "startDate", default, skip_serializing_if = "Option::is_none")] - pub start_date: Option, - #[serde(rename = "endDate", default, skip_serializing_if = "Option::is_none")] - pub end_date: Option, - #[serde( - rename = "startDateStartTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_start_time: Option, - #[serde( - rename = "endDateEndTime", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_end_time: Option, - #[serde( - rename = "startDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub start_date_custom_hours: Option, - #[serde( - rename = "endDateCustomHours", - default, - skip_serializing_if = "Option::is_none" - )] - pub end_date_custom_hours: Option, - #[doc = "Updated reason for leave request. This may be updated even for an APPROVED request."] - #[serde( - rename = "reasonForLeave", - default, - skip_serializing_if = "Option::is_none" - )] - pub reason_for_leave: Option, +pub struct GetUsersResponse { + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, + #[doc = "Identifier field"] + pub id: String, + #[doc = "Record creation date"] + pub created_at: String, + #[doc = "Record update date"] + pub updated_at: String, + #[doc = "Whether the user is able to access company resources, typically when they are in \ + actively engaged with the company and not after off-boarding."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub active: Option, + #[doc = "The unique identifier across Rippling used by the User for direct authentication \ + into their associated company. Globally unique."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub username: Option, + #[doc = "The user's name."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[doc = "The display name of the user using either the concatenated preferred given and \ + family name or username depending on availability."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub display_name: Option, + #[doc = "The user's email addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub emails: Option, + #[doc = "The user's phone numbers."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub phone_numbers: Option, + #[doc = "The user's addresses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub addresses: Option, + #[doc = "The user's photos."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub photos: Option, + #[doc = "The User's preferred written or spoken language in the same format of the HTTP \ + Accept-Language header, pursuant to Section 5.3.5 of RFC7231."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[doc = "The User's default location for purposes of localization of currency, date time \ + format, or numerical representations pursuant to RFC5646."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locale: Option, + #[doc = "The User's current time zone in IANA database Olson format"] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub timezone: Option, } -impl std::fmt::Display for PatchLeaveRequestsLeaveRequestIdRequestBody { +impl std::fmt::Display for GetUsersResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -4003,52 +15315,70 @@ impl std::fmt::Display for PatchLeaveRequestsLeaveRequestIdRequestBody { } #[cfg(feature = "tabled")] -impl tabled::Tabled for PatchLeaveRequestsLeaveRequestIdRequestBody { - const LENGTH: usize = 9; +impl tabled::Tabled for GetUsersResponse { + const LENGTH: usize = 15; fn fields(&self) -> Vec> { vec![ - if let Some(requested_by) = &self.requested_by { - format!("{:?}", requested_by).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() } else { String::new().into() }, - if let Some(status) = &self.status { - format!("{:?}", status).into() + self.id.clone().into(), + self.created_at.clone().into(), + self.updated_at.clone().into(), + if let Some(active) = &self.active { + format!("{:?}", active).into() } else { String::new().into() }, - if let Some(start_date) = &self.start_date { - format!("{:?}", start_date).into() + if let Some(username) = &self.username { + format!("{:?}", username).into() } else { String::new().into() }, - if let Some(end_date) = &self.end_date { - format!("{:?}", end_date).into() + if let Some(name) = &self.name { + format!("{:?}", name).into() } else { String::new().into() }, - if let Some(start_date_start_time) = &self.start_date_start_time { - format!("{:?}", start_date_start_time).into() + if let Some(display_name) = &self.display_name { + format!("{:?}", display_name).into() } else { String::new().into() }, - if let Some(end_date_end_time) = &self.end_date_end_time { - format!("{:?}", end_date_end_time).into() + if let Some(emails) = &self.emails { + format!("{:?}", emails).into() } else { String::new().into() }, - if let Some(start_date_custom_hours) = &self.start_date_custom_hours { - format!("{:?}", start_date_custom_hours).into() + if let Some(phone_numbers) = &self.phone_numbers { + format!("{:?}", phone_numbers).into() } else { String::new().into() }, - if let Some(end_date_custom_hours) = &self.end_date_custom_hours { - format!("{:?}", end_date_custom_hours).into() + if let Some(addresses) = &self.addresses { + format!("{:?}", addresses).into() } else { String::new().into() }, - if let Some(reason_for_leave) = &self.reason_for_leave { - format!("{:?}", reason_for_leave).into() + if let Some(photos) = &self.photos { + format!("{:?}", photos).into() + } else { + String::new().into() + }, + if let Some(preferred_language) = &self.preferred_language { + format!("{:?}", preferred_language).into() + } else { + String::new().into() + }, + if let Some(locale) = &self.locale { + format!("{:?}", locale).into() + } else { + String::new().into() + }, + if let Some(timezone) = &self.timezone { + format!("{:?}", timezone).into() } else { String::new().into() }, @@ -4057,15 +15387,21 @@ impl tabled::Tabled for PatchLeaveRequestsLeaveRequestIdRequestBody { fn headers() -> Vec> { vec![ - "requested_by".into(), - "status".into(), - "start_date".into(), - "end_date".into(), - "start_date_start_time".into(), - "end_date_end_time".into(), - "start_date_custom_hours".into(), - "end_date_custom_hours".into(), - "reason_for_leave".into(), + "meta".into(), + "id".into(), + "created_at".into(), + "updated_at".into(), + "active".into(), + "username".into(), + "name".into(), + "display_name".into(), + "emails".into(), + "phone_numbers".into(), + "addresses".into(), + "photos".into(), + "preferred_language".into(), + "locale".into(), + "timezone".into(), ] } } @@ -4073,12 +15409,18 @@ impl tabled::Tabled for PatchLeaveRequestsLeaveRequestIdRequestBody { #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct AppHandleId { +pub struct ListCompaniesResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub app_user_name: Option, + pub results: Option>, + #[doc = "A link to the next page of responses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl std::fmt::Display for AppHandleId { +impl std::fmt::Display for ListCompaniesResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -4089,32 +15431,48 @@ impl std::fmt::Display for AppHandleId { } #[cfg(feature = "tabled")] -impl tabled::Tabled for AppHandleId { - const LENGTH: usize = 1; +impl tabled::Tabled for ListCompaniesResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { - vec![if let Some(app_user_name) = &self.app_user_name { - format!("{:?}", app_user_name).into() - } else { - String::new().into() - }] + vec![ + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + if let Some(results) = &self.results { + format!("{:?}", results).into() + } else { + String::new().into() + }, + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() + } else { + String::new().into() + }, + ] } fn headers() -> Vec> { - vec!["app_user_name".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct Results { +pub struct ListEntitlementsResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub rippling_employee_id: Option, + pub results: Option>, + #[doc = "A link to the next page of responses."] #[serde(default, skip_serializing_if = "Option::is_none")] - pub app_handle_id: Option, + pub next_link: Option, } -impl std::fmt::Display for Results { +impl std::fmt::Display for ListEntitlementsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -4125,17 +15483,22 @@ impl std::fmt::Display for Results { } #[cfg(feature = "tabled")] -impl tabled::Tabled for Results { - const LENGTH: usize = 2; +impl tabled::Tabled for ListEntitlementsResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { vec![ - if let Some(rippling_employee_id) = &self.rippling_employee_id { - format!("{:?}", rippling_employee_id).into() + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + if let Some(results) = &self.results { + format!("{:?}", results).into() } else { String::new().into() }, - if let Some(app_handle_id) = &self.app_handle_id { - format!("{:?}", app_handle_id).into() + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() } else { String::new().into() }, @@ -4143,53 +15506,25 @@ impl tabled::Tabled for Results { } fn headers() -> Vec> { - vec!["rippling_employee_id".into(), "app_handle_id".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } #[derive( serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, )] -pub struct GetAppAppMatchingUsersResponse { +pub struct ListCustomFieldsResponse { + #[doc = "A list of redacted fields."] + #[serde(rename = "__meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, #[serde(default, skip_serializing_if = "Option::is_none")] - pub results: Option>, -} - -impl std::fmt::Display for GetAppAppMatchingUsersResponse { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { - write!( - f, - "{}", - serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)? - ) - } -} - -#[cfg(feature = "tabled")] -impl tabled::Tabled for GetAppAppMatchingUsersResponse { - const LENGTH: usize = 1; - fn fields(&self) -> Vec> { - vec![if let Some(results) = &self.results { - format!("{:?}", results).into() - } else { - String::new().into() - }] - } - - fn headers() -> Vec> { - vec!["results".into()] - } -} - -#[doc = "PostMarkAppInstalledResponse."] -#[derive( - serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema, -)] -pub struct PostMarkAppInstalledResponse { - pub ok: bool, + pub results: Option>, + #[doc = "A link to the next page of responses."] + #[serde(default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, } -impl std::fmt::Display for PostMarkAppInstalledResponse { +impl std::fmt::Display for ListCustomFieldsResponse { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { write!( f, @@ -4200,13 +15535,29 @@ impl std::fmt::Display for PostMarkAppInstalledResponse { } #[cfg(feature = "tabled")] -impl tabled::Tabled for PostMarkAppInstalledResponse { - const LENGTH: usize = 1; +impl tabled::Tabled for ListCustomFieldsResponse { + const LENGTH: usize = 3; fn fields(&self) -> Vec> { - vec![format!("{:?}", self.ok).into()] + vec![ + if let Some(meta) = &self.meta { + format!("{:?}", meta).into() + } else { + String::new().into() + }, + if let Some(results) = &self.results { + format!("{:?}", results).into() + } else { + String::new().into() + }, + if let Some(next_link) = &self.next_link { + format!("{:?}", next_link).into() + } else { + String::new().into() + }, + ] } fn headers() -> Vec> { - vec!["ok".into()] + vec!["meta".into(), "results".into(), "next_link".into()] } } diff --git a/rippling-beta/src/users.rs b/rippling/src/users.rs similarity index 81% rename from rippling-beta/src/users.rs rename to rippling/src/users.rs index e91d1e6..edd7652 100644 --- a/rippling-beta/src/users.rs +++ b/rippling/src/users.rs @@ -12,7 +12,13 @@ impl Users { Self { client } } - #[doc = "List users\n\nA List of users\n- Requires: `API Tier 1`\n- Sortable fields: `id`, `created_at`, `updated_at`\n\n**Parameters:**\n\n- `order_by: Option`\n\n```rust,no_run\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```"] + #[doc = "List users\n\nA List of users\n- Requires: `API Tier 1`\n- Sortable fields: `id`, \ + `created_at`, `updated_at`\n\n**Parameters:**\n\n- `order_by: \ + Option`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -51,8 +57,8 @@ impl Users { #[doc = "Retrieve a specific user\n\nRetrieve a specific user\n\n**Parameters:**\n\n- `id: \ &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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 \ + rippling_api::Client::new_from_env();\n let result: \ + rippling_api::types::GetUsersResponse = client\n .users()\n \ .get(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n .await?;\n \ println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] diff --git a/rippling-beta/src/work_locations.rs b/rippling/src/work_locations.rs similarity index 70% rename from rippling-beta/src/work_locations.rs rename to rippling/src/work_locations.rs index 4fdb476..c1cee3c 100644 --- a/rippling-beta/src/work_locations.rs +++ b/rippling/src/work_locations.rs @@ -12,7 +12,13 @@ impl WorkLocations { Self { client } } - #[doc = "List work locations\n\nA 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`\n\n```rust,no_run\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```"] + #[doc = "List work locations\n\nA 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`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -48,7 +54,13 @@ impl WorkLocations { } } - #[doc = "Retrieve a specific work location\n\nRetrieve a specific work location\n\n**Parameters:**\n\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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```"] + #[doc = "Retrieve a specific work location\n\nRetrieve a specific work \ + location\n\n**Parameters:**\n\n- `id: &'astr`: ID of the resource to return \ + (required)\n\n```rust,no_run\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(\"d9797f8d-9ad6-4e08-90d7-2ec17e13471c\")\n \ + .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"] #[tracing::instrument] pub async fn get<'a>( &'a self, diff --git a/rippling-beta/src/workers.rs b/rippling/src/workers.rs similarity index 77% rename from rippling-beta/src/workers.rs rename to rippling/src/workers.rs index 616883c..9f7482d 100644 --- a/rippling-beta/src/workers.rs +++ b/rippling/src/workers.rs @@ -12,7 +12,7 @@ impl Workers { Self { client } } - #[doc = "List workers\n\nA 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`\n- `filter: Option`\n- `order_by: Option`\n\n```rust,no_run\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```"] + #[doc = "List workers\n\nA 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`\n- `filter: Option`\n- `order_by: Option`\n\n```rust,no_run\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```"] #[tracing::instrument] pub async fn list<'a>( &'a self, @@ -58,7 +58,14 @@ impl Workers { } } - #[doc = "Retrieve a specific worker\n\nRetrieve a specific worker\n\n**Parameters:**\n\n- `expand: Option`\n- `id: &'astr`: ID of the resource to return (required)\n\n```rust,no_run\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```"] + #[doc = "Retrieve a specific worker\n\nRetrieve a specific worker\n\n**Parameters:**\n\n- \ + `expand: Option`\n- `id: &'astr`: ID of the resource to return \ + (required)\n\n```rust,no_run\nasync fn example_workers_get() -> anyhow::Result<()> \ + {\n let client = rippling_api::Client::new_from_env();\n let result: \ + rippling_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```"] #[tracing::instrument] pub async fn get<'a>( &'a self,