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,402 @@
|
|
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
|
+
class ActionMetadata
|
14
|
+
# The unique id of the log
|
15
|
+
attr_accessor :id
|
16
|
+
|
17
|
+
# The request sent to the provider
|
18
|
+
attr_accessor :request
|
19
|
+
|
20
|
+
# The response from the provider
|
21
|
+
attr_accessor :response
|
22
|
+
|
23
|
+
# The error request sent to the provider
|
24
|
+
attr_accessor :error_request
|
25
|
+
|
26
|
+
attr_accessor :type
|
27
|
+
|
28
|
+
# The date and time when the log was created
|
29
|
+
attr_accessor :created_at
|
30
|
+
|
31
|
+
# The date and time when the log was updated
|
32
|
+
attr_accessor :updated_at
|
33
|
+
|
34
|
+
# The provider of the log
|
35
|
+
attr_accessor :provider
|
36
|
+
|
37
|
+
# The client uuid of the log
|
38
|
+
attr_accessor :client_id
|
39
|
+
|
40
|
+
# The connection id of the log
|
41
|
+
attr_accessor :connection_id
|
42
|
+
|
43
|
+
# The action name of the log
|
44
|
+
attr_accessor :action_name
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'id' => :'id',
|
50
|
+
:'request' => :'request',
|
51
|
+
:'response' => :'response',
|
52
|
+
:'error_request' => :'errorRequest',
|
53
|
+
:'type' => :'type',
|
54
|
+
:'created_at' => :'createdAt',
|
55
|
+
:'updated_at' => :'updatedAt',
|
56
|
+
:'provider' => :'provider',
|
57
|
+
:'client_id' => :'clientId',
|
58
|
+
:'connection_id' => :'connectionId',
|
59
|
+
:'action_name' => :'actionName'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns all the JSON keys this model knows about
|
64
|
+
def self.acceptable_attributes
|
65
|
+
attribute_map.values
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.openapi_types
|
70
|
+
{
|
71
|
+
:'id' => :'String',
|
72
|
+
:'request' => :'String',
|
73
|
+
:'response' => :'String',
|
74
|
+
:'error_request' => :'String',
|
75
|
+
:'type' => :'ActionMetadataType',
|
76
|
+
:'created_at' => :'Time',
|
77
|
+
:'updated_at' => :'Time',
|
78
|
+
:'provider' => :'String',
|
79
|
+
:'client_id' => :'String',
|
80
|
+
:'connection_id' => :'String',
|
81
|
+
:'action_name' => :'String'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# List of attributes with nullable: true
|
86
|
+
def self.openapi_nullable
|
87
|
+
Set.new([
|
88
|
+
])
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initializes the object
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
def initialize(attributes = {})
|
94
|
+
if (!attributes.is_a?(Hash))
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::ActionMetadata` initialize method"
|
96
|
+
end
|
97
|
+
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
100
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::ActionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
102
|
+
end
|
103
|
+
h[k.to_sym] = v
|
104
|
+
}
|
105
|
+
|
106
|
+
if attributes.key?(:'id')
|
107
|
+
self.id = attributes[:'id']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'request')
|
111
|
+
self.request = attributes[:'request']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'response')
|
115
|
+
self.response = attributes[:'response']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'error_request')
|
119
|
+
self.error_request = attributes[:'error_request']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'type')
|
123
|
+
self.type = attributes[:'type']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'created_at')
|
127
|
+
self.created_at = attributes[:'created_at']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'updated_at')
|
131
|
+
self.updated_at = attributes[:'updated_at']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'provider')
|
135
|
+
self.provider = attributes[:'provider']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'client_id')
|
139
|
+
self.client_id = attributes[:'client_id']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'connection_id')
|
143
|
+
self.connection_id = attributes[:'connection_id']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'action_name')
|
147
|
+
self.action_name = attributes[:'action_name']
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
152
|
+
# @return Array for valid properties with the reasons
|
153
|
+
def list_invalid_properties
|
154
|
+
invalid_properties = Array.new
|
155
|
+
if @id.nil?
|
156
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
157
|
+
end
|
158
|
+
|
159
|
+
if @request.nil?
|
160
|
+
invalid_properties.push('invalid value for "request", request cannot be nil.')
|
161
|
+
end
|
162
|
+
|
163
|
+
if @type.nil?
|
164
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
165
|
+
end
|
166
|
+
|
167
|
+
if @created_at.nil?
|
168
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
169
|
+
end
|
170
|
+
|
171
|
+
pattern = Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
172
|
+
if @created_at !~ pattern
|
173
|
+
invalid_properties.push("invalid value for \"created_at\", must conform to the pattern #{pattern}.")
|
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
|
+
pattern = Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
181
|
+
if @updated_at !~ pattern
|
182
|
+
invalid_properties.push("invalid value for \"updated_at\", must conform to the pattern #{pattern}.")
|
183
|
+
end
|
184
|
+
|
185
|
+
if @provider.nil?
|
186
|
+
invalid_properties.push('invalid value for "provider", provider cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @client_id.nil?
|
190
|
+
invalid_properties.push('invalid value for "client_id", client_id cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @connection_id.nil?
|
194
|
+
invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @action_name.nil?
|
198
|
+
invalid_properties.push('invalid value for "action_name", action_name cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
invalid_properties
|
202
|
+
end
|
203
|
+
|
204
|
+
# Check to see if the all the properties in the model are valid
|
205
|
+
# @return true if the model is valid
|
206
|
+
def valid?
|
207
|
+
return false if @id.nil?
|
208
|
+
return false if @request.nil?
|
209
|
+
return false if @type.nil?
|
210
|
+
return false if @created_at.nil?
|
211
|
+
return false if @created_at !~ Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
212
|
+
return false if @updated_at.nil?
|
213
|
+
return false if @updated_at !~ Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
214
|
+
return false if @provider.nil?
|
215
|
+
return false if @client_id.nil?
|
216
|
+
return false if @connection_id.nil?
|
217
|
+
return false if @action_name.nil?
|
218
|
+
true
|
219
|
+
end
|
220
|
+
|
221
|
+
# Custom attribute writer method with validation
|
222
|
+
# @param [Object] created_at Value to be assigned
|
223
|
+
def created_at=(created_at)
|
224
|
+
if created_at.nil?
|
225
|
+
fail ArgumentError, 'created_at cannot be nil'
|
226
|
+
end
|
227
|
+
|
228
|
+
pattern = Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
229
|
+
if created_at !~ pattern
|
230
|
+
fail ArgumentError, "invalid value for \"created_at\", must conform to the pattern #{pattern}."
|
231
|
+
end
|
232
|
+
|
233
|
+
@created_at = created_at
|
234
|
+
end
|
235
|
+
|
236
|
+
# Custom attribute writer method with validation
|
237
|
+
# @param [Object] updated_at Value to be assigned
|
238
|
+
def updated_at=(updated_at)
|
239
|
+
if updated_at.nil?
|
240
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
241
|
+
end
|
242
|
+
|
243
|
+
pattern = Regexp.new(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d.\d+Z?/)
|
244
|
+
if updated_at !~ pattern
|
245
|
+
fail ArgumentError, "invalid value for \"updated_at\", must conform to the pattern #{pattern}."
|
246
|
+
end
|
247
|
+
|
248
|
+
@updated_at = updated_at
|
249
|
+
end
|
250
|
+
|
251
|
+
# Checks equality by comparing each attribute.
|
252
|
+
# @param [Object] Object to be compared
|
253
|
+
def ==(o)
|
254
|
+
return true if self.equal?(o)
|
255
|
+
self.class == o.class &&
|
256
|
+
id == o.id &&
|
257
|
+
request == o.request &&
|
258
|
+
response == o.response &&
|
259
|
+
error_request == o.error_request &&
|
260
|
+
type == o.type &&
|
261
|
+
created_at == o.created_at &&
|
262
|
+
updated_at == o.updated_at &&
|
263
|
+
provider == o.provider &&
|
264
|
+
client_id == o.client_id &&
|
265
|
+
connection_id == o.connection_id &&
|
266
|
+
action_name == o.action_name
|
267
|
+
end
|
268
|
+
|
269
|
+
# @see the `==` method
|
270
|
+
# @param [Object] Object to be compared
|
271
|
+
def eql?(o)
|
272
|
+
self == o
|
273
|
+
end
|
274
|
+
|
275
|
+
# Calculates hash code according to all attributes.
|
276
|
+
# @return [Integer] Hash code
|
277
|
+
def hash
|
278
|
+
[id, request, response, error_request, type, created_at, updated_at, provider, client_id, connection_id, action_name].hash
|
279
|
+
end
|
280
|
+
|
281
|
+
# Builds the object from hash
|
282
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
283
|
+
# @return [Object] Returns the model itself
|
284
|
+
def self.build_from_hash(attributes)
|
285
|
+
new.build_from_hash(attributes)
|
286
|
+
end
|
287
|
+
|
288
|
+
# Builds the object from hash
|
289
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
290
|
+
# @return [Object] Returns the model itself
|
291
|
+
def build_from_hash(attributes)
|
292
|
+
return nil unless attributes.is_a?(Hash)
|
293
|
+
attributes = attributes.transform_keys(&:to_sym)
|
294
|
+
self.class.openapi_types.each_pair do |key, type|
|
295
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
296
|
+
self.send("#{key}=", nil)
|
297
|
+
elsif type =~ /\AArray<(.*)>/i
|
298
|
+
# check to ensure the input is an array given that the attribute
|
299
|
+
# is documented as an array but the input is not
|
300
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
301
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
302
|
+
end
|
303
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
304
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
308
|
+
self
|
309
|
+
end
|
310
|
+
|
311
|
+
# Deserializes the data based on type
|
312
|
+
# @param string type Data type
|
313
|
+
# @param string value Value to be deserialized
|
314
|
+
# @return [Object] Deserialized data
|
315
|
+
def _deserialize(type, value)
|
316
|
+
case type.to_sym
|
317
|
+
when :Time
|
318
|
+
Time.parse(value)
|
319
|
+
when :Date
|
320
|
+
Date.parse(value)
|
321
|
+
when :String
|
322
|
+
value.to_s
|
323
|
+
when :Integer
|
324
|
+
value.to_i
|
325
|
+
when :Float
|
326
|
+
value.to_f
|
327
|
+
when :Boolean
|
328
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
329
|
+
true
|
330
|
+
else
|
331
|
+
false
|
332
|
+
end
|
333
|
+
when :Object
|
334
|
+
# generic object (usually a Hash), return directly
|
335
|
+
value
|
336
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
337
|
+
inner_type = Regexp.last_match[:inner_type]
|
338
|
+
value.map { |v| _deserialize(inner_type, v) }
|
339
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
340
|
+
k_type = Regexp.last_match[:k_type]
|
341
|
+
v_type = Regexp.last_match[:v_type]
|
342
|
+
{}.tap do |hash|
|
343
|
+
value.each do |k, v|
|
344
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
else # model
|
348
|
+
# models (e.g. Pet) or oneOf
|
349
|
+
klass = Composio.const_get(type)
|
350
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
351
|
+
end
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the string representation of the object
|
355
|
+
# @return [String] String presentation of the object
|
356
|
+
def to_s
|
357
|
+
to_hash.to_s
|
358
|
+
end
|
359
|
+
|
360
|
+
# to_body is an alias to to_hash (backward compatibility)
|
361
|
+
# @return [Hash] Returns the object in the form of hash
|
362
|
+
def to_body
|
363
|
+
to_hash
|
364
|
+
end
|
365
|
+
|
366
|
+
# Returns the object in the form of hash
|
367
|
+
# @return [Hash] Returns the object in the form of hash
|
368
|
+
def to_hash
|
369
|
+
hash = {}
|
370
|
+
self.class.attribute_map.each_pair do |attr, param|
|
371
|
+
value = self.send(attr)
|
372
|
+
if value.nil?
|
373
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
374
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
375
|
+
end
|
376
|
+
|
377
|
+
hash[param] = _to_hash(value)
|
378
|
+
end
|
379
|
+
hash
|
380
|
+
end
|
381
|
+
|
382
|
+
# Outputs non-array value in the form of hash
|
383
|
+
# For object, use to_hash. Otherwise, just return the value
|
384
|
+
# @param [Object] value Any valid value
|
385
|
+
# @return [Hash] Returns the value in the form of hash
|
386
|
+
def _to_hash(value)
|
387
|
+
if value.is_a?(Array)
|
388
|
+
value.compact.map { |v| _to_hash(v) }
|
389
|
+
elsif value.is_a?(Hash)
|
390
|
+
{}.tap do |hash|
|
391
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
392
|
+
end
|
393
|
+
elsif value.respond_to? :to_hash
|
394
|
+
value.to_hash
|
395
|
+
else
|
396
|
+
value
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
end
|
401
|
+
|
402
|
+
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 ActionMetadataType
|
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
|