When a request is made, it returns application information and caches it in the Application object itself. This is useful if you need to access this information again in a relatively short time, meaning it’s not worth making a new API request for updated data. In such cases, you can access Application.cache.
Copy
Ask AI
import squarecloud as squareclient = square.Client('API_KEY')async def example(): app = await client.app('application_id') # Note that, as no requests have been made, * in the cache will be None print(app.cache.logs) # None print(app.cache.status) # None print(app.cache.backup) # None # Now let's make some requests await app.logs() await app.status() await app.backup() # The cache has been updated 🤯 print(app.cache.logs) # LogsData(...) print(app.cache.status) # StatusData(...) print(app.cache.backup) # BackupData(...)