composio 0.1.6 → 0.1.7

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