composio 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +93 -0
- data/README.md +1779 -0
- data/Rakefile +10 -0
- data/composio.gemspec +39 -0
- data/header.png +0 -0
- data/lib/composio/api/actions_api.rb +1062 -0
- data/lib/composio/api/api_keys_api.rb +268 -0
- data/lib/composio/api/apps_api.rb +266 -0
- data/lib/composio/api/auth_api.rb +370 -0
- data/lib/composio/api/cli_api.rb +266 -0
- data/lib/composio/api/connections_api.rb +591 -0
- data/lib/composio/api/integrations_api.rb +578 -0
- data/lib/composio/api/logs_api.rb +166 -0
- data/lib/composio/api/metadata_api.rb +180 -0
- data/lib/composio/api/team_api.rb +188 -0
- data/lib/composio/api/triggers_api.rb +1222 -0
- data/lib/composio/api_client.rb +436 -0
- data/lib/composio/api_client_custom.rb +14 -0
- data/lib/composio/api_error.rb +53 -0
- data/lib/composio/configuration.rb +330 -0
- data/lib/composio/models/action_details.rb +357 -0
- data/lib/composio/models/action_details_minimal.rb +329 -0
- data/lib/composio/models/action_execution_req_dto.rb +260 -0
- data/lib/composio/models/action_execution_res_dto.rb +238 -0
- data/lib/composio/models/action_log_data.rb +345 -0
- data/lib/composio/models/action_metadata.rb +402 -0
- data/lib/composio/models/action_metadata_type.rb +101 -0
- data/lib/composio/models/actions_controller_v1.rb +222 -0
- data/lib/composio/models/actions_list_response_dto.rb +250 -0
- data/lib/composio/models/actions_minimal_list_response_dto.rb +250 -0
- data/lib/composio/models/actions_query_dto.rb +300 -0
- data/lib/composio/models/active_trigger_instance.rb +311 -0
- data/lib/composio/models/active_triggers_res_dto.rb +238 -0
- data/lib/composio/models/add_repo_url_req_dto.rb +221 -0
- data/lib/composio/models/add_repo_url_res_dto.rb +221 -0
- data/lib/composio/models/add_tools_req_dto.rb +251 -0
- data/lib/composio/models/add_tools_request_dto.rb +251 -0
- data/lib/composio/models/api_key_res_dto.rb +323 -0
- data/lib/composio/models/app_info_response_dto.rb +323 -0
- data/lib/composio/models/app_list_res_dto.rb +238 -0
- data/lib/composio/models/app_query_dto.rb +216 -0
- data/lib/composio/models/auth_config_dto.rb +229 -0
- data/lib/composio/models/cli_query_dto.rb +231 -0
- data/lib/composio/models/connected_account_response_dto.rb +331 -0
- data/lib/composio/models/connection_params.rb +395 -0
- data/lib/composio/models/connection_params_for_account.rb +323 -0
- data/lib/composio/models/connection_params_headers.rb +224 -0
- data/lib/composio/models/connection_with_app_data.rb +358 -0
- data/lib/composio/models/connection_with_app_data_created_at.rb +101 -0
- data/lib/composio/models/connector_list_item_dto.rb +376 -0
- data/lib/composio/models/connector_list_item_dto_created_at.rb +102 -0
- data/lib/composio/models/connector_list_item_dto_updated_at.rb +102 -0
- data/lib/composio/models/create_connector_payload_dto.rb +274 -0
- data/lib/composio/models/create_connector_payload_dto_use_composio_auth.rb +226 -0
- data/lib/composio/models/delete_api_key_req_dto.rb +221 -0
- data/lib/composio/models/delete_api_key_response_dto.rb +221 -0
- data/lib/composio/models/delete_row_apidto.rb +236 -0
- data/lib/composio/models/delete_tools_req_dto.rb +221 -0
- data/lib/composio/models/delete_tools_res_dto.rb +221 -0
- data/lib/composio/models/direct_execute_req_dto.rb +262 -0
- data/lib/composio/models/enable_trigger_body_dto.rb +221 -0
- data/lib/composio/models/enable_trigger_params_dto.rb +236 -0
- data/lib/composio/models/execute_action_res_dto.rb +236 -0
- data/lib/composio/models/generate_api_key_req_dto.rb +221 -0
- data/lib/composio/models/generate_cli_session_req_dto.rb +221 -0
- data/lib/composio/models/generate_cli_session_res_dto.rb +221 -0
- data/lib/composio/models/get_active_triggers_query_dto.rb +276 -0
- data/lib/composio/models/get_cli_session_res_dto.rb +236 -0
- data/lib/composio/models/get_connections_query_dto.rb +287 -0
- data/lib/composio/models/get_connections_response_dto.rb +250 -0
- data/lib/composio/models/get_connections_result.rb +236 -0
- data/lib/composio/models/get_connector_info_res_dto.rb +417 -0
- data/lib/composio/models/get_connector_list_res_dto.rb +253 -0
- data/lib/composio/models/get_logs_dto.rb +288 -0
- data/lib/composio/models/get_logs_query_dto.rb +246 -0
- data/lib/composio/models/get_trigger_params_dto.rb +221 -0
- data/lib/composio/models/get_trigger_response_dto.rb +230 -0
- data/lib/composio/models/handle_trigger_body_dto.rb +221 -0
- data/lib/composio/models/handle_trigger_params_dto.rb +236 -0
- data/lib/composio/models/identify_client_req_dto.rb +231 -0
- data/lib/composio/models/identify_client_res_dto.rb +251 -0
- data/lib/composio/models/initiate_connection_payload_dto.rb +281 -0
- data/lib/composio/models/initiate_connection_response.rb +272 -0
- data/lib/composio/models/invite_member_req_dto.rb +251 -0
- data/lib/composio/models/job_status.rb +37 -0
- data/lib/composio/models/list_triggers_query_dto.rb +246 -0
- data/lib/composio/models/logout_res_dto.rb +221 -0
- data/lib/composio/models/logs_res_dto.rb +233 -0
- data/lib/composio/models/magic_link_req_dto.rb +236 -0
- data/lib/composio/models/magic_link_res_dto.rb +220 -0
- data/lib/composio/models/member_res_dto.rb +305 -0
- data/lib/composio/models/meta.rb +220 -0
- data/lib/composio/models/meta_app.rb +220 -0
- data/lib/composio/models/metadata_query_dto.rb +221 -0
- data/lib/composio/models/metadata_req_dto.rb +232 -0
- data/lib/composio/models/o_auth2_callback_query_dto.rb +220 -0
- data/lib/composio/models/open_api_spec_list_res_dto.rb +436 -0
- data/lib/composio/models/page_info.rb +338 -0
- data/lib/composio/models/page_info_dto.rb +248 -0
- data/lib/composio/models/patch_connector_req_dto.rb +226 -0
- data/lib/composio/models/patch_connector_res_dto.rb +221 -0
- data/lib/composio/models/proxy_execution_req_dto.rb +234 -0
- data/lib/composio/models/redirect_uri_dto.rb +215 -0
- data/lib/composio/models/set_callback_url_body_dto.rb +221 -0
- data/lib/composio/models/single_app_info_res_dto.rb +394 -0
- data/lib/composio/models/single_trigger_res_dto.rb +336 -0
- data/lib/composio/models/status.rb +37 -0
- data/lib/composio/models/switch_trigger_status_body_dto.rb +221 -0
- data/lib/composio/models/switch_trigger_status_params_dto.rb +221 -0
- data/lib/composio/models/time.rb +41 -0
- data/lib/composio/models/toggle_connected_account_response_dto.rb +220 -0
- data/lib/composio/models/toggle_trigger_state_response_dto.rb +220 -0
- data/lib/composio/models/tools_execute_req_dto.rb +275 -0
- data/lib/composio/models/track_client_req_dto.rb +240 -0
- data/lib/composio/models/track_client_res_dto.rb +221 -0
- data/lib/composio/models/trigger_config.rb +237 -0
- data/lib/composio/models/trigger_instance_params_dto.rb +221 -0
- data/lib/composio/models/trigger_log_data.rb +345 -0
- data/lib/composio/models/trigger_log_item_dto.rb +336 -0
- data/lib/composio/models/trigger_logs_res_dto.rb +236 -0
- data/lib/composio/models/trigger_metadata.rb +402 -0
- data/lib/composio/models/trigger_metadata_dto.rb +347 -0
- data/lib/composio/models/trigger_metadata_type.rb +101 -0
- data/lib/composio/models/trigger_res_dto.rb +361 -0
- data/lib/composio/models/trigger_response_dto.rb +241 -0
- data/lib/composio/models/trigger_toggle_info_response_dto.rb +221 -0
- data/lib/composio/models/triggers_enabled_toggle_req_dto.rb +221 -0
- data/lib/composio/models/triggers_enabled_toggle_res_dto.rb +221 -0
- data/lib/composio/models/type.rb +37 -0
- data/lib/composio/models/user_git_user_info.rb +230 -0
- data/lib/composio/models/verify_cli_code_res_dto.rb +251 -0
- data/lib/composio/models/verify_magic_link_data_dto.rb +263 -0
- data/lib/composio/models/verify_magic_link_req_dto.rb +221 -0
- data/lib/composio/models/verify_magic_link_res_dto.rb +230 -0
- data/lib/composio/models/webhook_url_response_dto.rb +231 -0
- data/lib/composio/version.rb +11 -0
- data/lib/composio.rb +214 -0
- data/spec/api/actions_api_spec.rb +164 -0
- data/spec/api/api_keys_api_spec.rb +61 -0
- data/spec/api/apps_api_spec.rb +63 -0
- data/spec/api/auth_api_spec.rb +73 -0
- data/spec/api/cli_api_spec.rb +63 -0
- data/spec/api/connections_api_spec.rb +103 -0
- data/spec/api/integrations_api_spec.rb +96 -0
- data/spec/api/logs_api_spec.rb +48 -0
- data/spec/api/metadata_api_spec.rb +50 -0
- data/spec/api/team_api_spec.rb +50 -0
- data/spec/api/triggers_api_spec.rb +188 -0
- data/spec/api_client_spec.rb +191 -0
- data/spec/configuration_spec.rb +38 -0
- data/spec/models/action_details_minimal_spec.rb +76 -0
- data/spec/models/action_details_spec.rb +88 -0
- data/spec/models/action_execution_req_dto_spec.rb +58 -0
- data/spec/models/action_execution_res_dto_spec.rb +40 -0
- data/spec/models/action_log_data_spec.rb +70 -0
- data/spec/models/action_metadata_spec.rb +88 -0
- data/spec/models/action_metadata_type_spec.rb +25 -0
- data/spec/models/actions_controller_v1_spec.rb +28 -0
- data/spec/models/actions_list_response_dto_spec.rb +40 -0
- data/spec/models/actions_minimal_list_response_dto_spec.rb +40 -0
- data/spec/models/actions_query_dto_spec.rb +82 -0
- data/spec/models/active_trigger_instance_spec.rb +70 -0
- data/spec/models/active_triggers_res_dto_spec.rb +34 -0
- data/spec/models/add_repo_url_req_dto_spec.rb +28 -0
- data/spec/models/add_repo_url_res_dto_spec.rb +28 -0
- data/spec/models/add_tools_req_dto_spec.rb +40 -0
- data/spec/models/add_tools_request_dto_spec.rb +40 -0
- data/spec/models/api_key_res_dto_spec.rb +52 -0
- data/spec/models/app_info_response_dto_spec.rb +70 -0
- data/spec/models/app_list_res_dto_spec.rb +34 -0
- data/spec/models/app_query_dto_spec.rb +28 -0
- data/spec/models/auth_config_dto_spec.rb +34 -0
- data/spec/models/cli_query_dto_spec.rb +34 -0
- data/spec/models/connected_account_response_dto_spec.rb +82 -0
- data/spec/models/connection_params_for_account_spec.rb +100 -0
- data/spec/models/connection_params_headers_spec.rb +34 -0
- data/spec/models/connection_params_spec.rb +118 -0
- data/spec/models/connection_with_app_data_created_at_spec.rb +25 -0
- data/spec/models/connection_with_app_data_spec.rb +100 -0
- data/spec/models/connector_list_item_dto_created_at_spec.rb +25 -0
- data/spec/models/connector_list_item_dto_spec.rb +94 -0
- data/spec/models/connector_list_item_dto_updated_at_spec.rb +25 -0
- data/spec/models/create_connector_payload_dto_spec.rb +58 -0
- data/spec/models/create_connector_payload_dto_use_composio_auth_spec.rb +22 -0
- data/spec/models/delete_api_key_req_dto_spec.rb +28 -0
- data/spec/models/delete_api_key_response_dto_spec.rb +28 -0
- data/spec/models/delete_row_apidto_spec.rb +34 -0
- data/spec/models/delete_tools_req_dto_spec.rb +28 -0
- data/spec/models/delete_tools_res_dto_spec.rb +28 -0
- data/spec/models/direct_execute_req_dto_spec.rb +46 -0
- data/spec/models/enable_trigger_body_dto_spec.rb +28 -0
- data/spec/models/enable_trigger_params_dto_spec.rb +34 -0
- data/spec/models/execute_action_res_dto_spec.rb +34 -0
- data/spec/models/generate_api_key_req_dto_spec.rb +28 -0
- data/spec/models/generate_cli_session_req_dto_spec.rb +28 -0
- data/spec/models/generate_cli_session_res_dto_spec.rb +28 -0
- data/spec/models/get_active_triggers_query_dto_spec.rb +64 -0
- data/spec/models/get_cli_session_res_dto_spec.rb +34 -0
- data/spec/models/get_connections_query_dto_spec.rb +76 -0
- data/spec/models/get_connections_response_dto_spec.rb +40 -0
- data/spec/models/get_connections_result_spec.rb +34 -0
- data/spec/models/get_connector_info_res_dto_spec.rb +106 -0
- data/spec/models/get_connector_list_res_dto_spec.rb +40 -0
- data/spec/models/get_logs_dto_spec.rb +70 -0
- data/spec/models/get_logs_query_dto_spec.rb +46 -0
- data/spec/models/get_trigger_params_dto_spec.rb +28 -0
- data/spec/models/get_trigger_response_dto_spec.rb +34 -0
- data/spec/models/handle_trigger_body_dto_spec.rb +28 -0
- data/spec/models/handle_trigger_params_dto_spec.rb +34 -0
- data/spec/models/identify_client_req_dto_spec.rb +34 -0
- data/spec/models/identify_client_res_dto_spec.rb +40 -0
- data/spec/models/initiate_connection_payload_dto_spec.rb +46 -0
- data/spec/models/initiate_connection_response_spec.rb +34 -0
- data/spec/models/invite_member_req_dto_spec.rb +40 -0
- data/spec/models/job_status_spec.rb +22 -0
- data/spec/models/list_triggers_query_dto_spec.rb +46 -0
- data/spec/models/logout_res_dto_spec.rb +28 -0
- data/spec/models/logs_res_dto_spec.rb +34 -0
- data/spec/models/magic_link_req_dto_spec.rb +34 -0
- data/spec/models/magic_link_res_dto_spec.rb +28 -0
- data/spec/models/member_res_dto_spec.rb +52 -0
- data/spec/models/meta_app_spec.rb +28 -0
- data/spec/models/meta_spec.rb +28 -0
- data/spec/models/metadata_query_dto_spec.rb +28 -0
- data/spec/models/metadata_req_dto_spec.rb +34 -0
- data/spec/models/o_auth2_callback_query_dto_spec.rb +28 -0
- data/spec/models/open_api_spec_list_res_dto_spec.rb +94 -0
- data/spec/models/page_info_dto_spec.rb +40 -0
- data/spec/models/page_info_spec.rb +46 -0
- data/spec/models/patch_connector_req_dto_spec.rb +34 -0
- data/spec/models/patch_connector_res_dto_spec.rb +28 -0
- data/spec/models/proxy_execution_req_dto_spec.rb +34 -0
- data/spec/models/redirect_uri_dto_spec.rb +28 -0
- data/spec/models/set_callback_url_body_dto_spec.rb +28 -0
- data/spec/models/single_app_info_res_dto_spec.rb +118 -0
- data/spec/models/single_trigger_res_dto_spec.rb +76 -0
- data/spec/models/status_spec.rb +22 -0
- data/spec/models/switch_trigger_status_body_dto_spec.rb +28 -0
- data/spec/models/switch_trigger_status_params_dto_spec.rb +28 -0
- data/spec/models/time_spec.rb +22 -0
- data/spec/models/toggle_connected_account_response_dto_spec.rb +28 -0
- data/spec/models/toggle_trigger_state_response_dto_spec.rb +28 -0
- data/spec/models/tools_execute_req_dto_spec.rb +58 -0
- data/spec/models/track_client_req_dto_spec.rb +40 -0
- data/spec/models/track_client_res_dto_spec.rb +28 -0
- data/spec/models/trigger_config_spec.rb +34 -0
- data/spec/models/trigger_instance_params_dto_spec.rb +28 -0
- data/spec/models/trigger_log_data_spec.rb +70 -0
- data/spec/models/trigger_log_item_dto_spec.rb +82 -0
- data/spec/models/trigger_logs_res_dto_spec.rb +34 -0
- data/spec/models/trigger_metadata_dto_spec.rb +82 -0
- data/spec/models/trigger_metadata_spec.rb +94 -0
- data/spec/models/trigger_metadata_type_spec.rb +25 -0
- data/spec/models/trigger_res_dto_spec.rb +100 -0
- data/spec/models/trigger_response_dto_spec.rb +40 -0
- data/spec/models/trigger_toggle_info_response_dto_spec.rb +28 -0
- data/spec/models/triggers_enabled_toggle_req_dto_spec.rb +28 -0
- data/spec/models/triggers_enabled_toggle_res_dto_spec.rb +28 -0
- data/spec/models/type_spec.rb +22 -0
- data/spec/models/user_git_user_info_spec.rb +34 -0
- data/spec/models/verify_cli_code_res_dto_spec.rb +40 -0
- data/spec/models/verify_magic_link_data_dto_spec.rb +46 -0
- data/spec/models/verify_magic_link_req_dto_spec.rb +28 -0
- data/spec/models/verify_magic_link_res_dto_spec.rb +34 -0
- data/spec/models/webhook_url_response_dto_spec.rb +34 -0
- data/spec/simple_test_spec.rb +52 -0
- data/spec/spec_helper.rb +107 -0
- metadata +504 -0
@@ -0,0 +1,347 @@
|
|
1
|
+
=begin
|
2
|
+
#Composio OpenAPI
|
3
|
+
|
4
|
+
#Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Composio
|
13
|
+
# The trigger details if found
|
14
|
+
class TriggerMetadataDTO
|
15
|
+
# The unique identifier of the trigger
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# The connection identifier associated with the trigger
|
19
|
+
attr_accessor :connection_id
|
20
|
+
|
21
|
+
# The name of the trigger
|
22
|
+
attr_accessor :trigger_name
|
23
|
+
|
24
|
+
# The data associated with the trigger
|
25
|
+
attr_accessor :trigger_data
|
26
|
+
|
27
|
+
# The configuration of the trigger
|
28
|
+
attr_accessor :trigger_config
|
29
|
+
|
30
|
+
# The state of the trigger
|
31
|
+
attr_accessor :state
|
32
|
+
|
33
|
+
# The creation date of the trigger
|
34
|
+
attr_accessor :created_at
|
35
|
+
|
36
|
+
# The last update date of the trigger
|
37
|
+
attr_accessor :updated_at
|
38
|
+
|
39
|
+
# The date when the trigger was disabled, if applicable
|
40
|
+
attr_accessor :disabled_at
|
41
|
+
|
42
|
+
# The reason why the trigger was disabled, if applicable
|
43
|
+
attr_accessor :disabled_reason
|
44
|
+
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
+
def self.attribute_map
|
47
|
+
{
|
48
|
+
:'id' => :'id',
|
49
|
+
:'connection_id' => :'connectionId',
|
50
|
+
:'trigger_name' => :'triggerName',
|
51
|
+
:'trigger_data' => :'triggerData',
|
52
|
+
:'trigger_config' => :'triggerConfig',
|
53
|
+
:'state' => :'state',
|
54
|
+
:'created_at' => :'createdAt',
|
55
|
+
:'updated_at' => :'updatedAt',
|
56
|
+
:'disabled_at' => :'disabledAt',
|
57
|
+
:'disabled_reason' => :'disabledReason'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns all the JSON keys this model knows about
|
62
|
+
def self.acceptable_attributes
|
63
|
+
attribute_map.values
|
64
|
+
end
|
65
|
+
|
66
|
+
# Attribute type mapping.
|
67
|
+
def self.openapi_types
|
68
|
+
{
|
69
|
+
:'id' => :'String',
|
70
|
+
:'connection_id' => :'String',
|
71
|
+
:'trigger_name' => :'String',
|
72
|
+
:'trigger_data' => :'String',
|
73
|
+
:'trigger_config' => :'Object',
|
74
|
+
:'state' => :'Object',
|
75
|
+
:'created_at' => :'String',
|
76
|
+
:'updated_at' => :'String',
|
77
|
+
:'disabled_at' => :'String',
|
78
|
+
:'disabled_reason' => :'String'
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
# List of attributes with nullable: true
|
83
|
+
def self.openapi_nullable
|
84
|
+
Set.new([
|
85
|
+
])
|
86
|
+
end
|
87
|
+
|
88
|
+
# Initializes the object
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
90
|
+
def initialize(attributes = {})
|
91
|
+
if (!attributes.is_a?(Hash))
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::TriggerMetadataDTO` initialize method"
|
93
|
+
end
|
94
|
+
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
96
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
97
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
98
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::TriggerMetadataDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
99
|
+
end
|
100
|
+
h[k.to_sym] = v
|
101
|
+
}
|
102
|
+
|
103
|
+
if attributes.key?(:'id')
|
104
|
+
self.id = attributes[:'id']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'connection_id')
|
108
|
+
self.connection_id = attributes[:'connection_id']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'trigger_name')
|
112
|
+
self.trigger_name = attributes[:'trigger_name']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'trigger_data')
|
116
|
+
self.trigger_data = attributes[:'trigger_data']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'trigger_config')
|
120
|
+
self.trigger_config = attributes[:'trigger_config']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'state')
|
124
|
+
self.state = attributes[:'state']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'created_at')
|
128
|
+
self.created_at = attributes[:'created_at']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'updated_at')
|
132
|
+
self.updated_at = attributes[:'updated_at']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'disabled_at')
|
136
|
+
self.disabled_at = attributes[:'disabled_at']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.key?(:'disabled_reason')
|
140
|
+
self.disabled_reason = attributes[:'disabled_reason']
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
145
|
+
# @return Array for valid properties with the reasons
|
146
|
+
def list_invalid_properties
|
147
|
+
invalid_properties = Array.new
|
148
|
+
if @id.nil?
|
149
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @connection_id.nil?
|
153
|
+
invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @trigger_name.nil?
|
157
|
+
invalid_properties.push('invalid value for "trigger_name", trigger_name cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @trigger_data.nil?
|
161
|
+
invalid_properties.push('invalid value for "trigger_data", trigger_data cannot be nil.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if @trigger_config.nil?
|
165
|
+
invalid_properties.push('invalid value for "trigger_config", trigger_config cannot be nil.')
|
166
|
+
end
|
167
|
+
|
168
|
+
if @state.nil?
|
169
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
170
|
+
end
|
171
|
+
|
172
|
+
if @created_at.nil?
|
173
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
174
|
+
end
|
175
|
+
|
176
|
+
if @updated_at.nil?
|
177
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
178
|
+
end
|
179
|
+
|
180
|
+
invalid_properties
|
181
|
+
end
|
182
|
+
|
183
|
+
# Check to see if the all the properties in the model are valid
|
184
|
+
# @return true if the model is valid
|
185
|
+
def valid?
|
186
|
+
return false if @id.nil?
|
187
|
+
return false if @connection_id.nil?
|
188
|
+
return false if @trigger_name.nil?
|
189
|
+
return false if @trigger_data.nil?
|
190
|
+
return false if @trigger_config.nil?
|
191
|
+
return false if @state.nil?
|
192
|
+
return false if @created_at.nil?
|
193
|
+
return false if @updated_at.nil?
|
194
|
+
true
|
195
|
+
end
|
196
|
+
|
197
|
+
# Checks equality by comparing each attribute.
|
198
|
+
# @param [Object] Object to be compared
|
199
|
+
def ==(o)
|
200
|
+
return true if self.equal?(o)
|
201
|
+
self.class == o.class &&
|
202
|
+
id == o.id &&
|
203
|
+
connection_id == o.connection_id &&
|
204
|
+
trigger_name == o.trigger_name &&
|
205
|
+
trigger_data == o.trigger_data &&
|
206
|
+
trigger_config == o.trigger_config &&
|
207
|
+
state == o.state &&
|
208
|
+
created_at == o.created_at &&
|
209
|
+
updated_at == o.updated_at &&
|
210
|
+
disabled_at == o.disabled_at &&
|
211
|
+
disabled_reason == o.disabled_reason
|
212
|
+
end
|
213
|
+
|
214
|
+
# @see the `==` method
|
215
|
+
# @param [Object] Object to be compared
|
216
|
+
def eql?(o)
|
217
|
+
self == o
|
218
|
+
end
|
219
|
+
|
220
|
+
# Calculates hash code according to all attributes.
|
221
|
+
# @return [Integer] Hash code
|
222
|
+
def hash
|
223
|
+
[id, connection_id, trigger_name, trigger_data, trigger_config, state, created_at, updated_at, disabled_at, disabled_reason].hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Builds the object from hash
|
227
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
228
|
+
# @return [Object] Returns the model itself
|
229
|
+
def self.build_from_hash(attributes)
|
230
|
+
new.build_from_hash(attributes)
|
231
|
+
end
|
232
|
+
|
233
|
+
# Builds the object from hash
|
234
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
235
|
+
# @return [Object] Returns the model itself
|
236
|
+
def build_from_hash(attributes)
|
237
|
+
return nil unless attributes.is_a?(Hash)
|
238
|
+
attributes = attributes.transform_keys(&:to_sym)
|
239
|
+
self.class.openapi_types.each_pair do |key, type|
|
240
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
241
|
+
self.send("#{key}=", nil)
|
242
|
+
elsif type =~ /\AArray<(.*)>/i
|
243
|
+
# check to ensure the input is an array given that the attribute
|
244
|
+
# is documented as an array but the input is not
|
245
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
246
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
247
|
+
end
|
248
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
249
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
self
|
254
|
+
end
|
255
|
+
|
256
|
+
# Deserializes the data based on type
|
257
|
+
# @param string type Data type
|
258
|
+
# @param string value Value to be deserialized
|
259
|
+
# @return [Object] Deserialized data
|
260
|
+
def _deserialize(type, value)
|
261
|
+
case type.to_sym
|
262
|
+
when :Time
|
263
|
+
Time.parse(value)
|
264
|
+
when :Date
|
265
|
+
Date.parse(value)
|
266
|
+
when :String
|
267
|
+
value.to_s
|
268
|
+
when :Integer
|
269
|
+
value.to_i
|
270
|
+
when :Float
|
271
|
+
value.to_f
|
272
|
+
when :Boolean
|
273
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
274
|
+
true
|
275
|
+
else
|
276
|
+
false
|
277
|
+
end
|
278
|
+
when :Object
|
279
|
+
# generic object (usually a Hash), return directly
|
280
|
+
value
|
281
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
282
|
+
inner_type = Regexp.last_match[:inner_type]
|
283
|
+
value.map { |v| _deserialize(inner_type, v) }
|
284
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
285
|
+
k_type = Regexp.last_match[:k_type]
|
286
|
+
v_type = Regexp.last_match[:v_type]
|
287
|
+
{}.tap do |hash|
|
288
|
+
value.each do |k, v|
|
289
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
else # model
|
293
|
+
# models (e.g. Pet) or oneOf
|
294
|
+
klass = Composio.const_get(type)
|
295
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
# Returns the string representation of the object
|
300
|
+
# @return [String] String presentation of the object
|
301
|
+
def to_s
|
302
|
+
to_hash.to_s
|
303
|
+
end
|
304
|
+
|
305
|
+
# to_body is an alias to to_hash (backward compatibility)
|
306
|
+
# @return [Hash] Returns the object in the form of hash
|
307
|
+
def to_body
|
308
|
+
to_hash
|
309
|
+
end
|
310
|
+
|
311
|
+
# Returns the object in the form of hash
|
312
|
+
# @return [Hash] Returns the object in the form of hash
|
313
|
+
def to_hash
|
314
|
+
hash = {}
|
315
|
+
self.class.attribute_map.each_pair do |attr, param|
|
316
|
+
value = self.send(attr)
|
317
|
+
if value.nil?
|
318
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
319
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
320
|
+
end
|
321
|
+
|
322
|
+
hash[param] = _to_hash(value)
|
323
|
+
end
|
324
|
+
hash
|
325
|
+
end
|
326
|
+
|
327
|
+
# Outputs non-array value in the form of hash
|
328
|
+
# For object, use to_hash. Otherwise, just return the value
|
329
|
+
# @param [Object] value Any valid value
|
330
|
+
# @return [Hash] Returns the value in the form of hash
|
331
|
+
def _to_hash(value)
|
332
|
+
if value.is_a?(Array)
|
333
|
+
value.compact.map { |v| _to_hash(v) }
|
334
|
+
elsif value.is_a?(Hash)
|
335
|
+
{}.tap do |hash|
|
336
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
337
|
+
end
|
338
|
+
elsif value.respond_to? :to_hash
|
339
|
+
value.to_hash
|
340
|
+
else
|
341
|
+
value
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
end
|
346
|
+
|
347
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
=begin
|
2
|
+
#Composio OpenAPI
|
3
|
+
|
4
|
+
#Composio SDK: Equip your agent with high-quality tools and build your real-world usecase
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
=end
|
8
|
+
|
9
|
+
require 'date'
|
10
|
+
require 'time'
|
11
|
+
|
12
|
+
module Composio
|
13
|
+
# The type of the log
|
14
|
+
module TriggerMetadataType
|
15
|
+
class << self
|
16
|
+
# List of class defined in oneOf (OpenAPI v3)
|
17
|
+
def openapi_one_of
|
18
|
+
[
|
19
|
+
:'String'
|
20
|
+
]
|
21
|
+
end
|
22
|
+
|
23
|
+
# Builds the object
|
24
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
25
|
+
# @return [Object] Returns the model or the data itself
|
26
|
+
def build(data)
|
27
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
28
|
+
# Note:
|
29
|
+
# - We do not attempt to check whether exactly one item matches.
|
30
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
31
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
32
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
33
|
+
# - TODO: logging when debugging is set.
|
34
|
+
openapi_one_of.each do |klass|
|
35
|
+
begin
|
36
|
+
next if klass == :AnyType # "nullable: true"
|
37
|
+
typed_data = find_and_cast_into_type(klass, data)
|
38
|
+
return typed_data if typed_data
|
39
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
SchemaMismatchError = Class.new(StandardError)
|
49
|
+
|
50
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
51
|
+
def find_and_cast_into_type(klass, data)
|
52
|
+
return if data.nil?
|
53
|
+
|
54
|
+
case klass.to_s
|
55
|
+
when 'Boolean'
|
56
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
57
|
+
when 'Float'
|
58
|
+
return data if data.instance_of?(Float)
|
59
|
+
when 'Integer'
|
60
|
+
return data if data.instance_of?(Integer)
|
61
|
+
when 'Time'
|
62
|
+
return Time.parse(data)
|
63
|
+
when 'Date'
|
64
|
+
return Date.parse(data)
|
65
|
+
when 'String'
|
66
|
+
return data if data.instance_of?(String)
|
67
|
+
when 'Object' # "type: object"
|
68
|
+
return data if data.instance_of?(Hash)
|
69
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
70
|
+
if data.instance_of?(Array)
|
71
|
+
sub_type = Regexp.last_match[:sub_type]
|
72
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
73
|
+
end
|
74
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
75
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
76
|
+
sub_type = Regexp.last_match[:sub_type]
|
77
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
78
|
+
end
|
79
|
+
else # model
|
80
|
+
const = Composio.const_get(klass)
|
81
|
+
if const
|
82
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
83
|
+
model = const.build(data)
|
84
|
+
return model if model
|
85
|
+
else
|
86
|
+
# raise if data contains keys that are not known to the model
|
87
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
88
|
+
model = const.build_from_hash(data)
|
89
|
+
return model if model && model.valid?
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
raise # if no match by now, raise
|
95
|
+
rescue
|
96
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|