google_api_rust_client_unoffical/services/route_service/
mod.rs1
2
3use crate::auth::service_account::ServiceAccountCredentials;
4use super::ServiceBase;
5
6pub mod get_route;
7pub mod get_route_matrix;
8pub mod common_models;
9
10static ROUTE_SERVICE_SCOPE: &str = "https://www.googleapis.com/auth/cloud-platform";
11static GET_ROUTE_URL: &str = "https://routes.googleapis.com/directions/v2:computeRoutes";
12static GET_ROUTE_MATRIX_URL: &str = "https://routes.googleapis.com/distanceMatrix/v2:computeRouteMatrix";
13
14#[derive(Debug, Clone)]
15pub struct RouteService {
16 base: ServiceBase
17}
18
19
20impl RouteService {
21 pub fn new_with_api_key(api_key: String) -> Self {
25 return Self { base: ServiceBase::new_with_api_key(api_key) }
26 }
27
28 pub fn new_with_credentials(service_account_credentials: ServiceAccountCredentials) -> Self {
32 return Self { base: ServiceBase::new_with_credentials(service_account_credentials, vec![ROUTE_SERVICE_SCOPE]) }
33 }
34}