Class: Hubspot::Cms::Hubdb::RowsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RowsApi

Returns a new instance of RowsApi.



21
22
23
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_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/rows_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#clone_draft_table_row(row_id, table_id_or_name, 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_or_name (String)

    The ID or name of the table

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

    the optional parameters

Returns:



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

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

#clone_draft_table_row_with_http_info(row_id, table_id_or_name, 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_or_name (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



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
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 41

def clone_draft_table_row_with_http_info(row_id, table_id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.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 RowsApi.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 RowsApi.clone_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.clone_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft/clone'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#clone_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_table_row(table_id_or_name, 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 `push-live` endpoint to push these changes to live version and publish them.

Parameters:

  • table_id_or_name (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:



103
104
105
106
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 103

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

#create_table_row_with_http_info(table_id_or_name, 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 &#x60;push-live&#x60; endpoint to push these changes to live version and publish them.

Parameters:

  • table_id_or_name (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



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
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 114

def create_table_row_with_http_info(table_id_or_name, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.create_table_row ...'
  end
  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.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 RowsApi.create_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows'.sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#create_table_row\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_or_name, opts = {}) ⇒ HubDbTableRowV3

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

Parameters:

  • row_id (String)

    The ID of the row

  • table_id_or_name (String)

    The ID or name of the table

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

    the optional parameters

Returns:



173
174
175
176
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 173

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

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

Get a row from the draft table 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_or_name (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



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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 184

def get_draft_table_row_by_id_with_http_info(row_id, table_id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.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 RowsApi.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 RowsApi.get_draft_table_row_by_id, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.get_draft_table_row_by_id"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#get_draft_table_row_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_table_row(row_id, table_id_or_name, opts = {}) ⇒ HubDbTableRowV3

Get a table row Get a single row by ID from a table’s ‘live` version. Note: This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id_or_name (String)

    The ID or name of the table

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

    the optional parameters

Returns:



246
247
248
249
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 246

def get_table_row(row_id, table_id_or_name, opts = {})
  data, _status_code, _headers = get_table_row_with_http_info(row_id, table_id_or_name, opts)
  data
end

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

Get a table row Get a single row by ID from a table&#39;s &#x60;live&#x60; version. Note: This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.

Parameters:

  • row_id (String)

    The ID of the row

  • table_id_or_name (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



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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 257

def get_table_row_with_http_info(row_id, table_id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.get_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 RowsApi.get_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 RowsApi.get_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.get_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#get_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_table_rows(table_id_or_name, opts = {}) ⇒ CollectionResponseWithTotalHubDbTableRowV3ForwardPaging

Get rows for a table Returns a set of rows in the ‘live` version of the specified table. Row results can be filtered and sorted. Refer to the overview section for detailed filtering and sorting options. Note: This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.

Parameters:

  • table_id_or_name (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. See the above description for more details.

Returns:



322
323
324
325
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 322

def get_table_rows(table_id_or_name, opts = {})
  data, _status_code, _headers = get_table_rows_with_http_info(table_id_or_name, opts)
  data
end

#get_table_rows_with_http_info(table_id_or_name, opts = {}) ⇒ Array<(CollectionResponseWithTotalHubDbTableRowV3ForwardPaging, Integer, Hash)>

Get rows for a table Returns a set of rows in the &#x60;live&#x60; version of the specified table. Row results can be filtered and sorted. Refer to the overview section for detailed filtering and sorting options. Note: This endpoint can be accessed without any authentication, if the table is set to be allowed for public access.

Parameters:

  • table_id_or_name (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. See the above description for more details.

Returns:



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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 336

def get_table_rows_with_http_info(table_id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.get_table_rows ...'
  end
  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.get_table_rows"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows'.sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#get_table_rows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#purge_draft_table_row(row_id, table_id_or_name, 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_or_name (String)

    The ID or name of the table

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

    the optional parameters

Returns:

  • (nil)


393
394
395
396
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 393

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

#purge_draft_table_row_with_http_info(row_id, table_id_or_name, 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_or_name (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



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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 404

def purge_draft_table_row_with_http_info(row_id, table_id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.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 RowsApi.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 RowsApi.purge_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.purge_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#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_or_name, 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 overview section.

Parameters:

  • table_id_or_name (String)

    The ID or name of the table to query.

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

    the optional parameters

Options Hash (opts):

  • :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.

  • :properties (Array<String>)

    Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times.

  • :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:



469
470
471
472
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 469

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

#read_draft_table_rows_with_http_info(table_id_or_name, 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 overview section.

Parameters:

  • table_id_or_name (String)

    The ID or name of the table to query.

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

    the optional parameters

Options Hash (opts):

  • :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.

  • :properties (Array<String>)

    Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times.

  • :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:



483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 483

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'properties'] = @api_client.build_collection_param(opts[:'properties'], :multi) if !opts[:'properties'].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: RowsApi#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_or_name, 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_or_name (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:



541
542
543
544
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 541

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

#replace_draft_table_row_with_http_info(row_id, table_id_or_name, 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_or_name (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



553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 553

def replace_draft_table_row_with_http_info(row_id, table_id_or_name, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.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 RowsApi.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 RowsApi.replace_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.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 RowsApi.replace_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#replace_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_draft_table_row(row_id, table_id_or_name, 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_or_name (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:



622
623
624
625
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 622

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

#update_draft_table_row_with_http_info(row_id, table_id_or_name, 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_or_name (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



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
# File 'lib/hubspot/codegen/cms/hubdb/api/rows_api.rb', line 634

def update_draft_table_row_with_http_info(row_id, table_id_or_name, hub_db_table_row_v3_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RowsApi.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 RowsApi.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 RowsApi.update_draft_table_row, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'table_id_or_name' is set
  if @api_client.config.client_side_validation && table_id_or_name.nil?
    fail ArgumentError, "Missing the required parameter 'table_id_or_name' when calling RowsApi.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 RowsApi.update_draft_table_row"
  end
  # resource path
  local_var_path = '/cms/v3/hubdb/tables/{tableIdOrName}/rows/{rowId}/draft'.sub('{' + 'rowId' + '}', CGI.escape(row_id.to_s)).sub('{' + 'tableIdOrName' + '}', CGI.escape(table_id_or_name.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: RowsApi#update_draft_table_row\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end