Class: Hubspot::Cms::Hubdb::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/cms/hubdb/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



21
22
23
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 21

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



19
20
21
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#archive_table(table_id, opts = {}) ⇒ nil

Archive a table Archive an existing HubDB table.

Parameters:

  • table_id (String)

    The ID or name of the table to archive.

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

    the optional parameters

Returns:

  • (nil)


29
30
31
32
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 29

def archive_table(table_id, opts = {})
  archive_table_with_http_info(table_id, opts)
  nil
end

#archive_table_with_http_info(table_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Archive a table Archive an existing HubDB table.

Parameters:

  • table_id (String)

    The ID or name of the table to archive.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



39
40
41
42
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 39

def archive_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.archive_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.archive_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#archive_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_clone_draft_table_rows(table_id, batch_input_string, opts = {}) ⇒ Object

Clone rows in batch Clones rows in the ‘DRAFT` version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    The JSON array of row ids

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

    the optional parameters

Returns:

  • (Object)


92
93
94
95
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 92

def batch_clone_draft_table_rows(table_id, batch_input_string, opts = {})
  data, _status_code, _headers = batch_clone_draft_table_rows_with_http_info(table_id, batch_input_string, opts)
  data
end

#batch_clone_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Clone rows in batch Clones rows in the &#x60;DRAFT&#x60; version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    The JSON array of row ids

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 103

def batch_clone_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_clone_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_clone_draft_table_rows"
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.batch_clone_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/clone'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_clone_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_create_draft_table_rows(table_id, batch_input_hub_db_table_row_v3, opts = {}) ⇒ Object

Create rows in batch Creates rows in the ‘DRAFT` version of the specified table, given an array of row objects. See the endpoint `/tables/tableId/rows` for more details.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_hub_db_table_row_v3 (BatchInputHubDbTableRowV3)

    JSON array of row objects

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

    the optional parameters

Returns:

  • (Object)


162
163
164
165
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 162

def batch_create_draft_table_rows(table_id, batch_input_hub_db_table_row_v3, opts = {})
  data, _status_code, _headers = batch_create_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts)
  data
end

#batch_create_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create rows in batch Creates rows in the &#x60;DRAFT&#x60; version of the specified table, given an array of row objects. See the endpoint &#x60;/tables/tableId/rows&#x60; for more details.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_hub_db_table_row_v3 (BatchInputHubDbTableRowV3)

    JSON array of row objects

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 173

def batch_create_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_create_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_create_draft_table_rows"
  end
  # verify the required parameter 'batch_input_hub_db_table_row_v3' is set
  if @api_client.config.client_side_validation && batch_input_hub_db_table_row_v3.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_hub_db_table_row_v3' when calling DefaultApi.batch_create_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/create'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_create_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_purge_draft_table_rows(table_id, batch_input_string, opts = {}) ⇒ nil

Permanently deletes rows Permanently deletes rows from the ‘DRAFT` version of the table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    JSON array of row ids.

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

    the optional parameters

Returns:

  • (nil)


232
233
234
235
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 232

def batch_purge_draft_table_rows(table_id, batch_input_string, opts = {})
  batch_purge_draft_table_rows_with_http_info(table_id, batch_input_string, opts)
  nil
end

#batch_purge_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Permanently deletes rows Permanently deletes rows from the &#x60;DRAFT&#x60; version of the table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    JSON array of row ids.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 243

def batch_purge_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_purge_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_purge_draft_table_rows"
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.batch_purge_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/purge'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_purge_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_read_draft_table_rows(table_id, batch_input_string, opts = {}) ⇒ Object

Get a set of rows from DRAFT table Returns rows in the ‘DRAFT` version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    JSON array of row ids.

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

    the optional parameters

Returns:

  • (Object)


302
303
304
305
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 302

def batch_read_draft_table_rows(table_id, batch_input_string, opts = {})
  data, _status_code, _headers = batch_read_draft_table_rows_with_http_info(table_id, batch_input_string, opts)
  data
end

#batch_read_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get a set of rows from DRAFT table Returns rows in the &#x60;DRAFT&#x60; version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_string (BatchInputString)

    JSON array of row ids.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 313

def batch_read_draft_table_rows_with_http_info(table_id, batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_read_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_read_draft_table_rows"
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.batch_read_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/read'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_read_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_read_table_rows(table_id, batch_input_string, opts = {}) ⇒ Object

Get a set of rows Returns rows in the ‘PUBLISHED` version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table to query.

  • batch_input_string (BatchInputString)

    The JSON array of row ids

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

    the optional parameters

Returns:

  • (Object)


372
373
374
375
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 372

def batch_read_table_rows(table_id, batch_input_string, opts = {})
  data, _status_code, _headers = batch_read_table_rows_with_http_info(table_id, batch_input_string, opts)
  data
end

#batch_read_table_rows_with_http_info(table_id, batch_input_string, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get a set of rows Returns rows in the &#x60;PUBLISHED&#x60; version of the specified table, given a set of row ids.

Parameters:

  • table_id (String)

    The ID or name of the table to query.

  • batch_input_string (BatchInputString)

    The JSON array of row ids

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 383

def batch_read_table_rows_with_http_info(table_id, batch_input_string, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_read_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_read_table_rows"
  end
  # verify the required parameter 'batch_input_string' is set
  if @api_client.config.client_side_validation && batch_input_string.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling DefaultApi.batch_read_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/batch/read'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_read_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_replace_draft_table_rows(table_id, batch_input_hub_db_table_row_v3, opts = {}) ⇒ Object

Replace rows in batch in DRAFT table Updates multiple rows as a batch in the ‘DRAFT` version of the table. See the endpoint `/tables/tableId/rows/rowId/draft PUT` for details on updating a single row.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_hub_db_table_row_v3 (BatchInputHubDbTableRowV3)

    JSON array of row objects.

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

    the optional parameters

Returns:

  • (Object)


442
443
444
445
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 442

def batch_replace_draft_table_rows(table_id, batch_input_hub_db_table_row_v3, opts = {})
  data, _status_code, _headers = batch_replace_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts)
  data
