Class: Spatio::SheetsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/spatio-sdk/api/sheets_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SheetsApi

Returns a new instance of SheetsApi.



19
20
21
# File 'lib/spatio-sdk/api/sheets_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/spatio-sdk/api/sheets_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_sheet(create_sheet_request, opts = {}) ⇒ Sheet

Create a sheet. Creates a new sheet under the target account. Target resolution mirrors ‘POST /v1/notes`: body `accountId` → `?accountId=` → body `provider` → `?provider=` → caller’s single connected account (errors with ‘ambiguous_account` if more than one is connected and no selector is supplied).

Parameters:

  • create_sheet_request (CreateSheetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with `provider`. If omitted on a list endpoint the call fans out across every connected account.

  • :provider (String)

    Provider id (e.g. `native-notes`, `notion`). Selects every connected account for the provider. Mutually exclusive with `accountId`.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



30
31
32
33
# File 'lib/spatio-sdk/api/sheets_api.rb', line 30

def create_sheet(create_sheet_request, opts = {})
  data, _status_code, _headers = create_sheet_with_http_info(create_sheet_request, opts)
  data
end

#create_sheet_row(id, create_row_request, opts = {}) ⇒ Row

Insert a row. Inserts a row at ‘index` (zero-based) or appends to the end when `index` is omitted.

Parameters:

  • id (String)

    Sheet id.

  • create_row_request (CreateRowRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with `provider`. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



107
108
109
110
# File 'lib/spatio-sdk/api/sheets_api.rb', line 107

def create_sheet_row(id, create_row_request, opts = {})
  data, _status_code, _headers = create_sheet_row_with_http_info(id, create_row_request, opts)
  data
end

#create_sheet_row_with_http_info(id, create_row_request, opts = {}) ⇒ Array<(Row, Integer, Hash)>

Insert a row. Inserts a row at &#x60;index&#x60; (zero-based) or appends to the end when &#x60;index&#x60; is omitted.

Parameters:

  • id (String)

    Sheet id.

  • create_row_request (CreateRowRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Row, Integer, Hash)>)

    Row data, response status code and response headers



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/spatio-sdk/api/sheets_api.rb', line 120

def create_sheet_row_with_http_info(id, create_row_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.create_sheet_row ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.create_sheet_row"
  end
  # verify the required parameter 'create_row_request' is set
  if @api_client.config.client_side_validation && create_row_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_row_request' when calling SheetsApi.create_sheet_row"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}/rows'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_row_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Row'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.create_sheet_row",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#create_sheet_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_sheet_with_http_info(create_sheet_request, opts = {}) ⇒ Array<(Sheet, Integer, Hash)>

Create a sheet. Creates a new sheet under the target account. Target resolution mirrors &#x60;POST /v1/notes&#x60;: body &#x60;accountId&#x60; → &#x60;?accountId&#x3D;&#x60; → body &#x60;provider&#x60; → &#x60;?provider&#x3D;&#x60; → caller&#39;s single connected account (errors with &#x60;ambiguous_account&#x60; if more than one is connected and no selector is supplied).

Parameters:

  • create_sheet_request (CreateSheetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :provider (String)

    Provider id (e.g. &#x60;native-notes&#x60;, &#x60;notion&#x60;). Selects every connected account for the provider. Mutually exclusive with &#x60;accountId&#x60;.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Sheet, Integer, Hash)>)

    Sheet data, response status code and response headers



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/spatio-sdk/api/sheets_api.rb', line 43

def create_sheet_with_http_info(create_sheet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.create_sheet ...'
  end
  # verify the required parameter 'create_sheet_request' is set
  if @api_client.config.client_side_validation && create_sheet_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_sheet_request' when calling SheetsApi.create_sheet"
  end
  # resource path
  local_var_path = '/v1/sheets'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sheet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Sheet'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.create_sheet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#create_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sheet(id, opts = {}) ⇒ SuccessFlag

Delete a sheet.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



185
186
187
188
# File 'lib/spatio-sdk/api/sheets_api.rb', line 185

def delete_sheet(id, opts = {})
  data, _status_code, _headers = delete_sheet_with_http_info(id, opts)
  data
end

#delete_sheet_row(id, row_index, opts = {}) ⇒ SuccessFlag

Delete a row.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



253
254
255
256
# File 'lib/spatio-sdk/api/sheets_api.rb', line 253

def delete_sheet_row(id, row_index, opts = {})
  data, _status_code, _headers = delete_sheet_row_with_http_info(id, row_index, opts)
  data
end

#delete_sheet_row_with_http_info(id, row_index, opts = {}) ⇒ Array<(SuccessFlag, Integer, Hash)>

Delete a row.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(SuccessFlag, Integer, Hash)>)

    SuccessFlag data, response status code and response headers



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/spatio-sdk/api/sheets_api.rb', line 265

def delete_sheet_row_with_http_info(id, row_index, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.delete_sheet_row ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.delete_sheet_row"
  end
  # verify the required parameter 'row_index' is set
  if @api_client.config.client_side_validation && row_index.nil?
    fail ArgumentError, "Missing the required parameter 'row_index' when calling SheetsApi.delete_sheet_row"
  end
  if @api_client.config.client_side_validation && row_index < 0
    fail ArgumentError, 'invalid value for "row_index" when calling SheetsApi.delete_sheet_row, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/sheets/{id}/rows/{rowIndex}'.sub('{id}', CGI.escape(id.to_s)).sub('{rowIndex}', CGI.escape(row_index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessFlag'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.delete_sheet_row",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#delete_sheet_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_sheet_with_http_info(id, opts = {}) ⇒ Array<(SuccessFlag, Integer, Hash)>

Delete a sheet.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(SuccessFlag, Integer, Hash)>)

    SuccessFlag data, response status code and response headers



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/spatio-sdk/api/sheets_api.rb', line 196

def delete_sheet_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.delete_sheet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.delete_sheet"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SuccessFlag'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.delete_sheet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#delete_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_sheet(id, opts = {}) ⇒ Sheet

Fetch one sheet.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



329
330
331
332
# File 'lib/spatio-sdk/api/sheets_api.rb', line 329

def get_sheet(id, opts = {})
  data, _status_code, _headers = get_sheet_with_http_info(id, opts)
  data
end

#get_sheet_with_http_info(id, opts = {}) ⇒ Array<(Sheet, Integer, Hash)>

Fetch one sheet.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Sheet, Integer, Hash)>)

    Sheet data, response status code and response headers



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/spatio-sdk/api/sheets_api.rb', line 340

def get_sheet_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.get_sheet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.get_sheet"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Sheet'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.get_sheet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#get_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sheet_rows(id, opts = {}) ⇒ RowList

List rows in a sheet. Single-account row list. Unlike ‘GET /v1/sheets`, row listing always targets the one account that owns the sheet, so the response is a plain `{ rows, total }` rather than a fan-out envelope.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • :limit (Integer) — default: default to 100
  • :offset (Integer) — default: default to 0

Returns:



399
400
401
402
# File 'lib/spatio-sdk/api/sheets_api.rb', line 399

def list_sheet_rows(id, opts = {})
  data, _status_code, _headers = list_sheet_rows_with_http_info(id, opts)
  data
end

#list_sheet_rows_with_http_info(id, opts = {}) ⇒ Array<(RowList, Integer, Hash)>

List rows in a sheet. Single-account row list. Unlike &#x60;GET /v1/sheets&#x60;, row listing always targets the one account that owns the sheet, so the response is a plain &#x60;{ rows, total }&#x60; rather than a fan-out envelope.

Parameters:

  • id (String)

    Sheet id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • :limit (Integer) — default: default to 100
  • :offset (Integer) — default: default to 0

Returns:

  • (Array<(RowList, Integer, Hash)>)

    RowList data, response status code and response headers



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/spatio-sdk/api/sheets_api.rb', line 413

def list_sheet_rows_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.list_sheet_rows ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.list_sheet_rows"
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SheetsApi.list_sheet_rows, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SheetsApi.list_sheet_rows, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/sheets/{id}/rows'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RowList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.list_sheet_rows",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#list_sheet_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sheets(opts = {}) ⇒ SheetListEnvelope

List sheets across connected accounts. Fan-out list. Returns every sheet visible to the caller across every connected sheets provider, paginated by ‘limit` / `offset`. Pass `?accountId=` or `?provider=` to scope to a single source.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :provider (String)

    Provider id (e.g. &#x60;native-notes&#x60;, &#x60;notion&#x60;). Selects every connected account for the provider. Mutually exclusive with &#x60;accountId&#x60;.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0

Returns:



482
483
484
485
# File 'lib/spatio-sdk/api/sheets_api.rb', line 482

def list_sheets(opts = {})
  data, _status_code, _headers = list_sheets_with_http_info(opts)
  data
end

#list_sheets_with_http_info(opts = {}) ⇒ Array<(SheetListEnvelope, Integer, Hash)>

List sheets across connected accounts. Fan-out list. Returns every sheet visible to the caller across every connected sheets provider, paginated by &#x60;limit&#x60; / &#x60;offset&#x60;. Pass &#x60;?accountId&#x3D;&#x60; or &#x60;?provider&#x3D;&#x60; to scope to a single source.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :provider (String)

    Provider id (e.g. &#x60;native-notes&#x60;, &#x60;notion&#x60;). Selects every connected account for the provider. Mutually exclusive with &#x60;accountId&#x60;.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

  • :limit (Integer) — default: default to 50
  • :offset (Integer) — default: default to 0

Returns:

  • (Array<(SheetListEnvelope, Integer, Hash)>)

    SheetListEnvelope data, response status code and response headers



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/spatio-sdk/api/sheets_api.rb', line 496

def list_sheets_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.list_sheets ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SheetsApi.list_sheets, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SheetsApi.list_sheets, must be greater than or equal to 0.'
  end

  # resource path
  local_var_path = '/v1/sheets'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'provider'] = opts[:'provider'] if !opts[:'provider'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SheetListEnvelope'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.list_sheets",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#list_sheets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sheet(id, update_sheet_request, opts = {}) ⇒ Sheet

Update a sheet (partial). Partial update of sheet metadata. The renderer also calls this via ‘PUT /v1/sheets/id` for autosave parity; both verbs invoke the same handler. Per-cell and per-row mutations live on their dedicated endpoints, not here.

Parameters:

  • id (String)

    Sheet id.

  • update_sheet_request (UpdateSheetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



561
562
563
564
# File 'lib/spatio-sdk/api/sheets_api.rb', line 561

def update_sheet(id, update_sheet_request, opts = {})
  data, _status_code, _headers = update_sheet_with_http_info(id, update_sheet_request, opts)
  data
end

#update_sheet_cell(id, row_index, column, update_cell_request, opts = {}) ⇒ Cell

Update a single cell.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • column (String)

    Column identifier. Provider-specific — usually a letter (&#x60;A&#x60;, &#x60;AB&#x60;) for spreadsheet providers or a column key string for structured providers.

  • update_cell_request (UpdateCellRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



642
643
644
645
# File 'lib/spatio-sdk/api/sheets_api.rb', line 642

def update_sheet_cell(id, row_index, column, update_cell_request, opts = {})
  data, _status_code, _headers = update_sheet_cell_with_http_info(id, row_index, column, update_cell_request, opts)
  data
end

#update_sheet_cell_with_http_info(id, row_index, column, update_cell_request, opts = {}) ⇒ Array<(Cell, Integer, Hash)>

Update a single cell.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • column (String)

    Column identifier. Provider-specific — usually a letter (&#x60;A&#x60;, &#x60;AB&#x60;) for spreadsheet providers or a column key string for structured providers.

  • update_cell_request (UpdateCellRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Cell, Integer, Hash)>)

    Cell data, response status code and response headers



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# File 'lib/spatio-sdk/api/sheets_api.rb', line 656

def update_sheet_cell_with_http_info(id, row_index, column, update_cell_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.update_sheet_cell ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.update_sheet_cell"
  end
  # verify the required parameter 'row_index' is set
  if @api_client.config.client_side_validation && row_index.nil?
    fail ArgumentError, "Missing the required parameter 'row_index' when calling SheetsApi.update_sheet_cell"
  end
  if @api_client.config.client_side_validation && row_index < 0
    fail ArgumentError, 'invalid value for "row_index" when calling SheetsApi.update_sheet_cell, must be greater than or equal to 0.'
  end

  # verify the required parameter 'column' is set
  if @api_client.config.client_side_validation && column.nil?
    fail ArgumentError, "Missing the required parameter 'column' when calling SheetsApi.update_sheet_cell"
  end
  # verify the required parameter 'update_cell_request' is set
  if @api_client.config.client_side_validation && update_cell_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_cell_request' when calling SheetsApi.update_sheet_cell"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}/rows/{rowIndex}/cells/{column}'.sub('{id}', CGI.escape(id.to_s)).sub('{rowIndex}', CGI.escape(row_index.to_s)).sub('{column}', CGI.escape(column.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_cell_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Cell'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.update_sheet_cell",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#update_sheet_cell\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sheet_row(id, row_index, update_row_request, opts = {}) ⇒ Row

Update a row (sparse). Sparse update — keys present in ‘cells` overwrite that column; keys absent are preserved.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • update_row_request (UpdateRowRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:



736
737
738
739
# File 'lib/spatio-sdk/api/sheets_api.rb', line 736

def update_sheet_row(id, row_index, update_row_request, opts = {})
  data, _status_code, _headers = update_sheet_row_with_http_info(id, row_index, update_row_request, opts)
  data
end

#update_sheet_row_with_http_info(id, row_index, update_row_request, opts = {}) ⇒ Array<(Row, Integer, Hash)>

Update a row (sparse). Sparse update — keys present in &#x60;cells&#x60; overwrite that column; keys absent are preserved.

Parameters:

  • id (String)

    Sheet id.

  • row_index (Integer)

    Zero-based row index.

  • update_row_request (UpdateRowRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Row, Integer, Hash)>)

    Row data, response status code and response headers



750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/spatio-sdk/api/sheets_api.rb', line 750

def update_sheet_row_with_http_info(id, row_index, update_row_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.update_sheet_row ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.update_sheet_row"
  end
  # verify the required parameter 'row_index' is set
  if @api_client.config.client_side_validation && row_index.nil?
    fail ArgumentError, "Missing the required parameter 'row_index' when calling SheetsApi.update_sheet_row"
  end
  if @api_client.config.client_side_validation && row_index < 0
    fail ArgumentError, 'invalid value for "row_index" when calling SheetsApi.update_sheet_row, must be greater than or equal to 0.'
  end

  # verify the required parameter 'update_row_request' is set
  if @api_client.config.client_side_validation && update_row_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_row_request' when calling SheetsApi.update_sheet_row"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}/rows/{rowIndex}'.sub('{id}', CGI.escape(id.to_s)).sub('{rowIndex}', CGI.escape(row_index.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_row_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Row'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.update_sheet_row",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#update_sheet_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_sheet_with_http_info(id, update_sheet_request, opts = {}) ⇒ Array<(Sheet, Integer, Hash)>

Update a sheet (partial). Partial update of sheet metadata. The renderer also calls this via &#x60;PUT /v1/sheets/id&#x60; for autosave parity; both verbs invoke the same handler. Per-cell and per-row mutations live on their dedicated endpoints, not here.

Parameters:

  • id (String)

    Sheet id.

  • update_sheet_request (UpdateSheetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Connected-account row id. Selects which provider account this request targets when more than one is connected. Mutually exclusive with &#x60;provider&#x60;. If omitted on a list endpoint the call fans out across every connected account.

  • :x_workspace_id (String)

    Workspace scope for unscoped tokens. Workspace-scoped PATs and OAuth tokens carry this implicitly; for session/JWT auth without a scoped PAT, pass it explicitly.

Returns:

  • (Array<(Sheet, Integer, Hash)>)

    Sheet data, response status code and response headers



574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/spatio-sdk/api/sheets_api.rb', line 574

def update_sheet_with_http_info(id, update_sheet_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SheetsApi.update_sheet ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling SheetsApi.update_sheet"
  end
  # verify the required parameter 'update_sheet_request' is set
  if @api_client.config.client_side_validation && update_sheet_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_sheet_request' when calling SheetsApi.update_sheet"
  end
  # resource path
  local_var_path = '/v1/sheets/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'X-Workspace-ID'] = opts[:'x_workspace_id'] if !opts[:'x_workspace_id'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_sheet_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Sheet'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"SheetsApi.update_sheet",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SheetsApi#update_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end