package Ġcom . sam ur ain om ichi . cloud _ storage _ client . cloud storage Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . sam ur ain om ichi . cloud _ storage _ client . model . Structure Ċ import Ġcom . sam ur ain om ichi . cloud _ storage _ client . network . Connection Repository Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . launch Ċ Ċ class ĠCloud Storage ViewModel Ġ: ĠViewModel () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġrepository Ġ= ĠConnection Repository . getInstance () ĊĠĠĠ Ġprivate Ġval Ġ_ structures Ġ= ĠMutable LiveData < List < Structure >>() ĊĠĠĠ Ġval Ġstructures : ĠLive Data < List < Structure >> ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ structures ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ_ structures . post Value ( repository . p mt Available Structure ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrepository . on Structure Updated . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠ Ġ_ structures . value Ġ= Ġit ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }