composio 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +492 -4
  4. data/lib/composio/api/actions_api.rb +107 -0
  5. data/lib/composio/api/analytics_api.rb +181 -0
  6. data/lib/composio/api/apps_api.rb +257 -0
  7. data/lib/composio/api/connections_api.rb +84 -0
  8. data/lib/composio/api/event_logs_api.rb +427 -0
  9. data/lib/composio/api/logs_api.rb +127 -9
  10. data/lib/composio/api/payment_api.rb +430 -0
  11. data/lib/composio/models/action_analytics_dto.rb +250 -0
  12. data/lib/composio/models/action_by_app_dto.rb +237 -0
  13. data/lib/composio/models/action_by_status_dto.rb +237 -0
  14. data/lib/composio/models/action_get_nla_inputs_req_dto.rb +220 -0
  15. data/lib/composio/models/additional_info.rb +220 -0
  16. data/lib/composio/models/analytics_data_req_dto.rb +250 -0
  17. data/lib/composio/models/analytics_data_res_dto.rb +282 -0
  18. data/lib/composio/models/analytics_entity_data_dto.rb +257 -0
  19. data/lib/composio/models/api_key_res_dto.rb +61 -4
  20. data/lib/composio/models/app_name_count_dto.rb +267 -0
  21. data/lib/composio/models/client_unique_user_id_count_dto.rb +237 -0
  22. data/lib/composio/models/connected_account_response_dto.rb +10 -1
  23. data/lib/composio/models/connection_params.rb +22 -6
  24. data/lib/composio/models/connection_with_app_data.rb +22 -6
  25. data/lib/composio/models/connector_list_item_dto.rb +16 -1
  26. data/lib/composio/models/create_checkout_session_req_dto.rb +220 -0
  27. data/lib/composio/models/data.rb +234 -0
  28. data/lib/composio/models/entity_query_req_dto.rb +216 -0
  29. data/lib/composio/models/fetch_query_dto.rb +278 -0
  30. data/lib/composio/models/get_connection_info_response_dto.rb +250 -0
  31. data/lib/composio/models/get_connector_list_res_dto.rb +0 -1
  32. data/lib/composio/models/get_logs_dto.rb +10 -10
  33. data/lib/composio/models/{job_status.rb → get_logs_dto_status.rb} +6 -6
  34. data/lib/composio/models/ingest_data_dto.rb +298 -0
  35. data/lib/composio/models/ingest_data_response_dto.rb +220 -0
  36. data/lib/composio/models/integrations_with_counts_dto.rb +297 -0
  37. data/lib/composio/models/invite_member_req_dto.rb +14 -4
  38. data/lib/composio/models/last_time_period.rb +40 -0
  39. data/lib/composio/models/member_info_res_dto.rb +324 -0
  40. data/lib/composio/models/{connection_with_app_data_created_at.rb → member_info_res_dto_created_at.rb} +1 -1
  41. data/lib/composio/models/member_res_dto.rb +16 -1
  42. data/lib/composio/models/member_res_dto_role.rb +36 -0
  43. data/lib/composio/models/open_api_spec_list_res_dto.rb +17 -74
  44. data/lib/composio/models/parameter.rb +248 -0
  45. data/lib/composio/models/plan.rb +38 -0
  46. data/lib/composio/models/role.rb +36 -0
  47. data/lib/composio/models/state.rb +41 -0
  48. data/lib/composio/models/status.rb +7 -4
  49. data/lib/composio/models/t_connection_count_dto.rb +236 -0
  50. data/lib/composio/models/time_period_req_dto.rb +216 -0
  51. data/lib/composio/models/top_entities_res_dto.rb +223 -0
  52. data/lib/composio/models/update_member_req_dto.rb +236 -0
  53. data/lib/composio/models/update_member_req_dto_role.rb +36 -0
  54. data/lib/composio/models/webhook_req_dto.rb +221 -0
  55. data/lib/composio/models/webhook_secret_res_dto.rb +221 -0
  56. data/lib/composio/version.rb +1 -1
  57. data/lib/composio.rb +43 -2
  58. data/spec/api/actions_api_spec.rb +13 -0
  59. data/spec/api/analytics_api_spec.rb +51 -0
  60. data/spec/api/apps_api_spec.rb +34 -0
  61. data/spec/api/connections_api_spec.rb +11 -0
  62. data/spec/api/event_logs_api_spec.rb +83 -0
  63. data/spec/api/logs_api_spec.rb +13 -1
  64. data/spec/api/payment_api_spec.rb +83 -0
  65. data/spec/models/action_analytics_dto_spec.rb +40 -0
  66. data/spec/models/action_by_app_dto_spec.rb +34 -0
  67. data/spec/models/action_by_status_dto_spec.rb +34 -0
  68. data/spec/models/action_get_nla_inputs_req_dto_spec.rb +28 -0
  69. data/spec/models/additional_info_spec.rb +28 -0
  70. data/spec/models/analytics_data_req_dto_spec.rb +32 -0
  71. data/spec/models/analytics_data_res_dto_spec.rb +52 -0
  72. data/spec/models/analytics_entity_data_dto_spec.rb +40 -0
  73. data/spec/models/api_key_res_dto_spec.rb +18 -0
  74. data/spec/models/app_name_count_dto_spec.rb +46 -0
  75. data/spec/models/client_unique_user_id_count_dto_spec.rb +34 -0
  76. data/spec/models/connected_account_response_dto_spec.rb +6 -0
  77. data/spec/models/connection_params_spec.rb +6 -0
  78. data/spec/models/connection_with_app_data_spec.rb +6 -0
  79. data/spec/models/connector_list_item_dto_spec.rb +6 -0
  80. data/spec/models/create_checkout_session_req_dto_spec.rb +28 -0
  81. data/spec/models/data_spec.rb +34 -0
  82. data/spec/models/entity_query_req_dto_spec.rb +28 -0
  83. data/spec/models/fetch_query_dto_spec.rb +34 -0
  84. data/spec/models/get_connection_info_response_dto_spec.rb +40 -0
  85. data/spec/models/get_logs_dto_spec.rb +1 -1
  86. data/spec/models/get_logs_dto_status_spec.rb +22 -0
  87. data/spec/models/ingest_data_dto_spec.rb +64 -0
  88. data/spec/models/ingest_data_response_dto_spec.rb +28 -0
  89. data/spec/models/integrations_with_counts_dto_spec.rb +58 -0
  90. data/spec/models/invite_member_req_dto_spec.rb +6 -0
  91. data/spec/models/last_time_period_spec.rb +22 -0
  92. data/spec/models/{connection_with_app_data_created_at_spec.rb → member_info_res_dto_created_at_spec.rb} +2 -2
  93. data/spec/models/member_info_res_dto_spec.rb +76 -0
  94. data/spec/models/member_res_dto_role_spec.rb +22 -0
  95. data/spec/models/member_res_dto_spec.rb +6 -0
  96. data/spec/models/open_api_spec_list_res_dto_spec.rb +5 -29
  97. data/spec/models/parameter_spec.rb +40 -0
  98. data/spec/models/plan_spec.rb +22 -0
  99. data/spec/models/role_spec.rb +22 -0
  100. data/spec/models/state_spec.rb +22 -0
  101. data/spec/models/t_connection_count_dto_spec.rb +34 -0
  102. data/spec/models/time_period_req_dto_spec.rb +28 -0
  103. data/spec/models/top_entities_res_dto_spec.rb +28 -0
  104. data/spec/models/update_member_req_dto_role_spec.rb +22 -0
  105. data/spec/models/update_member_req_dto_spec.rb +34 -0
  106. data/spec/models/webhook_req_dto_spec.rb +28 -0
  107. data/spec/models/webhook_secret_res_dto_spec.rb +28 -0
  108. metadata +215 -110
  109. data/spec/models/job_status_spec.rb +0 -22
