blob: f83b27bb1606276f0dfad0b8efdc3bccdc0e35f2 [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">
78 <code><a href="#copyTo">copyTo(spreadsheetId, sheetId, body, x__xgafv=None)</a></code></p>
79<p class="firstline">Copies a single sheet from a spreadsheet to another spreadsheet.</p>
80<h3>Method Details</h3>
81<div class="method">
82 <code class="details" id="copyTo">copyTo(spreadsheetId, sheetId, body, x__xgafv=None)</code>
83 <pre>Copies a single sheet from a spreadsheet to another spreadsheet.
84Returns the properties of the newly created sheet.
85
86Args:
87 spreadsheetId: string, The id of the spreadsheet containing the sheet to copy. (required)
88 sheetId: integer, The ID of the sheet to copy. (required)
89 body: object, The request body. (required)
90 The object takes the form of:
91
92{ # The request to copy a sheet across spreadsheets.
93 "destinationSpreadsheetId": "A String", # The ID of the spreadsheet to copy the sheet to.
94 }
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.
105 "sheetType": "A String", # The type of sheet. Defaults to GRID.
106 # This field cannot be changed once set.
107 "index": 42, # The index of the sheet within the spreadsheet.
108 # When adding or updating sheet properties, if this field
109 # is excluded then the sheet will be added or moved to the end
110 # of the sheet list.
111 "title": "A String", # The name of the sheet.
112 "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
113 # (If the sheet is an object sheet, containing a chart or image, then
114 # this field will be absent.)
115 # When writing it is an error to set any grid properties on non-grid sheets.
116 "columnCount": 42, # The number of columns in the grid.
117 "rowCount": 42, # The number of rows in the grid.
118 "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
119 "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
120 "frozenRowCount": 42, # The number of rows that are frozen in the grid.
121 },
122 "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
123 "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
124 # for simplicity of conversion to/from color representations in various
125 # languages over compactness; for example, the fields of this representation
126 # can be trivially provided to the constructor of "java.awt.Color" in Java; it
127 # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
128 # method in iOS; and, with just a little work, it can be easily formatted into
129 # a CSS "rgba()" string in JavaScript, as well. Here are some examples:
130 #
131 # Example (Java):
132 #
133 # import com.google.type.Color;
134 #
135 # // ...
136 # public static java.awt.Color fromProto(Color protocolor) {
137 # float alpha = protocolor.hasAlpha()
138 # ? protocolor.getAlpha().getValue()
139 # : 1.0;
140 #
141 # return new java.awt.Color(
142 # protocolor.getRed(),
143 # protocolor.getGreen(),
144 # protocolor.getBlue(),
145 # alpha);
146 # }
147 #
148 # public static Color toProto(java.awt.Color color) {
149 # float red = (float) color.getRed();
150 # float green = (float) color.getGreen();
151 # float blue = (float) color.getBlue();
152 # float denominator = 255.0;
153 # Color.Builder resultBuilder =
154 # Color
155 # .newBuilder()
156 # .setRed(red / denominator)
157 # .setGreen(green / denominator)
158 # .setBlue(blue / denominator);
159 # int alpha = color.getAlpha();
160 # if (alpha != 255) {
161 # result.setAlpha(
162 # FloatValue
163 # .newBuilder()
164 # .setValue(((float) alpha) / denominator)
165 # .build());
166 # }
167 # return resultBuilder.build();
168 # }
169 # // ...
170 #
171 # Example (iOS / Obj-C):
172 #
173 # // ...
174 # static UIColor* fromProto(Color* protocolor) {
175 # float red = [protocolor red];
176 # float green = [protocolor green];
177 # float blue = [protocolor blue];
178 # FloatValue* alpha_wrapper = [protocolor alpha];
179 # float alpha = 1.0;
180 # if (alpha_wrapper != nil) {
181 # alpha = [alpha_wrapper value];
182 # }
183 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
184 # }
185 #
186 # static Color* toProto(UIColor* color) {
187 # CGFloat red, green, blue, alpha;
188 # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
189 # return nil;
190 # }
191 # Color* result = [Color alloc] init];
192 # [result setRed:red];
193 # [result setGreen:green];
194 # [result setBlue:blue];
195 # if (alpha <= 0.9999) {
196 # [result setAlpha:floatWrapperWithValue(alpha)];
197 # }
198 # [result autorelease];
199 # return result;
200 # }
201 # // ...
202 #
203 # Example (JavaScript):
204 #
205 # // ...
206 #
207 # var protoToCssColor = function(rgb_color) {
208 # var redFrac = rgb_color.red || 0.0;
209 # var greenFrac = rgb_color.green || 0.0;
210 # var blueFrac = rgb_color.blue || 0.0;
211 # var red = Math.floor(redFrac * 255);
212 # var green = Math.floor(greenFrac * 255);
213 # var blue = Math.floor(blueFrac * 255);
214 #
215 # if (!('alpha' in rgb_color)) {
216 # return rgbToCssColor_(red, green, blue);
217 # }
218 #
219 # var alphaFrac = rgb_color.alpha.value || 0.0;
220 # var rgbParams = [red, green, blue].join(',');
221 # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
222 # };
223 #
224 # var rgbToCssColor_ = function(red, green, blue) {
225 # var rgbNumber = new Number((red << 16) | (green << 8) | blue);
226 # var hexString = rgbNumber.toString(16);
227 # var missingZeros = 6 - hexString.length;
228 # var resultBuilder = ['#'];
229 # for (var i = 0; i < missingZeros; i++) {
230 # resultBuilder.push('0');
231 # }
232 # resultBuilder.push(hexString);
233 # return resultBuilder.join('');
234 # };
235 #
236 # // ...
237 "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
238 "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
239 # the final pixel color is defined by the equation:
240 #
241 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
242 #
243 # This means that a value of 1.0 corresponds to a solid color, whereas
244 # a value of 0.0 corresponds to a completely transparent color. This
245 # uses a wrapper message rather than a simple float scalar so that it is
246 # possible to distinguish between a default value and the value being unset.
247 # If omitted, this color object is to be rendered as a solid color
248 # (as if the alpha value had been explicitly given with a value of 1.0).
249 "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
250 "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
251 },
252 "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
253 "sheetId": 42, # The ID of the sheet. Must be non-negative.
254 # This field cannot be changed once set.
255 }</pre>
256</div>
257
258</body></html>