Module: Slack::Web::Api::Endpoints::Functions

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/functions.rb

Instance Method Summary collapse

Instance Method Details

#functions_completeError(options = {}) ⇒ Object

Signal that a function failed to complete

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :error (string)

    A human-readable error message that contains information about why the function failed to complete.

  • :function_execution_id (string)

    Context identifier that maps to the executed function.

Raises:

  • (ArgumentError)

See Also:



18
19
20
21
22
# File 'lib/slack/web/api/endpoints/functions.rb', line 18

def functions_completeError(options = {})
  raise ArgumentError, 'Required arguments :error missing' if options[:error].nil?
  raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
  post('functions.completeError', options)
end

#functions_completeSuccess(options = {}) ⇒ Object

Signal the successful completion of a function

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :function_execution_id (string)

    Context identifier that maps to the executed function.

  • :outputs (object)

    A JSON-based object that conforms to the output parameters schema for the custom function defined in the manifest.

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
# File 'lib/slack/web/api/endpoints/functions.rb', line 33

def functions_completeSuccess(options = {})
  raise ArgumentError, 'Required arguments :function_execution_id missing' if options[:function_execution_id].nil?
  raise ArgumentError, 'Required arguments :outputs missing' if options[:outputs].nil?
  options = encode_options_as_json(options, %i[outputs])
  post('functions.completeSuccess', options)
end