Magpie.Sharing (Magpie v0.1.0)

Copy Markdown View Source

Endpoints for creating and managing shared links and shared folders.

Summary

Functions

Adds specified members to a file. members is a list of MemberSelector maps, e.g. %{".tag" => "email", "email" => "a@b.com"}; opts accepts "custom_message", "quiet", "access_level" and "add_message_as_comment".

Allows an owner/editor to add members to a shared folder. members is a list of AddMember maps; opts accepts "quiet" and "custom_message".

Returns the status of an asynchronous sharing job.

Returns the status of an asynchronous member-removal job.

Returns the status of an asynchronous share-folder job.

Create a shared link with custom settings, returns a map.

Same as create_shared_link/3 but returns {:ok, %Magpie.SharedLink{}}.

Returns shared file metadata. file is a path or file id; opts accepts "actions".

Returns shared file metadata for a batch of files.

Returns shared folder metadata. opts accepts "actions".

Download the shared link's file from a user's Dropbox. opts accepts "path" and "link_password".

Get the metadata of a shared link. opts accepts "path" and "link_password".

List the members of a file. opts accepts "actions", "include_inherited" and "limit".

List the members of multiple files at once.

Fetches the next page of results from list_file_members/3.

List the members of a shared folder. opts accepts "actions" and "limit".

Return the list of all shared folders the current user has access to. opts accepts "limit" and "actions".

Fetches the next page of results from list_folders/2.

Returns a lazy Stream over all shared folders of the current user, fetching pages through list_folders/2 + list_folders_continue/2 on demand. Raises Magpie.Error if a page request fails.

Return the list of all shared folders the current user can mount or unmount. opts accepts "limit" and "actions".

Returns a list of files shared with the current user. opts accepts "limit" and "actions".

List shared links of this user. opts accepts "path", "cursor" and "direct_only".

Modify the settings of a shared link. settings takes the SharedLinkSettings fields.

Mount a shared folder into the current user's Dropbox.

The current user relinquishes their access to a file by id.

The current user relinquishes their membership in a shared file.

The current user relinquishes their membership in a shared folder.

Removes a specified member from the file. member is a MemberSelector map.

Removes a member from a shared folder. member is a MemberSelector map.

Revoke a shared link.

Sets the access inheritance of a shared folder ("inherit" or "no_inherit").

Share a folder with collaborators. opts accepts the ShareFolderArg fields ("acl_update_policy", "member_policy", "shared_link_policy", "viewer_info_policy", "access_inheritance", "force_async", ...).

Transfer ownership of a shared folder to another member.

Unmount a shared folder from the current user's Dropbox.

Remove all members from this file (does not remove inherited membership).

Changes a member's access on a shared file.

Changes the policies of a shared file. opts accepts "actions", "link_settings" and "viewer_info_policy".

Changes a member's access on a shared folder.

Update the sharing policies for a shared folder. opts accepts "member_policy", "acl_update_policy", "viewer_info_policy", "shared_link_policy", "link_settings" and "actions".

Functions

add_file_member(client, file, members, opts \\ %{})

Adds specified members to a file. members is a list of MemberSelector maps, e.g. %{".tag" => "email", "email" => "a@b.com"}; opts accepts "custom_message", "quiet", "access_level" and "add_message_as_comment".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-add_file_member

add_folder_member(client, shared_folder_id, members, opts \\ %{})

Allows an owner/editor to add members to a shared folder. members is a list of AddMember maps; opts accepts "quiet" and "custom_message".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-add_folder_member

check_job_status(client, async_job_id)

Returns the status of an asynchronous sharing job.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-check_job_status

check_remove_member_job_status(client, async_job_id)

Returns the status of an asynchronous member-removal job.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-check_remove_member_job_status

check_share_job_status(client, async_job_id)

Returns the status of an asynchronous share-folder job.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-check_share_job_status

create_shared_link(client, path, settings \\ %{})

@spec create_shared_link(Magpie.Client.t(), binary(), map()) :: Magpie.response()

Create a shared link with custom settings, returns a map.

settings accepts the SharedLinkSettings fields, e.g. %{"audience" => "public", "access" => "viewer"}.

Example

Magpie.Sharing.create_shared_link client, "/Path"

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-create_shared_link_with_settings

get_file_metadata(client, file, opts \\ %{})

Returns shared file metadata. file is a path or file id; opts accepts "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_file_metadata

get_file_metadata_batch(client, files, opts \\ %{})

Returns shared file metadata for a batch of files.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_file_metadata-batch

