|
| 1 | +class Empty(object): |
| 2 | + |
| 3 | + def __init__(self): |
| 4 | + pass |
| 5 | + |
| 6 | +class Space(object): |
| 7 | + """ |
| 8 | + The space quota info for a user. |
| 9 | + """ |
| 10 | + |
| 11 | + def __init__(self, |
| 12 | + quota, |
| 13 | + private, |
| 14 | + shared, |
| 15 | + datastores): |
| 16 | + # The user's total quota allocation (bytes). |
| 17 | + self.quota = quota |
| 18 | + # The user's used quota outside of shared folders (bytes). |
| 19 | + self.private = private |
| 20 | + # The user's used quota in shared folders (bytes). |
| 21 | + self.shared = shared |
| 22 | + # The user's used quota in datastores (bytes). |
| 23 | + self.datastores = datastores |
| 24 | + |
| 25 | +class Team(object): |
| 26 | + """ |
| 27 | + Information about a team. |
| 28 | + """ |
| 29 | + |
| 30 | + def __init__(self, |
| 31 | + id, |
| 32 | + name): |
| 33 | + # The team's unique ID. |
| 34 | + self.id = id |
| 35 | + # The name of the team. |
| 36 | + self.name = name |
| 37 | + |
| 38 | +class Name(object): |
| 39 | + """ |
| 40 | + Contains several ways a name might be represented to make |
| 41 | + internationalization more convenient. |
| 42 | + """ |
| 43 | + |
| 44 | + def __init__(self, |
| 45 | + given_name, |
| 46 | + surname, |
| 47 | + familiar_name, |
| 48 | + display_name): |
| 49 | + # Also known as a first name. |
| 50 | + self.given_name = given_name |
| 51 | + # Also known as a last name or family name. |
| 52 | + self.surname = surname |
| 53 | + # Locale-dependent familiar name. Generally matches :field:`given_name` |
| 54 | + # or :field:`display_name`. |
| 55 | + self.familiar_name = familiar_name |
| 56 | + # A name that can be used directly to represent the name of a user's |
| 57 | + # Dropbox account. |
| 58 | + self.display_name = display_name |
| 59 | + |
| 60 | +class BasicAccountInfo(object): |
| 61 | + """ |
| 62 | + Basic information about a user's account. |
| 63 | + """ |
| 64 | + |
| 65 | + def __init__(self, |
| 66 | + account_id, |
| 67 | + name): |
| 68 | + # The user's unique Dropbox ID. |
| 69 | + self.account_id = account_id |
| 70 | + # Details of a user's name. |
| 71 | + self.name = name |
| 72 | + |
| 73 | +class MeInfo(object): |
| 74 | + """ |
| 75 | + Information about a user's account. |
| 76 | + """ |
| 77 | + |
| 78 | + def __init__(self, |
| 79 | + email, |
| 80 | + country, |
| 81 | + locale, |
| 82 | + referral_link, |
| 83 | + space, |
| 84 | + team, |
| 85 | + is_paired): |
| 86 | + # The user's e-mail address. |
| 87 | + self.email = email |
| 88 | + # The user's two-letter country code, if available. |
| 89 | + self.country = country |
| 90 | + # The language setting that user specified. |
| 91 | + self.locale = locale |
| 92 | + # The user's :link:`referral link https://www.dropbox.com/referrals`. |
| 93 | + self.referral_link = referral_link |
| 94 | + # The user's quota. |
| 95 | + self.space = space |
| 96 | + # If this account is a member of a team. |
| 97 | + self.team = team |
| 98 | + # Whether the user has a personal and work account. If the authorized |
| 99 | + # account is personal, then :field:`team` will always be :val:`Null`, |
| 100 | + # but :field:`is_paired` will indicate if a work account is linked. |
| 101 | + self.is_paired = is_paired |
| 102 | + |
| 103 | +class InfoRequest(object): |
| 104 | + |
| 105 | + def __init__(self, |
| 106 | + account_id): |
| 107 | + # A user's account identifier. Use :val:`"me"` to get information for |
| 108 | + # the current account. |
| 109 | + self.account_id = account_id |
| 110 | + |
0 commit comments