[][src]Struct rustforce::client::Client

pub struct Client { /* fields omitted */ }

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]

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]

Login to Salesforce with username and password

pub async fn query<T: DeserializeOwned, '_, '_>(
    &'_ self,
    query: &'_ str
) -> Result<QueryResponse<T>, Error>
[src]

Query record using SOQL

pub async fn query_all<T: DeserializeOwned, '_, '_>(
    &'_ self,
    query: &'_ str
) -> Result<QueryResponse<T>, Error>
[src]

Query All records using SOQL

pub async fn search<'_, '_>(
    &'_ self,
    query: &'_ str
) -> Result<SearchResponse, Error>
[src]

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]

Finds a record by ID

pub async fn create<T: Serialize, '_, '_>(
    &'_ self,
    sobject_name: &'_ str,
    params: T
) -> Result<CreateResponse, Error>
[src]

Creates an SObject

pub async fn update<T: Serialize, '_, '_, '_>(
    &'_ self,
    sobject_name: &'_ str,
    id: &'_ str,
    params: T
) -> Result<(), Error>
[src]

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]

Upserts an SObject with key

pub async fn destroy<'_, '_, '_>(
    &'_ self,
    sobject_name: &'_ str,
    id: &'_ str
) -> Result<(), Error>
[src]

Deletes an SObject

pub async fn describe_global<'_>(
    &'_ self
) -> Result<DescribeGlobalResponse, Error>
[src]

Describes all objects

pub async fn describe<'_, '_>(
    &'_ self,
    sobject_name: &'_ str
) -> Result<DescribeResponse, Error>
[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,