@@ -0,0 +1,216 @@
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 TimePeriodReqDTO
14
+ # Time period to get the data for
15
+ attr_accessor :last_time_period
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'last_time_period' => :'lastTimePeriod'
21
+ }
22
+ end
23
+
24
+ # Returns all the JSON keys this model knows about
25
+ def self.acceptable_attributes
26
+ attribute_map.values
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'last_time_period' => :'LastTimePeriod'
33
+ }
34
+ end
35
+
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([
39
+ ])
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::TimePeriodReqDTO` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h|
51
+ if (!self.class.attribute_map.key?(k.to_sym))
52
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::TimePeriodReqDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+ h[k.to_sym] = v
55
+ }
56
+
57
+ if attributes.key?(:'last_time_period')
58
+ self.last_time_period = attributes[:'last_time_period']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ last_time_period == o.last_time_period
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [last_time_period].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ new.build_from_hash(attributes)
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ attributes = attributes.transform_keys(&:to_sym)
108
+ self.class.openapi_types.each_pair do |key, type|
109
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
110
+ self.send("#{key}=", nil)
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Composio.const_get(type)
164
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,223 @@
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 TopEntitiesResDTO
14
+ # Top entities by connection count
15
+ attr_accessor :entities
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'entities' => :'entities'
21
+ }
22
+ end
23
+
24
+ # Returns all the JSON keys this model knows about
25
+ def self.acceptable_attributes
26
+ attribute_map.values
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.openapi_types
31
+ {
32
+ :'entities' => :'Array<TConnectionCountDTO>'
33
+ }
34
+ end
35
+
36
+ # List of attributes with nullable: true
37
+ def self.openapi_nullable
38
+ Set.new([
39
+ ])
40
+ end
41
+
42
+ # Initializes the object
43
+ # @param [Hash] attributes Model attributes in the form of hash
44
+ def initialize(attributes = {})
45
+ if (!attributes.is_a?(Hash))
46
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::TopEntitiesResDTO` initialize method"
47
+ end
48
+
49
+ # check to see if the attribute exists and convert string to symbol for hash key
50
+ attributes = attributes.each_with_object({}) { |(k, v), h|
51
+ if (!self.class.attribute_map.key?(k.to_sym))
52
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::TopEntitiesResDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ end
54
+ h[k.to_sym] = v
55
+ }
56
+
57
+ if attributes.key?(:'entities')
58
+ if (value = attributes[:'entities']).is_a?(Array)
59
+ self.entities = value
60
+ end
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ if @entities.nil?
69
+ invalid_properties.push('invalid value for "entities", entities cannot be nil.')
70
+ end
71
+
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ return false if @entities.nil?
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ entities == o.entities
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [entities].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ new.build_from_hash(attributes)
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = Composio.const_get(type)
171
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -0,0 +1,236 @@
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 UpdateMemberReqDTO
14
+ # The uuid identifier for the member
15
+ attr_accessor :member_id
16
+
17
+ # The role that is assigned to the member
18
+ attr_accessor :role
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'member_id' => :'memberId',
24
+ :'role' => :'role'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'member_id' => :'String',
37
+ :'role' => :'UpdateMemberReqDtoRole'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Composio::UpdateMemberReqDTO` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Composio::UpdateMemberReqDTO`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'member_id')
63
+ self.member_id = attributes[:'member_id']
64
+ end
65
+
66
+ if attributes.key?(:'role')
67
+ self.role = attributes[:'role']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ if @member_id.nil?
76
+ invalid_properties.push('invalid value for "member_id", member_id cannot be nil.')
77
+ end
78
+
79
+ if @role.nil?
80
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if @member_id.nil?
90
+ return false if @role.nil?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ member_id == o.member_id &&
100
+ role == o.role
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [member_id, role].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ new.build_from_hash(attributes)
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ self.class.openapi_types.each_pair do |key, type|
129
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ elsif type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = Composio.const_get(type)
184
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ end
@@ -0,0 +1,36 @@
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 UpdateMemberReqDtoRole
14
+ ADMIN = "admin".freeze
15
+ DEVELOPER = "developer".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [ADMIN, DEVELOPER].freeze
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ return value if UpdateMemberReqDtoRole.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #UpdateMemberReqDtoRole"
34
+ end
35
+ end
36
+ end