fluminus v0.1.2 Fluminus.API.File View Source
Provides an abstraction over a file/directory in LumiNUS, and operations possible on them using LumiNUS API.
Struct fields:
:id
- id of the file:name
- the name of the file:directory?
- whether this file is a directory:children
-nil
indicated the need to fetch, otherwise it contains a list of its children. ifdirectory?
isfalse
, then this field contains an empty list.
Link to this section Summary
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: %Fluminus.API.File{
children: [Fluminus.API.File.t()] | nil,
directory?: bool(),
id: String.t(),
name: String.t()
}
t() :: %Fluminus.API.File{ children: [Fluminus.API.File.t()] | nil, directory?: bool(), id: String.t(), name: String.t() }
Link to this section Functions
Link to this function
download(file, auth, path)
View Source
download(file, auth, path)
View Source
download(Fluminus.API.File.t(), Fluminus.Authorization.t(), Path.t()) ::
:ok | {:error, :exists | any()}
download(Fluminus.API.File.t(), Fluminus.Authorization.t(), Path.t()) :: :ok | {:error, :exists | any()}
Downloads the given file to the location specified by path
.
This function will return {:error, :exists}
if the file already exists in the given path
Link to this function
from_module(module, auth)
View Source
from_module(module, auth)
View Source
from_module(Fluminus.API.Module.t(), Fluminus.Authorization.t()) ::
Fluminus.API.File.t()
from_module(Fluminus.API.Module.t(), Fluminus.Authorization.t()) :: Fluminus.API.File.t()
Creates Elixir.Fluminus.API.File
struct from a Module
.
Link to this function
get_download_url(file, auth)
View Source
get_download_url(file, auth)
View Source
get_download_url(Fluminus.API.File.t(), Fluminus.Authorization.t()) ::
String.t()
get_download_url(Fluminus.API.File.t(), Fluminus.Authorization.t()) :: String.t()
Obtains the download url for a given file.
Note that the download url of a directory is a url to that directory zipped.
Link to this function
load_children(file, auth)
View Source
load_children(file, auth)
View Source
load_children(Fluminus.API.File.t(), Fluminus.Authorization.t()) ::
Fluminus.API.File.t()
load_children(Fluminus.API.File.t(), Fluminus.Authorization.t()) :: Fluminus.API.File.t()
Loads the children of a given Elixir.Fluminus.API.File
struct.