blob: d1c3ef2b1b65188ec9837c881f69849e098ef00a [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, 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">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#delete">delete(folderId, childId, enforceSingleParent=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040079<p class="firstline">Removes a child from a folder.</p>
80<p class="toc_element">
81 <code><a href="#get">get(folderId, childId)</a></code></p>
82<p class="firstline">Gets a specific child reference.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#insert">insert(folderId, body=None, enforceSingleParent=None, supportsTeamDrives=None, supportsAllDrives=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040085<p class="firstline">Inserts a file into a folder.</p>
86<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -070087 <code><a href="#list">list(folderId, orderBy=None, q=None, pageToken=None, maxResults=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040088<p class="firstline">Lists a folder's children.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<h3>Method Details</h3>
93<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070094 <code class="details" id="delete">delete(folderId, childId, enforceSingleParent=None)</code>
John Asmuth614db982014-04-24 15:46:26 -040095 <pre>Removes a child from a folder.
96
97Args:
98 folderId: string, The ID of the folder. (required)
99 childId: string, The ID of the child. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 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 Asmuth614db982014-04-24 15:46:26 -0400101</pre>
102</div>
103
104<div class="method">
105 <code class="details" id="get">get(folderId, childId)</code>
106 <pre>Gets a specific child reference.
107
108Args:
109 folderId: string, The ID of the folder. (required)
110 childId: string, The ID of the child. (required)
111
112Returns:
113 An object of the form:
114
115 { # A reference to a folder's child.
116 "kind": "drive#childReference", # This is always drive#childReference.
117 "childLink": "A String", # A link to the child.
118 "id": "A String", # The ID of the child.
119 "selfLink": "A String", # A link back to this reference.
120 }</pre>
121</div>
122
123<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 <code class="details" id="insert">insert(folderId, body=None, enforceSingleParent=None, supportsTeamDrives=None, supportsAllDrives=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400125 <pre>Inserts a file into a folder.
126
127Args:
128 folderId: string, The ID of the folder. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700129 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400130 The object takes the form of:
131
132{ # A reference to a folder's child.
133 "kind": "drive#childReference", # This is always drive#childReference.
134 "childLink": "A String", # A link to the child.
135 "id": "A String", # The ID of the child.
136 "selfLink": "A String", # A link back to this reference.
137 }
138
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 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 Kim715bd7f2019-06-14 16:50:42 -0700140 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
141 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
John Asmuth614db982014-04-24 15:46:26 -0400142
143Returns:
144 An object of the form:
145
146 { # A reference to a folder's child.
147 "kind": "drive#childReference", # This is always drive#childReference.
148 "childLink": "A String", # A link to the child.
149 "id": "A String", # The ID of the child.
150 "selfLink": "A String", # A link back to this reference.
151 }</pre>
152</div>
153
154<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -0700155 <code class="details" id="list">list(folderId, orderBy=None, q=None, pageToken=None, maxResults=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400156 <pre>Lists a folder's children.
157
158Args:
159 folderId: string, The ID of the folder. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700160 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.
John Asmuth614db982014-04-24 15:46:26 -0400161 q: string, Query string for searching children.
162 pageToken: string, Page token for children.
163 maxResults: integer, Maximum number of children to return.
164
165Returns:
166 An object of the form:
167
168 { # A list of children of a file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400169 "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.
John Asmuth614db982014-04-24 15:46:26 -0400170 "kind": "drive#childList", # This is always drive#childList.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400171 "items": [ # The list of children. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
John Asmuth614db982014-04-24 15:46:26 -0400172 { # A reference to a folder's child.
173 "kind": "drive#childReference", # This is always drive#childReference.
174 "childLink": "A String", # A link to the child.
175 "id": "A String", # The ID of the child.
176 "selfLink": "A String", # A link back to this reference.
177 },
178 ],
179 "nextLink": "A String", # A link to the next page of children.
180 "etag": "A String", # The ETag of the list.
181 "selfLink": "A String", # A link back to this list.
182 }</pre>
183</div>
184
185<div class="method">
186 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
187 <pre>Retrieves the next page of results.
188
189Args:
190 previous_request: The request for the previous page. (required)
191 previous_response: The response from the request for the previous page. (required)
192
193Returns:
194 A request object that you can call 'execute()' on to request the next
195 page. Returns None if there are no more items in the collection.
196 </pre>
197</div>
198
199</body></html>