Struct square_rust::square_client::SquareApiClient
source · pub struct SquareApiClient {
pub customers: CustomersApi,
}
Expand description
The SquareApiClient is the main entry point for making requests to the Square API
Fields§
§customers: CustomersApi
Implementations§
source§impl SquareApiClient
impl SquareApiClient
sourcepub fn try_new(config: Option<SquareApiConfig>) -> Result<Self, SquareApiError>
pub fn try_new(config: Option<SquareApiConfig>) -> Result<Self, SquareApiError>
Create a new SquareApiClient
Example - Create a new SquareApiClient with Sandbox environment and default http client
use square_rust::square_client::SquareApiClient;
use square_rust::config::SquareApiConfig;
use square_rust::environment::Environment;
let config = SquareApiConfig::builder()
.environment(Environment::Sandbox)
.access_token("access_token".to_string())
.build();
Example - Create a new SquareApiClient with Production environment and default http client
use square_rust::square_client::SquareApiClient;
use square_rust::config::SquareApiConfig;
use square_rust::environment::Environment;
let config = SquareApiConfig::builder()
.environment(Environment::Production)
.access_token("access_token".to_string())
.build();
Auto Trait Implementations§
impl !RefUnwindSafe for SquareApiClient
impl Send for SquareApiClient
impl Sync for SquareApiClient
impl Unpin for SquareApiClient
impl !UnwindSafe for SquareApiClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more