Class: Hubspot::Automation::Actions::FunctionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/codegen/automation/actions/api/functions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FunctionsApi

Returns a new instance of FunctionsApi.



21
22
23
# File 'lib/hubspot/codegen/automation/actions/api/functions_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/automation/actions/api/functions_api.rb', line 19

def api_client
  @api_client
end

Instance Method Details

#archive(definition_id, function_type, function_id, app_id, opts = {}) ⇒ nil

Delete a custom action function Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can’t be undone.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for `PRE_FETCH_OPTIONS` and `POST_FETCH_OPTIONS` function types.

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

    the optional parameters

Returns:

  • (nil)


32
33
34
35
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 32

def archive(definition_id, function_type, function_id, app_id, opts = {})
  archive_with_http_info(definition_id, function_type, function_id, app_id, opts)
  nil
end

#archive_by_function_type(definition_id, function_type, app_id, opts = {}) ⇒ nil

Delete a custom action function Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can’t be undone.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

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

    the optional parameters

Returns:

  • (nil)


116
117
118
119
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 116

def archive_by_function_type(definition_id, function_type, app_id, opts = {})
  archive_by_function_type_with_http_info(definition_id, function_type, app_id, opts)
  nil
end

#archive_by_function_type_with_http_info(definition_id, function_type, app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a custom action function Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can&#39;t be undone.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 128

