carbon_ruby_sdk 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +155 -28
- data/lib/carbon_ruby_sdk/api/integrations_api.rb +261 -8
- data/lib/carbon_ruby_sdk/api/utilities_api.rb +196 -0
- data/lib/carbon_ruby_sdk/models/data_source_type.rb +2 -1
- data/lib/carbon_ruby_sdk/models/data_source_type_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/fetch_urls_request.rb +220 -0
- data/lib/carbon_ruby_sdk/models/file_formats.rb +2 -1
- data/lib/carbon_ruby_sdk/models/file_formats_nullable.rb +2 -1
- data/lib/carbon_ruby_sdk/models/o_auth_url_request.rb +2 -2
- data/lib/carbon_ruby_sdk/models/simple_o_auth_data_sources.rb +2 -1
- data/lib/carbon_ruby_sdk/models/slack_filters.rb +232 -0
- data/lib/carbon_ruby_sdk/models/slack_sync_request.rb +321 -0
- data/lib/carbon_ruby_sdk/models/sync_files_request.rb +1 -1
- data/lib/carbon_ruby_sdk/models/sync_options.rb +1 -1
- data/lib/carbon_ruby_sdk/models/user_file.rb +15 -1
- data/lib/carbon_ruby_sdk/models/user_web_page_order_by_types.rb +37 -0
- data/lib/carbon_ruby_sdk/models/user_web_pages_filters.rb +218 -0
- data/lib/carbon_ruby_sdk/models/user_web_pages_request.rb +246 -0
- data/lib/carbon_ruby_sdk/version.rb +1 -1
- data/lib/carbon_ruby_sdk.rb +6 -3
- data/spec/api/integrations_api_spec.rb +27 -0
- data/spec/api/utilities_api_spec.rb +22 -0
- data/spec/models/fetch_urls_request_spec.rb +28 -0
- data/spec/models/slack_filters_spec.rb +34 -0
- data/spec/models/slack_sync_request_spec.rb +82 -0
- data/spec/models/user_file_spec.rb +6 -0
- data/spec/models/user_web_page_order_by_types_spec.rb +22 -0
- data/spec/models/user_web_pages_filters_spec.rb +28 -0
- data/spec/models/user_web_pages_request_spec.rb +46 -0
- metadata +20 -5
- data/lib/carbon_ruby_sdk/api/health_api.rb +0 -92
- data/spec/api/health_api_spec.rb +0 -39
@@ -114,6 +114,98 @@ module Carbon
|
|
114
114
|
end
|
115
115
|
|
116
116
|
|
117
|
+
# Fetch Urls V2
|
118
|
+
#
|
119
|
+
# @param url [String]
|
120
|
+
# @param body [FetchURLsRequest]
|
121
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
122
|
+
def fetch_webpage(url:, extra: {})
|
123
|
+
_body = {}
|
124
|
+
_body[:url] = url if url != SENTINEL
|
125
|
+
fetch_urls_request = _body
|
126
|
+
api_response = fetch_webpage_with_http_info_impl(fetch_urls_request, extra)
|
127
|
+
api_response.data
|
128
|
+
end
|
129
|
+
|
130
|
+
# Fetch Urls V2
|
131
|
+
#
|
132
|
+
# @param url [String]
|
133
|
+
# @param body [FetchURLsRequest]
|
134
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
135
|
+
def fetch_webpage_with_http_info(url:, extra: {})
|
136
|
+
_body = {}
|
137
|
+
_body[:url] = url if url != SENTINEL
|
138
|
+
fetch_urls_request = _body
|
139
|
+
fetch_webpage_with_http_info_impl(fetch_urls_request, extra)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Fetch Urls V2
|
143
|
+
# @param fetch_urls_request [FetchURLsRequest]
|
144
|
+
# @param [Hash] opts the optional parameters
|
145
|
+
# @return [Object]
|
146
|
+
private def fetch_webpage_impl(fetch_urls_request, opts = {})
|
147
|
+
data, _status_code, _headers = fetch_webpage_with_http_info(fetch_urls_request, opts)
|
148
|
+
data
|
149
|
+
end
|
150
|
+
|
151
|
+
# Fetch Urls V2
|
152
|
+
# @param fetch_urls_request [FetchURLsRequest]
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @return [APIResponse] data is Object, status code, headers and response
|
155
|
+
private def fetch_webpage_with_http_info_impl(fetch_urls_request, opts = {})
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug 'Calling API: UtilitiesApi.fetch_webpage ...'
|
158
|
+
end
|
159
|
+
# verify the required parameter 'fetch_urls_request' is set
|
160
|
+
if @api_client.config.client_side_validation && fetch_urls_request.nil?
|
161
|
+
fail ArgumentError, "Missing the required parameter 'fetch_urls_request' when calling UtilitiesApi.fetch_webpage"
|
162
|
+
end
|
163
|
+
# resource path
|
164
|
+
local_var_path = '/fetch_webpage'
|
165
|
+
|
166
|
+
# query parameters
|
167
|
+
query_params = opts[:query_params] || {}
|
168
|
+
|
169
|
+
# header parameters
|
170
|
+
header_params = opts[:header_params] || {}
|
171
|
+
# HTTP header 'Accept' (if needed)
|
172
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
173
|
+
# HTTP header 'Content-Type'
|
174
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
175
|
+
if !content_type.nil?
|
176
|
+
header_params['Content-Type'] = content_type
|
177
|
+
end
|
178
|
+
|
179
|
+
# form parameters
|
180
|
+
form_params = opts[:form_params] || {}
|
181
|
+
|
182
|
+
# http body (model)
|
183
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(fetch_urls_request)
|
184
|
+
|
185
|
+
# return_type
|
186
|
+
return_type = opts[:debug_return_type] || 'Object'
|
187
|
+
|
188
|
+
# auth_names
|
189
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
190
|
+
|
191
|
+
new_options = opts.merge(
|
192
|
+
:operation => :"UtilitiesApi.fetch_webpage",
|
193
|
+
:header_params => header_params,
|
194
|
+
:query_params => query_params,
|
195
|
+
:form_params => form_params,
|
196
|
+
:body => post_body,
|
197
|
+
:auth_names => auth_names,
|
198
|
+
:return_type => return_type
|
199
|
+
)
|
200
|
+
|
201
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
202
|
+
if @api_client.config.debugging
|
203
|
+
@api_client.config.logger.debug "API called: UtilitiesApi#fetch_webpage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
204
|
+
end
|
205
|
+
APIResponse::new(data, status_code, headers, response)
|
206
|
+
end
|
207
|
+
|
208
|
+
|
117
209
|
# Fetch Youtube Transcripts
|
118
210
|
#
|
119
211
|
# Fetches english transcripts from YouTube videos.
|
@@ -711,6 +803,110 @@ module Carbon
|
|
711
803
|
end
|
712
804
|
APIResponse::new(data, status_code, headers, response)
|
713
805
|
end
|
806
|
+
|
807
|
+
|
808
|
+
# User Web Pages
|
809
|
+
#
|
810
|
+
# @param filters [UserWebPagesFilters]
|
811
|
+
# @param pagination [Pagination]
|
812
|
+
# @param order_by [UserWebPageOrderByTypes]
|
813
|
+
# @param order_dir [OrderDirV2]
|
814
|
+
# @param body [UserWebPagesRequest]
|
815
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
816
|
+
def user_webpages(filters: SENTINEL, pagination: SENTINEL, order_by: 'updated_at', order_dir: 'desc', extra: {})
|
817
|
+
_body = {}
|
818
|
+
_body[:filters] = filters if filters != SENTINEL
|
819
|
+
_body[:pagination] = pagination if pagination != SENTINEL
|
820
|
+
_body[:order_by] = order_by if order_by != SENTINEL
|
821
|
+
_body[:order_dir] = order_dir if order_dir != SENTINEL
|
822
|
+
user_web_pages_request = _body
|
823
|
+
api_response = user_webpages_with_http_info_impl(user_web_pages_request, extra)
|
824
|
+
api_response.data
|
825
|
+
end
|
826
|
+
|
827
|
+
# User Web Pages
|
828
|
+
#
|
829
|
+
# @param filters [UserWebPagesFilters]
|
830
|
+
# @param pagination [Pagination]
|
831
|
+
# @param order_by [UserWebPageOrderByTypes]
|
832
|
+
# @param order_dir [OrderDirV2]
|
833
|
+
# @param body [UserWebPagesRequest]
|
834
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
835
|
+
def user_webpages_with_http_info(filters: SENTINEL, pagination: SENTINEL, order_by: 'updated_at', order_dir: 'desc', extra: {})
|
836
|
+
_body = {}
|
837
|
+
_body[:filters] = filters if filters != SENTINEL
|
838
|
+
_body[:pagination] = pagination if pagination != SENTINEL
|
839
|
+
_body[:order_by] = order_by if order_by != SENTINEL
|
840
|
+
_body[:order_dir] = order_dir if order_dir != SENTINEL
|
841
|
+
user_web_pages_request = _body
|
842
|
+
user_webpages_with_http_info_impl(user_web_pages_request, extra)
|
843
|
+
end
|
844
|
+
|
845
|
+
# User Web Pages
|
846
|
+
# @param user_web_pages_request [UserWebPagesRequest]
|
847
|
+
# @param [Hash] opts the optional parameters
|
848
|
+
# @return [Object]
|
849
|
+
private def user_webpages_impl(user_web_pages_request, opts = {})
|
850
|
+
data, _status_code, _headers = user_webpages_with_http_info(user_web_pages_request, opts)
|
851
|
+
data
|
852
|
+
end
|
853
|
+
|
854
|
+
# User Web Pages
|
855
|
+
# @param user_web_pages_request [UserWebPagesRequest]
|
856
|
+
# @param [Hash] opts the optional parameters
|
857
|
+
# @return [APIResponse] data is Object, status code, headers and response
|
858
|
+
private def user_webpages_with_http_info_impl(user_web_pages_request, opts = {})
|
859
|
+
if @api_client.config.debugging
|
860
|
+
@api_client.config.logger.debug 'Calling API: UtilitiesApi.user_webpages ...'
|
861
|
+
end
|
862
|
+
# verify the required parameter 'user_web_pages_request' is set
|
863
|
+
if @api_client.config.client_side_validation && user_web_pages_request.nil?
|
864
|
+
fail ArgumentError, "Missing the required parameter 'user_web_pages_request' when calling UtilitiesApi.user_webpages"
|
865
|
+
end
|
866
|
+
# resource path
|
867
|
+
local_var_path = '/user_webpages'
|
868
|
+
|
869
|
+
# query parameters
|
870
|
+
query_params = opts[:query_params] || {}
|
871
|
+
|
872
|
+
# header parameters
|
873
|
+
header_params = opts[:header_params] || {}
|
874
|
+
# HTTP header 'Accept' (if needed)
|
875
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
876
|
+
# HTTP header 'Content-Type'
|
877
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
878
|
+
if !content_type.nil?
|
879
|
+
header_params['Content-Type'] = content_type
|
880
|
+
end
|
881
|
+
|
882
|
+
# form parameters
|
883
|
+
form_params = opts[:form_params] || {}
|
884
|
+
|
885
|
+
# http body (model)
|
886
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(user_web_pages_request)
|
887
|
+
|
888
|
+
# return_type
|
889
|
+
return_type = opts[:debug_return_type] || 'Object'
|
890
|
+
|
891
|
+
# auth_names
|
892
|
+
auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
|
893
|
+
|
894
|
+
new_options = opts.merge(
|
895
|
+
:operation => :"UtilitiesApi.user_webpages",
|
896
|
+
:header_params => header_params,
|
897
|
+
:query_params => query_params,
|
898
|
+
:form_params => form_params,
|
899
|
+
:body => post_body,
|
900
|
+
:auth_names => auth_names,
|
901
|
+
:return_type => return_type
|
902
|
+
)
|
903
|
+
|
904
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
905
|
+
if @api_client.config.debugging
|
906
|
+
@api_client.config.logger.debug "API called: UtilitiesApi#user_webpages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
907
|
+
end
|
908
|
+
APIResponse::new(data, status_code, headers, response)
|
909
|
+
end
|
714
910
|
end
|
715
911
|
|
716
912
|
# top-level client access to avoid having the user to insantiate their own API instances
|
@@ -43,6 +43,7 @@ module Carbon
|
|
43
43
|
GITBOOK = "GITBOOK".freeze
|
44
44
|
SALESFORCE = "SALESFORCE".freeze
|
45
45
|
GITHUB = "GITHUB".freeze
|
46
|
+
SLACK = "SLACK".freeze
|
46
47
|
JPG = "JPG".freeze
|
47
48
|
PNG = "PNG".freeze
|
48
49
|
JPEG = "JPEG".freeze
|
@@ -66,7 +67,7 @@ module Carbon
|
|
66
67
|
WEBM = "WEBM".freeze
|
67
68
|
|
68
69
|
def self.all_vars
|
69
|
-
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
70
|
+
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, SLACK, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
70
71
|
end
|
71
72
|
|
72
73
|
# Builds the enum from string
|
@@ -43,6 +43,7 @@ module Carbon
|
|
43
43
|
GITBOOK = "GITBOOK".freeze
|
44
44
|
SALESFORCE = "SALESFORCE".freeze
|
45
45
|
GITHUB = "GITHUB".freeze
|
46
|
+
SLACK = "SLACK".freeze
|
46
47
|
JPG = "JPG".freeze
|
47
48
|
PNG = "PNG".freeze
|
48
49
|
JPEG = "JPEG".freeze
|
@@ -66,7 +67,7 @@ module Carbon
|
|
66
67
|
WEBM = "WEBM".freeze
|
67
68
|
|
68
69
|
def self.all_vars
|
69
|
-
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
70
|
+
@all_vars ||= [GOOGLE_DRIVE, NOTION, NOTION_DATABASE, INTERCOM, DROPBOX, ONEDRIVE, SHAREPOINT, CONFLUENCE, BOX, ZENDESK, ZOTERO, S3, GMAIL, OUTLOOK, TEXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, RAW_TEXT, WEB_SCRAPE, RSS_FEED, FRESHDESK, GITBOOK, SALESFORCE, GITHUB, SLACK, JPG, PNG, JPEG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
70
71
|
end
|
71
72
|
|
72
73
|
# Builds the enum from string
|
@@ -0,0 +1,220 @@
|
|
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 FetchURLsRequest
|
14
|
+
attr_accessor :url
|
15
|
+
|
16
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:'url' => :'url'
|
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
|
+
:'url' => :'String'
|
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 `Carbon::FetchURLsRequest` 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 `Carbon::FetchURLsRequest`. 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?(:'url')
|
57
|
+
self.url = attributes[:'url']
|
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 @url.nil?
|
66
|
+
invalid_properties.push('invalid value for "url", url 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 @url.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
|
+
url == o.url
|
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
|
+
[url].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 = Carbon.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
|
@@ -37,6 +37,7 @@ module Carbon
|
|
37
37
|
GITBOOK = "GITBOOK".freeze
|
38
38
|
SALESFORCE = "SALESFORCE".freeze
|
39
39
|
GITHUB = "GITHUB".freeze
|
40
|
+
SLACK = "SLACK".freeze
|
40
41
|
JPG = "JPG".freeze
|
41
42
|
PNG = "PNG".freeze
|
42
43
|
MP3 = "MP3".freeze
|
@@ -59,7 +60,7 @@ module Carbon
|
|
59
60
|
WEBM = "WEBM".freeze
|
60
61
|
|
61
62
|
def self.all_vars
|
62
|
-
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
63
|
+
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, SLACK, JPG, PNG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
63
64
|
end
|
64
65
|
|
65
66
|
# Builds the enum from string
|
@@ -37,6 +37,7 @@ module Carbon
|
|
37
37
|
GITBOOK = "GITBOOK".freeze
|
38
38
|
SALESFORCE = "SALESFORCE".freeze
|
39
39
|
GITHUB = "GITHUB".freeze
|
40
|
+
SLACK = "SLACK".freeze
|
40
41
|
JPG = "JPG".freeze
|
41
42
|
PNG = "PNG".freeze
|
42
43
|
MP3 = "MP3".freeze
|
@@ -59,7 +60,7 @@ module Carbon
|
|
59
60
|
WEBM = "WEBM".freeze
|
60
61
|
|
61
62
|
def self.all_vars
|
62
|
-
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, JPG, PNG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
63
|
+
@all_vars ||= [TXT, CSV, TSV, PDF, DOCX, PPTX, XLSX, MD, RTF, JSON, HTML, NOTION, GOOGLE_DOCS, GOOGLE_SHEETS, GOOGLE_SLIDES, INTERCOM, CONFLUENCE, RSS_FEED, GMAIL, OUTLOOK, ZENDESK, FRESHDESK, WEB_SCRAPE, GITBOOK, SALESFORCE, GITHUB, SLACK, JPG, PNG, MP3, MP2, AAC, WAV, FLAC, PCM, M4_A, OGG, OPUS, MPEG, MPG, MP4, WMV, AVI, MOV, MKV, FLV, WEBM].freeze
|
63
64
|
end
|
64
65
|
|
65
66
|
# Builds the enum from string
|
@@ -61,7 +61,7 @@ module Carbon
|
|
61
61
|
|
62
62
|
attr_accessor :parse_pdf_tables_with_ocr
|
63
63
|
|
64
|
-
# Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, ONEDRIVE,
|
64
|
+
# Enable integration's file picker for sources that support it. Supported sources: SHAREPOINT, GOOGLE_DRIVE, ONEDRIVE, BOX, DROPBOX
|
65
65
|
attr_accessor :enable_file_picker
|
66
66
|
|
67
67
|
# Enabling this flag will fetch all available content from the source to be listed via list items endpoint
|
@@ -279,7 +279,7 @@ module Carbon
|
|
279
279
|
if attributes.key?(:'request_id')
|
280
280
|
self.request_id = attributes[:'request_id']
|
281
281
|
else
|
282
|
-
self.request_id = '
|
282
|
+
self.request_id = '1855375f-faa1-4965-99a1-03d1cab8000b'
|
283
283
|
end
|
284
284
|
|
285
285
|
if attributes.key?(:'use_ocr')
|
@@ -18,9 +18,10 @@ module Carbon
|
|
18
18
|
BOX = "BOX".freeze
|
19
19
|
GMAIL = "GMAIL".freeze
|
20
20
|
OUTLOOK = "OUTLOOK".freeze
|
21
|
+
SLACK = "SLACK".freeze
|
21
22
|
|
22
23
|
def self.all_vars
|
23
|
-
@all_vars ||= [GOOGLE_DRIVE, INTERCOM, DROPBOX, ONEDRIVE, BOX, GMAIL, OUTLOOK].freeze
|
24
|
+
@all_vars ||= [GOOGLE_DRIVE, INTERCOM, DROPBOX, ONEDRIVE, BOX, GMAIL, OUTLOOK, SLACK].freeze
|
24
25
|
end
|
25
26
|
|
26
27
|
# Builds the enum from string
|