# `Magpie.Sharing`
[🔗](https://github.com/alexcassol/magpie/blob/v0.3.1/lib/magpie/sharing.ex#L1)

Endpoints for creating and managing shared links and shared folders.

# `add_file_member`

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`

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`

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`

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`

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`

```elixir
@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

# `create_shared_link_to_struct`

```elixir
@spec create_shared_link_to_struct(Magpie.Client.t(), binary()) ::
  {:ok, Magpie.SharedLink.t()} | {:error, Magpie.Error.t()}
```

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

## Example

  Magpie.Sharing.create_shared_link_to_struct client, "/Path"

# `get_file_metadata`

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`

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`

Returns shared folder metadata. `opts` accepts `"actions"`.

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

# `get_shared_link_file`

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

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

# `get_shared_link_metadata`

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

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

# `list_file_members`

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`

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`

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`

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`

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`

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`

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`

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`

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`

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`

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`

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`

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

# `modify_shared_link_settings`

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

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

# `mount_folder`

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`

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`

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`

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`

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`

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`

Revoke a shared link.

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

# `set_access_inheritance`

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`

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`

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`

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`

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`

Allows the owner to unshare a folder.

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

# `update_file_member`

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`

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`

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`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
