1[ 2 { 3 "namespace": "manifest", 4 "types": [ 5 { 6 "$extend": "OptionalPermission", 7 "choices": [ 8 { 9 "type": "string", 10 "enum": [ 11 "accountsRead" 12 ] 13 } 14 ] 15 } 16 ] 17 }, 18 { 19 "namespace": "accounts", 20 "permissions": [ 21 "accountsRead" 22 ], 23 "types": [ 24 { 25 "id": "MailAccount", 26 "description": "An object describing a mail account, as returned for example by the :ref:`accounts.list` and :ref:`accounts.get` methods. The ``folders`` property is only included if requested.", 27 "type": "object", 28 "properties": { 29 "id": { 30 "type": "string", 31 "description": "A unique identifier for this account." 32 }, 33 "name": { 34 "type": "string", 35 "description": "The human-friendly name of this account." 36 }, 37 "type": { 38 "type": "string", 39 "description": "What sort of account this is, e.g. ``imap``, ``nntp``, or ``pop3``." 40 }, 41 "folders": { 42 "type": "array", 43 "optional": true, 44 "description": "The folders for this account are only included if requested.", 45 "items": { 46 "$ref": "folders.MailFolder" 47 } 48 }, 49 "identities": { 50 "type": "array", 51 "description": "The identities associated with this account. The default identity is listed first, others in no particular order.", 52 "items": { 53 "$ref": "identities.MailIdentity" 54 } 55 } 56 } 57 } 58 ], 59 "functions": [ 60 { 61 "name": "list", 62 "type": "function", 63 "description": "Returns all mail accounts.", 64 "async": "callback", 65 "parameters": [ 66 { 67 "name": "includeFolders", 68 "description": "Specifies whether the returned :ref:`accounts.MailAccount` objects should included their account's folders. Defaults to ``true``.", 69 "optional": true, 70 "default": true, 71 "type": "boolean" 72 }, 73 { 74 "type": "function", 75 "name": "callback", 76 "optional": true, 77 "parameters": [ 78 { 79 "type": "array", 80 "items": { 81 "$ref": "accounts.MailAccount" 82 } 83 } 84 ] 85 } 86 ] 87 }, 88 { 89 "name": "get", 90 "type": "function", 91 "description": "Returns details of the requested account, or null if it doesn't exist.", 92 "async": "callback", 93 "parameters": [ 94 { 95 "name": "accountId", 96 "type": "string" 97 }, 98 { 99 "name": "includeFolders", 100 "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to ``true``.", 101 "optional": true, 102 "default": true, 103 "type": "boolean" 104 }, 105 { 106 "type": "function", 107 "name": "callback", 108 "optional": true, 109 "parameters": [ 110 { 111 "$ref": "accounts.MailAccount", 112 "optional": true 113 } 114 ] 115 } 116 ] 117 }, 118 { 119 "name": "getDefault", 120 "type": "function", 121 "description": "Returns the default account, or null if it is not defined.", 122 "async": "callback", 123 "parameters": [ 124 { 125 "name": "includeFolders", 126 "description": "Specifies whether the returned :ref:`accounts.MailAccount` object should included the account's folders. Defaults to ``true``.", 127 "optional": true, 128 "default": true, 129 "type": "boolean" 130 }, 131 { 132 "type": "function", 133 "name": "callback", 134 "optional": true, 135 "parameters": [ 136 { 137 "$ref": "accounts.MailAccount", 138 "optional": true 139 } 140 ] 141 } 142 ] 143 }, 144 { 145 "name": "setDefaultIdentity", 146 "type": "function", 147 "description": "Sets the default identity for an account.", 148 "async": true, 149 "deprecated": "This will be removed. Use :ref:`identities.setDefault` instead.", 150 "parameters": [ 151 { 152 "name": "accountId", 153 "type": "string" 154 }, 155 { 156 "name": "identityId", 157 "type": "string" 158 } 159 ] 160 }, 161 { 162 "name": "getDefaultIdentity", 163 "type": "function", 164 "description": "Returns the default identity for an account, or null if it is not defined.", 165 "async": "callback", 166 "deprecated": "This will be removed. Use :ref:`identities.getDefault` instead.", 167 "parameters": [ 168 { 169 "name": "accountId", 170 "type": "string" 171 }, 172 { 173 "type": "function", 174 "name": "callback", 175 "optional": true, 176 "parameters": [ 177 { 178 "$ref": "identities.MailIdentity" 179 } 180 ] 181 } 182 ] 183 } 184 ] 185 } 186] 187