pub struct SalesforceRestClient { /* private fields */ }Expand description
Salesforce REST API client.
Provides typed methods for all REST API operations:
- CRUD operations on SObjects
- SOQL queries with automatic pagination
- SOSL search
- Describe operations
- Composite API
- SObject Collections
§Example
use sf_rest::SalesforceRestClient;
let client = SalesforceRestClient::new(
"https://myorg.my.salesforce.com",
"access_token_here",
)?;
// Query
let accounts: Vec<Account> = client.query_all("SELECT Id, Name FROM Account").await?;
// Create
let id = client.create("Account", &json!({"Name": "New Account"})).await?;
// Update
client.update("Account", &id, &json!({"Name": "Updated"})).await?;
// Delete
client.delete("Account", &id).await?;Implementations§
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn get_blob(
&self,
sobject: &str,
id: &str,
blob_field: &str,
) -> Result<Vec<u8>, Error>
pub async fn get_blob( &self, sobject: &str, id: &str, blob_field: &str, ) -> Result<Vec<u8>, Error>
Get binary blob content from an SObject field (e.g., Attachment body, Document body).
Sourcepub async fn get_rich_text_image(
&self,
sobject: &str,
id: &str,
field_name: &str,
content_reference_id: &str,
) -> Result<Vec<u8>, Error>
pub async fn get_rich_text_image( &self, sobject: &str, id: &str, field_name: &str, content_reference_id: &str, ) -> Result<Vec<u8>, Error>
Get a rich text image from an SObject field.
Sourcepub async fn get_relationship<T>(
&self,
sobject: &str,
id: &str,
relationship_name: &str,
) -> Result<T, Error>where
T: DeserializeOwned,
pub async fn get_relationship<T>(
&self,
sobject: &str,
id: &str,
relationship_name: &str,
) -> Result<T, Error>where
T: DeserializeOwned,
Get related records via a relationship field.
Sourcepub async fn get_sobject_basic_info(
&self,
sobject: &str,
) -> Result<SObjectInfo, Error>
pub async fn get_sobject_basic_info( &self, sobject: &str, ) -> Result<SObjectInfo, Error>
Get basic info about an SObject type (describe + recent items).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn create_multiple<T>(
&self,
sobject: &str,
records: &[T],
all_or_none: bool,
) -> Result<Vec<CollectionResult>, Error>where
T: Serialize,
pub async fn create_multiple<T>(
&self,
sobject: &str,
records: &[T],
all_or_none: bool,
) -> Result<Vec<CollectionResult>, Error>where
T: Serialize,
Create multiple records in a single request (up to 200).
Sourcepub async fn update_multiple<T>(
&self,
sobject: &str,
records: &[(String, T)],
all_or_none: bool,
) -> Result<Vec<CollectionResult>, Error>where
T: Serialize,
pub async fn update_multiple<T>(
&self,
sobject: &str,
records: &[(String, T)],
all_or_none: bool,
) -> Result<Vec<CollectionResult>, Error>where
T: Serialize,
Update multiple records in a single request (up to 200).
Sourcepub async fn delete_multiple(
&self,
ids: &[&str],
all_or_none: bool,
) -> Result<Vec<CollectionResult>, Error>
pub async fn delete_multiple( &self, ids: &[&str], all_or_none: bool, ) -> Result<Vec<CollectionResult>, Error>
Delete multiple records in a single request (up to 200).
Sourcepub async fn get_multiple<T>(
&self,
sobject: &str,
ids: &[&str],
fields: &[&str],
) -> Result<Vec<T>, Error>where
T: DeserializeOwned,
pub async fn get_multiple<T>(
&self,
sobject: &str,
ids: &[&str],
fields: &[&str],
) -> Result<Vec<T>, Error>where
T: DeserializeOwned,
Get multiple records by ID in a single request (up to 2000).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn composite(
&self,
request: &CompositeRequest,
) -> Result<CompositeResponse, Error>
pub async fn composite( &self, request: &CompositeRequest, ) -> Result<CompositeResponse, Error>
Execute a composite request with multiple subrequests.
The composite API allows up to 25 subrequests in a single API call.
Subrequests can reference results from earlier subrequests using @{referenceId}.
Available since API v34.0.
Sourcepub async fn composite_batch(
&self,
request: &CompositeBatchRequest,
) -> Result<CompositeBatchResponse, Error>
pub async fn composite_batch( &self, request: &CompositeBatchRequest, ) -> Result<CompositeBatchResponse, Error>
Execute a composite batch request with multiple independent subrequests.
The composite batch API executes up to 25 subrequests independently. Unlike the standard composite API, subrequests cannot reference each other’s results.
Available since API v34.0.
Sourcepub async fn composite_tree(
&self,
sobject: &str,
request: &CompositeTreeRequest,
) -> Result<CompositeTreeResponse, Error>
pub async fn composite_tree( &self, sobject: &str, request: &CompositeTreeRequest, ) -> Result<CompositeTreeResponse, Error>
Execute a composite tree request to create record hierarchies.
Creates parent records with nested child records in a single request. Supports up to 200 records total across all levels of the hierarchy.
Available since API v42.0.
§Arguments
sobject- The parent SObject type (e.g., “Account”)request- The tree request containing parent records and nested children
Sourcepub async fn composite_graph(
&self,
request: &CompositeGraphRequest,
) -> Result<CompositeGraphResponse, Error>
pub async fn composite_graph( &self, request: &CompositeGraphRequest, ) -> Result<CompositeGraphResponse, Error>
Execute a composite graph request with multiple independent graphs.
Each graph contains a set of composite subrequests that can reference each other within the same graph. Different graphs are independent.
Available since API v50.0.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn read_consent(
&self,
action: &str,
ids: &[&str],
) -> Result<ConsentResponse, Error>
pub async fn read_consent( &self, action: &str, ids: &[&str], ) -> Result<ConsentResponse, Error>
Read consent status for an action and a set of IDs.
Sourcepub async fn write_consent(
&self,
action: &str,
request: &ConsentWriteRequest,
) -> Result<(), Error>
pub async fn write_consent( &self, action: &str, request: &ConsentWriteRequest, ) -> Result<(), Error>
Write consent for an action (uses PATCH, not POST).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn create<T>(
&self,
sobject: &str,
record: &T,
) -> Result<String, Error>where
T: Serialize,
pub async fn create<T>(
&self,
sobject: &str,
record: &T,
) -> Result<String, Error>where
T: Serialize,
Create a new record.
Returns the ID of the created record.
Sourcepub async fn get<T>(
&self,
sobject: &str,
id: &str,
fields: Option<&[&str]>,
) -> Result<T, Error>where
T: DeserializeOwned,
pub async fn get<T>(
&self,
sobject: &str,
id: &str,
fields: Option<&[&str]>,
) -> Result<T, Error>where
T: DeserializeOwned,
Get a record by ID.
Optionally specify which fields to retrieve.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn describe_global(&self) -> Result<DescribeGlobalResult, Error>
pub async fn describe_global(&self) -> Result<DescribeGlobalResult, Error>
Get a list of all SObjects available in the org.
This is equivalent to calling /services/data/vXX.0/sobjects/.
Sourcepub async fn describe_sobject(
&self,
sobject: &str,
) -> Result<DescribeSObjectResult, Error>
pub async fn describe_sobject( &self, sobject: &str, ) -> Result<DescribeSObjectResult, Error>
Get detailed metadata for a specific SObject.
This is equivalent to calling /services/data/vXX.0/sobjects/{sobject}/describe.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn get_embedded_service_config(
&self,
config_id: &str,
) -> Result<EmbeddedServiceConfig, Error>
pub async fn get_embedded_service_config( &self, config_id: &str, ) -> Result<EmbeddedServiceConfig, Error>
Get embedded service configuration by ID.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn list_standard_actions(
&self,
) -> Result<InvocableActionCollection, Error>
pub async fn list_standard_actions( &self, ) -> Result<InvocableActionCollection, Error>
List all standard invocable actions.
Returns a collection of all standard actions available in the org.
Sourcepub async fn list_custom_action_types(
&self,
) -> Result<HashMap<String, String>, Error>
pub async fn list_custom_action_types( &self, ) -> Result<HashMap<String, String>, Error>
List custom invocable action type categories.
Returns a map of category names (e.g., “apex”, “flow”) to their
sub-resource URLs. Use list_custom_actions() to get actual actions
within a category.
Sourcepub async fn list_custom_actions(
&self,
action_type: &str,
) -> Result<InvocableActionCollection, Error>
pub async fn list_custom_actions( &self, action_type: &str, ) -> Result<InvocableActionCollection, Error>
List custom invocable actions of a specific type.
§Arguments
action_type- The action type category (e.g., “apex”, “flow”)
Sourcepub async fn describe_standard_action(
&self,
action_name: &str,
) -> Result<InvocableActionDescribe, Error>
pub async fn describe_standard_action( &self, action_name: &str, ) -> Result<InvocableActionDescribe, Error>
Describe a standard invocable action.
Sourcepub async fn describe_custom_action(
&self,
action_type: &str,
action_name: &str,
) -> Result<InvocableActionDescribe, Error>
pub async fn describe_custom_action( &self, action_type: &str, action_name: &str, ) -> Result<InvocableActionDescribe, Error>
Describe a custom invocable action.
Custom actions are organized by type (e.g., “apex”, “flow”). Both the action type and action name are required.
Sourcepub async fn invoke_standard_action(
&self,
action_name: &str,
request: &InvocableActionRequest,
) -> Result<Vec<InvocableActionResult>, Error>
pub async fn invoke_standard_action( &self, action_name: &str, request: &InvocableActionRequest, ) -> Result<Vec<InvocableActionResult>, Error>
Invoke a standard action.
Returns a vector of results (one per input).
Sourcepub async fn invoke_custom_action(
&self,
action_type: &str,
action_name: &str,
request: &InvocableActionRequest,
) -> Result<Vec<InvocableActionResult>, Error>
pub async fn invoke_custom_action( &self, action_type: &str, action_name: &str, request: &InvocableActionRequest, ) -> Result<Vec<InvocableActionResult>, Error>
Invoke a custom action.
Custom actions are organized by type. Both the action type and action name are required.
Returns a vector of results (one per input).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn knowledge_settings(&self) -> Result<KnowledgeSettings, Error>
pub async fn knowledge_settings(&self) -> Result<KnowledgeSettings, Error>
Get knowledge management settings.
Sourcepub async fn knowledge_articles(
&self,
query: Option<&str>,
channel: Option<&str>,
) -> Result<KnowledgeArticlesResponse, Error>
pub async fn knowledge_articles( &self, query: Option<&str>, channel: Option<&str>, ) -> Result<KnowledgeArticlesResponse, Error>
List knowledge articles, optionally filtering by query string and channel.
Sourcepub async fn data_category_groups(
&self,
sobject: Option<&str>,
) -> Result<DataCategoryGroupsResponse, Error>
pub async fn data_category_groups( &self, sobject: Option<&str>, ) -> Result<DataCategoryGroupsResponse, Error>
Get data category groups, optionally filtered by SObject type.
Sourcepub async fn data_categories(
&self,
group: &str,
sobject: Option<&str>,
) -> Result<DataCategoriesResponse, Error>
pub async fn data_categories( &self, group: &str, sobject: Option<&str>, ) -> Result<DataCategoriesResponse, Error>
Get data categories within a group, optionally filtered by SObject type.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn describe_layouts(&self, sobject: &str) -> Result<Value, Error>
pub async fn describe_layouts(&self, sobject: &str) -> Result<Value, Error>
Get all page layouts for a specific SObject.
This returns metadata about all page layouts configured for the SObject, including sections, rows, items, and field metadata.
§Example
let layouts = client.describe_layouts("Account").await?;
println!("Account layouts: {:?}", layouts);This is equivalent to calling /services/data/vXX.0/sobjects/{sobject}/describe/layouts.
Sourcepub async fn describe_named_layout(
&self,
sobject: &str,
layout_name: &str,
) -> Result<Value, Error>
pub async fn describe_named_layout( &self, sobject: &str, layout_name: &str, ) -> Result<Value, Error>
Get a specific named layout for an SObject.
This returns the layout metadata for a specific named layout.
§Example
let layout = client.describe_named_layout("Account", "MyCustomLayout").await?;
println!("Layout metadata: {:?}", layout);This is equivalent to calling /services/data/vXX.0/sobjects/{sobject}/describe/namedLayouts/{layoutName}.
Sourcepub async fn describe_approval_layouts(
&self,
sobject: &str,
) -> Result<Value, Error>
pub async fn describe_approval_layouts( &self, sobject: &str, ) -> Result<Value, Error>
Get approval process layouts for a specific SObject.
This returns the approval process layout information including approval steps, actions, and field mappings.
§Example
let approval_layouts = client.describe_approval_layouts("Account").await?;
println!("Approval layouts: {:?}", approval_layouts);This is equivalent to calling /services/data/vXX.0/sobjects/{sobject}/describe/approvalLayouts.
Sourcepub async fn describe_compact_layouts(
&self,
sobject: &str,
) -> Result<Value, Error>
pub async fn describe_compact_layouts( &self, sobject: &str, ) -> Result<Value, Error>
Get compact layouts for a specific SObject.
Compact layouts are used in the Salesforce mobile app and Lightning Experience to show a preview of a record in a compact space.
§Example
let compact_layouts = client.describe_compact_layouts("Account").await?;
println!("Compact layouts: {:?}", compact_layouts);This is equivalent to calling /services/data/vXX.0/sobjects/{sobject}/describe/compactLayouts.
Sourcepub async fn describe_global_publisher_layouts(&self) -> Result<Value, Error>
pub async fn describe_global_publisher_layouts(&self) -> Result<Value, Error>
Get global publisher layouts (global quick actions).
This returns global quick actions and publisher layouts that are available across the entire organization, not tied to a specific SObject.
§Example
let global_layouts = client.describe_global_publisher_layouts().await?;
println!("Global layouts: {:?}", global_layouts);This is equivalent to calling /services/data/vXX.0/sobjects/Global/describe/layouts.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn list_views(
&self,
sobject: &str,
) -> Result<ListViewCollection, Error>
pub async fn list_views( &self, sobject: &str, ) -> Result<ListViewCollection, Error>
List all list views for an SObject.
Sourcepub async fn get_list_view(
&self,
sobject: &str,
list_view_id: &str,
) -> Result<ListView, Error>
pub async fn get_list_view( &self, sobject: &str, list_view_id: &str, ) -> Result<ListView, Error>
Get a specific list view by ID.
Sourcepub async fn describe_list_view(
&self,
sobject: &str,
list_view_id: &str,
) -> Result<ListViewDescribe, Error>
pub async fn describe_list_view( &self, sobject: &str, list_view_id: &str, ) -> Result<ListViewDescribe, Error>
Describe a list view (get columns, filters, etc.).
Sourcepub async fn execute_list_view<T>(
&self,
sobject: &str,
list_view_id: &str,
) -> Result<ListViewResult<T>, Error>where
T: DeserializeOwned,
pub async fn execute_list_view<T>(
&self,
sobject: &str,
list_view_id: &str,
) -> Result<ListViewResult<T>, Error>where
T: DeserializeOwned,
Execute a list view and return its results.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn list_process_rules(&self) -> Result<ProcessRuleCollection, Error>
pub async fn list_process_rules(&self) -> Result<ProcessRuleCollection, Error>
List all process rules.
Sourcepub async fn list_process_rules_for_sobject(
&self,
sobject: &str,
) -> Result<Vec<ProcessRule>, Error>
pub async fn list_process_rules_for_sobject( &self, sobject: &str, ) -> Result<Vec<ProcessRule>, Error>
List process rules for a specific SObject type.
Returns the array of rules for that SObject.
Sourcepub async fn trigger_process_rules(
&self,
request: &ProcessRuleRequest,
) -> Result<ProcessRuleResult, Error>
pub async fn trigger_process_rules( &self, request: &ProcessRuleRequest, ) -> Result<ProcessRuleResult, Error>
Trigger process rules for a record.
Sourcepub async fn list_pending_approvals(
&self,
) -> Result<PendingApprovalCollection, Error>
pub async fn list_pending_approvals( &self, ) -> Result<PendingApprovalCollection, Error>
List pending approval work items.
Sourcepub async fn submit_approval(
&self,
request: &ApprovalRequest,
) -> Result<ApprovalResult, Error>
pub async fn submit_approval( &self, request: &ApprovalRequest, ) -> Result<ApprovalResult, Error>
Submit, approve, or reject an approval request.
The response is an array; this method returns the first element.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn query<T>(&self, soql: &str) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
pub async fn query<T>(&self, soql: &str) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
Execute a SOQL query.
Returns the first page of results. Use query_all for automatic pagination.
§Security
IMPORTANT: If you are including user-provided values in the WHERE clause, you MUST escape them to prevent SOQL injection attacks. Use the security utilities:
use busbar_sf_client::security::soql;
// WRONG - vulnerable to injection:
let query = format!("SELECT Id FROM Account WHERE Name = '{}'", user_input);
// CORRECT - properly escaped:
let safe_value = soql::escape_string(user_input);
let query = format!("SELECT Id FROM Account WHERE Name = '{}'", safe_value);Sourcepub async fn query_all<T>(&self, soql: &str) -> Result<Vec<T>, Error>where
T: DeserializeOwned + Clone,
pub async fn query_all<T>(&self, soql: &str) -> Result<Vec<T>, Error>where
T: DeserializeOwned + Clone,
Execute a SOQL query and return all results (automatic pagination).
§Security
IMPORTANT: Escape user-provided values with busbar_sf_client::security::soql::escape_string()
to prevent SOQL injection attacks. See query() for examples.
Sourcepub async fn query_all_including_deleted<T>(
&self,
soql: &str,
) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
pub async fn query_all_including_deleted<T>(
&self,
soql: &str,
) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
Execute a SOQL query including deleted/archived records.
§Security
IMPORTANT: Escape user-provided values with busbar_sf_client::security::soql::escape_string()
to prevent SOQL injection attacks. See query() for examples.
Sourcepub async fn query_more<T>(
&self,
next_records_url: &str,
) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
pub async fn query_more<T>(
&self,
next_records_url: &str,
) -> Result<QueryResult<T>, Error>where
T: DeserializeOwned,
Fetch the next page of query results.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn list_global_quick_actions(&self) -> Result<Vec<QuickAction>, Error>
pub async fn list_global_quick_actions(&self) -> Result<Vec<QuickAction>, Error>
List all global quick actions.
Sourcepub async fn describe_global_quick_action(
&self,
action_name: &str,
) -> Result<QuickActionDescribe, Error>
pub async fn describe_global_quick_action( &self, action_name: &str, ) -> Result<QuickActionDescribe, Error>
Describe a global quick action.
Sourcepub async fn list_quick_actions(
&self,
sobject: &str,
) -> Result<Vec<QuickAction>, Error>
pub async fn list_quick_actions( &self, sobject: &str, ) -> Result<Vec<QuickAction>, Error>
List all quick actions available for an SObject.
Sourcepub async fn describe_quick_action(
&self,
sobject: &str,
action_name: &str,
) -> Result<QuickActionDescribe, Error>
pub async fn describe_quick_action( &self, sobject: &str, action_name: &str, ) -> Result<QuickActionDescribe, Error>
Describe a specific quick action.
Action names can contain dots for SObject-scoped actions
(e.g., FeedItem.TextPost, FeedItem.ContentPost).
Sourcepub async fn invoke_quick_action(
&self,
sobject: &str,
action_name: &str,
body: &Value,
) -> Result<QuickActionResult, Error>
pub async fn invoke_quick_action( &self, sobject: &str, action_name: &str, body: &Value, ) -> Result<QuickActionResult, Error>
Invoke a quick action on an SObject.
Action names can contain dots for SObject-scoped actions
(e.g., FeedItem.TextPost, FeedItem.ContentPost).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn appointment_candidates(
&self,
request: &AppointmentCandidatesRequest,
) -> Result<AppointmentCandidatesResponse, Error>
pub async fn appointment_candidates( &self, request: &AppointmentCandidatesRequest, ) -> Result<AppointmentCandidatesResponse, Error>
Get appointment candidates based on scheduling parameters.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn search<T>(&self, sosl: &str) -> Result<SearchResult<T>, Error>where
T: DeserializeOwned,
pub async fn search<T>(&self, sosl: &str) -> Result<SearchResult<T>, Error>where
T: DeserializeOwned,
Execute a SOSL search.
§Security
IMPORTANT: If you are including user-provided values in the search term,
you MUST escape them. Use busbar_sf_client::security::soql::escape_string()
for string values in SOSL queries.
Sourcepub async fn parameterized_search(
&self,
request: &ParameterizedSearchRequest,
) -> Result<ParameterizedSearchResponse, Error>
pub async fn parameterized_search( &self, request: &ParameterizedSearchRequest, ) -> Result<ParameterizedSearchResponse, Error>
Execute a parameterized search request.
This provides a structured alternative to raw SOSL queries, with support for filtering by SObject type, field selection, and pagination.
Sourcepub async fn search_suggestions(
&self,
query: &str,
sobject: &str,
) -> Result<SearchSuggestionResult, Error>
pub async fn search_suggestions( &self, query: &str, sobject: &str, ) -> Result<SearchSuggestionResult, Error>
Get search suggestions (auto-complete) for a query string and SObject type.
Returns suggested records matching the query prefix.
Sourcepub async fn search_scope_order(&self) -> Result<Vec<ScopeEntity>, Error>
pub async fn search_scope_order(&self) -> Result<Vec<ScopeEntity>, Error>
Get the search scope order for the current user.
Returns the list of SObjects in the order they appear in the user’s search scope.
Sourcepub async fn search_result_layouts(
&self,
sobjects: &[&str],
) -> Result<Vec<SearchLayoutInfo>, Error>
pub async fn search_result_layouts( &self, sobjects: &[&str], ) -> Result<Vec<SearchLayoutInfo>, Error>
Get search result layouts for the specified SObject types.
Returns the columns displayed in search results for each SObject type.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn tabs(&self) -> Result<Vec<Value>, Error>
pub async fn tabs(&self) -> Result<Vec<Value>, Error>
Get all tabs available to the current user.
Returns information about all tabs, including custom tabs.
Sourcepub async fn theme(&self) -> Result<Value, Error>
pub async fn theme(&self) -> Result<Value, Error>
Get the current user’s theme information.
Returns theme colors, icons, and other UI customization data.
Get the app menu for a specific menu type.
§Arguments
app_menu_type- One of: “AppSwitcher”, “Salesforce1”, “NetworkTabs”
Sourcepub async fn recent_items(&self) -> Result<Vec<Value>, Error>
pub async fn recent_items(&self) -> Result<Vec<Value>, Error>
Get recently viewed items for the current user.
Returns a list of recently accessed records.
Sourcepub async fn relevant_items(&self) -> Result<Value, Error>
pub async fn relevant_items(&self) -> Result<Value, Error>
Get relevant items for the current user.
Returns items that Salesforce considers relevant based on the user’s activity.
Sourcepub async fn compact_layouts(&self, sobject_list: &str) -> Result<Value, Error>
pub async fn compact_layouts(&self, sobject_list: &str) -> Result<Value, Error>
Get compact layouts for multiple SObject types.
§Arguments
sobject_list- Comma-separated list of SObject API names (e.g., “Account,Contact”)
Sourcepub async fn platform_event_schema(
&self,
event_name: &str,
) -> Result<Value, Error>
pub async fn platform_event_schema( &self, event_name: &str, ) -> Result<Value, Error>
Get the event schema for a platform event.
§Arguments
event_name- The platform event API name (e.g., “MyEvent__e”)
Sourcepub async fn lightning_toggle_metrics(&self) -> Result<Value, Error>
pub async fn lightning_toggle_metrics(&self) -> Result<Value, Error>
Get Lightning Experience toggle metrics.
Returns metrics about Lightning Experience vs Classic usage.
Sourcepub async fn lightning_usage(&self) -> Result<Value, Error>
pub async fn lightning_usage(&self) -> Result<Value, Error>
Get Lightning Experience usage data.
Returns Lightning Experience usage statistics.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn get_deleted(
&self,
sobject: &str,
start: &str,
end: &str,
) -> Result<GetDeletedResult, Error>
pub async fn get_deleted( &self, sobject: &str, start: &str, end: &str, ) -> Result<GetDeletedResult, Error>
Get deleted records for an SObject type within a date range.
The start and end parameters should be ISO 8601 date-time strings (e.g., “2024-01-01T00:00:00Z”).
Sourcepub async fn get_updated(
&self,
sobject: &str,
start: &str,
end: &str,
) -> Result<GetUpdatedResult, Error>
pub async fn get_updated( &self, sobject: &str, start: &str, end: &str, ) -> Result<GetUpdatedResult, Error>
Get updated record IDs for an SObject type within a date range.
The start and end parameters should be ISO 8601 date-time strings (e.g., “2024-01-01T00:00:00Z”).
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub async fn get_user_password_status(
&self,
user_id: &str,
) -> Result<UserPasswordStatus, Error>
pub async fn get_user_password_status( &self, user_id: &str, ) -> Result<UserPasswordStatus, Error>
Get the password expiration status for a user.
Sourcepub async fn set_user_password(
&self,
user_id: &str,
request: &SetPasswordRequest,
) -> Result<(), Error>
pub async fn set_user_password( &self, user_id: &str, request: &SetPasswordRequest, ) -> Result<(), Error>
Set a user’s password.
Sourcepub async fn reset_user_password(
&self,
user_id: &str,
) -> Result<SetPasswordResponse, Error>
pub async fn reset_user_password( &self, user_id: &str, ) -> Result<SetPasswordResponse, Error>
Reset a user’s password.
Salesforce generates a new password and returns it in the response. This uses DELETE to trigger the reset.
Source§impl SalesforceRestClient
impl SalesforceRestClient
Sourcepub fn new(
instance_url: impl Into<String>,
access_token: impl Into<String>,
) -> Result<SalesforceRestClient, Error>
pub fn new( instance_url: impl Into<String>, access_token: impl Into<String>, ) -> Result<SalesforceRestClient, Error>
Create a new REST client with the given instance URL and access token.
Sourcepub fn with_config(
instance_url: impl Into<String>,
access_token: impl Into<String>,
config: ClientConfig,
) -> Result<SalesforceRestClient, Error>
pub fn with_config( instance_url: impl Into<String>, access_token: impl Into<String>, config: ClientConfig, ) -> Result<SalesforceRestClient, Error>
Create a new REST client with custom HTTP configuration.
Sourcepub fn from_client(client: SalesforceClient) -> SalesforceRestClient
pub fn from_client(client: SalesforceClient) -> SalesforceRestClient
Create a REST client from an existing SalesforceClient.
Sourcepub fn inner(&self) -> &SalesforceClient
pub fn inner(&self) -> &SalesforceClient
Get the underlying SalesforceClient.
Sourcepub fn instance_url(&self) -> &str
pub fn instance_url(&self) -> &str
Get the instance URL.
Sourcepub fn api_version(&self) -> &str
pub fn api_version(&self) -> &str
Get the API version.
Sourcepub fn with_api_version(
self,
version: impl Into<String>,
) -> SalesforceRestClient
pub fn with_api_version( self, version: impl Into<String>, ) -> SalesforceRestClient
Set the API version.
Trait Implementations§
Source§impl Clone for SalesforceRestClient
impl Clone for SalesforceRestClient
Source§fn clone(&self) -> SalesforceRestClient
fn clone(&self) -> SalesforceRestClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more