[−][src]Struct rustforce::client::Client
Represents a Salesforce Client
Implementations
impl Client
[src]
pub fn new(client_id: String, client_secret: String) -> Client
[src]
Creates a new client when passed a Client ID and Client Secret. These can be obtained by creating a connected app in Salesforce
pub fn set_login_endpoint(&mut self, endpoint: &str)
[src]
Set the login endpoint. This is useful if you want to connect to a Sandbox
pub fn set_version(&mut self, version: &str)
[src]
Set API Version
pub fn set_instance_url(&mut self, instance_url: &str)
[src]
pub fn set_access_token(&mut self, access_token: &str)
[src]
Set Access token if you've already obtained one via one of the OAuth2 flows
pub async fn refresh<'_, '_>(
&'_ mut self,
refresh_token: &'_ str
) -> Result<(), Error>
[src]
&'_ mut self,
refresh_token: &'_ str
) -> Result<(), Error>
This will fetch an access token when provided with a refresh token
pub async fn login_with_credential<'_>(
&'_ mut self,
username: String,
password: String
) -> Result<(), Error>
[src]
&'_ mut self,
username: String,
password: String
) -> Result<(), Error>
Login to Salesforce with username and password
pub async fn query<T: DeserializeOwned, '_, '_>(
&'_ self,
query: &'_ str
) -> Result<QueryResponse<T>, Error>
[src]
&'_ self,
query: &'_ str
) -> Result<QueryResponse<T>, Error>
Query record using SOQL
pub async fn query_all<T: DeserializeOwned, '_, '_>(
&'_ self,
query: &'_ str
) -> Result<QueryResponse<T>, Error>
[src]
&'_ self,
query: &'_ str
) -> Result<QueryResponse<T>, Error>
Query All records using SOQL
pub async fn search<'_, '_>(
&'_ self,
query: &'_ str
) -> Result<SearchResponse, Error>
[src]
&'_ self,
query: &'_ str
) -> Result<SearchResponse, Error>
Find records using SOSL
pub async fn versions<'_>(&'_ self) -> Result<Vec<VersionResponse>, Error>
[src]
Get all supported API versions
pub async fn find_by_id<T: DeserializeOwned, '_, '_, '_>(
&'_ self,
sobject_name: &'_ str,
id: &'_ str
) -> Result<T, Error>
[src]
&'_ self,
sobject_name: &'_ str,
id: &'_ str
) -> Result<T, Error>
Finds a record by ID
pub async fn create<T: Serialize, '_, '_>(
&'_ self,
sobject_name: &'_ str,
params: T
) -> Result<CreateResponse, Error>
[src]
&'_ self,
sobject_name: &'_ str,
params: T
) -> Result<CreateResponse, Error>
Creates an SObject
pub async fn update<T: Serialize, '_, '_, '_>(
&'_ self,
sobject_name: &'_ str,
id: &'_ str,
params: T
) -> Result<(), Error>
[src]
&'_ self,
sobject_name: &'_ str,
id: &'_ str,
params: T
) -> Result<(), Error>
Updates an SObject
pub async fn upsert<T: Serialize, '_, '_, '_, '_>(
&'_ self,
sobject_name: &'_ str,
key_name: &'_ str,
key: &'_ str,
params: T
) -> Result<Option<CreateResponse>, Error>
[src]
&'_ self,
sobject_name: &'_ str,
key_name: &'_ str,
key: &'_ str,
params: T
) -> Result<Option<CreateResponse>, Error>
Upserts an SObject with key
pub async fn destroy<'_, '_, '_>(
&'_ self,
sobject_name: &'_ str,
id: &'_ str
) -> Result<(), Error>
[src]
&'_ self,
sobject_name: &'_ str,
id: &'_ str
) -> Result<(), Error>
Deletes an SObject
pub async fn describe_global<'_>(
&'_ self
) -> Result<DescribeGlobalResponse, Error>
[src]
&'_ self
) -> Result<DescribeGlobalResponse, Error>
Describes all objects
pub async fn describe<'_, '_>(
&'_ self,
sobject_name: &'_ str
) -> Result<DescribeResponse, Error>
[src]
&'_ self,
sobject_name: &'_ str
) -> Result<DescribeResponse, Error>
Describes specific object
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,