pub struct LocationsApi { /* private fields */ }
Expand description
Get a list of all a seller’s locations.
Implementations§
Source§impl LocationsApi
impl LocationsApi
Sourcepub fn new(config: Configuration, client: HttpClient) -> Self
pub fn new(config: Configuration, client: HttpClient) -> Self
Instantiates a new LocationsApi
Sourcepub async fn list_locations(&self) -> Result<ListLocationsResponse, ApiError>
pub async fn list_locations(&self) -> Result<ListLocationsResponse, ApiError>
Provides details about all of the seller’s locations, including those with an inactive status.
Sourcepub async fn create_location(
&self,
body: &CreateLocationRequest,
) -> Result<CreateLocationResponse, ApiError>
pub async fn create_location( &self, body: &CreateLocationRequest, ) -> Result<CreateLocationResponse, ApiError>
Creates a location.
Creating new locations allows for separate configuration of receipt layouts, item prices, and sales reports. Developers can use locations to separate sales activity through applications that integrate with Square from sales activity elsewhere in a seller’s account. Locations created programmatically with the Locations API last forever and are visible to the seller for their own management. Therefore, ensure that each location has a sensible and unique name.
Sourcepub async fn retrieve_location(
&self,
location_id: &str,
) -> Result<RetrieveLocationResponse, ApiError>
pub async fn retrieve_location( &self, location_id: &str, ) -> Result<RetrieveLocationResponse, ApiError>
Retrieves details of a single location.
Specify “main” as the location ID to retrieve details of the main location.
Sourcepub async fn update_location(
&self,
location_id: &str,
body: &UpdateLocationRequest,
) -> Result<UpdateLocationResponse, ApiError>
pub async fn update_location( &self, location_id: &str, body: &UpdateLocationRequest, ) -> Result<UpdateLocationResponse, ApiError>
Updates a location.