Class: Composio::ActionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/composio/api/actions_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ActionsApi

Returns a new instance of ActionsApi.



15
16
17
# File 'lib/composio/api/actions_api.rb', line 15

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



13
14
15
# File 'lib/composio/api/actions_api.rb', line 13

def api_client
  @api_client
end

Instance Method Details

#execute(action_id:, connected_account_id: SENTINEL, app_name: SENTINEL, entity_id: SENTINEL, endpoint: SENTINEL, input: SENTINEL, session_info: SENTINEL, auth_config: SENTINEL, text: SENTINEL, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {}) ⇒ Object

Execute action

Execute an action. Support both connected account and no auth auth.

Parameters:

  • action_id (String)
  • connected_account_id (String) (defaults to: SENTINEL)
  • app_name (String) (defaults to: SENTINEL)
  • entity_id (String) (defaults to: SENTINEL)
  • endpoint (String) (defaults to: SENTINEL)
  • input (Object) (defaults to: SENTINEL)
  • session_info (SessionInfoDTO) (defaults to: SENTINEL)
  • auth_config (CustomAuthDTO) (defaults to: SENTINEL)
  • text (String) (defaults to: SENTINEL)
  • custom_description (String) (defaults to: SENTINEL)
  • system_prompt (String) (defaults to: SENTINEL)
  • body (ActionExecutionReqDTO)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/composio/api/actions_api.rb', line 36

def execute(action_id:, connected_account_id: SENTINEL, app_name: SENTINEL, entity_id: SENTINEL, endpoint: SENTINEL, input: SENTINEL, session_info: SENTINEL, auth_config: SENTINEL, text: SENTINEL, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {})
  _body = {}
  _body[:connectedAccountId] =  if  != SENTINEL
  _body[:appName] = app_name if app_name != SENTINEL
  _body[:entityId] = entity_id if entity_id != SENTINEL
  _body[:endpoint] = endpoint if endpoint != SENTINEL
  _body[:input] = input if input != SENTINEL
  _body[:sessionInfo] = session_info if session_info != SENTINEL
  _body[:authConfig] = auth_config if auth_config != SENTINEL
  _body[:text] = text if text != SENTINEL
  _body[:customDescription] = custom_description if custom_description != SENTINEL
  _body[:systemPrompt] = system_prompt if system_prompt != SENTINEL
  extra[:action_execution_req_dto] = _body if !_body.empty?
  api_response = execute_with_http_info_impl(action_id, extra)
  api_response.data
end

#execute_action_proxy(parameters:, connected_account_id:, endpoint:, method:, body: SENTINEL, extra: {}) ⇒ Object

Execute action proxy

Execute an action with direct auth.

Parameters:

  • parameters (Array<Parameter>)
  • connected_account_id (String)

    The connected account uuid to use for the action.

  • endpoint (String)

    The endpoint to call for the action. If the given url is relative, it will be resolved relative to the base_url set in the connected account info.

  • method (Method)

    The HTTP method to use for the action.

  • body (Object) (defaults to: SENTINEL)

    The body to be sent to the endpoint. This can either be a JSON field or a string.

  • body (ActionProxyRequestConfigDTO) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



173
174
175
176
177
178
179
180
181
182
183
# File 'lib/composio/api/actions_api.rb', line 173

def execute_action_proxy(parameters:, connected_account_id:, endpoint:, method:, body: SENTINEL, extra: {})
  _body = {}
  _body[:parameters] = parameters if parameters != SENTINEL
  _body[:connectedAccountId] =  if  != SENTINEL
  _body[:endpoint] = endpoint if endpoint != SENTINEL
  _body[:method] = method if method != SENTINEL
  _body[:body] = body if body != SENTINEL
  extra[:action_proxy_request_config_dto] = _body if !_body.empty?
  api_response = execute_action_proxy_with_http_info_impl(extra)
  api_response.data
end

#execute_action_proxy_with_http_info(parameters:, connected_account_id:, endpoint:, method:, body: SENTINEL, extra: {}) ⇒ Object

Execute action proxy

Execute an action with direct auth.

