WaifuVault (waifu_vault v0.0.2)
This API wrapper is meant to conform to the WaifuVault Swagger docs.
require WaifuVault
Summary
Albums
The create_album/2 creates an album within the specified bucket.
The get_album/1 function returns album info, given either the public or private token.
Buckets
Buckets are virtual collections that are linked to your IP and a token. When you create a bucket, you will receive a bucket token that you can use in Get Bucket to get all the files in that bucket
Deleting a bucket will delete the bucket and all the files it contains.
The get_bucket/1 function returns the list of files and albums contained in a bucket.
The bucket has a dateCreated
value that can be converted
with DateTime.from_unix( dateCreated, :millisecond)
Albums
The create_album/2 creates an album within the specified bucket.
Examples
iex> {:ok, album} = waifuvault.create_album("some-bucket-token", "album-name")
{:ok, Map}
The get_album/1 function returns album info, given either the public or private token.
Examples
iex> {:ok, boolean} = WaifuVault.get_album("some-valid-album-token")
{:ok, Map}
Buckets
Buckets are virtual collections that are linked to your IP and a token. When you create a bucket, you will receive a bucket token that you can use in Get Bucket to get all the files in that bucket
NOTE: Only one bucket is allowed per client IP address, if you call it more than once, it will return the same bucket token
To create a bucket, use the create_bucket function. This function does not take any arguments.
Examples
iex> {:ok, bucket} = WaifuVault.create_bucket()
{:ok, "some-uuid-type-value"}
Deleting a bucket will delete the bucket and all the files it contains.
IMPORTANT: All contained files will be DELETED along with the Bucket!
Examples
iex> {:ok, boolean} = WaifuVault.delete_bucket("some-valid-uuid-token")
{:ok, true}
The get_bucket/1 function returns the list of files and albums contained in a bucket.
The bucket has a dateCreated
value that can be converted
with DateTime.from_unix( dateCreated, :millisecond)
Individual files have a retentionPeriod
which is the UNIX timestamp in milliseconds for when the
file will expire. It can be converted with DateTime.from_unix( retentionPeriod, :millisecond)
Examples
iex> {:ok, boolean} = WaifuVault.get_bucket("some-valid-uuid-token")
{:ok, Map}