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,376 @@
|
|
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 ConnectorListItemDTO
|
14
|
+
# Application name associated with the connector
|
15
|
+
attr_accessor :app_name
|
16
|
+
|
17
|
+
# Count of connections for the connector
|
18
|
+
attr_accessor :_count
|
19
|
+
|
20
|
+
# List of connections with their details and request logs count
|
21
|
+
attr_accessor :connections
|
22
|
+
|
23
|
+
# Unique identifier of the connector
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
# Name of the connector
|
27
|
+
attr_accessor :name
|
28
|
+
|
29
|
+
# Authentication scheme used by the connector
|
30
|
+
attr_accessor :auth_scheme
|
31
|
+
|
32
|
+
attr_accessor :created_at
|
33
|
+
|
34
|
+
attr_accessor :updated_at
|
35
|
+
|
36
|
+
# Flag to indicate if the connector is enabled
|
37
|
+
attr_accessor :enabled
|
38
|
+
|
39
|
+
# Flag to indicate if the connector is deleted
|
40
|
+
attr_accessor :deleted
|
41
|
+
|
42
|
+
# App ID associated with the connector
|
43
|
+
attr_accessor :app_id
|
44
|
+
|
45
|
+
# Default connector ID if available
|
46
|
+
attr_accessor :default_connector_id
|
47
|
+
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
+
def self.attribute_map
|
50
|
+
{
|
51
|
+
:'app_name' => :'appName',
|
52
|
+
:'_count' => :'_count',
|
53
|
+
:'connections' => :'connections',
|
54
|
+
:'id' => :'id',
|
55
|
+
:'name' => :'name',
|
56
|
+
:'auth_scheme' => :'authScheme',
|
57
|
+
:'created_at' => :'createdAt',
|
58
|
+
:'updated_at' => :'updatedAt',
|
59
|
+
:'enabled' => :'enabled',
|
60
|
+
:'deleted' => :'deleted',
|
61
|
+
:'app_id' => :'appId',
|
62
|
+
:'default_connector_id' => :'defaultConnectorId'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Returns all the JSON keys this model knows about
|
67
|
+
def self.acceptable_attributes
|
68
|
+
attribute_map.values
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute type mapping.
|
72
|
+
def self.openapi_types
|
73
|
+
{
|
74
|
+
:'app_name' => :'String',
|
75
|
+
:'_count' => :'Object',
|
76
|
+
:'connections' => :'Array<Object>',
|
77
|
+
:'id' => :'String',
|
78
|
+
:'name' => :'String',
|
79
|
+
:'auth_scheme' => :'String',
|
80
|
+
:'created_at' => :'ConnectorListItemDTOCreatedAt',
|
81
|
+
:'updated_at' => :'ConnectorListItemDTOUpdatedAt',
|
82
|
+
:'enabled' => :'Boolean',
|
83
|
+
:'deleted' => :'Boolean',
|
84
|
+
:'app_id' => :'String',
|
85
|
+
:'default_connector_id' => :'String'
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of attributes with nullable: true
|
90
|
+
def self.openapi_nullable
|
91
|
+
Set.new([
|
92
|
+
])
|
93
|
+
end
|
94
|
+
|
95
|
+
# Initializes the object
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
def initialize(attributes = {})
|
98
|
+
if (!attributes.is_a?(Hash))
|
99
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::ConnectorListItemDTO` initialize method"
|
100
|
+
end
|
101
|
+
|
102
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
103
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
104
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
105
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::ConnectorListItemDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
106
|
+
end
|
107
|
+
h[k.to_sym] = v
|
108
|
+
}
|
109
|
+
|
110
|
+
if attributes.key?(:'app_name')
|
111
|
+
self.app_name = attributes[:'app_name']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'_count')
|
115
|
+
self._count = attributes[:'_count']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'connections')
|
119
|
+
if (value = attributes[:'connections']).is_a?(Array)
|
120
|
+
self.connections = value
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'id')
|
125
|
+
self.id = attributes[:'id']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'name')
|
129
|
+
self.name = attributes[:'name']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'auth_scheme')
|
133
|
+
self.auth_scheme = attributes[:'auth_scheme']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'created_at')
|
137
|
+
self.created_at = attributes[:'created_at']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'updated_at')
|
141
|
+
self.updated_at = attributes[:'updated_at']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'enabled')
|
145
|
+
self.enabled = attributes[:'enabled']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'deleted')
|
149
|
+
self.deleted = attributes[:'deleted']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'app_id')
|
153
|
+
self.app_id = attributes[:'app_id']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'default_connector_id')
|
157
|
+
self.default_connector_id = attributes[:'default_connector_id']
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
162
|
+
# @return Array for valid properties with the reasons
|
163
|
+
def list_invalid_properties
|
164
|
+
invalid_properties = Array.new
|
165
|
+
if @app_name.nil?
|
166
|
+
invalid_properties.push('invalid value for "app_name", app_name cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
if @_count.nil?
|
170
|
+
invalid_properties.push('invalid value for "_count", _count cannot be nil.')
|
171
|
+
end
|
172
|
+
|
173
|
+
if @connections.nil?
|
174
|
+
invalid_properties.push('invalid value for "connections", connections cannot be nil.')
|
175
|
+
end
|
176
|
+
|
177
|
+
if @id.nil?
|
178
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
179
|
+
end
|
180
|
+
|
181
|
+
if @name.nil?
|
182
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
183
|
+
end
|
184
|
+
|
185
|
+
if @auth_scheme.nil?
|
186
|
+
invalid_properties.push('invalid value for "auth_scheme", auth_scheme cannot be nil.')
|
187
|
+
end
|
188
|
+
|
189
|
+
if @created_at.nil?
|
190
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
191
|
+
end
|
192
|
+
|
193
|
+
if @updated_at.nil?
|
194
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
195
|
+
end
|
196
|
+
|
197
|
+
if @enabled.nil?
|
198
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
199
|
+
end
|
200
|
+
|
201
|
+
if @app_id.nil?
|
202
|
+
invalid_properties.push('invalid value for "app_id", app_id cannot be nil.')
|
203
|
+
end
|
204
|
+
|
205
|
+
invalid_properties
|
206
|
+
end
|
207
|
+
|
208
|
+
# Check to see if the all the properties in the model are valid
|
209
|
+
# @return true if the model is valid
|
210
|
+
def valid?
|
211
|
+
return false if @app_name.nil?
|
212
|
+
return false if @_count.nil?
|
213
|
+
return false if @connections.nil?
|
214
|
+
return false if @id.nil?
|
215
|
+
return false if @name.nil?
|
216
|
+
return false if @auth_scheme.nil?
|
217
|
+
return false if @created_at.nil?
|
218
|
+
return false if @updated_at.nil?
|
219
|
+
return false if @enabled.nil?
|
220
|
+
return false if @app_id.nil?
|
221
|
+
true
|
222
|
+
end
|
223
|
+
|
224
|
+
# Checks equality by comparing each attribute.
|
225
|
+
# @param [Object] Object to be compared
|
226
|
+
def ==(o)
|
227
|
+
return true if self.equal?(o)
|
228
|
+
self.class == o.class &&
|
229
|
+
app_name == o.app_name &&
|
230
|
+
_count == o._count &&
|
231
|
+
connections == o.connections &&
|
232
|
+
id == o.id &&
|
233
|
+
name == o.name &&
|
234
|
+
auth_scheme == o.auth_scheme &&
|
235
|
+
created_at == o.created_at &&
|
236
|
+
updated_at == o.updated_at &&
|
237
|
+
enabled == o.enabled &&
|
238
|
+
deleted == o.deleted &&
|
239
|
+
app_id == o.app_id &&
|
240
|
+
default_connector_id == o.default_connector_id
|
241
|
+
end
|
242
|
+
|
243
|
+
# @see the `==` method
|
244
|
+
# @param [Object] Object to be compared
|
245
|
+
def eql?(o)
|
246
|
+
self == o
|
247
|
+
end
|
248
|
+
|
249
|
+
# Calculates hash code according to all attributes.
|
250
|
+
# @return [Integer] Hash code
|
251
|
+
def hash
|
252
|
+
[app_name, _count, connections, id, name, auth_scheme, created_at, updated_at, enabled, deleted, app_id, default_connector_id].hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Builds the object from hash
|
256
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
257
|
+
# @return [Object] Returns the model itself
|
258
|
+
def self.build_from_hash(attributes)
|
259
|
+
new.build_from_hash(attributes)
|
260
|
+
end
|
261
|
+
|
262
|
+
# Builds the object from hash
|
263
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
264
|
+
# @return [Object] Returns the model itself
|
265
|
+
def build_from_hash(attributes)
|
266
|
+
return nil unless attributes.is_a?(Hash)
|
267
|
+
attributes = attributes.transform_keys(&:to_sym)
|
268
|
+
self.class.openapi_types.each_pair do |key, type|
|
269
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
270
|
+
self.send("#{key}=", nil)
|
271
|
+
elsif type =~ /\AArray<(.*)>/i
|
272
|
+
# check to ensure the input is an array given that the attribute
|
273
|
+
# is documented as an array but the input is not
|
274
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
275
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
276
|
+
end
|
277
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
278
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
self
|
283
|
+
end
|
284
|
+
|
285
|
+
# Deserializes the data based on type
|
286
|
+
# @param string type Data type
|
287
|
+
# @param string value Value to be deserialized
|
288
|
+
# @return [Object] Deserialized data
|
289
|
+
def _deserialize(type, value)
|
290
|
+
case type.to_sym
|
291
|
+
when :Time
|
292
|
+
Time.parse(value)
|
293
|
+
when :Date
|
294
|
+
Date.parse(value)
|
295
|
+
when :String
|
296
|
+
value.to_s
|
297
|
+
when :Integer
|
298
|
+
value.to_i
|
299
|
+
when :Float
|
300
|
+
value.to_f
|
301
|
+
when :Boolean
|
302
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
303
|
+
true
|
304
|
+
else
|
305
|
+
false
|
306
|
+
end
|
307
|
+
when :Object
|
308
|
+
# generic object (usually a Hash), return directly
|
309
|
+
value
|
310
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
311
|
+
inner_type = Regexp.last_match[:inner_type]
|
312
|
+
value.map { |v| _deserialize(inner_type, v) }
|
313
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
314
|
+
k_type = Regexp.last_match[:k_type]
|
315
|
+
v_type = Regexp.last_match[:v_type]
|
316
|
+
{}.tap do |hash|
|
317
|
+
value.each do |k, v|
|
318
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
319
|
+
end
|
320
|
+
end
|
321
|
+
else # model
|
322
|
+
# models (e.g. Pet) or oneOf
|
323
|
+
klass = Composio.const_get(type)
|
324
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
# Returns the string representation of the object
|
329
|
+
# @return [String] String presentation of the object
|
330
|
+
def to_s
|
331
|
+
to_hash.to_s
|
332
|
+
end
|
333
|
+
|
334
|
+
# to_body is an alias to to_hash (backward compatibility)
|
335
|
+
# @return [Hash] Returns the object in the form of hash
|
336
|
+
def to_body
|
337
|
+
to_hash
|
338
|
+
end
|
339
|
+
|
340
|
+
# Returns the object in the form of hash
|
341
|
+
# @return [Hash] Returns the object in the form of hash
|
342
|
+
def to_hash
|
343
|
+
hash = {}
|
344
|
+
self.class.attribute_map.each_pair do |attr, param|
|
345
|
+
value = self.send(attr)
|
346
|
+
if value.nil?
|
347
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
348
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
349
|
+
end
|
350
|
+
|
351
|
+
hash[param] = _to_hash(value)
|
352
|
+
end
|
353
|
+
hash
|
354
|
+
end
|
355
|
+
|
356
|
+
# Outputs non-array value in the form of hash
|
357
|
+
# For object, use to_hash. Otherwise, just return the value
|
358
|
+
# @param [Object] value Any valid value
|
359
|
+
# @return [Hash] Returns the value in the form of hash
|
360
|
+
def _to_hash(value)
|
361
|
+
if value.is_a?(Array)
|
362
|
+
value.compact.map { |v| _to_hash(v) }
|
363
|
+
elsif value.is_a?(Hash)
|
364
|
+
{}.tap do |hash|
|
365
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
366
|
+
end
|
367
|
+
elsif value.respond_to? :to_hash
|
368
|
+
value.to_hash
|
369
|
+
else
|
370
|
+
value
|
371
|
+
end
|
372
|
+
end
|
373
|
+
|
374
|
+
end
|
375
|
+
|
376
|
+
end
|
@@ -0,0 +1,102 @@
|
|
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
|
+
# Creation date of the connector
|
14
|
+
module ConnectorListItemDTOCreatedAt
|
15
|
+
class << self
|
16
|
+
# List of class defined in oneOf (OpenAPI v3)
|
17
|
+
def openapi_one_of
|
18
|
+
[
|
19
|
+
:'Date',
|
20
|
+
:'Time'
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the object
|
25
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
26
|
+
# @return [Object] Returns the model or the data itself
|
27
|
+
def build(data)
|
28
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
29
|
+
# Note:
|
30
|
+
# - We do not attempt to check whether exactly one item matches.
|
31
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
32
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
33
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
34
|
+
# - TODO: logging when debugging is set.
|
35
|
+
openapi_one_of.each do |klass|
|
36
|
+
begin
|
37
|
+
next if klass == :AnyType # "nullable: true"
|
38
|
+
typed_data = find_and_cast_into_type(klass, data)
|
39
|
+
return typed_data if typed_data
|
40
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
SchemaMismatchError = Class.new(StandardError)
|
50
|
+
|
51
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
52
|
+
def find_and_cast_into_type(klass, data)
|
53
|
+
return if data.nil?
|
54
|
+
|
55
|
+
case klass.to_s
|
56
|
+
when 'Boolean'
|
57
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
58
|
+
when 'Float'
|
59
|
+
return data if data.instance_of?(Float)
|
60
|
+
when 'Integer'
|
61
|
+
return data if data.instance_of?(Integer)
|
62
|
+
when 'Time'
|
63
|
+
return Time.parse(data)
|
64
|
+
when 'Date'
|
65
|
+
return Date.parse(data)
|
66
|
+
when 'String'
|
67
|
+
return data if data.instance_of?(String)
|
68
|
+
when 'Object' # "type: object"
|
69
|
+
return data if data.instance_of?(Hash)
|
70
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
71
|
+
if data.instance_of?(Array)
|
72
|
+
sub_type = Regexp.last_match[:sub_type]
|
73
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
74
|
+
end
|
75
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
76
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
77
|
+
sub_type = Regexp.last_match[:sub_type]
|
78
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
79
|
+
end
|
80
|
+
else # model
|
81
|
+
const = Composio.const_get(klass)
|
82
|
+
if const
|
83
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
84
|
+
model = const.build(data)
|
85
|
+
return model if model
|
86
|
+
else
|
87
|
+
# raise if data contains keys that are not known to the model
|
88
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
89
|
+
model = const.build_from_hash(data)
|
90
|
+
return model if model && model.valid?
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
raise # if no match by now, raise
|
96
|
+
rescue
|
97
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,102 @@
|
|
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
|
+
# Last update date of the connector
|
14
|
+
module ConnectorListItemDTOUpdatedAt
|
15
|
+
class << self
|
16
|
+
# List of class defined in oneOf (OpenAPI v3)
|
17
|
+
def openapi_one_of
|
18
|
+
[
|
19
|
+
:'Date',
|
20
|
+
:'Time'
|
21
|
+
]
|
22
|
+
end
|
23
|
+
|
24
|
+
# Builds the object
|
25
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
26
|
+
# @return [Object] Returns the model or the data itself
|
27
|
+
def build(data)
|
28
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
29
|
+
# Note:
|
30
|
+
# - We do not attempt to check whether exactly one item matches.
|
31
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
32
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
33
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
34
|
+
# - TODO: logging when debugging is set.
|
35
|
+
openapi_one_of.each do |klass|
|
36
|
+
begin
|
37
|
+
next if klass == :AnyType # "nullable: true"
|
38
|
+
typed_data = find_and_cast_into_type(klass, data)
|
39
|
+
return typed_data if typed_data
|
40
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
SchemaMismatchError = Class.new(StandardError)
|
50
|
+
|
51
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
52
|
+
def find_and_cast_into_type(klass, data)
|
53
|
+
return if data.nil?
|
54
|
+
|
55
|
+
case klass.to_s
|
56
|
+
when 'Boolean'
|
57
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
58
|
+
when 'Float'
|
59
|
+
return data if data.instance_of?(Float)
|
60
|
+
when 'Integer'
|
61
|
+
return data if data.instance_of?(Integer)
|
62
|
+
when 'Time'
|
63
|
+
return Time.parse(data)
|
64
|
+
when 'Date'
|
65
|
+
return Date.parse(data)
|
66
|
+
when 'String'
|
67
|
+
return data if data.instance_of?(String)
|
68
|
+
when 'Object' # "type: object"
|
69
|
+
return data if data.instance_of?(Hash)
|
70
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
71
|
+
if data.instance_of?(Array)
|
72
|
+
sub_type = Regexp.last_match[:sub_type]
|
73
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
74
|
+
end
|
75
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
76
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
77
|
+
sub_type = Regexp.last_match[:sub_type]
|
78
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
79
|
+
end
|
80
|
+
else # model
|
81
|
+
const = Composio.const_get(klass)
|
82
|
+
if const
|
83
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
84
|
+
model = const.build(data)
|
85
|
+
return model if model
|
86
|
+
else
|
87
|
+
# raise if data contains keys that are not known to the model
|
88
|
+
raise unless (data.keys - const.acceptable_attributes).empty?
|
89
|
+
model = const.build_from_hash(data)
|
90
|
+
return model if model && model.valid?
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
raise # if no match by now, raise
|
96
|
+
rescue
|
97
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|