Parameters:

  • parameters (Array<Parameter>)
  • connected_account_id (String)

    The connected account uuid to use for the action.

  • endpoint (String)

    The endpoint to call for the action. If the given url is relative, it will be resolved relative to the base_url set in the connected account info.

  • method (Method)

    The HTTP method to use for the action.

  • body (Object) (defaults to: SENTINEL)

    The body to be sent to the endpoint. This can either be a JSON field or a string.

  • body (ActionProxyRequestConfigDTO) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



196
197
198
199
200
201
202
203
204
205
# File 'lib/composio/api/actions_api.rb', line 196

def execute_action_proxy_with_http_info(parameters:, connected_account_id:, endpoint:, method:, body: SENTINEL, extra: {})
  _body = {}
  _body[:parameters] = parameters if parameters != SENTINEL
  _body[:connectedAccountId] =  if  != SENTINEL
  _body[:endpoint] = endpoint if endpoint != SENTINEL
  _body[:method] = method if method != SENTINEL
  _body[:body] = body if body != SENTINEL
  extra[:action_proxy_request_config_dto] = _body if !_body.empty?
  execute_action_proxy_with_http_info_impl(extra)
end

#execute_with_http_info(action_id:, connected_account_id: SENTINEL, app_name: SENTINEL, entity_id: SENTINEL, endpoint: SENTINEL, input: SENTINEL, session_info: SENTINEL, auth_config: SENTINEL, text: SENTINEL, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {}) ⇒ Object

Execute action

Execute an action. Support both connected account and no auth auth.

Parameters:

  • action_id (String)
  • connected_account_id (String) (defaults to: SENTINEL)
  • app_name (String) (defaults to: SENTINEL)
  • entity_id (String) (defaults to: SENTINEL)
  • endpoint (String) (defaults to: SENTINEL)
  • input (Object) (defaults to: SENTINEL)
  • session_info (SessionInfoDTO) (defaults to: SENTINEL)
  • auth_config (CustomAuthDTO) (defaults to: SENTINEL)
  • text (String) (defaults to: SENTINEL)
  • custom_description (String) (defaults to: SENTINEL)
  • system_prompt (String) (defaults to: SENTINEL)
  • body (ActionExecutionReqDTO)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/composio/api/actions_api.rb', line 70

def execute_with_http_info(action_id:, connected_account_id: SENTINEL, app_name: SENTINEL, entity_id: SENTINEL, endpoint: SENTINEL, input: SENTINEL, session_info: SENTINEL, auth_config: SENTINEL, text: SENTINEL, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {})
  _body = {}
  _body[:connectedAccountId] =  if  != SENTINEL
  _body[:appName] = app_name if app_name != SENTINEL
  _body[:entityId] = entity_id if entity_id != SENTINEL
  _body[:endpoint] = endpoint if endpoint != SENTINEL
  _body[:input] = input if input != SENTINEL
  _body[:sessionInfo] = session_info if session_info != SENTINEL
  _body[:authConfig] = auth_config if auth_config != SENTINEL
  _body[:text] = text if text != SENTINEL
  _body[:customDescription] = custom_description if custom_description != SENTINEL
  _body[:systemPrompt] = system_prompt if system_prompt != SENTINEL
  extra[:action_execution_req_dto] = _body if !_body.empty?
  execute_with_http_info_impl(action_id, extra)
end

#get_action_by_id(action_id:, extra: {}) ⇒ Object

Get action

Get action details

Parameters:

  • action_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



278
279
280
281
# File 'lib/composio/api/actions_api.rb', line 278

def get_action_by_id(action_id:, extra: {})
  api_response = get_action_by_id_with_http_info_impl(action_id, extra)
  api_response.data
end

#get_action_by_id_with_http_info(action_id:, extra: {}) ⇒ Object

Get action

Get action details

Parameters:

  • action_id (String)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



289
290
291
# File 'lib/composio/api/actions_api.rb', line 289

def get_action_by_id_with_http_info(action_id:, extra: {})
  get_action_by_id_with_http_info_impl(action_id, extra)
end

#get_action_inputs(text:, action_id:, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {}) ⇒ Object

Get action inputs

Get the inputs for an action with NLA

Parameters:

  • text (String)
  • action_id (String)
  • custom_description (String) (defaults to: SENTINEL)
  • system_prompt (String) (defaults to: SENTINEL)
  • body (ActionGetNLAInputsReqDTO)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



372
373
374
375
376
377
378
379
380
# File 'lib/composio/api/actions_api.rb', line 372

