carbon_ruby_sdk 0.2.46 → 0.2.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +39 -2
  4. data/lib/carbon_ruby_sdk/api/integrations_api.rb +109 -0
  5. data/lib/carbon_ruby_sdk/models/confluence_file_types.rb +36 -0
  6. data/lib/carbon_ruby_sdk/models/gitbook_file_types.rb +38 -0
  7. data/lib/carbon_ruby_sdk/models/github_file_types.rb +37 -0
  8. data/lib/carbon_ruby_sdk/models/gong_file_types.rb +37 -0
  9. data/lib/carbon_ruby_sdk/models/guru_file_types.rb +37 -0
  10. data/lib/carbon_ruby_sdk/models/intercom_file_types.rb +43 -0
  11. data/lib/carbon_ruby_sdk/models/item_types_property_inner.rb +235 -0
  12. data/lib/carbon_ruby_sdk/models/list_items_filters.rb +59 -5
  13. data/lib/carbon_ruby_sdk/models/list_items_filters_nullable.rb +59 -5
  14. data/lib/carbon_ruby_sdk/models/shared_source_item_types.rb +36 -0
  15. data/lib/carbon_ruby_sdk/models/storage_file_formats.rb +68 -0
  16. data/lib/carbon_ruby_sdk/models/zendesk_file_types.rb +39 -0
  17. data/lib/carbon_ruby_sdk/version.rb +1 -1
  18. data/lib/carbon_ruby_sdk.rb +10 -0
  19. data/spec/api/integrations_api_spec.rb +13 -0
  20. data/spec/models/confluence_file_types_spec.rb +22 -0
  21. data/spec/models/gitbook_file_types_spec.rb +22 -0
  22. data/spec/models/github_file_types_spec.rb +22 -0
  23. data/spec/models/gong_file_types_spec.rb +22 -0
  24. data/spec/models/guru_file_types_spec.rb +22 -0
  25. data/spec/models/intercom_file_types_spec.rb +22 -0
  26. data/spec/models/item_types_property_inner_spec.rb +22 -0
  27. data/spec/models/list_items_filters_nullable_spec.rb +12 -0
  28. data/spec/models/list_items_filters_spec.rb +12 -0
  29. data/spec/models/shared_source_item_types_spec.rb +22 -0
  30. data/spec/models/storage_file_formats_spec.rb +22 -0
  31. data/spec/models/zendesk_file_types_spec.rb +22 -0
  32. metadata +32 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6744e44fd0600e16103921e4b1a6a359ed7843f7ba3a6e8e6d44148dd9ad7b0c
4
- data.tar.gz: d54957620b7d4324e441bd777e2a9475dd969071673ad45c15571f2450791d96
3
+ metadata.gz: d158183ebdc660f6d69baf1b1eb19602fc5a66bba6b22bea74767f46ef82d891
4
+ data.tar.gz: 0e311b3d43eef4948cbaa7961a78ce909c6aa534e37b7336abaf831446d45d9c
5
5
  SHA512:
6
- metadata.gz: 6dc396894df099d59b67614dc0eb2efeb1018c217311f7878be5e0b73ae2e5c6fdebc2b513613b697e14b8c7d792fa64bc4721cf2576cf3f8ca145235fcc62df
7
- data.tar.gz: b606cf25c74b50dc5b82b8b57b0fc6850b25cb58f74c617dfaba60dd29bb5f58b2d65fc4c871da42c3474af953119e6a37a5dac4e06ad45478508d0573bfe5fa
6
+ metadata.gz: 9368fd94c8fbf3332fdf66fb7d3e26aacfcf4d7b0a6cd037ecb0a03b6eac064dbbaddd74386aafa81addf085d77488aa4e3ec8a8eb14d18d0c618219f5abf6bb
7
+ data.tar.gz: 9f595147da4e18dcfb076fd11420317ebb041de7d85ccb2a45e2c681f52d21ad04538f2f179efd2c1a103f797c04bb43cc79be65d74b83f521c3671a694aea9b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- carbon_ruby_sdk (0.2.46)
4
+ carbon_ruby_sdk (0.2.47)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -29,7 +29,7 @@ GEM
29
29
  method_source (1.1.0)
30
30
  multipart-post (2.4.1)
31
31
  parallel (1.26.3)
32
- parser (3.3.5.0)
32
+ parser (3.3.5.1)
33
33
  ast (~> 2.4.1)
34
34
  racc
35
35
  pry (0.14.2)
@@ -67,7 +67,7 @@ GEM
67
67
  rubocop-ast (>= 1.2.0, < 2.0)
