blob: 0d74deda158c31b7706ce14d6e47b06dfebf84cd [file] [log] [blame]
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001<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="sheets_v4.html">Google Sheets API</a> . <a href="sheets_v4.spreadsheets.html">spreadsheets</a> . <a href="sheets_v4.spreadsheets.sheets.html">sheets</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#copyTo">copyTo(spreadsheetId, sheetId, body=None, x__xgafv=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070079<p class="firstline">Copies a single sheet from a spreadsheet to another spreadsheet.</p>
80<h3>Method Details</h3>
81<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070082 <code class="details" id="copyTo">copyTo(spreadsheetId, sheetId, body=None, x__xgafv=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070083 <pre>Copies a single sheet from a spreadsheet to another spreadsheet.
84Returns the properties of the newly created sheet.
85
86Args:
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070087 spreadsheetId: string, The ID of the spreadsheet containing the sheet to copy. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070088 sheetId: integer, The ID of the sheet to copy. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -070089 body: object, The request body.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070090 The object takes the form of:
91
92{ # The request to copy a sheet across spreadsheets.
Bu Sun Kim65020912020-05-20 12:08:20 -070093 &quot;destinationSpreadsheetId&quot;: &quot;A String&quot;, # The ID of the spreadsheet to copy the sheet to.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070094 }
95
96 x__xgafv: string, V1 error format.
97 Allowed values
98 1 - v1 error format
99 2 - v2 error format
100
101Returns:
102 An object of the form:
103
104 { # Properties of a sheet.
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 &quot;index&quot;: 42, # The index of the sheet within the spreadsheet.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700106 # When adding or updating sheet properties, if this field
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 # is excluded then the sheet is added or moved to the end
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800108 # of the sheet list. When updating sheet indices or inserting
Bu Sun Kim65020912020-05-20 12:08:20 -0700109 # sheets, movement is considered in &quot;before the move&quot; indexes.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800110 # For example, if there were 3 sheets (S1, S2, S3) in order to
111 # move S1 ahead of S2 the index would have to be set to 2. A sheet
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 # index update request is ignored if the requested index is
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800113 # identical to the sheets current index or if the requested new
114 # index is equal to the current sheet index + 1.
Bu Sun Kim65020912020-05-20 12:08:20 -0700115 &quot;title&quot;: &quot;A String&quot;, # The name of the sheet.
116 &quot;gridProperties&quot;: { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700117 # (If the sheet is an object sheet, containing a chart or image, then
118 # this field will be absent.)
119 # When writing it is an error to set any grid properties on non-grid sheets.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700120 &quot;rowCount&quot;: 42, # The number of rows in the grid.
121 &quot;columnCount&quot;: 42, # The number of columns in the grid.
122 &quot;frozenRowCount&quot;: 42, # The number of rows that are frozen in the grid.
Bu Sun Kim65020912020-05-20 12:08:20 -0700123 &quot;rowGroupControlAfter&quot;: True or False, # True if the row grouping control toggle is shown after the group.
124 &quot;hideGridlines&quot;: True or False, # True if the grid isn&#x27;t showing gridlines in the UI.
125 &quot;frozenColumnCount&quot;: 42, # The number of columns that are frozen in the grid.
126 &quot;columnGroupControlAfter&quot;: True or False, # True if the column grouping control toggle is shown after the group.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700127 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 &quot;tabColor&quot;: { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700129 # for simplicity of conversion to/from color representations in various
130 # languages over compactness; for example, the fields of this representation
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
132 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700133 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim65020912020-05-20 12:08:20 -0700134 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700135 #
136 # Note: this proto does not carry information about the absolute color space
137 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
138 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
139 # space.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700140 #
141 # Example (Java):
142 #
143 # import com.google.type.Color;
144 #
145 # // ...
146 # public static java.awt.Color fromProto(Color protocolor) {
147 # float alpha = protocolor.hasAlpha()
148 # ? protocolor.getAlpha().getValue()
149 # : 1.0;
150 #
151 # return new java.awt.Color(
152 # protocolor.getRed(),
153 # protocolor.getGreen(),
154 # protocolor.getBlue(),
155 # alpha);
156 # }
157 #
158 # public static Color toProto(java.awt.Color color) {
159 # float red = (float) color.getRed();
160 # float green = (float) color.getGreen();
161 # float blue = (float) color.getBlue();
162 # float denominator = 255.0;
163 # Color.Builder resultBuilder =
164 # Color
165 # .newBuilder()
166 # .setRed(red / denominator)
167 # .setGreen(green / denominator)
168 # .setBlue(blue / denominator);
169 # int alpha = color.getAlpha();
170 # if (alpha != 255) {
171 # result.setAlpha(
172 # FloatValue
173 # .newBuilder()
174 # .setValue(((float) alpha) / denominator)
175 # .build());
176 # }
177 # return resultBuilder.build();
178 # }
179 # // ...
180 #
181 # Example (iOS / Obj-C):
182 #
183 # // ...
184 # static UIColor* fromProto(Color* protocolor) {
185 # float red = [protocolor red];
186 # float green = [protocolor green];
187 # float blue = [protocolor blue];
188 # FloatValue* alpha_wrapper = [protocolor alpha];
189 # float alpha = 1.0;
190 # if (alpha_wrapper != nil) {
191 # alpha = [alpha_wrapper value];
192 # }
193 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
194 # }
195 #
196 # static Color* toProto(UIColor* color) {
197 # CGFloat red, green, blue, alpha;
Dan O'Mearadd494642020-05-01 07:42:23 -0700198 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700199 # return nil;
200 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700201 # Color* result = [[Color alloc] init];
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700202 # [result setRed:red];
203 # [result setGreen:green];
204 # [result setBlue:blue];
Dan O'Mearadd494642020-05-01 07:42:23 -0700205 # if (alpha &lt;= 0.9999) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700206 # [result setAlpha:floatWrapperWithValue(alpha)];
207 # }
208 # [result autorelease];
209 # return result;
210 # }
211 # // ...
212 #
213 # Example (JavaScript):
214 #
215 # // ...
216 #
217 # var protoToCssColor = function(rgb_color) {
218 # var redFrac = rgb_color.red || 0.0;
219 # var greenFrac = rgb_color.green || 0.0;
220 # var blueFrac = rgb_color.blue || 0.0;
221 # var red = Math.floor(redFrac * 255);
222 # var green = Math.floor(greenFrac * 255);
223 # var blue = Math.floor(blueFrac * 255);
224 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700225 # if (!(&#x27;alpha&#x27; in rgb_color)) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700226 # return rgbToCssColor_(red, green, blue);
227 # }
228 #
229 # var alphaFrac = rgb_color.alpha.value || 0.0;
Bu Sun Kim65020912020-05-20 12:08:20 -0700230 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
231 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700232 # };
233 #
234 # var rgbToCssColor_ = function(red, green, blue) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700235 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700236 # var hexString = rgbNumber.toString(16);
237 # var missingZeros = 6 - hexString.length;
Bu Sun Kim65020912020-05-20 12:08:20 -0700238 # var resultBuilder = [&#x27;#&#x27;];
Dan O'Mearadd494642020-05-01 07:42:23 -0700239 # for (var i = 0; i &lt; missingZeros; i++) {
Bu Sun Kim65020912020-05-20 12:08:20 -0700240 # resultBuilder.push(&#x27;0&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700241 # }
242 # resultBuilder.push(hexString);
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 # return resultBuilder.join(&#x27;&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700244 # };
245 #
246 # // ...
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700247 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
248 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
249 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700251 # the final pixel color is defined by the equation:
252 #
253 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
254 #
255 # This means that a value of 1.0 corresponds to a solid color, whereas
256 # a value of 0.0 corresponds to a completely transparent color. This
257 # uses a wrapper message rather than a simple float scalar so that it is
258 # possible to distinguish between a default value and the value being unset.
259 # If omitted, this color object is to be rendered as a solid color
260 # (as if the alpha value had been explicitly given with a value of 1.0).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700261 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700262 &quot;sheetId&quot;: 42, # The ID of the sheet. Must be non-negative.
263 # This field cannot be changed once set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 &quot;rightToLeft&quot;: True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
265 &quot;tabColorStyle&quot;: { # A color value. # The color of the tab in the UI.
Dan O'Mearadd494642020-05-01 07:42:23 -0700266 # If tab_color is also set, this field takes precedence.
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &quot;themeColor&quot;: &quot;A String&quot;, # Theme color.
268 &quot;rgbColor&quot;: { # Represents a color in the RGBA color space. This representation is designed # RGB color.
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 # for simplicity of conversion to/from color representations in various
270 # languages over compactness; for example, the fields of this representation
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
272 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700273 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim65020912020-05-20 12:08:20 -0700274 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
Dan O'Mearadd494642020-05-01 07:42:23 -0700275 #
276 # Note: this proto does not carry information about the absolute color space
277 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
278 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
279 # space.
280 #
281 # Example (Java):
282 #
283 # import com.google.type.Color;
284 #
285 # // ...
286 # public static java.awt.Color fromProto(Color protocolor) {
287 # float alpha = protocolor.hasAlpha()
288 # ? protocolor.getAlpha().getValue()
289 # : 1.0;
290 #
291 # return new java.awt.Color(
292 # protocolor.getRed(),
293 # protocolor.getGreen(),
294 # protocolor.getBlue(),
295 # alpha);
296 # }
297 #
298 # public static Color toProto(java.awt.Color color) {
299 # float red = (float) color.getRed();
300 # float green = (float) color.getGreen();
301 # float blue = (float) color.getBlue();
302 # float denominator = 255.0;
303 # Color.Builder resultBuilder =
304 # Color
305 # .newBuilder()
306 # .setRed(red / denominator)
307 # .setGreen(green / denominator)
308 # .setBlue(blue / denominator);
309 # int alpha = color.getAlpha();
310 # if (alpha != 255) {
311 # result.setAlpha(
312 # FloatValue
313 # .newBuilder()
314 # .setValue(((float) alpha) / denominator)
315 # .build());
316 # }
317 # return resultBuilder.build();
318 # }
319 # // ...
320 #
321 # Example (iOS / Obj-C):
322 #
323 # // ...
324 # static UIColor* fromProto(Color* protocolor) {
325 # float red = [protocolor red];
326 # float green = [protocolor green];
327 # float blue = [protocolor blue];
328 # FloatValue* alpha_wrapper = [protocolor alpha];
329 # float alpha = 1.0;
330 # if (alpha_wrapper != nil) {
331 # alpha = [alpha_wrapper value];
332 # }
333 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
334 # }
335 #
336 # static Color* toProto(UIColor* color) {
337 # CGFloat red, green, blue, alpha;
338 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
339 # return nil;
340 # }
341 # Color* result = [[Color alloc] init];
342 # [result setRed:red];
343 # [result setGreen:green];
344 # [result setBlue:blue];
345 # if (alpha &lt;= 0.9999) {
346 # [result setAlpha:floatWrapperWithValue(alpha)];
347 # }
348 # [result autorelease];
349 # return result;
350 # }
351 # // ...
352 #
353 # Example (JavaScript):
354 #
355 # // ...
356 #
357 # var protoToCssColor = function(rgb_color) {
358 # var redFrac = rgb_color.red || 0.0;
359 # var greenFrac = rgb_color.green || 0.0;
360 # var blueFrac = rgb_color.blue || 0.0;
361 # var red = Math.floor(redFrac * 255);
362 # var green = Math.floor(greenFrac * 255);
363 # var blue = Math.floor(blueFrac * 255);
364 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700365 # if (!(&#x27;alpha&#x27; in rgb_color)) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700366 # return rgbToCssColor_(red, green, blue);
367 # }
368 #
369 # var alphaFrac = rgb_color.alpha.value || 0.0;
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
371 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700372 # };
373 #
374 # var rgbToCssColor_ = function(red, green, blue) {
375 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
376 # var hexString = rgbNumber.toString(16);
377 # var missingZeros = 6 - hexString.length;
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 # var resultBuilder = [&#x27;#&#x27;];
Dan O'Mearadd494642020-05-01 07:42:23 -0700379 # for (var i = 0; i &lt; missingZeros; i++) {
Bu Sun Kim65020912020-05-20 12:08:20 -0700380 # resultBuilder.push(&#x27;0&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700381 # }
382 # resultBuilder.push(hexString);
Bu Sun Kim65020912020-05-20 12:08:20 -0700383 # return resultBuilder.join(&#x27;&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700384 # };
385 #
386 # // ...
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700387 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
388 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
389 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700390 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
Dan O'Mearadd494642020-05-01 07:42:23 -0700391 # the final pixel color is defined by the equation:
392 #
393 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
394 #
395 # This means that a value of 1.0 corresponds to a solid color, whereas
396 # a value of 0.0 corresponds to a completely transparent color. This
397 # uses a wrapper message rather than a simple float scalar so that it is
398 # possible to distinguish between a default value and the value being unset.
399 # If omitted, this color object is to be rendered as a solid color
400 # (as if the alpha value had been explicitly given with a value of 1.0).
Dan O'Mearadd494642020-05-01 07:42:23 -0700401 },
402 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 &quot;hidden&quot;: True or False, # True if the sheet is hidden in the UI, false if it&#x27;s visible.
404 &quot;sheetType&quot;: &quot;A String&quot;, # The type of sheet. Defaults to GRID.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700405 # This field cannot be changed once set.
406 }</pre>
407</div>
408
409</body></html>