def get_action_inputs(text:, action_id:, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {})
  _body = {}
  _body[:text] = text if text != SENTINEL
  _body[:customDescription] = custom_description if custom_description != SENTINEL
  _body[:systemPrompt] = system_prompt if system_prompt != SENTINEL
  extra[:action_get_nla_inputs_req_dto] = _body if !_body.empty?
  api_response = get_action_inputs_with_http_info_impl(action_id, extra)
  api_response.data
end

#get_action_inputs_with_http_info(text:, action_id:, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {}) ⇒ Object

Get action inputs

Get the inputs for an action with NLA

Parameters:

  • text (String)
  • action_id (String)
  • custom_description (String) (defaults to: SENTINEL)
  • system_prompt (String) (defaults to: SENTINEL)
  • body (ActionGetNLAInputsReqDTO)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



392
393
394
395
396
397
398
399
# File 'lib/composio/api/actions_api.rb', line 392

def get_action_inputs_with_http_info(text:, action_id:, custom_description: SENTINEL, system_prompt: SENTINEL, extra: {})
  _body = {}
  _body[:text] = text if text != SENTINEL
  _body[:customDescription] = custom_description if custom_description != SENTINEL
  _body[:systemPrompt] = system_prompt if system_prompt != SENTINEL
  extra[:action_get_nla_inputs_req_dto] = _body if !_body.empty?
  get_action_inputs_with_http_info_impl(action_id, extra)
end

#get_all_actions_based_on_query(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {}) ⇒ Object

List actions minimal

Retrieve a list of all actions based on query parameters.

Parameters:

  • app_names (String) (defaults to: SENTINEL)
  • use_case (String) (defaults to: SENTINEL)
  • show_enabled_only (Boolean) (defaults to: SENTINEL)
  • limit (Float) (defaults to: SENTINEL)
  • apps (String) (defaults to: SENTINEL)
  • actions (String) (defaults to: SENTINEL)
  • tags (String) (defaults to: SENTINEL)
  • usecase_limit (Float) (defaults to: SENTINEL)
  • filter_important_actions (Boolean) (defaults to: SENTINEL)
  • show_all (Boolean) (defaults to: SENTINEL)
  • page (Float) (defaults to: SENTINEL)
  • offset (Float) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/composio/api/actions_api.rb', line 494

def get_all_actions_based_on_query(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {})
  extra[:app_names] = app_names if app_names != SENTINEL
  extra[:use_case] = use_case if use_case != SENTINEL
  extra[:show_enabled_only] = show_enabled_only if show_enabled_only != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:apps] = apps if apps != SENTINEL
  extra[:actions] = actions if actions != SENTINEL
  extra[:tags] = tags if tags != SENTINEL
  extra[:usecase_limit] = usecase_limit if usecase_limit != SENTINEL
  extra[:filter_important_actions] = filter_important_actions if filter_important_actions != SENTINEL
  extra[:show_all] = show_all if show_all != SENTINEL
  extra[:page] = page if page != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  api_response = get_all_actions_based_on_query_with_http_info_impl(extra)
  api_response.data
end

#get_all_actions_based_on_query_with_http_info(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {}) ⇒ Object

List actions minimal

Retrieve a list of all actions based on query parameters.

Parameters:

  • app_names (String) (defaults to: SENTINEL)
  • use_case (String) (defaults to: SENTINEL)
  • show_enabled_only (Boolean) (defaults to: SENTINEL)
  • limit (Float) (defaults to: SENTINEL)
  • apps (String) (defaults to: SENTINEL)
  • actions (String) (defaults to: SENTINEL)
  • tags (String) (defaults to: SENTINEL)
  • usecase_limit (Float) (defaults to: SENTINEL)
  • filter_important_actions (Boolean) (defaults to: SENTINEL)
  • show_all (Boolean) (defaults to: SENTINEL)
  • page (Float) (defaults to: SENTINEL)
  • offset (Float) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/composio/api/actions_api.rb', line 528