68
68
  ruby-progressbar (~> 1.7)
69
69
  unicode-display_width (>= 1.4.0, < 3.0)
70
- rubocop-ast (1.32.3)
70
+ rubocop-ast (1.33.0)
71
71
  parser (>= 3.3.1.0)
72
72
  ruby-progressbar (1.13.0)
73
73
  ruby2_keywords (0.0.5)
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect external data to LLMs, no matter the source.
8
8
 
9
- [![npm](https://img.shields.io/badge/gem-v0.2.46-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.46)
9
+ [![npm](https://img.shields.io/badge/gem-v0.2.47-blue)](https://rubygems.org/gems/carbon_ruby_sdk/versions/0.2.47)
10
10
 
11
11
  </div>
12
12
 
@@ -73,6 +73,7 @@ Connect external data to LLMs, no matter the source.
73
73
  * [`carbon.integrations.list_labels`](#carbonintegrationslist_labels)
74
74
  * [`carbon.integrations.list_outlook_categories`](#carbonintegrationslist_outlook_categories)
75
75
  * [`carbon.integrations.list_repos`](#carbonintegrationslist_repos)
76
+ * [`carbon.integrations.list_sharepoint_sites`](#carbonintegrationslist_sharepoint_sites)
76
77
  * [`carbon.integrations.sync_azure_blob_files`](#carbonintegrationssync_azure_blob_files)
77
78
  * [`carbon.integrations.sync_azure_blob_storage`](#carbonintegrationssync_azure_blob_storage)
78
79
  * [`carbon.integrations.sync_confluence`](#carbonintegrationssync_confluence)
@@ -118,7 +119,7 @@ Connect external data to LLMs, no matter the source.
118
119
  Add to Gemfile:
119
120
 
120
121
  ```ruby
121
- gem 'carbon_ruby_sdk', '~> 0.2.46'
122
+ gem 'carbon_ruby_sdk', '~> 0.2.47'
122
123
  ```
123
124
 
124
125
  ## Getting Started<a id="getting-started"></a>
@@ -2911,6 +2912,42 @@ p result
2911
2912
  ---
2912
2913
 
2913
2914
 
2915
+ ### `carbon.integrations.list_sharepoint_sites`<a id="carbonintegrationslist_sharepoint_sites"></a>
2916
+
2917
+ List all Sharepoint sites in the connected tenant. The site names from the response can be
2918
+ used as the site name when connecting a Sharepoint site. If site name is null in the response, then site name should
2919
+ be left null when connecting to the site.
2920
+
2921
+ This endpoint requires an additional Sharepoint scope: "Sites.Read.All". Include this scope along with the default
2922
+ Sharepoint scopes to list Sharepoint sites, connect to a site, and finally sync files from the site. The default
2923
+ Sharepoint scopes are: [o, p, e, n, i, d, , o, f, f, l, i, n, e, _, a, c, c, e, s, s, , U, s, e, r, ., R, e, a, d, , F, i, l, e, s, ., R, e, a, d, ., A, l, l].
2924
+
2925
+ data_soure_id: Data source needs to be specified if you have linked multiple Sharepoint accounts
2926
+ cursor: Used for pagination. If next_cursor is returned in response, you need to pass it as the cursor in the next request
2927
+
2928
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
2929
+
2930
+ ```ruby
2931
+ result = carbon.integrations.list_sharepoint_sites(
2932
+ data_source_id: 1,
2933
+ cursor: "string_example",
2934
+ )
2935
+ p result
2936
+ ```
2937
+
2938
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2939
+
2940
+ ##### data_source_id: `Integer`<a id="data_source_id-integer"></a>
2941
+ ##### cursor: `String`<a id="cursor-string"></a>
2942
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2943
+
2944
+ `/integrations/sharepoint/sites/list` `GET`
2945
+
2946
+ [🔙 **Back to Table of Contents**](#table-of-contents)
2947
+
2948
+ ---
2949
+
2950
+
2914
2951
  ### `carbon.integrations.sync_azure_blob_files`<a id="carbonintegrationssync_azure_blob_files"></a>
2915
2952
 
2916
2953
  After optionally loading the items via /integrations/items/sync and integrations/items/list, use the container name
@@ -1817,6 +1817,115 @@ module Carbon
1817
1817
  end
1818
1818
 
1819
1819
 
1820
+ # List Sharepoint Sites
1821
+ #
1822
+ # List all Sharepoint sites in the connected tenant. The site names from the response can be
1823
+ # used as the site name when connecting a Sharepoint site. If site name is null in the response, then site name should
1824
+ # be left null when connecting to the site.
1825
+ #
1826
+ # This endpoint requires an additional Sharepoint scope: "Sites.Read.All". Include this scope along with the default
1827
+ # Sharepoint scopes to list Sharepoint sites, connect to a site, and finally sync files from the site. The default
1828
+ # Sharepoint scopes are: [o, p, e, n, i, d, , o, f, f, l, i, n, e, _, a, c, c, e, s, s, , U, s, e, r, ., R, e, a, d, , F, i, l, e, s, ., R, e, a, d, ., A, l, l].
1829
+ #
1830
+ # data_soure_id: Data source needs to be specified if you have linked multiple Sharepoint accounts
1831
+ # cursor: Used for pagination. If next_cursor is returned in response, you need to pass it as the cursor in the next request
1832
+ #
1833
+ # @param data_source_id [Integer]
1834
+ # @param cursor [String]
1835
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1836
+ def list_sharepoint_sites(data_source_id: SENTINEL, cursor: SENTINEL, extra: {})
1837
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
1838
+ extra[:cursor] = cursor if cursor != SENTINEL
1839
+ api_response = list_sharepoint_sites_with_http_info_impl(extra)
1840
+ api_response.data
1841
+ end
1842
+
1843
+ # List Sharepoint Sites
1844
+ #
1845
+ # List all Sharepoint sites in the connected tenant. The site names from the response can be
1846
+ # used as the site name when connecting a Sharepoint site. If site name is null in the response, then site name should
1847
+ # be left null when connecting to the site.
1848
+ #
1849
+ # This endpoint requires an additional Sharepoint scope: "Sites.Read.All". Include this scope along with the default
1850
+ # Sharepoint scopes to list Sharepoint sites, connect to a site, and finally sync files from the site. The default
1851
+ # Sharepoint scopes are: [o, p, e, n, i, d, , o, f, f, l, i, n, e, _, a, c, c, e, s, s, , U, s, e, r, ., R, e, a, d, , F, i, l, e, s, ., R, e, a, d, ., A, l, l].
1852
+ #
1853
+ # data_soure_id: Data source needs to be specified if you have linked multiple Sharepoint accounts
1854
+ # cursor: Used for pagination. If next_cursor is returned in response, you need to pass it as the cursor in the next request
1855
+ #
1856
+ # @param data_source_id [Integer]
1857
+ # @param cursor [String]
1858
+ # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
1859
+ def list_sharepoint_sites_with_http_info(data_source_id: SENTINEL, cursor: SENTINEL, extra: {})
1860
+ extra[:data_source_id] = data_source_id if data_source_id != SENTINEL
1861
+ extra[:cursor] = cursor if cursor != SENTINEL
1862
+ list_sharepoint_sites_with_http_info_impl(extra)
1863
+ end
1864
+
1865
+ # List Sharepoint Sites
1866
+ # List all Sharepoint sites in the connected tenant. The site names from the response can be used as the site name when connecting a Sharepoint site. If site name is null in the response, then site name should be left null when connecting to the site. This endpoint requires an additional Sharepoint scope: \"Sites.Read.All\". Include this scope along with the default Sharepoint scopes to list Sharepoint sites, connect to a site, and finally sync files from the site. The default Sharepoint scopes are: [o, p, e, n, i, d, , o, f, f, l, i, n, e, _, a, c, c, e, s, s, , U, s, e, r, ., R, e, a, d, , F, i, l, e, s, ., R, e, a, d, ., A, l, l]. data_soure_id: Data source needs to be specified if you have linked multiple Sharepoint accounts cursor: Used for pagination. If next_cursor is returned in response, you need to pass it as the cursor in the next request
1867
+ # @param [Hash] opts the optional parameters
1868
+ # @option opts [Integer] :data_source_id
1869
+ # @option opts [String] :cursor
1870
+ # @return [Object]
1871
+ private def list_sharepoint_sites_impl(opts = {})
1872
+ data, _status_code, _headers = list_sharepoint_sites_with_http_info(opts)
1873
+ data
1874
+ end
1875
+
1876
+ # List Sharepoint Sites
1877
+ # List all Sharepoint sites in the connected tenant. The site names from the response can be used as the site name when connecting a Sharepoint site. If site name is null in the response, then site name should be left null when connecting to the site. This endpoint requires an additional Sharepoint scope: \&quot;Sites.Read.All\&quot;. Include this scope along with the default Sharepoint scopes to list Sharepoint sites, connect to a site, and finally sync files from the site. The default Sharepoint scopes are: [o, p, e, n, i, d, , o, f, f, l, i, n, e, _, a, c, c, e, s, s, , U, s, e, r, ., R, e, a, d, , F, i, l, e, s, ., R, e, a, d, ., A, l, l]. data_soure_id: Data source needs to be specified if you have linked multiple Sharepoint accounts cursor: Used for pagination. If next_cursor is returned in response, you need to pass it as the cursor in the next request
1878
+ # @param [Hash] opts the optional parameters
1879
+ # @option opts [Integer] :data_source_id
1880
+ # @option opts [String] :cursor
1881
+ # @return [APIResponse] data is Object, status code, headers and response
1882
+ private def list_sharepoint_sites_with_http_info_impl(opts = {})
1883
+ if @api_client.config.debugging
1884
+ @api_client.config.logger.debug 'Calling API: IntegrationsApi.list_sharepoint_sites ...'
1885
+ end
1886
+ # resource path
1887
+ local_var_path = '/integrations/sharepoint/sites/list'
1888
+
1889
+ # query parameters
1890
+ query_params = opts[:query_params] || {}
1891
+ query_params[:'data_source_id'] = opts[:'data_source_id'] if !opts[:'data_source_id'].nil?
1892
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1893
+
1894
+ # header parameters
1895
+ header_params = opts[:header_params] || {}
1896
+ # HTTP header 'Accept' (if needed)
1897
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1898
+
1899
+ # form parameters
1900
+ form_params = opts[:form_params] || {}
1901
+
1902
+ # http body (model)
1903
+ post_body = opts[:debug_body]
1904
+
1905
+ # return_type
1906
+ return_type = opts[:debug_return_type] || 'Object'
1907
+
1908
+ # auth_names
1909
+ auth_names = opts[:debug_auth_names] || ['accessToken', 'apiKey', 'customerId']
1910
+
1911
+ new_options = opts.merge(
1912
+ :operation => :"IntegrationsApi.list_sharepoint_sites",
1913
+ :header_params => header_params,
1914
+ :query_params => query_params,
1915
+ :form_params => form_params,
1916
+ :body => post_body,
1917
+ :auth_names => auth_names,
1918
+ :return_type => return_type
1919
+ )
1920
+
1921
+ data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
1922
+ if @api_client.config.debugging
1923
+ @api_client.config.logger.debug "API called: IntegrationsApi#list_sharepoint_sites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1924
+ end
1925
+ APIResponse::new(data, status_code, headers, response)
1926
+ end
1927
+
1928
+
1820
1929
  # Azure Blob Files
1821
1930
  #
1822
1931
  # After optionally loading the items via /integrations/items/sync and integrations/items/list, use the container name
@@ -0,0 +1,36 @@
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 ConfluenceFileTypes
14
+ SPACE = "SPACE".freeze
15
+ PAGE = "PAGE".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [SPACE, PAGE].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 ConfluenceFileTypes.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #ConfluenceFileTypes"
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,38 @@
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 GitbookFileTypes
14
+ SPACE = "SPACE".freeze
15
+ SHEET = "SHEET".freeze
16
+ GROUP = "GROUP".freeze
17
+ LINK = "LINK".freeze
18
+
19
+ def self.all_vars
20
+ @all_vars ||= [SPACE, SHEET, GROUP, LINK].freeze
21
+ end
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def self.build_from_hash(value)
27
+ new.build_from_hash(value)
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def build_from_hash(value)
34
+ return value if GitbookFileTypes.all_vars.include?(value)
35
+ raise "Invalid ENUM value #{value} for class #GitbookFileTypes"
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,37 @@
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 GithubFileTypes
14
+ REPOSITORY = "REPOSITORY".freeze
15
+ DIRECTORY = "DIRECTORY".freeze
16
+ FILE = "FILE".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [REPOSITORY, DIRECTORY, FILE].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if GithubFileTypes.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #GithubFileTypes"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
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 GongFileTypes
14
+ WORKSPACE = "WORKSPACE".freeze
15
+ FOLDER = "FOLDER".freeze
16
+ CALL = "CALL".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [WORKSPACE, FOLDER, CALL].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if GongFileTypes.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #GongFileTypes"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
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 GuruFileTypes
14
+ COLLECTION = "COLLECTION".freeze
15
+ FOLDER = "FOLDER".freeze
16
+ CARD = "CARD".freeze
17
+
18
+ def self.all_vars
19
+ @all_vars ||= [COLLECTION, FOLDER, CARD].freeze
20
+ end
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ return value if GuruFileTypes.all_vars.include?(value)
34
+ raise "Invalid ENUM value #{value} for class #GuruFileTypes"
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,43 @@
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 IntercomFileTypes
14
+ ARTICLE = "ARTICLE".freeze
15
+ COLLECTION = "COLLECTION".freeze
16
+ HELP_CENTER = "HELP_CENTER".freeze
17
+ TICKET = "TICKET".freeze
18
+ TICKET_ATTACHMENT = "TICKET_ATTACHMENT".freeze
19
+ CONTACT = "CONTACT".freeze
20
+ ADMIN = "ADMIN".freeze
21
+ TEAM = "TEAM".freeze
22
+ CONVERSATION = "CONVERSATION".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [ARTICLE, COLLECTION, HELP_CENTER, TICKET, TICKET_ATTACHMENT, CONTACT, ADMIN, TEAM, CONVERSATION].freeze
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 self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if IntercomFileTypes.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #IntercomFileTypes"
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,235 @@
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 ItemTypesPropertyInner
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ }
18
+ end
19
+
20
+ # Returns all the JSON keys this model knows about
21
+ def self.acceptable_attributes
22
+ attribute_map.values
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([
34
+ ])
35
+ end
36
+
37
+ # List of class defined in anyOf (OpenAPI v3)
38
+ def self.openapi_any_of
39
+ [
40
+ :'ConfluenceFileTypes',
41
+ :'GitbookFileTypes',
42
+ :'GithubFileTypes',
43
+ :'GongFileTypes',
44
+ :'GuruFileTypes',
45
+ :'HelpdeskFileTypes',
46
+ :'IntercomFileTypes',
47
+ :'ServiceNowFileTypes',
48
+ :'SharedSourceItemTypes',
49
+ :'String',
50
+ :'ZendeskFileTypes'
51
+ ]
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Carbon::ItemTypesPropertyInner` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Carbon::ItemTypesPropertyInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
66
+ h[k.to_sym] = v
67
+ }
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ _any_of_found = false
81
+ self.class.openapi_any_of.each do |_class|
82
+ _any_of = Carbon.const_get(_class).build_from_hash(self.to_hash)
83
+ if _any_of.valid?
84
+ _any_of_found = true
85
+ end
86
+ end
87
+
88
+ if !_any_of_found
89
+ return false
90
+ end
91
+
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ attributes = attributes.transform_keys(&:to_sym)
127
+ self.class.openapi_types.each_pair do |key, type|
128
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
129
+ self.send("#{key}=", nil)
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Deserializes the data based on type
145
+ # @param string type Data type
146
+ # @param string value Value to be deserialized
147
+ # @return [Object] Deserialized data
148
+ def _deserialize(type, value)
149
+ case type.to_sym
150
+ when :Time
151
+ Time.parse(value)
152
+ when :Date
153
+ Date.parse(value)
154
+ when :String
155
+ value.to_s
156
+ when :Integer
157
+ value.to_i
158
+ when :Float
159
+ value.to_f
160
+ when :Boolean
161
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
162
+ true
163
+ else
164
+ false
165
+ end
166
+ when :Object
167
+ # generic object (usually a Hash), return directly
168
+ value
169
+ when /\AArray<(?<inner_type>.+)>\z/
170
+ inner_type = Regexp.last_match[:inner_type]
171
+ value.map { |v| _deserialize(inner_type, v) }
172
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
173
+ k_type = Regexp.last_match[:k_type]
174
+ v_type = Regexp.last_match[:v_type]
175
+ {}.tap do |hash|
176
+ value.each do |k, v|
177
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
178
+ end
179
+ end
180
+ else # model
181
+ # models (e.g. Pet) or oneOf
182
+ klass = Carbon.const_get(type)
183
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+
215
+ # Outputs non-array value in the form of hash
216
+ # For object, use to_hash. Otherwise, just return the value
217
+ # @param [Object] value Any valid value
218
+ # @return [Hash] Returns the value in the form of hash
219
+ def _to_hash(value)
220
+ if value.is_a?(Array)
221
+ value.compact.map { |v| _to_hash(v) }
222
+ elsif value.is_a?(Hash)
223
+ {}.tap do |hash|
224
+ value.each { |k, v| hash[k] = _to_hash(v) }
225
+ end
226
+ elsif value.respond_to? :to_hash
227
+ value.to_hash
228
+ else
229
+ value
230
+ end
231
+ end
232
+
233
+ end
234
+
235
+ end