• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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 is added or moved to the end
110        # of the sheet list. When updating sheet indices or inserting
111        # sheets, movement is considered in "before the move" indexes.
112        # For example, if there were 3 sheets (S1, S2, S3) in order to
113        # move S1 ahead of S2 the index would have to be set to 2. A sheet
114        # index update request is ignored if the requested index is
115        # identical to the sheets current index or if the requested new
116        # index is equal to the current sheet index + 1.
117    "title": "A String", # The name of the sheet.
118    "gridProperties": { # Properties of a grid. # Additional properties of the sheet if this sheet is a grid.
119        # (If the sheet is an object sheet, containing a chart or image, then
120        # this field will be absent.)
121        # When writing it is an error to set any grid properties on non-grid sheets.
122      "columnCount": 42, # The number of columns in the grid.
123      "rowGroupControlAfter": True or False, # True if the row grouping control toggle is shown after the group.
124      "columnGroupControlAfter": True or False, # True if the column grouping control toggle is shown after the group.
125      "frozenRowCount": 42, # The number of rows that are frozen in the grid.
126      "frozenColumnCount": 42, # The number of columns that are frozen in the grid.
127      "rowCount": 42, # The number of rows in the grid.
128      "hideGridlines": True or False, # True if the grid isn't showing gridlines in the UI.
129    },
130    "rightToLeft": True or False, # True if the sheet is an RTL sheet instead of an LTR sheet.
131    "tabColor": { # Represents a color in the RGBA color space. This representation is designed # The color of the tab in the UI.
132        # for simplicity of conversion to/from color representations in various
133        # languages over compactness; for example, the fields of this representation
134        # can be trivially provided to the constructor of "java.awt.Color" in Java; it
135        # can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
136        # method in iOS; and, with just a little work, it can be easily formatted into
137        # a CSS "rgba()" string in JavaScript, as well.
138        #
139        # Note: this proto does not carry information about the absolute color space
140        # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
141        # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
142        # space.
143        #
144        # Example (Java):
145        #
146        #      import com.google.type.Color;
147        #
148        #      // ...
149        #      public static java.awt.Color fromProto(Color protocolor) {
150        #        float alpha = protocolor.hasAlpha()
151        #            ? protocolor.getAlpha().getValue()
152        #            : 1.0;
153        #
154        #        return new java.awt.Color(
155        #            protocolor.getRed(),
156        #            protocolor.getGreen(),
157        #            protocolor.getBlue(),
158        #            alpha);
159        #      }
160        #
161        #      public static Color toProto(java.awt.Color color) {
162        #        float red = (float) color.getRed();
163        #        float green = (float) color.getGreen();
164        #        float blue = (float) color.getBlue();
165        #        float denominator = 255.0;
166        #        Color.Builder resultBuilder =
167        #            Color
168        #                .newBuilder()
169        #                .setRed(red / denominator)
170        #                .setGreen(green / denominator)
171        #                .setBlue(blue / denominator);
172        #        int alpha = color.getAlpha();
173        #        if (alpha != 255) {
174        #          result.setAlpha(
175        #              FloatValue
176        #                  .newBuilder()
177        #                  .setValue(((float) alpha) / denominator)
178        #                  .build());
179        #        }
180        #        return resultBuilder.build();
181        #      }
182        #      // ...
183        #
184        # Example (iOS / Obj-C):
185        #
186        #      // ...
187        #      static UIColor* fromProto(Color* protocolor) {
188        #         float red = [protocolor red];
189        #         float green = [protocolor green];
190        #         float blue = [protocolor blue];
191        #         FloatValue* alpha_wrapper = [protocolor alpha];
192        #         float alpha = 1.0;
193        #         if (alpha_wrapper != nil) {
194        #           alpha = [alpha_wrapper value];
195        #         }
196        #         return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
197        #      }
198        #
199        #      static Color* toProto(UIColor* color) {
200        #          CGFloat red, green, blue, alpha;
201        #          if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
202        #            return nil;
203        #          }
204        #          Color* result = [[Color alloc] init];
205        #          [result setRed:red];
206        #          [result setGreen:green];
207        #          [result setBlue:blue];
208        #          if (alpha <= 0.9999) {
209        #            [result setAlpha:floatWrapperWithValue(alpha)];
210        #          }
211        #          [result autorelease];
212        #          return result;
213        #     }
214        #     // ...
215        #
216        #  Example (JavaScript):
217        #
218        #     // ...
219        #
220        #     var protoToCssColor = function(rgb_color) {
221        #        var redFrac = rgb_color.red || 0.0;
222        #        var greenFrac = rgb_color.green || 0.0;
223        #        var blueFrac = rgb_color.blue || 0.0;
224        #        var red = Math.floor(redFrac * 255);
225        #        var green = Math.floor(greenFrac * 255);
226        #        var blue = Math.floor(blueFrac * 255);
227        #
228        #        if (!('alpha' in rgb_color)) {
229        #           return rgbToCssColor_(red, green, blue);
230        #        }
231        #
232        #        var alphaFrac = rgb_color.alpha.value || 0.0;
233        #        var rgbParams = [red, green, blue].join(',');
234        #        return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
235        #     };
236        #
237        #     var rgbToCssColor_ = function(red, green, blue) {
238        #       var rgbNumber = new Number((red << 16) | (green << 8) | blue);
239        #       var hexString = rgbNumber.toString(16);
240        #       var missingZeros = 6 - hexString.length;
241        #       var resultBuilder = ['#'];
242        #       for (var i = 0; i < missingZeros; i++) {
243        #          resultBuilder.push('0');
244        #       }
245        #       resultBuilder.push(hexString);
246        #       return resultBuilder.join('');
247        #     };
248        #
249        #     // ...
250      "blue": 3.14, # The amount of blue in the color as a value in the interval [0, 1].
251      "alpha": 3.14, # The fraction of this color that should be applied to the pixel. That is,
252          # the final pixel color is defined by the equation:
253          #
254          #   pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
255          #
256          # This means that a value of 1.0 corresponds to a solid color, whereas
257          # a value of 0.0 corresponds to a completely transparent color. This
258          # uses a wrapper message rather than a simple float scalar so that it is
259          # possible to distinguish between a default value and the value being unset.
260          # If omitted, this color object is to be rendered as a solid color
261          # (as if the alpha value had been explicitly given with a value of 1.0).
262      "green": 3.14, # The amount of green in the color as a value in the interval [0, 1].
263      "red": 3.14, # The amount of red in the color as a value in the interval [0, 1].
264    },
265    "hidden": True or False, # True if the sheet is hidden in the UI, false if it's visible.
266    "sheetId": 42, # The ID of the sheet. Must be non-negative.
267        # This field cannot be changed once set.
268  }</pre>
269</div>
270
271</body></html>