pub struct LinkyUseCases { /* private fields */ }Expand description
Use cases for managing Linky devices and syncing data
Implementations§
Source§impl LinkyUseCases
impl LinkyUseCases
pub fn new( iot_repo: Arc<dyn IoTRepository>, linky_client: Arc<dyn LinkyApiClient>, oauth_redirect_uri: String, ) -> Self
Sourcepub async fn configure_linky_device(
&self,
dto: ConfigureLinkyDeviceDto,
user_id: Uuid,
organization_id: Uuid,
) -> Result<LinkyDeviceResponseDto, String>
pub async fn configure_linky_device( &self, dto: ConfigureLinkyDeviceDto, user_id: Uuid, organization_id: Uuid, ) -> Result<LinkyDeviceResponseDto, String>
Configure a new Linky device for a building
Sourcepub async fn sync_linky_data(
&self,
dto: SyncLinkyDataDto,
user_id: Uuid,
organization_id: Uuid,
) -> Result<LinkySyncResponseDto, String>
pub async fn sync_linky_data( &self, dto: SyncLinkyDataDto, user_id: Uuid, organization_id: Uuid, ) -> Result<LinkySyncResponseDto, String>
Sync data from Linky API for a building
Sourcepub async fn get_linky_device(
&self,
building_id: Uuid,
) -> Result<LinkyDeviceResponseDto, String>
pub async fn get_linky_device( &self, building_id: Uuid, ) -> Result<LinkyDeviceResponseDto, String>
Get Linky device information for a building
Sourcepub async fn delete_linky_device(
&self,
building_id: Uuid,
user_id: Uuid,
organization_id: Uuid,
) -> Result<(), String>
pub async fn delete_linky_device( &self, building_id: Uuid, user_id: Uuid, organization_id: Uuid, ) -> Result<(), String>
Delete Linky device configuration
Sourcepub async fn toggle_sync(
&self,
building_id: Uuid,
enabled: bool,
user_id: Uuid,
organization_id: Uuid,
) -> Result<LinkyDeviceResponseDto, String>
pub async fn toggle_sync( &self, building_id: Uuid, enabled: bool, user_id: Uuid, organization_id: Uuid, ) -> Result<LinkyDeviceResponseDto, String>
Enable/disable sync for a Linky device
Sourcepub async fn find_devices_needing_sync(
&self,
) -> Result<Vec<LinkyDeviceResponseDto>, String>
pub async fn find_devices_needing_sync( &self, ) -> Result<Vec<LinkyDeviceResponseDto>, String>
Find devices that need syncing (enabled, not synced recently)
Sourcepub async fn find_devices_with_expired_tokens(
&self,
) -> Result<Vec<LinkyDeviceResponseDto>, String>
pub async fn find_devices_with_expired_tokens( &self, ) -> Result<Vec<LinkyDeviceResponseDto>, String>
Find devices with expired tokens
Auto Trait Implementations§
impl Freeze for LinkyUseCases
impl !RefUnwindSafe for LinkyUseCases
impl Send for LinkyUseCases
impl Sync for LinkyUseCases
impl Unpin for LinkyUseCases
impl !UnwindSafe for LinkyUseCases
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.