def archive_by_function_type_with_http_info(definition_id, function_type, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.archive_by_function_type ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.archive_by_function_type"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.archive_by_function_type"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.archive_by_function_type"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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] || ['developer_hapikey']

  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: FunctionsApi#archive_by_function_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#archive_with_http_info(definition_id, function_type, function_id, app_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a custom action function Delete a function for a custom workflow action. This will remove the function itself as well as removing the association between the function and the custom action. This can&#39;t be undone.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for &#x60;PRE_FETCH_OPTIONS&#x60; and &#x60;POST_FETCH_OPTIONS&#x60; function types.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 45

def archive_with_http_info(definition_id, function_type, function_id, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.archive ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.archive"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.archive"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'function_id' is set
  if @api_client.config.client_side_validation && function_id.nil?
    fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.archive"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.archive"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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] || ['developer_hapikey']

  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: FunctionsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_or_replace(definition_id, function_type, function_id, app_id, body, opts = {}) ⇒ ActionFunctionIdentifier

Create or replace a custom action function Creates or replaces a function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for &#x60;PRE_FETCH_OPTIONS&#x60; and &#x60;POST_FETCH_OPTIONS&#x60; function types.

  • app_id (Integer)
  • body (String)

    The function source code. Must be valid JavaScript code.

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

    the optional parameters

Returns:



197
198
199
200
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 197

def create_or_replace(definition_id, function_type, function_id, app_id, body, opts = {})
  data, _status_code, _headers = create_or_replace_with_http_info(definition_id, function_type, function_id, app_id, body, opts)
  data
end

#create_or_replace_by_function_type(definition_id, function_type, app_id, body, opts = {}) ⇒ ActionFunctionIdentifier

Create or replace a custom action function Creates or replaces a function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • app_id (Integer)
  • body (String)

    The function source code. Must be valid JavaScript code.

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

    the optional parameters

Returns:



289
290
291
292
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 289

def create_or_replace_by_function_type(definition_id, function_type, app_id, body, opts = {})
  data, _status_code, _headers = create_or_replace_by_function_type_with_http_info(definition_id, function_type, app_id, body, opts)
  data
end

#create_or_replace_by_function_type_with_http_info(definition_id, function_type, app_id, body, opts = {}) ⇒ Array<(ActionFunctionIdentifier, Integer, Hash)>

Create or replace a custom action function Creates or replaces a function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • app_id (Integer)
  • body (String)

    The function source code. Must be valid JavaScript code.

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

    the optional parameters

Returns:

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

    ActionFunctionIdentifier data, response status code and response headers



302
303
304
305
306
307
308
309
310
311
312
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
365
366
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 302

def create_or_replace_by_function_type_with_http_info(definition_id, function_type, app_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.create_or_replace_by_function_type ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.create_or_replace_by_function_type"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.create_or_replace_by_function_type"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.create_or_replace_by_function_type"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FunctionsApi.create_or_replace_by_function_type"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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(['text/plain'])

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

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

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

  # auth_names
  auth_names = opts[:auth_names] || ['developer_hapikey']

  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: FunctionsApi#create_or_replace_by_function_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_or_replace_with_http_info(definition_id, function_type, function_id, app_id, body, opts = {}) ⇒ Array<(ActionFunctionIdentifier, Integer, Hash)>

Create or replace a custom action function Creates or replaces a function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for &#x60;PRE_FETCH_OPTIONS&#x60; and &#x60;POST_FETCH_OPTIONS&#x60; function types.

  • app_id (Integer)
  • body (String)

    The function source code. Must be valid JavaScript code.

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

    the optional parameters

Returns:

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

    ActionFunctionIdentifier data, response status code and response headers



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
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
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 211

def create_or_replace_with_http_info(definition_id, function_type, function_id, app_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.create_or_replace ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.create_or_replace"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.create_or_replace"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'function_id' is set
  if @api_client.config.client_side_validation && function_id.nil?
    fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.create_or_replace"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.create_or_replace"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling FunctionsApi.create_or_replace"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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(['text/plain'])

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

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

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

  # auth_names
  auth_names = opts[:auth_names] || ['developer_hapikey']

  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: FunctionsApi#create_or_replace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_function_type(definition_id, function_type, app_id, opts = {}) ⇒ ActionFunction

Get a custom action function Returns the given function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

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

    the optional parameters

Returns:



375
376
377
378
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 375

def get_by_function_type(definition_id, function_type, app_id, opts = {})
  data, _status_code, _headers = get_by_function_type_with_http_info(definition_id, function_type, app_id, opts)
  data
end

#get_by_function_type_with_http_info(definition_id, function_type, app_id, opts = {}) ⇒ Array<(ActionFunction, Integer, Hash)>

Get a custom action function Returns the given function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

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

    the optional parameters

Returns:

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

    ActionFunction data, response status code and response headers



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
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 387

def get_by_function_type_with_http_info(definition_id, function_type, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.get_by_function_type ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.get_by_function_type"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.get_by_function_type"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.get_by_function_type"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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] || 'ActionFunction' 

  # auth_names
  auth_names = opts[:auth_names] || ['developer_hapikey']

  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: FunctionsApi#get_by_function_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_by_id(definition_id, function_type, function_id, app_id, opts = {}) ⇒ ActionFunction

Get a custom action function Returns the given function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for &#x60;PRE_FETCH_OPTIONS&#x60; and &#x60;POST_FETCH_OPTIONS&#x60; function types.

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

    the optional parameters

Returns:



455
456
457
458
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 455

def get_by_id(definition_id, function_type, function_id, app_id, opts = {})
  data, _status_code, _headers = get_by_id_with_http_info(definition_id, function_type, function_id, app_id, opts)
  data
end

#get_by_id_with_http_info(definition_id, function_type, function_id, app_id, opts = {}) ⇒ Array<(ActionFunction, Integer, Hash)>

Get a custom action function Returns the given function for a custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

  • function_type (String)

    The type of function. This determines when the function will be called.

  • function_id (String)

    The ID qualifier for the function. This is used to specify which input field a function is associated with for &#x60;PRE_FETCH_OPTIONS&#x60; and &#x60;POST_FETCH_OPTIONS&#x60; function types.

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

    the optional parameters

Returns:

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

    ActionFunction data, response status code and response headers



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
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
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 468

def get_by_id_with_http_info(definition_id, function_type, function_id, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.get_by_id ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.get_by_id"
  end
  # verify the required parameter 'function_type' is set
  if @api_client.config.client_side_validation && function_type.nil?
    fail ArgumentError, "Missing the required parameter 'function_type' when calling FunctionsApi.get_by_id"
  end
  # verify enum value
  allowable_values = ["PRE_ACTION_EXECUTION", "PRE_FETCH_OPTIONS", "POST_FETCH_OPTIONS"]
  if @api_client.config.client_side_validation && !allowable_values.include?(function_type)
    fail ArgumentError, "invalid value for \"function_type\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'function_id' is set
  if @api_client.config.client_side_validation && function_id.nil?
    fail ArgumentError, "Missing the required parameter 'function_id' when calling FunctionsApi.get_by_id"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.get_by_id"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions/{functionType}/{functionId}'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'functionType' + '}', CGI.escape(function_type.to_s)).sub('{' + 'functionId' + '}', CGI.escape(function_id.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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] || 'ActionFunction' 

  # auth_names
  auth_names = opts[:auth_names] || ['developer_hapikey']

  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: FunctionsApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_page(definition_id, app_id, opts = {}) ⇒ CollectionResponseActionFunctionIdentifierNoPaging

Get all custom action functions Returns a list of all functions that are associated with the given custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

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

    the optional parameters

Returns:



538
539
540
541
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 538

def get_page(definition_id, app_id, opts = {})
  data, _status_code, _headers = get_page_with_http_info(definition_id, app_id, opts)
  data
end

#get_page_with_http_info(definition_id, app_id, opts = {}) ⇒ Array<(CollectionResponseActionFunctionIdentifierNoPaging, Integer, Hash)>

Get all custom action functions Returns a list of all functions that are associated with the given custom workflow action.

Parameters:

  • definition_id (String)

    The ID of the custom workflow action.

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

    the optional parameters

Returns:



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
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/hubspot/codegen/automation/actions/api/functions_api.rb', line 549

def get_page_with_http_info(definition_id, app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FunctionsApi.get_page ...'
  end
  # verify the required parameter 'definition_id' is set
  if @api_client.config.client_side_validation && definition_id.nil?
    fail ArgumentError, "Missing the required parameter 'definition_id' when calling FunctionsApi.get_page"
  end
  # verify the required parameter 'app_id' is set
  if @api_client.config.client_side_validation && app_id.nil?
    fail ArgumentError, "Missing the required parameter 'app_id' when calling FunctionsApi.get_page"
  end
  # resource path
  local_var_path = '/automation/v4/actions/{appId}/{definitionId}/functions'.sub('{' + 'definitionId' + '}', CGI.escape(definition_id.to_s)).sub('{' + 'appId' + '}', CGI.escape(app_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] || 'CollectionResponseActionFunctionIdentifierNoPaging' 

  # auth_names
  auth_names = opts[:auth_names] || ['developer_hapikey']

  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: FunctionsApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end