File: Users.pm

package info (click to toggle)
libwebservice-dropbox-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 360 kB
  • sloc: perl: 885; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,314 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package WebService::Dropbox::Users;
use strict;
use warnings;
use parent qw(Exporter);

our @EXPORT = do {
    no strict 'refs';
    grep { $_ !~ qr{ \A [A-Z]+ \z }xms } keys %{ __PACKAGE__ . '::' };
};

# https://www.dropbox.com/developers/documentation/http/documentation#users-get_account
sub get_account {
    my ($self, $account_id) = @_;

    $self->api({
        url => 'https://api.dropboxapi.com/2/users/get_account',
        params => {
            account_id => $account_id,
        },
    });
}

# https://www.dropbox.com/developers/documentation/http/documentation#users-get_account_batch
sub get_account_batch {
    my ($self, $account_ids) = @_;

    $self->api({
        url => 'https://api.dropboxapi.com/2/users/get_account_batch',
        params => {
            account_ids => $account_ids,
        },
    });
}

# https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account
sub get_current_account {
    my ($self) = @_;

    $self->api({
        url => 'https://api.dropboxapi.com/2/users/get_current_account',
    });
}

# https://www.dropbox.com/developers/documentation/http/documentation#users-get_space_usage
sub get_space_usage {
    my ($self) = @_;

    $self->api({
        url => 'https://api.dropboxapi.com/2/users/get_space_usage',
    });
}

1;