blob: cff3c454630647a9183050188b26c70e1d3fdb35 [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 Kimd059ad82020-07-22 17:02:09 -0700105 &quot;hidden&quot;: True or False, # True if the sheet is hidden in the UI, false if it&#x27;s visible.
106 &quot;sheetId&quot;: 42, # The ID of the sheet. Must be non-negative.
107 # This field cannot be changed once set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700108 &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 -0700109 # for simplicity of conversion to/from color representations in various
110 # languages over compactness; for example, the fields of this representation
Bu Sun Kim65020912020-05-20 12:08:20 -0700111 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
112 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700113 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim65020912020-05-20 12:08:20 -0700114 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700115 #
116 # Note: this proto does not carry information about the absolute color space
117 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
118 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
119 # space.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700120 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700121 # Note: when color equality needs to be decided, implementations, unless
122 # documented otherwise, will treat two colors to be equal if all their red,
123 # green, blue and alpha values each differ by at most 1e-5.
124 #
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700125 # Example (Java):
126 #
127 # import com.google.type.Color;
128 #
129 # // ...
130 # public static java.awt.Color fromProto(Color protocolor) {
131 # float alpha = protocolor.hasAlpha()
132 # ? protocolor.getAlpha().getValue()
133 # : 1.0;
134 #
135 # return new java.awt.Color(
136 # protocolor.getRed(),
137 # protocolor.getGreen(),
138 # protocolor.getBlue(),
139 # alpha);
140 # }
141 #
142 # public static Color toProto(java.awt.Color color) {
143 # float red = (float) color.getRed();
144 # float green = (float) color.getGreen();
145 # float blue = (float) color.getBlue();
146 # float denominator = 255.0;
147 # Color.Builder resultBuilder =
148 # Color
149 # .newBuilder()
150 # .setRed(red / denominator)
151 # .setGreen(green / denominator)
152 # .setBlue(blue / denominator);
153 # int alpha = color.getAlpha();
154 # if (alpha != 255) {
155 # result.setAlpha(
156 # FloatValue
157 # .newBuilder()
158 # .setValue(((float) alpha) / denominator)
159 # .build());
160 # }
161 # return resultBuilder.build();
162 # }
163 # // ...
164 #
165 # Example (iOS / Obj-C):
166 #
167 # // ...
168 # static UIColor* fromProto(Color* protocolor) {
169 # float red = [protocolor red];
170 # float green = [protocolor green];
171 # float blue = [protocolor blue];
172 # FloatValue* alpha_wrapper = [protocolor alpha];
173 # float alpha = 1.0;
174 # if (alpha_wrapper != nil) {
175 # alpha = [alpha_wrapper value];
176 # }
177 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
178 # }
179 #
180 # static Color* toProto(UIColor* color) {
181 # CGFloat red, green, blue, alpha;
Dan O'Mearadd494642020-05-01 07:42:23 -0700182 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700183 # return nil;
184 # }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700185 # Color* result = [[Color alloc] init];
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700186 # [result setRed:red];
187 # [result setGreen:green];
188 # [result setBlue:blue];
Dan O'Mearadd494642020-05-01 07:42:23 -0700189 # if (alpha &lt;= 0.9999) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700190 # [result setAlpha:floatWrapperWithValue(alpha)];
191 # }
192 # [result autorelease];
193 # return result;
194 # }
195 # // ...
196 #
197 # Example (JavaScript):
198 #
199 # // ...
200 #
201 # var protoToCssColor = function(rgb_color) {
202 # var redFrac = rgb_color.red || 0.0;
203 # var greenFrac = rgb_color.green || 0.0;
204 # var blueFrac = rgb_color.blue || 0.0;
205 # var red = Math.floor(redFrac * 255);
206 # var green = Math.floor(greenFrac * 255);
207 # var blue = Math.floor(blueFrac * 255);
208 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 # if (!(&#x27;alpha&#x27; in rgb_color)) {
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700210 # return rgbToCssColor_(red, green, blue);
211 # }
212 #
213 # var alphaFrac = rgb_color.alpha.value || 0.0;
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
215 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700216 # };
217 #
218 # var rgbToCssColor_ = function(red, green, blue) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700219 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700220 # var hexString = rgbNumber.toString(16);
221 # var missingZeros = 6 - hexString.length;
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 # var resultBuilder = [&#x27;#&#x27;];
Dan O'Mearadd494642020-05-01 07:42:23 -0700223 # for (var i = 0; i &lt; missingZeros; i++) {
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 # resultBuilder.push(&#x27;0&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700225 # }
226 # resultBuilder.push(hexString);
Bu Sun Kim65020912020-05-20 12:08:20 -0700227 # return resultBuilder.join(&#x27;&#x27;);
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700228 # };
229 #
230 # // ...
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700231 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
232 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700233 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 &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 -0700235 # the final pixel color is defined by the equation:
236 #
237 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
238 #
239 # This means that a value of 1.0 corresponds to a solid color, whereas
240 # a value of 0.0 corresponds to a completely transparent color. This
241 # uses a wrapper message rather than a simple float scalar so that it is
242 # possible to distinguish between a default value and the value being unset.
243 # If omitted, this color object is to be rendered as a solid color
244 # (as if the alpha value had been explicitly given with a value of 1.0).
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700245 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700246 &quot;tabColorStyle&quot;: { # A color value. # The color of the tab in the UI.
Dan O'Mearadd494642020-05-01 07:42:23 -0700247 # If tab_color is also set, this field takes precedence.
Bu Sun Kim65020912020-05-20 12:08:20 -0700248 &quot;themeColor&quot;: &quot;A String&quot;, # Theme color.
249 &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 -0700250 # for simplicity of conversion to/from color representations in various
251 # languages over compactness; for example, the fields of this representation
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
253 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700254 # method in iOS; and, with just a little work, it can be easily formatted into
Bu Sun Kim65020912020-05-20 12:08:20 -0700255 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
Dan O'Mearadd494642020-05-01 07:42:23 -0700256 #
257 # Note: this proto does not carry information about the absolute color space
258 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
259 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
260 # space.
261 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700262 # Note: when color equality needs to be decided, implementations, unless
263 # documented otherwise, will treat two colors to be equal if all their red,
264 # green, blue and alpha values each differ by at most 1e-5.
265 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700266 # Example (Java):
267 #
268 # import com.google.type.Color;
269 #
270 # // ...
271 # public static java.awt.Color fromProto(Color protocolor) {
272 # float alpha = protocolor.hasAlpha()
273 # ? protocolor.getAlpha().getValue()
274 # : 1.0;
275 #
276 # return new java.awt.Color(
277 # protocolor.getRed(),
278 # protocolor.getGreen(),
279 # protocolor.getBlue(),
280 # alpha);
281 # }
282 #
283 # public static Color toProto(java.awt.Color color) {
284 # float red = (float) color.getRed();
285 # float green = (float) color.getGreen();
286 # float blue = (float) color.getBlue();
287 # float denominator = 255.0;
288 # Color.Builder resultBuilder =
289 # Color
290 # .newBuilder()
291 # .setRed(red / denominator)
292 # .setGreen(green / denominator)
293 # .setBlue(blue / denominator);
294 # int alpha = color.getAlpha();
295 # if (alpha != 255) {
296 # result.setAlpha(
297 # FloatValue
298 # .newBuilder()
299 # .setValue(((float) alpha) / denominator)
300 # .build());
301 # }
302 # return resultBuilder.build();
303 # }
304 # // ...
305 #
306 # Example (iOS / Obj-C):
307 #
308 # // ...
309 # static UIColor* fromProto(Color* protocolor) {
310 # float red = [protocolor red];
311 # float green = [protocolor green];
312 # float blue = [protocolor blue];
313 # FloatValue* alpha_wrapper = [protocolor alpha];
314 # float alpha = 1.0;
315 # if (alpha_wrapper != nil) {
316 # alpha = [alpha_wrapper value];
317 # }
318 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
319 # }
320 #
321 # static Color* toProto(UIColor* color) {
322 # CGFloat red, green, blue, alpha;
323 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
324 # return nil;
325 # }
326 # Color* result = [[Color alloc] init];
327 # [result setRed:red];
328 # [result setGreen:green];
329 # [result setBlue:blue];
330 # if (alpha &lt;= 0.9999) {
331 # [result setAlpha:floatWrapperWithValue(alpha)];
332 # }
333 # [result autorelease];
334 # return result;
335 # }
336 # // ...
337 #
338 # Example (JavaScript):
339 #
340 # // ...
341 #
342 # var protoToCssColor = function(rgb_color) {
343 # var redFrac = rgb_color.red || 0.0;
344 # var greenFrac = rgb_color.green || 0.0;
345 # var blueFrac = rgb_color.blue || 0.0;
346 # var red = Math.floor(redFrac * 255);
347 # var green = Math.floor(greenFrac * 255);
348 # var blue = Math.floor(blueFrac * 255);
349 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700350 # if (!(&#x27;alpha&#x27; in rgb_color)) {
Dan O'Mearadd494642020-05-01 07:42:23 -0700351 # return rgbToCssColor_(red, green, blue);
352 # }
353 #
354 # var alphaFrac = rgb_color.alpha.value || 0.0;
Bu Sun Kim65020912020-05-20 12:08:20 -0700355 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
356 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700357 # };
358 #
359 # var rgbToCssColor_ = function(red, green, blue) {
360 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
361 # var hexString = rgbNumber.toString(16);
362 # var missingZeros = 6 - hexString.length;
Bu Sun Kim65020912020-05-20 12:08:20 -0700363 # var resultBuilder = [&#x27;#&#x27;];
Dan O'Mearadd494642020-05-01 07:42:23 -0700364 # for (var i = 0; i &lt; missingZeros; i++) {
Bu Sun Kim65020912020-05-20 12:08:20 -0700365 # resultBuilder.push(&#x27;0&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700366 # }
367 # resultBuilder.push(hexString);
Bu Sun Kim65020912020-05-20 12:08:20 -0700368 # return resultBuilder.join(&#x27;&#x27;);
Dan O'Mearadd494642020-05-01 07:42:23 -0700369 # };
370 #
371 # // ...
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700372 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
373 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700374 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 &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 -0700376 # the final pixel color is defined by the equation:
377 #
378 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
379 #
380 # This means that a value of 1.0 corresponds to a solid color, whereas
381 # a value of 0.0 corresponds to a completely transparent color. This
382 # uses a wrapper message rather than a simple float scalar so that it is
383 # possible to distinguish between a default value and the value being unset.
384 # If omitted, this color object is to be rendered as a solid color
385 # (as if the alpha value had been explicitly given with a value of 1.0).
Dan O'Mearadd494642020-05-01 07:42:23 -0700386 },
387 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700388 &quot;sheetType&quot;: &quot;A String&quot;, # The type of sheet. Defaults to GRID.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700389 # This field cannot be changed once set.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700390 &quot;rightToLeft&quot;: True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
391 &quot;index&quot;: 42, # The index of the sheet within the spreadsheet.
392 # When adding or updating sheet properties, if this field
393 # is excluded then the sheet is added or moved to the end
394 # of the sheet list. When updating sheet indices or inserting
395 # sheets, movement is considered in &quot;before the move&quot; indexes.
396 # For example, if there were 3 sheets (S1, S2, S3) in order to
397 # move S1 ahead of S2 the index would have to be set to 2. A sheet
398 # index update request is ignored if the requested index is
399 # identical to the sheets current index or if the requested new
400 # index is equal to the current sheet index + 1.
401 &quot;gridProperties&quot;: { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
402 # (If the sheet is an object sheet, containing a chart or image, then
403 # this field will be absent.)
404 # When writing it is an error to set any grid properties on non-grid sheets.
405 &quot;hideGridlines&quot;: True or False, # True if the grid isn&#x27;t showing gridlines in the UI.
406 &quot;columnCount&quot;: 42, # The number of columns in the grid.
407 &quot;frozenColumnCount&quot;: 42, # The number of columns that are frozen in the grid.
408 &quot;rowCount&quot;: 42, # The number of rows in the grid.
409 &quot;rowGroupControlAfter&quot;: True or False, # True if the row grouping control toggle is shown after the group.
410 &quot;frozenRowCount&quot;: 42, # The number of rows that are frozen in the grid.
411 &quot;columnGroupControlAfter&quot;: True or False, # True if the column grouping control toggle is shown after the group.
412 },
413 &quot;title&quot;: &quot;A String&quot;, # The name of the sheet.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700414 }</pre>
415</div>
416
417</body></html>