Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="drive_v3.html">Drive API</a> . <a href="drive_v3.permissions.html">permissions</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 78 | <code><a href="#create">create(fileId, body, sendNotificationEmail=None, transferOwnership=None, emailMessage=None)</a></code></p> |
| 79 | <p class="firstline">Creates a permission for a file.</p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 80 | <p class="toc_element"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 81 | <code><a href="#delete">delete(fileId, permissionId)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 82 | <p class="firstline">Deletes a permission.</p> |
| 83 | <p class="toc_element"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 84 | <code><a href="#get">get(fileId, permissionId)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 85 | <p class="firstline">Gets a permission by ID.</p> |
| 86 | <p class="toc_element"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 87 | <code><a href="#list">list(fileId)</a></code></p> |
| 88 | <p class="firstline">Lists a file's permissions.</p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 89 | <p class="toc_element"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 90 | <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 91 | <p class="firstline">Updates a permission with patch semantics.</p> |
| 92 | <h3>Method Details</h3> |
| 93 | <div class="method"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 94 | <code class="details" id="create">create(fileId, body, sendNotificationEmail=None, transferOwnership=None, emailMessage=None)</code> |
| 95 | <pre>Creates a permission for a file. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 96 | |
| 97 | Args: |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 98 | fileId: string, The ID of the file. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 99 | body: object, The request body. (required) |
| 100 | The object takes the form of: |
| 101 | |
| 102 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 103 | "domain": "A String", # The domain to which this permission refers. |
| 104 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 105 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 106 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 107 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 108 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 109 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 110 | # - owner |
| 111 | # - writer |
| 112 | # - commenter |
| 113 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 114 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 115 | "type": "A String", # The type of the grantee. Valid values are: |
| 116 | # - user |
| 117 | # - group |
| 118 | # - domain |
| 119 | # - anyone |
| 120 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 121 | } |
| 122 | |
| 123 | sendNotificationEmail: boolean, Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. |
| 124 | transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. |
| 125 | emailMessage: string, A custom message to include in the notification email. |
| 126 | |
| 127 | Returns: |
| 128 | An object of the form: |
| 129 | |
| 130 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 131 | "domain": "A String", # The domain to which this permission refers. |
| 132 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 133 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 134 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 135 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 136 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 137 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 138 | # - owner |
| 139 | # - writer |
| 140 | # - commenter |
| 141 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 142 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 143 | "type": "A String", # The type of the grantee. Valid values are: |
| 144 | # - user |
| 145 | # - group |
| 146 | # - domain |
| 147 | # - anyone |
| 148 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 149 | }</pre> |
| 150 | </div> |
| 151 | |
| 152 | <div class="method"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 153 | <code class="details" id="delete">delete(fileId, permissionId)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 154 | <pre>Deletes a permission. |
| 155 | |
| 156 | Args: |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 157 | fileId: string, The ID of the file. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 158 | permissionId: string, The ID of the permission. (required) |
| 159 | </pre> |
| 160 | </div> |
| 161 | |
| 162 | <div class="method"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 163 | <code class="details" id="get">get(fileId, permissionId)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 164 | <pre>Gets a permission by ID. |
| 165 | |
| 166 | Args: |
| 167 | fileId: string, The ID of the file. (required) |
| 168 | permissionId: string, The ID of the permission. (required) |
| 169 | |
| 170 | Returns: |
| 171 | An object of the form: |
| 172 | |
| 173 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 174 | "domain": "A String", # The domain to which this permission refers. |
| 175 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 176 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 177 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 178 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 179 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 180 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 181 | # - owner |
| 182 | # - writer |
| 183 | # - commenter |
| 184 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 185 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 186 | "type": "A String", # The type of the grantee. Valid values are: |
| 187 | # - user |
| 188 | # - group |
| 189 | # - domain |
| 190 | # - anyone |
| 191 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 192 | }</pre> |
| 193 | </div> |
| 194 | |
| 195 | <div class="method"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 196 | <code class="details" id="list">list(fileId)</code> |
| 197 | <pre>Lists a file's permissions. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 198 | |
| 199 | Args: |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 200 | fileId: string, The ID of the file. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 201 | |
| 202 | Returns: |
| 203 | An object of the form: |
| 204 | |
| 205 | { # A list of permissions for a file. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 206 | "kind": "drive#permissionList", # Identifies what kind of resource this is. Value: the fixed string "drive#permissionList". |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 207 | "permissions": [ # The full list of permissions. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 208 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 209 | "domain": "A String", # The domain to which this permission refers. |
| 210 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 211 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 212 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 213 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 214 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 215 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 216 | # - owner |
| 217 | # - writer |
| 218 | # - commenter |
| 219 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 220 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 221 | "type": "A String", # The type of the grantee. Valid values are: |
| 222 | # - user |
| 223 | # - group |
| 224 | # - domain |
| 225 | # - anyone |
| 226 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 227 | }, |
| 228 | ], |
| 229 | }</pre> |
| 230 | </div> |
| 231 | |
| 232 | <div class="method"> |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 233 | <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 234 | <pre>Updates a permission with patch semantics. |
| 235 | |
| 236 | Args: |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 237 | fileId: string, The ID of the file. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 238 | permissionId: string, The ID of the permission. (required) |
| 239 | body: object, The request body. (required) |
| 240 | The object takes the form of: |
| 241 | |
| 242 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 243 | "domain": "A String", # The domain to which this permission refers. |
| 244 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 245 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 246 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 247 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 248 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 249 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 250 | # - owner |
| 251 | # - writer |
| 252 | # - commenter |
| 253 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 254 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 255 | "type": "A String", # The type of the grantee. Valid values are: |
| 256 | # - user |
| 257 | # - group |
| 258 | # - domain |
| 259 | # - anyone |
| 260 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 261 | } |
| 262 | |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 263 | removeExpiration: boolean, Whether to remove the expiration date. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 264 | transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. |
| 265 | |
| 266 | Returns: |
| 267 | An object of the form: |
| 268 | |
| 269 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 270 | "domain": "A String", # The domain to which this permission refers. |
| 271 | "displayName": "A String", # A displayable name for users, groups or domains. |
| 272 | "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 273 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 274 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 275 | "photoLink": "A String", # A link to the user's profile photo, if available. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 276 | "role": "A String", # The role granted by this permission. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 277 | # - owner |
| 278 | # - writer |
| 279 | # - commenter |
| 280 | # - reader |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame^] | 281 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 282 | "type": "A String", # The type of the grantee. Valid values are: |
| 283 | # - user |
| 284 | # - group |
| 285 | # - domain |
| 286 | # - anyone |
| 287 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. |
| 288 | }</pre> |
| 289 | </div> |
| 290 | |
| 291 | </body></html> |