sf-tooling
Salesforce Tooling API client for development and deployment operations.
Features
- Apex Operations - Execute anonymous Apex, query Apex logs
- Metadata Query - Query ApexClass, ApexTrigger, and other tooling objects
- Debug Logs - Retrieve and manage debug logs
- Trace Flags - Manage debug trace flags
- Describe - Get tooling object metadata
Example
use sf_tooling::ToolingClient;
#[tokio::main]
async fn main() -> Result<(), sf_tooling::Error> {
let client = ToolingClient::new(
"https://myorg.my.salesforce.com",
"access_token_here",
)?;
let result = client
.execute_anonymous("System.debug('Hello World');")
.await?;
if result.success {
println!("Apex executed successfully");
}
let classes: Vec<ApexClass> = client
.query_all("SELECT Id, Name, Body FROM ApexClass LIMIT 10")
.await?;
let logs = client.get_apex_logs(Some(10)).await?;
Ok(())
}