carbon_ruby_sdk 0.2.41 → 0.2.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +273 -3
  4. data/lib/carbon_ruby_sdk/api/data_sources_api.rb +196 -0
  5. data/lib/carbon_ruby_sdk/api/files_api.rb +4 -4
  6. data/lib/carbon_ruby_sdk/api/integrations_api.rb +48 -16
  7. data/lib/carbon_ruby_sdk/api/users_api.rb +71 -0
  8. data/lib/carbon_ruby_sdk/api/white_label_api.rb +393 -0
  9. data/lib/carbon_ruby_sdk/models/add_data_source_tags_input.rb +234 -0
  10. data/lib/carbon_ruby_sdk/models/azure_blob_auth_request.rb +14 -4
  11. data/lib/carbon_ruby_sdk/models/cold_storage_props.rb +1 -1
  12. data/lib/carbon_ruby_sdk/models/credentials.rb +244 -0
  13. data/lib/carbon_ruby_sdk/models/delete_white_label_request.rb +222 -0
  14. data/lib/carbon_ruby_sdk/models/external_source_item.rb +11 -1
  15. data/lib/carbon_ruby_sdk/models/fresh_desk_connect_request.rb +15 -5
  16. data/lib/carbon_ruby_sdk/models/gitbook_connect_request.rb +15 -5
  17. data/lib/carbon_ruby_sdk/models/github_connect_request.rb +14 -4
  18. data/lib/carbon_ruby_sdk/models/google_drive_credentials.rb +254 -0
  19. data/lib/carbon_ruby_sdk/models/google_drive_white_label_input.rb +230 -0
  20. data/lib/carbon_ruby_sdk/models/guru_connect_request.rb +15 -5
  21. data/lib/carbon_ruby_sdk/models/list_white_label_request.rb +246 -0
  22. data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +15 -5
  23. data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_credentials.rb +264 -0
  24. data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_white_label_input.rb +234 -0
  25. data/lib/carbon_ruby_sdk/models/one_drive_sharepoint_white_label_input_data_source_type.rb +36 -0
  26. data/lib/carbon_ruby_sdk/models/organization_user_data_source_api.rb +15 -1
  27. data/lib/carbon_ruby_sdk/models/organization_user_data_source_filters.rb +12 -1
  28. data/lib/carbon_ruby_sdk/models/remove_data_source_tags_input.rb +242 -0
  29. data/lib/carbon_ruby_sdk/models/rss_feed_input.rb +15 -5
  30. data/lib/carbon_ruby_sdk/models/s3_auth_request.rb +15 -5
  31. data/lib/carbon_ruby_sdk/models/sync_options.rb +15 -5
  32. data/lib/carbon_ruby_sdk/models/user_response.rb +18 -4
  33. data/lib/carbon_ruby_sdk/models/white_label_create_request_inner.rb +255 -0
  34. data/lib/carbon_ruby_sdk/models/white_label_filters.rb +230 -0
  35. data/lib/carbon_ruby_sdk/models/white_label_input.rb +234 -0
  36. data/lib/carbon_ruby_sdk/models/white_label_input_data_source_type.rb +48 -0
  37. data/lib/carbon_ruby_sdk/models/white_label_order_by_columns.rb +36 -0
  38. data/lib/carbon_ruby_sdk/models/white_label_update_request.rb +255 -0
  39. data/lib/carbon_ruby_sdk/models/white_labeling_response.rb +18 -4
  40. data/lib/carbon_ruby_sdk/version.rb +1 -1
  41. data/lib/carbon_ruby_sdk.rb +19 -0
  42. data/spec/api/data_sources_api_spec.rb +22 -0
  43. data/spec/api/files_api_spec.rb +1 -1
  44. data/spec/api/users_api_spec.rb +10 -0
  45. data/spec/api/white_label_api_spec.rb +73 -0
  46. data/spec/models/add_data_source_tags_input_spec.rb +34 -0
  47. data/spec/models/azure_blob_auth_request_spec.rb +6 -0
  48. data/spec/models/credentials_spec.rb +40 -0
  49. data/spec/models/delete_white_label_request_spec.rb +28 -0
  50. data/spec/models/external_source_item_spec.rb +6 -0
  51. data/spec/models/fresh_desk_connect_request_spec.rb +6 -0
  52. data/spec/models/gitbook_connect_request_spec.rb +6 -0
  53. data/spec/models/github_connect_request_spec.rb +6 -0
  54. data/spec/models/google_drive_credentials_spec.rb +46 -0
  55. data/spec/models/google_drive_white_label_input_spec.rb +34 -0
  56. data/spec/models/guru_connect_request_spec.rb +6 -0
  57. data/spec/models/list_white_label_request_spec.rb +46 -0
  58. data/spec/models/o_auth_url_request_spec.rb +6 -0
  59. data/spec/models/one_drive_sharepoint_credentials_spec.rb +52 -0
  60. data/spec/models/one_drive_sharepoint_white_label_input_data_source_type_spec.rb +22 -0
  61. data/spec/models/one_drive_sharepoint_white_label_input_spec.rb +34 -0
  62. data/spec/models/organization_user_data_source_api_spec.rb +6 -0
  63. data/spec/models/organization_user_data_source_filters_spec.rb +6 -0
  64. data/spec/models/remove_data_source_tags_input_spec.rb +40 -0
  65. data/spec/models/rss_feed_input_spec.rb +6 -0
  66. data/spec/models/s3_auth_request_spec.rb +6 -0
  67. data/spec/models/sync_options_spec.rb +6 -0
  68. data/spec/models/user_response_spec.rb +6 -0
  69. data/spec/models/white_label_create_request_inner_spec.rb +34 -0
  70. data/spec/models/white_label_filters_spec.rb +34 -0
  71. data/spec/models/white_label_input_data_source_type_spec.rb +22 -0
  72. data/spec/models/white_label_input_spec.rb +34 -0
  73. data/spec/models/white_label_order_by_columns_spec.rb +22 -0
  74. data/spec/models/white_label_update_request_spec.rb +34 -0
  75. data/spec/models/white_labeling_response_spec.rb +6 -0
  76. metadata +53 -2