get_folder_metadata(client, shared_folder_id, opts \\ %{})

Returns shared folder metadata. opts accepts "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-get_folder_metadata

list_file_members(client, file, opts \\ %{})

List the members of a file. opts accepts "actions", "include_inherited" and "limit".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_file_members

list_file_members_batch(client, files, opts \\ %{})

List the members of multiple files at once.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_file_members-batch

list_file_members_continue(client, cursor)

Fetches the next page of results from list_file_members/3.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_file_members-continue

list_folder_members(client, shared_folder_id, opts \\ %{})

List the members of a shared folder. opts accepts "actions" and "limit".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_folder_members

list_folder_members_continue(client, cursor)

Fetches the next page of results from list_folder_members/3.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_folder_members-continue

list_folders(client, opts \\ %{})

Return the list of all shared folders the current user has access to. opts accepts "limit" and "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_folders

list_folders_continue(client, cursor)

Fetches the next page of results from list_folders/2.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_folders-continue

list_folders_stream(client, opts \\ %{})

Returns a lazy Stream over all shared folders of the current user, fetching pages through list_folders/2 + list_folders_continue/2 on demand. Raises Magpie.Error if a page request fails.

Example

client
|> Magpie.Sharing.list_folders_stream()
|> Enum.map(& &1["name"])

list_mountable_folders(client, opts \\ %{})

Return the list of all shared folders the current user can mount or unmount. opts accepts "limit" and "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_mountable_folders

list_mountable_folders_continue(client, cursor)

Fetches the next page of results from list_mountable_folders/2.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_mountable_folders-continue

list_received_files(client, opts \\ %{})

Returns a list of files shared with the current user. opts accepts "limit" and "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_received_files

list_received_files_continue(client, cursor)

Fetches the next page of results from list_received_files/2.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_received_files-continue

list_shared_links(client, opts \\ %{})

List shared links of this user. opts accepts "path", "cursor" and "direct_only".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-list_shared_links

mount_folder(client, shared_folder_id)

Mount a shared folder into the current user's Dropbox.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-mount_folder

relinquish_access(client, file_id)

The current user relinquishes their access to a file by id.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-relinquish_access

relinquish_file_membership(client, file)

The current user relinquishes their membership in a shared file.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-relinquish_file_membership

relinquish_folder_membership(client, shared_folder_id, leave_a_copy \\ false)

The current user relinquishes their membership in a shared folder.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-relinquish_folder_membership

remove_file_member(client, file, member)

Removes a specified member from the file. member is a MemberSelector map.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-remove_file_member_2

remove_folder_member(client, shared_folder_id, member, leave_a_copy \\ false)

Removes a member from a shared folder. member is a MemberSelector map.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-remove_folder_member

revoke_shared_link(client, url)

Revoke a shared link.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-revoke_shared_link

set_access_inheritance(client, shared_folder_id, access_inheritance \\ "inherit")

Sets the access inheritance of a shared folder ("inherit" or "no_inherit").

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-set_access_inheritance

share_folder(client, path, opts \\ %{})

Share a folder with collaborators. opts accepts the ShareFolderArg fields ("acl_update_policy", "member_policy", "shared_link_policy", "viewer_info_policy", "access_inheritance", "force_async", ...).

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-share_folder

transfer_folder(client, shared_folder_id, to_dropbox_id)

Transfer ownership of a shared folder to another member.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-transfer_folder

unmount_folder(client, shared_folder_id)

Unmount a shared folder from the current user's Dropbox.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-unmount_folder

unshare_file(client, file)

Remove all members from this file (does not remove inherited membership).

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-unshare_file

unshare_folder(client, shared_folder_id, leave_a_copy \\ false)

Allows the owner to unshare a folder.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-unshare_folder

update_file_member(client, file, member, access_level)

Changes a member's access on a shared file.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-update_file_member

update_file_policy(client, file, opts \\ %{})

Changes the policies of a shared file. opts accepts "actions", "link_settings" and "viewer_info_policy".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-update_file_policy

update_folder_member(client, shared_folder_id, member, access_level)

Changes a member's access on a shared folder.

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-update_folder_member

update_folder_policy(client, shared_folder_id, opts \\ %{})

Update the sharing policies for a shared folder. opts accepts "member_policy", "acl_update_policy", "viewer_info_policy", "shared_link_policy", "link_settings" and "actions".

More info at: https://www.dropbox.com/developers/documentation/http/documentation#sharing-update_folder_policy