def get_all_actions_based_on_query_with_http_info(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {})
  extra[:app_names] = app_names if app_names != SENTINEL
  extra[:use_case] = use_case if use_case != SENTINEL
  extra[:show_enabled_only] = show_enabled_only if show_enabled_only != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:apps] = apps if apps != SENTINEL
  extra[:actions] = actions if actions != SENTINEL
  extra[:tags] = tags if tags != SENTINEL
  extra[:usecase_limit] = usecase_limit if usecase_limit != SENTINEL
  extra[:filter_important_actions] = filter_important_actions if filter_important_actions != SENTINEL
  extra[:show_all] = show_all if show_all != SENTINEL
  extra[:page] = page if page != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  get_all_actions_based_on_query_with_http_info_impl(extra)
end

#list(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {}) ⇒ Object

List actions

Retrieve a list of all actions based on query parameters.

Parameters:

  • app_names (String) (defaults to: SENTINEL)
  • use_case (String) (defaults to: SENTINEL)
  • show_enabled_only (Boolean) (defaults to: SENTINEL)
  • limit (Float) (defaults to: SENTINEL)
  • apps (String) (defaults to: SENTINEL)
  • actions (String) (defaults to: SENTINEL)
  • tags (String) (defaults to: SENTINEL)
  • usecase_limit (Float) (defaults to: SENTINEL)
  • filter_important_actions (Boolean) (defaults to: SENTINEL)
  • show_all (Boolean) (defaults to: SENTINEL)
  • page (Float) (defaults to: SENTINEL)
  • offset (Float) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
# File 'lib/composio/api/actions_api.rb', line 655

def list(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {})
  extra[:app_names] = app_names if app_names != SENTINEL
  extra[:use_case] = use_case if use_case != SENTINEL
  extra[:show_enabled_only] = show_enabled_only if show_enabled_only != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:apps] = apps if apps != SENTINEL
  extra[:actions] = actions if actions != SENTINEL
  extra[:tags] = tags if tags != SENTINEL
  extra[:usecase_limit] = usecase_limit if usecase_limit != SENTINEL
  extra[:filter_important_actions] = filter_important_actions if filter_important_actions != SENTINEL
  extra[:show_all] = show_all if show_all != SENTINEL
  extra[:page] = page if page != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  api_response = list_with_http_info_impl(extra)
  api_response.data
end

#list_with_http_info(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {}) ⇒ Object

List actions

Retrieve a list of all actions based on query parameters.

Parameters:

  • app_names (String) (defaults to: SENTINEL)
  • use_case (String) (defaults to: SENTINEL)
  • show_enabled_only (Boolean) (defaults to: SENTINEL)
  • limit (Float) (defaults to: SENTINEL)
  • apps (String) (defaults to: SENTINEL)
  • actions (String) (defaults to: SENTINEL)
  • tags (String) (defaults to: SENTINEL)
  • usecase_limit (Float) (defaults to: SENTINEL)
  • filter_important_actions (Boolean) (defaults to: SENTINEL)
  • show_all (Boolean) (defaults to: SENTINEL)
  • page (Float) (defaults to: SENTINEL)
  • offset (Float) (defaults to: SENTINEL)
  • extra (Hash) (defaults to: {})

    additional parameters to pass along through :header_params, :query_params, or parameter name



689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/composio/api/actions_api.rb', line 689

def list_with_http_info(app_names: SENTINEL, use_case: SENTINEL, show_enabled_only: SENTINEL, limit: SENTINEL, apps: SENTINEL, actions: SENTINEL, tags: SENTINEL, usecase_limit: SENTINEL, filter_important_actions: SENTINEL, show_all: SENTINEL, page: SENTINEL, offset: SENTINEL, extra: {})
  extra[:app_names] = app_names if app_names != SENTINEL
  extra[:use_case] = use_case if use_case != SENTINEL
  extra[:show_enabled_only] = show_enabled_only if show_enabled_only != SENTINEL
  extra[:limit] = limit if limit != SENTINEL
  extra[:apps] = apps if apps != SENTINEL
  extra[:actions] = actions if actions != SENTINEL
  extra[:tags] = tags if tags != SENTINEL
  extra[:usecase_limit] = usecase_limit if usecase_limit != SENTINEL
  extra[:filter_important_actions] = filter_important_actions if filter_important_actions != SENTINEL
  extra[:show_all] = show_all if show_all != SENTINEL
  extra[:page] = page if page != SENTINEL
  extra[:offset] = offset if offset != SENTINEL
  list_with_http_info_impl(extra)
end