@@ -0,0 +1,393 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'cgi'
10
+
11
+ module Carbon
12
+ class WhiteLabelApi
13
+ attr_accessor :api_client
14
+
15
+ def initialize(api_client = ApiClient.default)
16
+ @api_client = api_client
17
+ end
18
+
19
+ # Create White Labels
20
+ #
21
+ # @param body [Array<WhiteLabelCreateRequestInner>]
22
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
23
+ def create(body:, extra: {})
24
+ white_label_create_request_inner = body
25
+ api_response = create_with_http_info_impl(white_label_create_request_inner, extra)
26
+ api_response.data
27
+ end
28
+
29
+ # Create White Labels
30
+ #
31
+ # @param body [Array<WhiteLabelCreateRequestInner>]
32
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
33
+ def create_with_http_info(body:, extra: {})
34
+ white_label_create_request_inner = body
35
+ create_with_http_info_impl(white_label_create_request_inner, extra)
36
+ end
37
+
38
+ # Create White Labels
39
+ # @param white_label_create_request_inner [Array<WhiteLabelCreateRequestInner>]
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [Object]
42
+ private def create_impl(white_label_create_request_inner, opts = {})
43
+ data, _status_code, _headers = create_with_http_info(white_label_create_request_inner, opts)
44
+ data
45
+ end
46
+
47
+ # Create White Labels
48
+ # @param white_label_create_request_inner [Array<WhiteLabelCreateRequestInner>]
49
+ # @param [Hash] opts the optional parameters
50
+ # @return [APIResponse] data is Object, status code, headers and response
51
+ private def create_with_http_info_impl(white_label_create_request_inner, opts = {})
52
+ if @api_client.config.debugging
53
+ @api_client.config.logger.debug 'Calling API: WhiteLabelApi.create ...'
54
+ end
55
+ # verify the required parameter 'white_label_create_request_inner' is set
56
+ if @api_client.config.client_side_validation && white_label_create_request_inner.nil?
57
+ fail ArgumentError, "Missing the required parameter 'white_label_create_request_inner' when calling WhiteLabelApi.create"
58
+ end
59
+ # resource path
60
+ local_var_path = '/white_label/create'
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+
65
+ # header parameters
66
+ header_params = opts[:header_params] || {}
67
+ # HTTP header 'Accept' (if needed)
68
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
69
+ # HTTP header 'Content-Type'
70
+ content_type = @api_client.select_header_content_type(['application/json'])
71
+ if !content_type.nil?
72
+ header_params['Content-Type'] = content_type
73
+ end
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+
78
+ # http body (model)
79
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(white_label_create_request_inner)
80
+
81
+ # return_type
82
+ return_type = opts[:debug_return_type] || 'Object'
83
+
84
+ # auth_names
85
+ auth_names = opts[:debug_auth_names] || ['apiKey']
86
+
87
+ new_options = opts.merge(
88
+ :operation => :"WhiteLabelApi.create",
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: WhiteLabelApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ APIResponse::new(data, status_code, headers, response)
102
+ end
103
+
104
+
105
+ # Delete White Labels
106
+ #
107
+ # @param ids [Array<Integer>]
108
+ # @param body [DeleteWhiteLabelRequest]
109
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
110
+ def delete(ids:, extra: {})
111
+ _body = {}
112
+ _body[:ids] = ids if ids != SENTINEL
113
+ delete_white_label_request = _body
114
+ api_response = delete_with_http_info_impl(delete_white_label_request, extra)
115
+ api_response.data
116
+ end
117
+
118
+ # Delete White Labels
119
+ #
120
+ # @param ids [Array<Integer>]
121
+ # @param body [DeleteWhiteLabelRequest]
122
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
123
+ def delete_with_http_info(ids:, extra: {})
124
+ _body = {}
125
+ _body[:ids] = ids if ids != SENTINEL
126
+ delete_white_label_request = _body
127
+ delete_with_http_info_impl(delete_white_label_request, extra)
128
+ end
129
+
130
+ # Delete White Labels
131
+ # @param delete_white_label_request [DeleteWhiteLabelRequest]
132
+ # @param [Hash] opts the optional parameters
133
+ # @return [Object]
134
+ private def delete_impl(delete_white_label_request, opts = {})
135
+ data, _status_code, _headers = delete_with_http_info(delete_white_label_request, opts)
136
+ data
137
+ end
138
+
139
+ # Delete White Labels
140
+ # @param delete_white_label_request [DeleteWhiteLabelRequest]
141
+ # @param [Hash] opts the optional parameters
142
+ # @return [APIResponse] data is Object, status code, headers and response
143
+ private def delete_with_http_info_impl(delete_white_label_request, opts = {})
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug 'Calling API: WhiteLabelApi.delete ...'
146
+ end
147
+ # verify the required parameter 'delete_white_label_request' is set
148
+ if @api_client.config.client_side_validation && delete_white_label_request.nil?
149
+ fail ArgumentError, "Missing the required parameter 'delete_white_label_request' when calling WhiteLabelApi.delete"
150
+ end
151
+ # resource path
152
+ local_var_path = '/white_label/delete'
153
+
154
+ # query parameters
155
+ query_params = opts[:query_params] || {}
156
+
157
+ # header parameters
158
+ header_params = opts[:header_params] || {}
159
+ # HTTP header 'Accept' (if needed)
160
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
161
+ # HTTP header 'Content-Type'
162
+ content_type = @api_client.select_header_content_type(['application/json'])
163
+ if !content_type.nil?
164
+ header_params['Content-Type'] = content_type
165
+ end
166
+
167
+ # form parameters
168
+ form_params = opts[:form_params] || {}
169
+
170
+ # http body (model)
171
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_white_label_request)
172
+
173
+ # return_type
174
+ return_type = opts[:debug_return_type] || 'Object'
175
+
176
+ # auth_names
177
+ auth_names = opts[:debug_auth_names] || ['apiKey']
178
+
179
+ new_options = opts.merge(
180
+ :operation => :"WhiteLabelApi.delete",
181
+ :header_params => header_params,
182
+ :query_params => query_params,
183
+ :form_params => form_params,
184
+ :body => post_body,
185
+ :auth_names => auth_names,
186
+ :return_type => return_type
187
+ )
188
+
189
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug "API called: WhiteLabelApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
192
+ end
193
+ APIResponse::new(data, status_code, headers, response)
194
+ end
195
+
196
+
197
+ # List White Labels
198
+ #
199
+ # @param pagination [Pagination]
200
+ # @param order_by [WhiteLabelOrderByColumns]
201
+ # @param order_dir [OrderDir]
202
+ # @param filters [WhiteLabelFilters]
203
+ # @param body [ListWhiteLabelRequest]
204
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
205
+ def list(pagination: SENTINEL, order_by: 'created_at', order_dir: 'asc', filters: SENTINEL, extra: {})
206
+ _body = {}
207
+ _body[:pagination] = pagination if pagination != SENTINEL
208
+ _body[:order_by] = order_by if order_by != SENTINEL
209
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
210
+ _body[:filters] = filters if filters != SENTINEL
211
+ list_white_label_request = _body
212
+ api_response = list_with_http_info_impl(list_white_label_request, extra)
213
+ api_response.data
214
+ end
215
+
216
+ # List White Labels
217
+ #
218
+ # @param pagination [Pagination]
219
+ # @param order_by [WhiteLabelOrderByColumns]
220
+ # @param order_dir [OrderDir]
221
+ # @param filters [WhiteLabelFilters]
222
+ # @param body [ListWhiteLabelRequest]
223
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
224
+ def list_with_http_info(pagination: SENTINEL, order_by: 'created_at', order_dir: 'asc', filters: SENTINEL, extra: {})
225
+ _body = {}
226
+ _body[:pagination] = pagination if pagination != SENTINEL
227
+ _body[:order_by] = order_by if order_by != SENTINEL
228
+ _body[:order_dir] = order_dir if order_dir != SENTINEL
229
+ _body[:filters] = filters if filters != SENTINEL
230
+ list_white_label_request = _body
231
+ list_with_http_info_impl(list_white_label_request, extra)
232
+ end
233
+
234
+ # List White Labels
235
+ # @param list_white_label_request [ListWhiteLabelRequest]
236
+ # @param [Hash] opts the optional parameters
237
+ # @return [Object]
238
+ private def list_impl(list_white_label_request, opts = {})
239
+ data, _status_code, _headers = list_with_http_info(list_white_label_request, opts)
240
+ data
241
+ end
242
+
243
+ # List White Labels
244
+ # @param list_white_label_request [ListWhiteLabelRequest]
245
+ # @param [Hash] opts the optional parameters
246
+ # @return [APIResponse] data is Object, status code, headers and response
247
+ private def list_with_http_info_impl(list_white_label_request, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: WhiteLabelApi.list ...'
250
+ end
251
+ # verify the required parameter 'list_white_label_request' is set
252
+ if @api_client.config.client_side_validation && list_white_label_request.nil?
253
+ fail ArgumentError, "Missing the required parameter 'list_white_label_request' when calling WhiteLabelApi.list"
254
+ end
255
+ # resource path
256
+ local_var_path = '/white_label/list'
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+
261
+ # header parameters
262
+ header_params = opts[:header_params] || {}
263
+ # HTTP header 'Accept' (if needed)
264
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
265
+ # HTTP header 'Content-Type'
266
+ content_type = @api_client.select_header_content_type(['application/json'])
267
+ if !content_type.nil?
268
+ header_params['Content-Type'] = content_type
269
+ end
270
+
271
+ # form parameters
272
+ form_params = opts[:form_params] || {}
273
+
274
+ # http body (model)
275
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(list_white_label_request)
276
+
277
+ # return_type
278
+ return_type = opts[:debug_return_type] || 'Object'
279
+
280
+ # auth_names
281
+ auth_names = opts[:debug_auth_names] || ['apiKey']
282
+
283
+ new_options = opts.merge(
284
+ :operation => :"WhiteLabelApi.list",
285
+ :header_params => header_params,
286
+ :query_params => query_params,
287
+ :form_params => form_params,
288
+ :body => post_body,
289
+ :auth_names => auth_names,
290
+ :return_type => return_type
291
+ )
292
+
293
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
294
+ if @api_client.config.debugging
295
+ @api_client.config.logger.debug "API called: WhiteLabelApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
296
+ end
297
+ APIResponse::new(data, status_code, headers, response)
298
+ end
299
+
300
+
301
+ # Update White Label
302
+ #
303
+ # @param data_source_type [WhiteLabelInputDataSourceType]
304
+ # @param credentials [Credentials]
305
+ # @param body [WhiteLabelUpdateRequest]
306
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
307
+ def update(data_source_type: SENTINEL, credentials: SENTINEL, body:, extra: {})
308
+ white_label_update_request = body
309
+ api_response = update_with_http_info_impl(white_label_update_request, extra)
310
+ api_response.data
311
+ end
312
+
313
+ # Update White Label
314
+ #
315
+ # @param data_source_type [WhiteLabelInputDataSourceType]
316
+ # @param credentials [Credentials]
317
+ # @param body [WhiteLabelUpdateRequest]
318
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
319
+ def update_with_http_info(data_source_type: SENTINEL, credentials: SENTINEL, body:, extra: {})
320
+ white_label_update_request = body
321
+ update_with_http_info_impl(white_label_update_request, extra)
322
+ end
323
+
324
+ # Update White Label
325
+ # @param white_label_update_request [WhiteLabelUpdateRequest]
326
+ # @param [Hash] opts the optional parameters
327
+ # @return [Object]
328
+ private def update_impl(white_label_update_request, opts = {})
329
+ data, _status_code, _headers = update_with_http_info(white_label_update_request, opts)
330
+ data
331
+ end
332
+
333
+ # Update White Label
334
+ # @param white_label_update_request [WhiteLabelUpdateRequest]
335
+ # @param [Hash] opts the optional parameters
336
+ # @return [APIResponse] data is Object, status code, headers and response
337
+ private def update_with_http_info_impl(white_label_update_request, opts = {})
338
+ if @api_client.config.debugging
339
+ @api_client.config.logger.debug 'Calling API: WhiteLabelApi.update ...'
340
+ end
341
+ # verify the required parameter 'white_label_update_request' is set
342
+ if @api_client.config.client_side_validation && white_label_update_request.nil?
343
+ fail ArgumentError, "Missing the required parameter 'white_label_update_request' when calling WhiteLabelApi.update"
344
+ end
345
+ # resource path
346
+ local_var_path = '/white_label/update'
347
+
348
+ # query parameters
349
+ query_params = opts[:query_params] || {}
350
+
351
+ # header parameters
352
+ header_params = opts[:header_params] || {}
353
+ # HTTP header 'Accept' (if needed)
354
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
355
+ # HTTP header 'Content-Type'
356
+ content_type = @api_client.select_header_content_type(['application/json'])
357
+ if !content_type.nil?
358
+ header_params['Content-Type'] = content_type
359
+ end
360
+
361
+ # form parameters
362
+ form_params = opts[:form_params] || {}
363
+
364
+ # http body (model)
365
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(white_label_update_request)
366
+
367
+ # return_type
368
+ return_type = opts[:debug_return_type] || 'Object'
369
+
370
+ # auth_names
371
+ auth_names = opts[:debug_auth_names] || ['apiKey']
372
+
373
+ new_options = opts.merge(
374
+ :operation => :"WhiteLabelApi.update",
375
+ :header_params => header_params,
376
+ :query_params => query_params,
377
+ :form_params => form_params,
378
+ :body => post_body,
379
+ :auth_names => auth_names,
380
+ :return_type => return_type
381
+ )
382
+
383
+ data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
384
+ if @api_client.config.debugging
385
+ @api_client.config.logger.debug "API called: WhiteLabelApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
386
+ end
387
+ APIResponse::new(data, status_code, headers, response)
388
+ end
389
+ end
390
+
391
+ # top-level client access to avoid having the user to insantiate their own API instances
392
+ WhiteLabel = WhiteLabelApi::new
393
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Carbon
3
+
4
+ #Connect external data to LLMs, no matter the source.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Carbon
13
+ class AddDataSourceTagsInput
14
+ attr_accessor :tags
15
+
16
+ attr_accessor :data_source_id
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'tags' => :'tags',
22
+ :'data_source_id' => :'data_source_id'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'tags' => :'Object',
35
+ :'data_source_id' => :'Integer'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::AddDataSourceTagsInput` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::AddDataSourceTagsInput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'tags')
61
+ self.tags = attributes[:'tags']
62
+ end
63
+
64
+ if attributes.key?(:'data_source_id')
65
+ self.data_source_id = attributes[:'data_source_id']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @tags.nil?
74
+ invalid_properties.push('invalid value for "tags", tags cannot be nil.')
75
+ end
76
+
77
+ if @data_source_id.nil?
78
+ invalid_properties.push('invalid value for "data_source_id", data_source_id cannot be nil.')
79
+ end
80
+
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ return false if @tags.nil?
88
+ return false if @data_source_id.nil?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ tags == o.tags &&
98
+ data_source_id == o.data_source_id
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [tags, data_source_id].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Carbon.const_get(type)
182
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end
@@ -17,12 +17,16 @@ module Carbon
17
17
 
18
18
  attr_accessor :sync_source_items
19
19
 
20
+ # Tags to be associated with the data source. If the data source already has tags set, then an upsert will be performed.
21
+ attr_accessor :data_source_tags
22
+
20
23
  # Attribute mapping from ruby-style variable name to JSON key.
21
24
  def self.attribute_map
22
25
  {
23
26
  :'account_name' => :'account_name',
24
27
  :'account_key' => :'account_key',
25
- :'sync_source_items' => :'sync_source_items'
28
+ :'sync_source_items' => :'sync_source_items',
29
+ :'data_source_tags' => :'data_source_tags'
26
30
  }
27
31
  end
28
32
 
@@ -36,7 +40,8 @@ module Carbon
36
40
  {
37
41
  :'account_name' => :'String',
38
42
  :'account_key' => :'String',
39
- :'sync_source_items' => :'Boolean'
43
+ :'sync_source_items' => :'Boolean',
44
+ :'data_source_tags' => :'Object'
40
45
  }
41
46
  end
42
47
 
@@ -74,6 +79,10 @@ module Carbon
74
79
  else
75
80
  self.sync_source_items = true
76
81
  end
82
+
83
+ if attributes.key?(:'data_source_tags')
84
+ self.data_source_tags = attributes[:'data_source_tags']
85
+ end
77
86
  end
78
87
 
79
88
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -106,7 +115,8 @@ module Carbon
106
115
  self.class == o.class &&
107
116
  account_name == o.account_name &&
108
117
  account_key == o.account_key &&
109
- sync_source_items == o.sync_source_items
118
+ sync_source_items == o.sync_source_items &&
119
+ data_source_tags == o.data_source_tags
110
120
  end
111
121
 
112
122
  # @see the `==` method
@@ -118,7 +128,7 @@ module Carbon
118
128
  # Calculates hash code according to all attributes.
119
129
  # @return [Integer] Hash code
120
130
  def hash
121
- [account_name, account_key, sync_source_items].hash
131
+ [account_name, account_key, sync_source_items, data_source_tags].hash
122
132
  end
123
133
 
124
134
  # Builds the object from hash
@@ -14,7 +14,7 @@ module Carbon
14
14
  # Enable cold storage for the file. If set to true, the file will be moved to cold storage after a certain period of inactivity. Default is false.
15
15
  attr_accessor :enable_cold_storage
16
16
 
17
- # Time in seconds after which the file will be moved to cold storage.
17
+ # Time in days after which the file will be moved to cold storage. Valid values are [1, 3, 7, 14, 30]
18
18
  attr_accessor :hot_storage_time_to_live
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.