-module(rocksky@googledrive).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/rocksky/googledrive.gleam").
-export([get_files/0, with_at/2, get_file/1, download_file/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
?MODULEDOC(" `app.rocksky.googledrive.*` — read files from the user's connected Drive.\n").
-file("src/rocksky/googledrive.gleam", 8).
?DOC(" `app.rocksky.googledrive.getFiles` — list files. Use `with_at` for a path.\n").
-spec get_files() -> rocksky:request(gleam@dynamic:dynamic_()).
get_files() ->
rocksky:'query'(
<<"app.rocksky.googledrive.getFiles"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1}
).
-file("src/rocksky/googledrive.gleam", 12).
-spec with_at(rocksky:request(HSW), binary()) -> rocksky:request(HSW).
with_at(Req, At) ->
rocksky:param(Req, <<"at"/utf8>>, At).
-file("src/rocksky/googledrive.gleam", 17).
?DOC(" `app.rocksky.googledrive.getFile` — get a single file by id.\n").
-spec get_file(binary()) -> rocksky:request(gleam@dynamic:dynamic_()).
get_file(File_id) ->
_pipe = rocksky:'query'(
<<"app.rocksky.googledrive.getFile"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1}
),
rocksky:param(_pipe, <<"fileId"/utf8>>, File_id).
-file("src/rocksky/googledrive.gleam", 23).
?DOC(" `app.rocksky.googledrive.downloadFile` — proxy a file download.\n").
-spec download_file(binary()) -> rocksky:request(gleam@dynamic:dynamic_()).
download_file(File_id) ->
_pipe = rocksky:'query'(
<<"app.rocksky.googledrive.downloadFile"/utf8>>,
{decoder, fun gleam@dynamic@decode:decode_dynamic/1}
),
rocksky:param(_pipe, <<"fileId"/utf8>>, File_id).