end

#batch_replace_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Replace rows in batch in DRAFT table Updates multiple rows as a batch in the &#x60;DRAFT&#x60; version of the table. See the endpoint &#x60;/tables/tableId/rows/rowId/draft PUT&#x60; for details on updating a single row.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_hub_db_table_row_v3 (BatchInputHubDbTableRowV3)

    JSON array of row objects.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 453

def batch_replace_draft_table_rows_with_http_info(table_id, batch_input_hub_db_table_row_v3, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_replace_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_replace_draft_table_rows"
  end
  # verify the required parameter 'batch_input_hub_db_table_row_v3' is set
  if @api_client.config.client_side_validation && batch_input_hub_db_table_row_v3.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_hub_db_table_row_v3' when calling DefaultApi.batch_replace_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/replace'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_replace_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#batch_update_draft_table_rows(table_id, batch_input_json_node, opts = {}) ⇒ Object

Update rows in batch in DRAFT table Updates multiple rows as a batch in the ‘DRAFT` version of the table. See the endpoint `/tables/tableId/rows/rowId/draft PATCH` for details on updating a single row.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_json_node (BatchInputJsonNode)

    JSON array of row objects.

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

    the optional parameters

Returns:

  • (Object)


512
513
514
515
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 512

def batch_update_draft_table_rows(table_id, batch_input_json_node, opts = {})
  data, _status_code, _headers = batch_update_draft_table_rows_with_http_info(table_id, batch_input_json_node, opts)
  data
end

#batch_update_draft_table_rows_with_http_info(table_id, batch_input_json_node, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update rows in batch in DRAFT table Updates multiple rows as a batch in the &#x60;DRAFT&#x60; version of the table. See the endpoint &#x60;/tables/tableId/rows/rowId/draft PATCH&#x60; for details on updating a single row.

Parameters:

  • table_id (String)

    The ID or name of the table

  • batch_input_json_node (BatchInputJsonNode)

    JSON array of row objects.

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 523

def batch_update_draft_table_rows_with_http_info(table_id, batch_input_json_node, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.batch_update_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.batch_update_draft_table_rows"
  end
  # verify the required parameter 'batch_input_json_node' is set
  if @api_client.config.client_side_validation && batch_input_json_node.nil?
    fail ArgumentError, "Missing the required parameter 'batch_input_json_node' when calling DefaultApi.batch_update_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft/batch/update'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'Object' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#batch_update_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#clone_draft_table(table_id, hub_db_table_clone_request, opts = {}) ⇒ HubDbTableV3

Clone a table Clone an existing HubDB table. The ‘newName` and `newLabel` of the new table can be sent as JSON in the `body` parameter. This will create the cloned table as a `DRAFT`.

Parameters:

  • table_id (String)

    The ID or name of the table to clone.

  • hub_db_table_clone_request (HubDbTableCloneRequest)

    JSON object with the properties newName and newLabel. You can set copyRows to false to clone the table with copying rows and default is true.

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

    the optional parameters

Returns:



582
583
584
585
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 582

def clone_draft_table(table_id, hub_db_table_clone_request, opts = {})
  data, _status_code, _headers = clone_draft_table_with_http_info(table_id, hub_db_table_clone_request, opts)
  data
end

#clone_draft_table_row(row_id, table_id, opts = {}) ⇒ HubDbTableRowV3

Clone a row Clones a single row in the ‘DRAFT` version of the table.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:



652
653
654
655
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 652

def clone_draft_table_row(row_id, table_id, opts = {})
  data, _status_code, _headers = clone_draft_table_row_with_http_info(row_id, table_id, opts)
  data
end

#clone_draft_table_row_with_http_info(row_id, table_id, opts = {}) ⇒ Array<(HubDbTableRowV3, Integer, Hash)>

Clone a row Clones a single row in the &#x60;DRAFT&#x60; version of the table.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:

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

    HubDbTableRowV3 data, response status code and response headers



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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 663

def clone_draft_table_row_with_http_info(row_id, table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.clone_draft_table_row ...'
  end
  # verify the required parameter 'row_id' is set
  if @api_client.config.client_side_validation && row_id.nil?
    fail ArgumentError, "Missing the required parameter 'row_id' when calling DefaultApi.clone_draft_table_row"
  end
  pattern = Regexp.new(/\d+/)
  if @api_client.config.client_side_validation && row_id !~ pattern
    fail ArgumentError, "invalid value for 'row_id' when calling DefaultApi.clone_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.clone_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/{rowId}/draft/clone'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableRowV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#clone_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#clone_draft_table_with_http_info(table_id, hub_db_table_clone_request, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Clone a table Clone an existing HubDB table. The &#x60;newName&#x60; and &#x60;newLabel&#x60; of the new table can be sent as JSON in the &#x60;body&#x60; parameter. This will create the cloned table as a &#x60;DRAFT&#x60;.

Parameters:

  • table_id (String)

    The ID or name of the table to clone.

  • hub_db_table_clone_request (HubDbTableCloneRequest)

    JSON object with the properties newName and newLabel. You can set copyRows to false to clone the table with copying rows and default is true.

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

    the optional parameters

Returns:

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

    HubDbTableV3 data, response status code and response headers



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
632
633
634
635
636
637
638
639
640
641
642
643
644
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 593

def clone_draft_table_with_http_info(table_id, hub_db_table_clone_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.clone_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.clone_draft_table"
  end
  # verify the required parameter 'hub_db_table_clone_request' is set
  if @api_client.config.client_side_validation && hub_db_table_clone_request.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_clone_request' when calling DefaultApi.clone_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft/clone'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#clone_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_table(hub_db_table_v3_input, opts = {}) ⇒ HubDbTableV3

Create a new table Creates a new HubDB table given a JSON schema. The table name and label should be unique for each account.

Parameters:

  • hub_db_table_v3_input (HubDbTableV3Input)

    The JSON schema for the table being created.

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

    the optional parameters

Returns:



724
725
726
727
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 724

def create_table(hub_db_table_v3_input, opts = {})
  data, _status_code, _headers = create_table_with_http_info(hub_db_table_v3_input, opts)
  data
end

#create_table_row(table_id, hub_db_table_row_v3_input, opts = {}) ⇒ HubDbTableRowV3

Add a new row to a table Add a new row to a HubDB table. New rows will be added to the ‘DRAFT` version of the table. Use the `/publish` endpoint to push these changes live.

Parameters:

  • table_id (String)

    The ID or name of the target table.

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The row definition JSON, formatted as described above.

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

    the optional parameters

Returns:



789
790
791
792
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 789

def create_table_row(table_id, hub_db_table_row_v3_input, opts = {})
  data, _status_code, _headers = create_table_row_with_http_info(table_id, hub_db_table_row_v3_input, opts)
  data
end

#create_table_row_with_http_info(table_id, hub_db_table_row_v3_input, opts = {}) ⇒ Array<(HubDbTableRowV3, Integer, Hash)>

Add a new row to a table Add a new row to a HubDB table. New rows will be added to the &#x60;DRAFT&#x60; version of the table. Use the &#x60;/publish&#x60; endpoint to push these changes live.

Parameters:

  • table_id (String)

    The ID or name of the target table.

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The row definition JSON, formatted as described above.

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

    the optional parameters

Returns:

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

    HubDbTableRowV3 data, response status code and response headers



800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 800

def create_table_row_with_http_info(table_id, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.create_table_row ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.create_table_row"
  end
  # verify the required parameter 'hub_db_table_row_v3_input' is set
  if @api_client.config.client_side_validation && hub_db_table_row_v3_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_row_v3_input' when calling DefaultApi.create_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableRowV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#create_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_table_with_http_info(hub_db_table_v3_input, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Create a new table Creates a new HubDB table given a JSON schema. The table name and label should be unique for each account.

Parameters:

  • hub_db_table_v3_input (HubDbTableV3Input)

    The JSON schema for the table being created.

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

    the optional parameters

Returns:

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

    HubDbTableV3 data, response status code and response headers



734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
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
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 734

def create_table_with_http_info(hub_db_table_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.create_table ...'
  end
  # verify the required parameter 'hub_db_table_v3_input' is set
  if @api_client.config.client_side_validation && hub_db_table_v3_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_v3_input' when calling DefaultApi.create_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#create_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#export_draft_table(table_id, opts = {}) ⇒ File

Export a DRAFT table Exports the ‘DRAFT` version of a table to CSV / EXCEL format.

Parameters:

  • table_id (String)

    The ID or name of the table to export.

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

    the optional parameters

Options Hash (opts):

  • :format (String)

    The file format to export. Possible values include &#x60;CSV&#x60;, &#x60;XLSX&#x60;, and &#x60;XLS&#x60;.

Returns:

  • (File)


859
860
861
862
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 859

def export_draft_table(table_id, opts = {})
  data, _status_code, _headers = export_draft_table_with_http_info(table_id, opts)
  data
end

#export_draft_table_with_http_info(table_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Export a DRAFT table Exports the &#x60;DRAFT&#x60; version of a table to CSV / EXCEL format.

Parameters:

  • table_id (String)

    The ID or name of the table to export.

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

    the optional parameters

Options Hash (opts):

  • :format (String)

    The file format to export. Possible values include &#x60;CSV&#x60;, &#x60;XLSX&#x60;, and &#x60;XLS&#x60;.

Returns:

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

    File data, response status code and response headers



870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 870

def export_draft_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.export_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.export_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft/export'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.ms-excel', 'text/csv', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'File' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#export_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#export_table(table_id, opts = {}) ⇒ File

Export a PUBLISHED version of a table Exports the ‘PUBLISHED` version of a table to CSV / EXCEL format.

Parameters:

  • table_id (String)

    The ID or name of the table to export.

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

    the optional parameters

Options Hash (opts):

  • :format (String)

    The file format to export. Possible values include &#x60;CSV&#x60;, &#x60;XLSX&#x60;, and &#x60;XLS&#x60;.

Returns:

  • (File)


924
925
926
927
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 924

def export_table(table_id, opts = {})
  data, _status_code, _headers = export_table_with_http_info(table_id, opts)
  data
end

#export_table_with_http_info(table_id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Export a PUBLISHED version of a table Exports the &#x60;PUBLISHED&#x60; version of a table to CSV / EXCEL format.

Parameters:

  • table_id (String)

    The ID or name of the table to export.

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

    the optional parameters

Options Hash (opts):

  • :format (String)

    The file format to export. Possible values include &#x60;CSV&#x60;, &#x60;XLSX&#x60;, and &#x60;XLS&#x60;.

Returns:

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

    File data, response status code and response headers



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 935

def export_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.export_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.export_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/export'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.ms-excel', 'text/csv', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'File' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#export_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_draft_tables(opts = {}) ⇒ CollectionResponseWithTotalHubDbTableV3ForwardPaging

Return all DRAFT tables Returns the details for each DRAFT table defined in the specified account, including column definitions. ‘Note:` Unlike other HubDB GET endpoints, getting all tables will require authentication."

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :updated_after (DateTime)

    Only return tables last updated after the specified time.

  • :updated_before (DateTime)

    Only return tables last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :created_at (DateTime)

    Only return tables created at exactly the specified time.

  • :created_after (DateTime)

    Only return tables created after the specified time.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :archived (Boolean)

    Specifies whether to return archived tables. Defaults to &#x60;false&#x60;.

  • :created_before (DateTime)

    Only return tables created before the specified time.

  • :updated_at (DateTime)

    Only return tables last updated at exactly the specified time.

  • :limit (Integer)

    The maximum number of results to return. Default is 1000.

Returns:



997
998
999
1000
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 997

def get_all_draft_tables(opts = {})
  data, _status_code, _headers = get_all_draft_tables_with_http_info(opts)
  data
end

#get_all_draft_tables_with_http_info(opts = {}) ⇒ Array<(CollectionResponseWithTotalHubDbTableV3ForwardPaging, Integer, Hash)>

Return all DRAFT tables Returns the details for each DRAFT table defined in the specified account, including column definitions. &#x60;Note:&#x60; Unlike other HubDB GET endpoints, getting all tables will require authentication.&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :updated_after (DateTime)

    Only return tables last updated after the specified time.

  • :updated_before (DateTime)

    Only return tables last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :created_at (DateTime)

    Only return tables created at exactly the specified time.

  • :created_after (DateTime)

    Only return tables created after the specified time.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :archived (Boolean)

    Specifies whether to return archived tables. Defaults to &#x60;false&#x60;.

  • :created_before (DateTime)

    Only return tables created before the specified time.

  • :updated_at (DateTime)

    Only return tables last updated at exactly the specified time.

  • :limit (Integer)

    The maximum number of results to return. Default is 1000.

Returns:



1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1016

def get_all_draft_tables_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_all_draft_tables ...'
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/draft'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
  query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
  query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'CollectionResponseWithTotalHubDbTableV3ForwardPaging' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#get_all_draft_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_tables(opts = {}) ⇒ CollectionResponseWithTotalHubDbTableV3ForwardPaging

Get all tables Returns the details for each table defined in an account, including column definitions. ‘Note:` Unlike other HubDB GET endpoints, getting all tables will require authentication."

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :updated_after (DateTime)

    Only return tables last updated after the specified time.

  • :updated_before (DateTime)

    Only return tables last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :created_at (DateTime)

    Only return tables created at exactly the specified time.

  • :created_after (DateTime)

    Only return tables created after the specified time.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :archived (Boolean)

    Specifies whether to return archived tables. Defaults to &#x60;false&#x60;.

  • :created_before (DateTime)

    Only return tables created before the specified time.

  • :updated_at (DateTime)

    Only return tables last updated at exactly the specified time.

  • :limit (Integer)

    The maximum number of results to return. Default is 1000.

Returns:



1083
1084
1085
1086
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1083

def get_all_tables(opts = {})
  data, _status_code, _headers = get_all_tables_with_http_info(opts)
  data
end

#get_all_tables_with_http_info(opts = {}) ⇒ Array<(CollectionResponseWithTotalHubDbTableV3ForwardPaging, Integer, Hash)>

Get all tables Returns the details for each table defined in an account, including column definitions. &#x60;Note:&#x60; Unlike other HubDB GET endpoints, getting all tables will require authentication.&quot;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :updated_after (DateTime)

    Only return tables last updated after the specified time.

  • :updated_before (DateTime)

    Only return tables last updated before the specified time.

  • :sort (Array<String>)

    Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.

  • :created_at (DateTime)

    Only return tables created at exactly the specified time.

  • :created_after (DateTime)

    Only return tables created after the specified time.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :archived (Boolean)

    Specifies whether to return archived tables. Defaults to &#x60;false&#x60;.

  • :created_before (DateTime)

    Only return tables created before the specified time.

  • :updated_at (DateTime)

    Only return tables last updated at exactly the specified time.

  • :limit (Integer)

    The maximum number of results to return. Default is 1000.

Returns:



1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1102

def get_all_tables_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_all_tables ...'
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
  query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
  query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
  query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
  query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'CollectionResponseWithTotalHubDbTableV3ForwardPaging' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#get_all_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_draft_table_details_by_id(table_id, opts = {}) ⇒ HubDbTableV3

Get details for a DRAFT table Get the details for the ‘DRAFT` version of a specific HubDB table. This will include the definitions for the columns in the table and the number of rows in the table.

Parameters:

  • table_id (String)

    The ID or name of the table to return.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Set this to &#x60;true&#x60; to return an archived table. Defaults to &#x60;false&#x60;.

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:



1162
1163
1164
1165
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1162

def get_draft_table_details_by_id(table_id, opts = {})
  data, _status_code, _headers = get_draft_table_details_by_id_with_http_info(table_id, opts)
  data
end

#get_draft_table_details_by_id_with_http_info(table_id, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Get details for a DRAFT table Get the details for the &#x60;DRAFT&#x60; version of a specific HubDB table. This will include the definitions for the columns in the table and the number of rows in the table.

Parameters:

  • table_id (String)

    The ID or name of the table to return.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Set this to &#x60;true&#x60; to return an archived table. Defaults to &#x60;false&#x60;.

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:

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

    HubDbTableV3 data, response status code and response headers



1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1174

def get_draft_table_details_by_id_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_draft_table_details_by_id ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.get_draft_table_details_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'includeForeignIds'] = opts[:'include_foreign_ids'] if !opts[:'include_foreign_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#get_draft_table_details_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_draft_table_row_by_id(row_id, table_id, opts = {}) ⇒ HubDbTableRowV3

Get a table row Get a single row by ID from a table’s ‘DRAFT` version.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:



1229
1230
1231
1232
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1229

def get_draft_table_row_by_id(row_id, table_id, opts = {})
  data, _status_code, _headers = get_draft_table_row_by_id_with_http_info(row_id, table_id, opts)
  data
end

#get_draft_table_row_by_id_with_http_info(row_id, table_id, opts = {}) ⇒ Array<(HubDbTableRowV3, Integer, Hash)>

Get a table row Get a single row by ID from a table&#39;s &#x60;DRAFT&#x60; version.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:

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

    HubDbTableRowV3 data, response status code and response headers



1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1240

def get_draft_table_row_by_id_with_http_info(row_id, table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.get_draft_table_row_by_id ...'
  end
  # verify the required parameter 'row_id' is set
  if @api_client.config.client_side_validation && row_id.nil?
    fail ArgumentError, "Missing the required parameter 'row_id' when calling DefaultApi.get_draft_table_row_by_id"
  end
  pattern = Regexp.new(/\d+/)
  if @api_client.config.client_side_validation && row_id !~ pattern
    fail ArgumentError, "invalid value for 'row_id' when calling DefaultApi.get_draft_table_row_by_id, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.get_draft_table_row_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableRowV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#get_draft_table_row_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_draft_table(table_id, opts = {}) ⇒ ImportResult

Import data into DRAFT table Import the contents of a CSV file into an existing HubDB table. The data will always be imported into the ‘DRAFT` version of the table. Use the `/push-live` endpoint to push these changes to `PUBLISHED`. This endpoint takes a multi-part POST request. The first part will be a set of JSON-formatted options for the import. The second part will be the CSV file you want to import. Refer the overview section to check the details and format of the JSON-formatted options for the import.

Parameters:

  • table_id (String)

    The ID of the destination table where data will be imported.

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    The source CSV file to be imported.

  • :config (String)

    Configuration for the import in JSON format as described above.

Returns:



1303
1304
1305
1306
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1303

def import_draft_table(table_id, opts = {})
  data, _status_code, _headers = import_draft_table_with_http_info(table_id, opts)
  data
end

#import_draft_table_with_http_info(table_id, opts = {}) ⇒ Array<(ImportResult, Integer, Hash)>

Import data into DRAFT table Import the contents of a CSV file into an existing HubDB table. The data will always be imported into the &#x60;DRAFT&#x60; version of the table. Use the &#x60;/push-live&#x60; endpoint to push these changes to &#x60;PUBLISHED&#x60;. This endpoint takes a multi-part POST request. The first part will be a set of JSON-formatted options for the import. The second part will be the CSV file you want to import. Refer the overview section to check the details and format of the JSON-formatted options for the import.

Parameters:

  • table_id (String)

    The ID of the destination table where data will be imported.

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

    the optional parameters

Options Hash (opts):

  • :file (File)

    The source CSV file to be imported.

  • :config (String)

    Configuration for the import in JSON format as described above.

Returns:

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

    ImportResult data, response status code and response headers



1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1315

def import_draft_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.import_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.import_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft/import'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
  form_params['config'] = opts[:'config'] if !opts[:'config'].nil?

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

  # return_type
  return_type = opts[:return_type] || 'ImportResult' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#import_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_draft_table(table_id, opts = {}) ⇒ HubDbTableV3

Publish a table from draft Publishes the current ‘DRAFT` version of the table by copying the data to the PUBLISHED version of the table. This will immediately push the data for any stored `DRAFT` version to the `PUBLISHED` version of the table, meaning any website pages using data from the table will be updated.

Parameters:

  • table_id (String)

    The ID or name of the table to publish.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the response.

Returns:



1372
1373
1374
1375
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1372

def publish_draft_table(table_id, opts = {})
  data, _status_code, _headers = publish_draft_table_with_http_info(table_id, opts)
  data
end

#publish_draft_table_with_http_info(table_id, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Publish a table from draft Publishes the current &#x60;DRAFT&#x60; version of the table by copying the data to the PUBLISHED version of the table. This will immediately push the data for any stored &#x60;DRAFT&#x60; version to the &#x60;PUBLISHED&#x60; version of the table, meaning any website pages using data from the table will be updated.

Parameters:

  • table_id (String)

    The ID or name of the table to publish.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the response.

Returns:

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

    HubDbTableV3 data, response status code and response headers



1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1383

def publish_draft_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.publish_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.publish_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft/push-live'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#publish_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#purge_draft_table_row(row_id, table_id, opts = {}) ⇒ nil

Permanently deletes a row Permanently deletes a row from a table’s ‘DRAFT` version.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:

  • (nil)


1437
1438
1439
1440
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1437

def purge_draft_table_row(row_id, table_id, opts = {})
  purge_draft_table_row_with_http_info(row_id, table_id, opts)
  nil
end

#purge_draft_table_row_with_http_info(row_id, table_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Permanently deletes a row Permanently deletes a row from a table&#39;s &#x60;DRAFT&#x60; version.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1448

def purge_draft_table_row_with_http_info(row_id, table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.purge_draft_table_row ...'
  end
  # verify the required parameter 'row_id' is set
  if @api_client.config.client_side_validation && row_id.nil?
    fail ArgumentError, "Missing the required parameter 'row_id' when calling DefaultApi.purge_draft_table_row"
  end
  pattern = Regexp.new(/\d+/)
  if @api_client.config.client_side_validation && row_id !~ pattern
    fail ArgumentError, "invalid value for 'row_id' when calling DefaultApi.purge_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.purge_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*'])

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

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

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#purge_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#read_draft_table_rows(table_id, opts = {}) ⇒ CollectionResponseWithTotalHubDbTableRowV3ForwardPaging

Get rows from DRAFT table Returns rows in the ‘DRAFT` version of the specified table. Row results can be filtered and sorted using the options mentioned in the `/tables/tableId/rows` endpoint.

Parameters:

  • table_id (String)

    The ID or name of the table to query.

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

    the optional parameters

Options Hash (opts):

  • :properties (Array<String>)

    Specify the column names to get results containing only the required columns instead of all column details.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is &#x60;1000&#x60;.

  • :sort (Array<String>)

    Specifies the column names to sort the results by.

Returns:



1513
1514
1515
1516
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1513

def read_draft_table_rows(table_id, opts = {})
  data, _status_code, _headers = read_draft_table_rows_with_http_info(table_id, opts)
  data
end

#read_draft_table_rows_with_http_info(table_id, opts = {}) ⇒ Array<(CollectionResponseWithTotalHubDbTableRowV3ForwardPaging, Integer, Hash)>

Get rows from DRAFT table Returns rows in the &#x60;DRAFT&#x60; version of the specified table. Row results can be filtered and sorted using the options mentioned in the &#x60;/tables/tableId/rows&#x60; endpoint.

Parameters:

  • table_id (String)

    The ID or name of the table to query.

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

    the optional parameters

Options Hash (opts):

  • :properties (Array<String>)

    Specify the column names to get results containing only the required columns instead of all column details.

  • :after (String)

    The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.

  • :limit (Integer)

    The maximum number of results to return. Default is &#x60;1000&#x60;.

  • :sort (Array<String>)

    Specifies the column names to sort the results by.

Returns:



1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1527

def read_draft_table_rows_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.read_draft_table_rows ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.read_draft_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/draft'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :multi) if !opts[:'properties'].nil?
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'CollectionResponseWithTotalHubDbTableRowV3ForwardPaging' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#read_draft_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#replace_draft_table_row(row_id, table_id, hub_db_table_row_v3_input, opts = {}) ⇒ HubDbTableRowV3

Replaces an existing row Replace a single row in the table’s ‘DRAFT` version. All the column values must be specified. If a column has a value in the target table and this request doesn’t define that value, it will be deleted. See the ‘Create a row` endpoint for instructions on how to format the JSON row definitions.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The JSON object of the row

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

    the optional parameters

Returns:



1585
1586
1587
1588
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1585

def replace_draft_table_row(row_id, table_id, hub_db_table_row_v3_input, opts = {})
  data, _status_code, _headers = replace_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts)
  data
end

#replace_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts = {}) ⇒ Array<(HubDbTableRowV3, Integer, Hash)>

Replaces an existing row Replace a single row in the table&#39;s &#x60;DRAFT&#x60; version. All the column values must be specified. If a column has a value in the target table and this request doesn&#39;t define that value, it will be deleted. See the &#x60;Create a row&#x60; endpoint for instructions on how to format the JSON row definitions.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The JSON object of the row

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

    the optional parameters

Returns:

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

    HubDbTableRowV3 data, response status code and response headers



1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1597

def replace_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.replace_draft_table_row ...'
  end
  # verify the required parameter 'row_id' is set
  if @api_client.config.client_side_validation && row_id.nil?
    fail ArgumentError, "Missing the required parameter 'row_id' when calling DefaultApi.replace_draft_table_row"
  end
  pattern = Regexp.new(/\d+/)
  if @api_client.config.client_side_validation && row_id !~ pattern
    fail ArgumentError, "invalid value for 'row_id' when calling DefaultApi.replace_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.replace_draft_table_row"
  end
  # verify the required parameter 'hub_db_table_row_v3_input' is set
  if @api_client.config.client_side_validation && hub_db_table_row_v3_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_row_v3_input' when calling DefaultApi.replace_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableRowV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#replace_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_draft_table(table_id, opts = {}) ⇒ HubDbTableV3

Reset a draft table Replaces the data in the ‘DRAFT` version of the table with values from the `PUBLISHED` version. Any unpublished changes in the `DRAFT` will be lost after this call is made.

Parameters:

  • table_id (String)

    The ID or name of the table to reset.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the response.

Returns:



1665
1666
1667
1668
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1665

def reset_draft_table(table_id, opts = {})
  data, _status_code, _headers = reset_draft_table_with_http_info(table_id, opts)
  data
end

#reset_draft_table_with_http_info(table_id, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Reset a draft table Replaces the data in the &#x60;DRAFT&#x60; version of the table with values from the &#x60;PUBLISHED&#x60; version. Any unpublished changes in the &#x60;DRAFT&#x60; will be lost after this call is made.

Parameters:

  • table_id (String)

    The ID or name of the table to reset.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the response.

Returns:

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

    HubDbTableV3 data, response status code and response headers



1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1676

def reset_draft_table_with_http_info(table_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.reset_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.reset_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft/reset'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#reset_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_draft_table(table_id, hub_db_table_v3_input, opts = {}) ⇒ HubDbTableV3

Update an existing table Update an existing HubDB table. You can use this endpoint to add or remove a column. Tables updated using the endpoint will only modify the ‘DRAFT` table. Use the publish endpoint to push all changes to the `PUBLISHED` version. You can only include the columns that need to be modified without including the remaining columns.

Parameters:

  • table_id (String)

    The ID or name of the table to update.

  • hub_db_table_v3_input (HubDbTableV3Input)

    The JSON schema for the table being updated.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:



1731
1732
1733
1734
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1731

def update_draft_table(table_id, hub_db_table_v3_input, opts = {})
  data, _status_code, _headers = update_draft_table_with_http_info(table_id, hub_db_table_v3_input, opts)
  data
end

#update_draft_table_row(row_id, table_id, hub_db_table_row_v3_input, opts = {}) ⇒ HubDbTableRowV3

Updates an existing row Sparse updates a single row in the table’s ‘DRAFT` version. All the column values need not be specified. Only the columns or fields that needs to be modified can be specified. See the `Create a row` endpoint for instructions on how to format the JSON row definitions.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The JSON object of the row with necessary fields that needs to be updated.

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

    the optional parameters

Returns:



1804
1805
1806
1807
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1804

def update_draft_table_row(row_id, table_id, hub_db_table_row_v3_input, opts = {})
  data, _status_code, _headers = update_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts)
  data
end

#update_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts = {}) ⇒ Array<(HubDbTableRowV3, Integer, Hash)>

Updates an existing row Sparse updates a single row in the table&#39;s &#x60;DRAFT&#x60; version. All the column values need not be specified. Only the columns or fields that needs to be modified can be specified. See the &#x60;Create a row&#x60; endpoint for instructions on how to format the JSON row definitions.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id (String)

    The ID or name of the table

  • hub_db_table_row_v3_input (HubDbTableRowV3Input)

    The JSON object of the row with necessary fields that needs to be updated.

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

    the optional parameters

Returns:

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

    HubDbTableRowV3 data, response status code and response headers



1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1816

def update_draft_table_row_with_http_info(row_id, table_id, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update_draft_table_row ...'
  end
  # verify the required parameter 'row_id' is set
  if @api_client.config.client_side_validation && row_id.nil?
    fail ArgumentError, "Missing the required parameter 'row_id' when calling DefaultApi.update_draft_table_row"
  end
  pattern = Regexp.new(/\d+/)
  if @api_client.config.client_side_validation && row_id !~ pattern
    fail ArgumentError, "invalid value for 'row_id' when calling DefaultApi.update_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.update_draft_table_row"
  end
  # verify the required parameter 'hub_db_table_row_v3_input' is set
  if @api_client.config.client_side_validation && hub_db_table_row_v3_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_row_v3_input' when calling DefaultApi.update_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableRowV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#update_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_draft_table_with_http_info(table_id, hub_db_table_v3_input, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Update an existing table Update an existing HubDB table. You can use this endpoint to add or remove a column. Tables updated using the endpoint will only modify the &#x60;DRAFT&#x60; table. Use the publish endpoint to push all changes to the &#x60;PUBLISHED&#x60; version. You can only include the columns that need to be modified without including the remaining columns.

Parameters:

  • table_id (String)

    The ID or name of the table to update.

  • hub_db_table_v3_input (HubDbTableV3Input)

    The JSON schema for the table being updated.

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

    the optional parameters

Options Hash (opts):

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:

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

    HubDbTableV3 data, response status code and response headers



1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1743

def update_draft_table_with_http_info(table_id, hub_db_table_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update_draft_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.update_draft_table"
  end
  # verify the required parameter 'hub_db_table_v3_input' is set
  if @api_client.config.client_side_validation && hub_db_table_v3_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_v3_input' when calling DefaultApi.update_draft_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}/draft'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#update_draft_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_table(table_id, hub_db_table_v3_live_input, opts = {}) ⇒ HubDbTableV3

Publish or unpublish a live version of a table or restore an archived table Use this endpoint to perform one of the following <ul><li> Publish a live version of a table (without copying table data from DRAFT) </li><li>Un-publish a live version of a table (Leaving the data in the live version)</li><li>Restore an archived table</li></ul> To publish a table, send ‘published` property in the JSON object with the value `true`. To unpublish a table, send `published` property in the JSON object with the value `false`. To restore an archived table, send `archived` property in the JSON object with the value `false` along with the query parameter `archived=true`. When restoring an archived table, if an active table already exists with the same `name` or `label`, you will need to change the name of the archived table when restoring it using the `name` and `label` parameters with a new name and new label. Examples: Publish a table: “` { "published": true } “` Unpublish a table: “` { "published": false } “` Restore a table: (send `archived=true` in query parameters) “` { "archived": false } “` Restore a table with a new name: (send `archived=true` in query parameters) “` { "label": "New Table Name", "name": "new_table_name", "archived": false } “`

Parameters:

  • table_id (String)

    The ID or name of the table to return.

  • hub_db_table_v3_live_input (HubDbTableV3LiveInput)

    The JSON object as described.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:



1886
1887
1888
1889
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1886

def update_table(table_id, hub_db_table_v3_live_input, opts = {})
  data, _status_code, _headers = update_table_with_http_info(table_id, hub_db_table_v3_live_input, opts)
  data
end

#update_table_with_http_info(table_id, hub_db_table_v3_live_input, opts = {}) ⇒ Array<(HubDbTableV3, Integer, Hash)>

Publish or unpublish a live version of a table or restore an archived table Use this endpoint to perform one of the following &lt;ul&gt;&lt;li&gt; Publish a live version of a table (without copying table data from DRAFT) &lt;/li&gt;&lt;li&gt;Un-publish a live version of a table (Leaving the data in the live version)&lt;/li&gt;&lt;li&gt;Restore an archived table&lt;/li&gt;&lt;/ul&gt; To publish a table, send &#x60;published&#x60; property in the JSON object with the value &#x60;true&#x60;. To unpublish a table, send &#x60;published&#x60; property in the JSON object with the value &#x60;false&#x60;. To restore an archived table, send &#x60;archived&#x60; property in the JSON object with the value &#x60;false&#x60; along with the query parameter &#x60;archived&#x3D;true&#x60;. When restoring an archived table, if an active table already exists with the same &#x60;name&#x60; or &#x60;label&#x60;, you will need to change the name of the archived table when restoring it using the &#x60;name&#x60; and &#x60;label&#x60; parameters with a new name and new label. Examples: Publish a table: &#x60;&#x60;&#x60; { &quot;published&quot;: true } &#x60;&#x60;&#x60; Unpublish a table: &#x60;&#x60;&#x60; { &quot;published&quot;: false } &#x60;&#x60;&#x60; Restore a table: (send &#x60;archived&#x3D;true&#x60; in query parameters) &#x60;&#x60;&#x60; { &quot;archived&quot;: false } &#x60;&#x60;&#x60; Restore a table with a new name: (send &#x60;archived&#x3D;true&#x60; in query parameters) &#x60;&#x60;&#x60; { &quot;label&quot;: &quot;New Table Name&quot;, &quot;name&quot;: &quot;new_table_name&quot;, &quot;archived&quot;: false } &#x60;&#x60;&#x60;

Parameters:

  • table_id (String)

    The ID or name of the table to return.

  • hub_db_table_v3_live_input (HubDbTableV3LiveInput)

    The JSON object as described.

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

    the optional parameters

Options Hash (opts):

  • :archived (Boolean)

    Whether to return only results that have been archived.

  • :include_foreign_ids (Boolean)

    Set this to &#x60;true&#x60; to populate foreign ID values in the result.

Returns:

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

    HubDbTableV3 data, response status code and response headers



1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
# File 'lib/hubspot/codegen/cms/hubdb/api/default_api.rb', line 1899

def update_table_with_http_info(table_id, hub_db_table_v3_live_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.update_table ...'
  end
  # verify the required parameter 'table_id' is set
  if @api_client.config.client_side_validation && table_id.nil?
    fail ArgumentError, "Missing the required parameter 'table_id' when calling DefaultApi.update_table"
  end
  # verify the required parameter 'hub_db_table_v3_live_input' is set
  if @api_client.config.client_side_validation && hub_db_table_v3_live_input.nil?
    fail ArgumentError, "Missing the required parameter 'hub_db_table_v3_live_input' when calling DefaultApi.update_table"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableId}'.sub('{' + 'tableId' + '}', CGI.escape(table_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
  query_params[:'includeForeignIds'] = opts[:'include_foreign_ids'] if !opts[:'include_foreign_ids'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

  # return_type
  return_type = opts[:return_type] || 'HubDbTableV3' 

  # auth_names
  auth_names = opts[:auth_names] || ['hapikey', 'oauth2']

  new_options = opts.merge(
    :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: DefaultApi#update_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end