Skip to content

update remote (dont log tokens) #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ log = { version = "^0.4", features = ["serde"], optional = true }
mime_guess = "2.0.4"
parse-display = "0.10.0"
phonenumber = "0.3.7"
rand = { version = "0.8", optional = true }
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
rand = { version = "0.9", optional = true }
getrandom = { version = "0.3" }
reqwest = { version = "0.12.14", default-features = false, features = ["json", "multipart", "rustls-tls"], optional = true }
reqwest-conditional-middleware = { version = "0.4", optional = true }
reqwest-middleware = { version = "0.4", optional = true, features = ["json", "multipart", "http2", "rustls-tls"] }
reqwest-retry = { version = "0.7", optional = true }
Expand All @@ -36,7 +37,7 @@ serde = { version = "1", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1"
serde_urlencoded = { version = "^0.7", optional = true }
tabled = { version = "0.17.0", features = ["ansi"], optional = true }
tabled = { version = "0.18.0", features = ["ansi"], optional = true }
thiserror = "2"
tracing = { version = "^0.1", optional = true }
url = { version = "2", features = ["serde"] }
Expand All @@ -53,7 +54,7 @@ chrono = { version = "0.4", default-features = false, features = ["serde", "std"
expectorate = "1"
futures-util = "^0.3.26"
pretty_assertions = "1"
rand = "0.8"
rand = "0.9"
tokio = { version = "1.43.1", features = ["rt", "macros"] }
tokio-tungstenite = "0.24"

Expand All @@ -63,7 +64,7 @@ clap = ["dep:clap"]
tabled = ["dep:tabled"]
requests = ["dep:async-trait", "dep:format_serde_error", "dep:futures", "dep:http", "dep:log", "dep:rand", "dep:reqwest", "dep:serde_urlencoded", "dep:tracing"]
retry = ["dep:reqwest-conditional-middleware", "dep:reqwest-retry", "dep:reqwest-middleware", "dep:reqwest-tracing"]
js = ["uuid/js"]
js = ["uuid/js", "getrandom/wasm_js"]

[package.metadata.docs.rs]
all-features = true
Expand Down
12 changes: 6 additions & 6 deletions remote/remote-api.rs.patch.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions remote/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Client {
/// an &str (`String` or `Vec<u8>` for example). As long as the function is
/// given a valid API key your requests will work.
/// Also takes reqwest client builders, for customizing the client's behaviour.
#[tracing::instrument]
#[tracing::instrument(skip(token))]
#[cfg(not(target_arch = "wasm32"))]
pub fn new_from_reqwest<T>(
token: T,
Expand Down Expand Up @@ -181,7 +181,7 @@ impl Client {
/// an &str (`String` or `Vec<u8>` for example). As long as the function is
/// given a valid API key your requests will work.
/// Also takes reqwest client builders, for customizing the client's behaviour.
#[tracing::instrument]
#[tracing::instrument(skip(token))]
#[cfg(target_arch = "wasm32")]
pub fn new_from_reqwest<T>(token: T, builder_http: reqwest::ClientBuilder) -> Self
where
Expand Down Expand Up @@ -230,7 +230,7 @@ impl Client {
/// Create a new Client struct. It takes a type that can convert into
/// an &str (`String` or `Vec<u8>` for example). As long as the function is
/// given a valid API key your requests will work.
#[tracing::instrument]
#[tracing::instrument(skip(token))]
pub fn new<T>(token: T) -> Self
where
T: ToString + std::fmt::Debug,
Expand Down
4 changes: 2 additions & 2 deletions remote/src/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl Sandbox {
Self { client }
}

#[doc = "Update employment in the Sandbox Environment\n\nUpdates an employment. Use this endpoint to modify employment states for testing\nin the Sandbox environment. This endpoint will respond with a 404 outside of the\nSandbox environment.\n\nFor updating an employment's parameters outside of testing purposes, use [this\nEmployment update endpoint](#operation/patch_update_employment).\n\n\n**Parameters:**\n\n- `employment_id: &'astr`: Employment ID (required)\n\n```rust,no_run\nasync fn example_sandbox_patch_update_employment_4() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .sandbox()\n .patch_update_employment_4(\n \"some-string\",\n &remote_api::types::EmploymentUpdateParams {\n status: Some(remote_api::types::EmploymentStatus::Deleted),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Update employment in the Sandbox Environment\n\nUpdates an employment. Use this endpoint to modify employment states for testing\nin the Sandbox environment. This endpoint will respond with a 404 outside of the\nSandbox environment.\n\nFor updating an employment's parameters outside of testing purposes, use [this\nEmployment update endpoint](#operation/patch_update_employment).\n\n\n**Parameters:**\n\n- `employment_id: &'astr`: Employment ID (required)\n\n```rust,no_run\nasync fn example_sandbox_patch_update_employment_4() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .sandbox()\n .patch_update_employment_4(\n \"some-string\",\n &remote_api::types::EmploymentUpdateParams {\n status: Some(remote_api::types::EmploymentStatus::Pending),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn patch_update_employment_4<'a>(
&'a self,
Expand Down Expand Up @@ -48,7 +48,7 @@ impl Sandbox {
}
}

#[doc = "Update employment in the Sandbox Environment\n\nUpdates an employment. Use this endpoint to modify employment states for testing\nin the Sandbox environment. This endpoint will respond with a 404 outside of the\nSandbox environment.\n\nFor updating an employment's parameters outside of testing purposes, use [this\nEmployment update endpoint](#operation/patch_update_employment).\n\n\n**Parameters:**\n\n- `employment_id: &'astr`: Employment ID (required)\n\n```rust,no_run\nasync fn example_sandbox_patch_update_employment_3() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .sandbox()\n .patch_update_employment_3(\n \"some-string\",\n &remote_api::types::EmploymentUpdateParams {\n status: Some(remote_api::types::EmploymentStatus::Deleted),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Update employment in the Sandbox Environment\n\nUpdates an employment. Use this endpoint to modify employment states for testing\nin the Sandbox environment. This endpoint will respond with a 404 outside of the\nSandbox environment.\n\nFor updating an employment's parameters outside of testing purposes, use [this\nEmployment update endpoint](#operation/patch_update_employment).\n\n\n**Parameters:**\n\n- `employment_id: &'astr`: Employment ID (required)\n\n```rust,no_run\nasync fn example_sandbox_patch_update_employment_3() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::EmploymentResponse = client\n .sandbox()\n .patch_update_employment_3(\n \"some-string\",\n &remote_api::types::EmploymentUpdateParams {\n status: Some(remote_api::types::EmploymentStatus::Pending),\n },\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn patch_update_employment_3<'a>(
&'a self,
Expand Down
8 changes: 4 additions & 4 deletions remote/src/time_off.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl TimeOff {
Self { client }
}

#[doc = "List Time Off\n\nLists all Time Off records.\n\n**Parameters:**\n\n- `employment_id: Option<String>`: Only show time off for a specific employment\n- `order_by: Option<crate::types::OrderBy>`: Sort order\n- `page: Option<i64>`: Starts fetching records after the given page\n- `page_size: Option<i64>`: Change the amount of records returned per page, defaults to 20, limited to 100\n- `sort_by: Option<crate::types::SortBy>`: Field to sort by\n- `status: Option<crate::types::GetIndexTimeoffStatus>`: Filter time off by its status\n- `timeoff_type: Option<crate::types::TimeoffType>`: Filter time off by its type\n\n```rust,no_run\nasync fn example_time_off_get_index_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::ListTimeoffResponse = client\n .time_off()\n .get_index_timeoff(\n Some(\"some-string\".to_string()),\n Some(remote_api::types::OrderBy::Desc),\n Some(4 as i64),\n Some(4 as i64),\n Some(remote_api::types::SortBy::Status),\n Some(remote_api::types::GetIndexTimeoffStatus::CancelRequested),\n Some(remote_api::types::TimeoffType::MilitaryLeave),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "List Time Off\n\nLists all Time Off records.\n\n**Parameters:**\n\n- `employment_id: Option<String>`: Only show time off for a specific employment\n- `order_by: Option<crate::types::OrderBy>`: Sort order\n- `page: Option<i64>`: Starts fetching records after the given page\n- `page_size: Option<i64>`: Change the amount of records returned per page, defaults to 20, limited to 100\n- `sort_by: Option<crate::types::SortBy>`: Field to sort by\n- `status: Option<crate::types::GetIndexTimeoffStatus>`: Filter time off by its status\n- `timeoff_type: Option<crate::types::TimeoffType>`: Filter time off by its type\n\n```rust,no_run\nasync fn example_time_off_get_index_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::ListTimeoffResponse = client\n .time_off()\n .get_index_timeoff(\n Some(\"some-string\".to_string()),\n Some(remote_api::types::OrderBy::Desc),\n Some(4 as i64),\n Some(4 as i64),\n Some(remote_api::types::SortBy::Status),\n Some(remote_api::types::GetIndexTimeoffStatus::Requested),\n Some(remote_api::types::TimeoffType::PaternityLeave),\n )\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn get_index_timeoff<'a>(
&'a self,
Expand Down Expand Up @@ -78,7 +78,7 @@ impl TimeOff {
}
}

#[doc = "Create Time Off\n\nCreates a Time Off record\n\n```rust,no_run\nasync fn example_time_off_post_create_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .post_create_timeoff(&remote_api::types::CreateApprovedTimeoffParams {\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n employment_id: \"some-string\".to_string(),\n end_date: chrono::Utc::now().date_naive(),\n notes: Some(\"some-string\".to_string()),\n start_date: chrono::Utc::now().date_naive(),\n timeoff_days: vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }],\n timeoff_type: remote_api::types::TimeoffType::MilitaryLeave,\n timezone: \"some-string\".to_string(),\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n status: Some(remote_api::types::CreateApprovedTimeoffParamsStatus::Approved),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Create Time Off\n\nCreates a Time Off record\n\n```rust,no_run\nasync fn example_time_off_post_create_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .post_create_timeoff(&remote_api::types::CreateApprovedTimeoffParams {\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n employment_id: \"some-string\".to_string(),\n end_date: chrono::Utc::now().date_naive(),\n notes: Some(\"some-string\".to_string()),\n start_date: chrono::Utc::now().date_naive(),\n timeoff_days: vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }],\n timeoff_type: remote_api::types::TimeoffType::PaternityLeave,\n timezone: \"some-string\".to_string(),\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n status: Some(remote_api::types::CreateApprovedTimeoffParamsStatus::Approved),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn post_create_timeoff<'a>(
&'a self,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl TimeOff {
}
}

#[doc = "Update Time Off\n\nUpdates a Time Off record. This endpoint can also be used for cancelling a time off.\n\n```rust,no_run\nasync fn example_time_off_patch_update_timeoff_2() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .patch_update_timeoff_2(&remote_api::types::UpdateApprovedTimeoffParams {\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n cancel_reason: \"some-string\".to_string(),\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n edit_reason: \"some-string\".to_string(),\n end_date: Some(chrono::Utc::now().date_naive()),\n notes: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n status: Some(remote_api::types::UpdateApprovedTimeoffParamsStatus::Cancelled),\n timeoff_days: Some(vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }]),\n timeoff_type: Some(remote_api::types::TimeoffType::MilitaryLeave),\n timezone: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Update Time Off\n\nUpdates a Time Off record. This endpoint can also be used for cancelling a time off.\n\n```rust,no_run\nasync fn example_time_off_patch_update_timeoff_2() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .patch_update_timeoff_2(&remote_api::types::UpdateApprovedTimeoffParams {\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n cancel_reason: \"some-string\".to_string(),\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n edit_reason: \"some-string\".to_string(),\n end_date: Some(chrono::Utc::now().date_naive()),\n notes: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n status: Some(remote_api::types::UpdateApprovedTimeoffParamsStatus::Cancelled),\n timeoff_days: Some(vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }]),\n timeoff_type: Some(remote_api::types::TimeoffType::PaternityLeave),\n timezone: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn patch_update_timeoff_2<'a>(
&'a self,
Expand Down Expand Up @@ -215,7 +215,7 @@ impl TimeOff {
}
}

#[doc = "Update Time Off\n\nUpdates a Time Off record. This endpoint can also be used for cancelling a time off.\n\n```rust,no_run\nasync fn example_time_off_patch_update_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .patch_update_timeoff(&remote_api::types::UpdateApprovedTimeoffParams {\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n cancel_reason: \"some-string\".to_string(),\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n edit_reason: \"some-string\".to_string(),\n end_date: Some(chrono::Utc::now().date_naive()),\n notes: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n status: Some(remote_api::types::UpdateApprovedTimeoffParamsStatus::Cancelled),\n timeoff_days: Some(vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }]),\n timeoff_type: Some(remote_api::types::TimeoffType::MilitaryLeave),\n timezone: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[doc = "Update Time Off\n\nUpdates a Time Off record. This endpoint can also be used for cancelling a time off.\n\n```rust,no_run\nasync fn example_time_off_patch_update_timeoff() -> anyhow::Result<()> {\n let client = remote_api::Client::new_from_env();\n let result: remote_api::types::TimeoffResponse = client\n .time_off()\n .patch_update_timeoff(&remote_api::types::UpdateApprovedTimeoffParams {\n approved_at: Some(chrono::Utc::now()),\n approver_id: Some(\"some-string\".to_string()),\n cancel_reason: \"some-string\".to_string(),\n document: Some(remote_api::types::TimeoffDocumentParams {\n content: \"some-string\".to_string(),\n name: \"some-string\".to_string(),\n }),\n edit_reason: \"some-string\".to_string(),\n end_date: Some(chrono::Utc::now().date_naive()),\n notes: Some(\"some-string\".to_string()),\n start_date: Some(chrono::Utc::now().date_naive()),\n status: Some(remote_api::types::UpdateApprovedTimeoffParamsStatus::Cancelled),\n timeoff_days: Some(vec![remote_api::types::TimeoffDaysParams {\n day: Some(chrono::Utc::now().date_naive()),\n hours: Some(4 as i64),\n }]),\n timeoff_type: Some(remote_api::types::TimeoffType::PaternityLeave),\n timezone: Some(\"some-string\".to_string()),\n })\n .await?;\n println!(\"{:?}\", result);\n Ok(())\n}\n```"]
#[tracing::instrument]
pub async fn patch_update_timeoff<'a>(
&'a self,
Expand Down
Loading
Loading