John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [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_v2.html">Drive API</a> . <a href="drive_v2.children.html">children</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
| 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#delete">delete(folderId, childId, enforceSingleParent=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 82 | <p class="firstline">Removes a child from a folder.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(folderId, childId)</a></code></p> |
| 85 | <p class="firstline">Gets a specific child reference.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 87 | <code><a href="#insert">insert(folderId, body=None, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 88 | <p class="firstline">Inserts a file into a folder.</p> |
| 89 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 90 | <code><a href="#list">list(folderId, maxResults=None, orderBy=None, pageToken=None, q=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 91 | <p class="firstline">Lists a folder's children.</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 94 | <p class="firstline">Retrieves the next page of results.</p> |
| 95 | <h3>Method Details</h3> |
| 96 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 97 | <code class="details" id="close">close()</code> |
| 98 | <pre>Close httplib2 connections.</pre> |
| 99 | </div> |
| 100 | |
| 101 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 102 | <code class="details" id="delete">delete(folderId, childId, enforceSingleParent=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 103 | <pre>Removes a child from a folder. |
| 104 | |
| 105 | Args: |
| 106 | folderId: string, The ID of the folder. (required) |
| 107 | childId: string, The ID of the child. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 108 | enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's last parent is removed, the item is placed under its owner's root. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 109 | </pre> |
| 110 | </div> |
| 111 | |
| 112 | <div class="method"> |
| 113 | <code class="details" id="get">get(folderId, childId)</code> |
| 114 | <pre>Gets a specific child reference. |
| 115 | |
| 116 | Args: |
| 117 | folderId: string, The ID of the folder. (required) |
| 118 | childId: string, The ID of the child. (required) |
| 119 | |
| 120 | Returns: |
| 121 | An object of the form: |
| 122 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 123 | { # A reference to a folder's child. |
| 124 | "childLink": "A String", # A link to the child. |
| 125 | "id": "A String", # The ID of the child. |
| 126 | "kind": "drive#childReference", # This is always drive#childReference. |
| 127 | "selfLink": "A String", # A link back to this reference. |
| 128 | }</pre> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 129 | </div> |
| 130 | |
| 131 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 132 | <code class="details" id="insert">insert(folderId, body=None, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 133 | <pre>Inserts a file into a folder. |
| 134 | |
| 135 | Args: |
| 136 | folderId: string, The ID of the folder. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 137 | body: object, The request body. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 138 | The object takes the form of: |
| 139 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 140 | { # A reference to a folder's child. |
| 141 | "childLink": "A String", # A link to the child. |
| 142 | "id": "A String", # The ID of the child. |
| 143 | "kind": "drive#childReference", # This is always drive#childReference. |
| 144 | "selfLink": "A String", # A link back to this reference. |
| 145 | } |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 146 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 147 | enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the child's owner makes the request, the child is removed from all current folders and placed in the requested folder. Any other requests that increase the number of the child's parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 148 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 149 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 150 | |
| 151 | Returns: |
| 152 | An object of the form: |
| 153 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 154 | { # A reference to a folder's child. |
| 155 | "childLink": "A String", # A link to the child. |
| 156 | "id": "A String", # The ID of the child. |
| 157 | "kind": "drive#childReference", # This is always drive#childReference. |
| 158 | "selfLink": "A String", # A link back to this reference. |
| 159 | }</pre> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 160 | </div> |
| 161 | |
| 162 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 163 | <code class="details" id="list">list(folderId, maxResults=None, orderBy=None, pageToken=None, q=None)</code> |
| 164 | <pre>Lists a folder's children. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 165 | |
| 166 | Args: |
| 167 | folderId: string, The ID of the folder. (required) |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 168 | maxResults: integer, Maximum number of children to return. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 169 | orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. |
| 170 | pageToken: string, Page token for children. |
| 171 | q: string, Query string for searching children. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 172 | |
| 173 | Returns: |
| 174 | An object of the form: |
| 175 | |
| 176 | { # A list of children of a file. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 177 | "etag": "A String", # The ETag of the list. |
| 178 | "items": [ # The list of children. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. |
| 179 | { # A reference to a folder's child. |
| 180 | "childLink": "A String", # A link to the child. |
| 181 | "id": "A String", # The ID of the child. |
| 182 | "kind": "drive#childReference", # This is always drive#childReference. |
| 183 | "selfLink": "A String", # A link back to this reference. |
| 184 | }, |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 185 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 186 | "kind": "drive#childList", # This is always drive#childList. |
| 187 | "nextLink": "A String", # A link to the next page of children. |
| 188 | "nextPageToken": "A String", # The page token for the next page of children. This will be absent if the end of the children list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. |
| 189 | "selfLink": "A String", # A link back to this list. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 190 | }</pre> |
| 191 | </div> |
| 192 | |
| 193 | <div class="method"> |
| 194 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 195 | <pre>Retrieves the next page of results. |
| 196 | |
| 197 | Args: |
| 198 | previous_request: The request for the previous page. (required) |
| 199 | previous_response: The response from the request for the previous page. (required) |
| 200 | |
| 201 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 202 | A request object that you can call 'execute()' on to request the next |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 203 | page. Returns None if there are no more items in the collection. |
| 204 | </pre> |
| 205 | </div> |
| 206 | |
| 207 | </body></html> |