elastic-enterprise-search 7.12.1 → 7.13.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +12 -0
  3. data/.ci/test-matrix.yml +1 -1
  4. data/docs/guide/connecting.asciidoc +47 -1
  5. data/docs/guide/release_notes/712.asciidoc +0 -22
  6. data/docs/guide/workplace-search-api.asciidoc +19 -2
  7. data/elastic-enterprise-search.gemspec +1 -1
  8. data/lib/elastic/enterprise-search/api/put_read_only.rb +2 -0
  9. data/lib/elastic/enterprise-search/client.rb +0 -12
  10. data/lib/elastic/enterprise-search/request.rb +4 -0
  11. data/lib/elastic/enterprise-search/version.rb +1 -1
  12. data/lib/elastic/enterprise_search.rb +11 -0
  13. data/lib/elastic/workplace-search/api/content_source.rb +49 -0
  14. data/lib/elastic/workplace-search/api/create_analytics_event.rb +2 -2
  15. data/lib/elastic/workplace-search/api/create_content_source.rb +52 -0
  16. data/lib/elastic/workplace-search/api/create_external_identity.rb +2 -0
  17. data/lib/elastic/workplace-search/api/delete_all_documents.rb +49 -0
  18. data/lib/elastic/workplace-search/api/delete_content_source.rb +49 -0
  19. data/lib/elastic/workplace-search/api/delete_documents.rb +1 -1
  20. data/lib/elastic/workplace-search/api/document.rb +53 -0
  21. data/lib/elastic/workplace-search/api/list_content_sources.rb +48 -0
  22. data/lib/elastic/workplace-search/api/put_content_source.rb +55 -0
  23. data/lib/elastic/workplace-search/api/put_external_identity.rb +2 -0
  24. data/lib/elastic/workplace-search/workplace_search.rb +6 -1
  25. data/spec/integration/enterprise_search_api_spec.rb +4 -0
  26. data/spec/integration/workplace_search_spec.rb +253 -0
  27. metadata +18 -32
  28. data/.ci/jobs/elastic+enterprise-search-ruby+7.11.yml +0 -12
  29. data/spec/fixtures/vcr/workplace_search/add_user_permissions.yml +0 -53
  30. data/spec/fixtures/vcr/workplace_search/clear_user_permissions.yml +0 -53
  31. data/spec/fixtures/vcr/workplace_search/create_external_identity.yml +0 -53
  32. data/spec/fixtures/vcr/workplace_search/delete_documents.yml +0 -53
  33. data/spec/fixtures/vcr/workplace_search/delete_external_identity.yml +0 -53
  34. data/spec/fixtures/vcr/workplace_search/index_documents.yml +0 -55
  35. data/spec/fixtures/vcr/workplace_search/list_external_identities.yml +0 -53
  36. data/spec/fixtures/vcr/workplace_search/list_permissions.yml +0 -53
  37. data/spec/fixtures/vcr/workplace_search/put_external_identity.yml +0 -53
  38. data/spec/fixtures/vcr/workplace_search/put_user_permissions.yml +0 -103
  39. data/spec/fixtures/vcr/workplace_search/remove_user_permissions.yml +0 -53
  40. data/spec/fixtures/vcr/workplace_search/retrieve_external_identity.yml +0 -53
  41. data/spec/fixtures/vcr/workplace_search/user_permissions_empty.yml +0 -53
  42. data/spec/workplace-search/documents_spec.rb +0 -80
  43. data/spec/workplace-search/external_identities_spec.rb +0 -84
  44. data/spec/workplace-search/permissions_spec.rb +0 -136
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cc91758d4ef25ab3d509996223bf7c7cb07352e81f5f450fccadf8e0d799a4b
4
- data.tar.gz: 646f6a1cb4295263a1dc3ee07441aa8c5bfe20b1692e5f0d970d31a2a14a41c4
3
+ metadata.gz: 8036e7cf6cee2aa2a4bd8ebe43e8ebd81e46de9849dd785c1185e865cd197a6d
4
+ data.tar.gz: 0dc716523605727f80cf992537ace657ba4152db79e8b7df08a077d77c40f623
5
5
  SHA512:
6
- metadata.gz: bddacbdbf0df0b8fe15197e4b3a016743dc7a79854d1de1bc9b5216c6297051808d905daae04c7d1da949840f971b4ad65dfc95b258db063a985380eaa66109c
7
- data.tar.gz: 45e7a164a0ee32daa8968b87690c27eead9b3de83e5ae4e72fb7a9d6a496cd2fa4ec24dd696f666ac581c19d541e4cc978423f0b888f6611329b8c351b9408ed
6
+ metadata.gz: 2a46a41e600dbae30c4f24ff5a76b766ce68ae54d4c322e94c5eb312a1e0ee4bbf55df7bbea572656285078cc3a177b35bd4d8619d3cd706db7500f91ac71c72
7
+ data.tar.gz: d825c1dccff5af252f2eaba9dd2f84ef47594fbe8e3992a1255433179f44e32d4318a91dc495871d889a273456ef7cf6663184fc2a8f03f32658e560d253a159
@@ -0,0 +1,12 @@
1
+ ---
2
+ - job:
3
+ name: elastic+enterprise-search-ruby+7.10.0.beta.1
4
+ display-name: 'elastic / enterprise-search-ruby # 7.10.0.beta.1'
5
+ description: Testing the enterprise-search-ruby 7.10.0.beta.1 branch.
6
+ junit_results: "*-junit.xml"
7
+ parameters:
8
+ - string:
9
+ name: branch_specifier
10
+ default: refs/heads/7.10.0.beta.1
11
+ description: the Git branch specifier to build (<branchName>, <tagName>,
12
+ <commitId>, etc.)
data/.ci/test-matrix.yml CHANGED
@@ -6,7 +6,7 @@ RUBY_VERSION:
6
6
  - 2.5
7
7
 
8
8
  STACK_VERSION:
9
- - 7.12-SNAPSHOT
9
+ - 7.13-SNAPSHOT
10
10
 
11
11
  TEST_SUITE:
12
12
  - platinum
@@ -87,7 +87,13 @@ client.search(engine_name, query: 'jungle')
87
87
  [[auth-ws]]
88
88
  ==== Authenticating with Workplace Search
89
89
 
90
- In your Elastic Workplace Search dashboard navigate to _Sources/Add a Shared Content Source_ and select _Custom API Source_ to create a new source. Name your source (e.g. `Enterprise Search Ruby Client`) and once it's created you'll get an `access token` and an `ID`. You'll need these in the following steps.
90
+ Workplace Search supports multiple authentication methods:
91
+
92
+ [discrete]
93
+ [[access-tokens]]
94
+ ===== Workplace Search admin user access tokens
95
+
96
+ In your Elastic Workplace Search dashboard navigate to _Sources/Add a Shared Content Source_ and select _Custom API Source_ to create a new source. Name your source (e.g. `Enterprise Search Ruby Client`) and once it's created you'll get an `access token` and an `ID`.
91
97
 
92
98
  The Workplace Search client can be accessed from an existing Enterprise Search Client, or you can initialize a new one. If you instantiate the Workplace Search client from an existing Enterprise Search Client, it's going to share the HTTP transport instance, so it's going to connect to the same host, which is a common scenario. However, if you want to connect to a different host, you should instantiate a new Workplace Client on its own:
93
99
 
@@ -109,6 +115,46 @@ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new
109
115
  )
110
116
  ----------------------------
111
117
 
118
+ [discrete]
119
+ [[basic-auth]]
120
+ ===== Basic Authentication
121
+
122
+ Workplace Search APIs support basic authentication headers to authenticate users. All Workplace Search APIs support basic authentication:
123
+
124
+ [source,rb]
125
+ ----------------------------
126
+ host = 'https://id.ent-search.europe-west2.gcp.elastic-cloud.com'
127
+ basic_auth = { user: 'enterprise_search', password: 'changeme' }
128
+
129
+ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(
130
+ host: host,
131
+ http_auth: basic_auth
132
+ )
133
+ ----------------------------
134
+
135
+ [discrete]
136
+ [[es-tokens]]
137
+ ===== Elasticsearch tokens
138
+
139
+ Workplace Search APIs support Elasticsearch tokens generated by the Elasticsearch Token Service. All Workplace Search APIs support Elasticsearch tokens as an authentication method.
140
+
141
+ [source,rb]
142
+ ----------------------------
143
+ host = 'https://id.ent-search.europe-west2.gcp.elastic-cloud.com'
144
+ access_token = '<access token>'
145
+
146
+ workplace_search_client = Elastic::EnterpriseSearch::WorkplaceSearch::Client.new(
147
+ host: host,
148
+ http_auth: access_token
149
+ )
150
+ ----------------------------
151
+
152
+ [discrete]
153
+ [[ws-oauth]]
154
+ ===== Workplace Search OAuth access tokens
155
+
156
+ The Search API and the Analytics Events API support user access tokens generated by the Workplace Search OAuth Service. The token is acquired via an OAuth authorization flow. User access tokens are meant to be used for Custom Search Experiences. Check <<ws-oauth-authentication>>.
157
+
112
158
  [discrete]
113
159
  [[custom_headers]]
114
160
  === Custom HTTP Headers
@@ -1,18 +1,6 @@
1
1
  [[release_notes_712]]
2
- === 7.12 Release notes
3
-
4
- [discrete]
5
- [[release_notes_7121]]
6
- === 7.12.1 Release notes
7
-
8
- - Elastic Transport: Locks dependency version to < 7.14
9
- - Elastic Transport: Adds ENTERPRISE_SERVICE_VERSION constant for compatibility
10
-
11
- [discrete]
12
- [[release_notes_7120]]
13
2
  === 7.12.0 Release notes
14
3
 
15
-
16
4
  [discrete]
17
5
  ==== General
18
6
 
@@ -26,13 +14,3 @@
26
14
 
27
15
  - Updates source code documentation for `current_page` and `page_size` parameters from type `String` to `Integer`.
28
16
  - In `multi_search`, the body parameter is renamed to `body` from `queries` to avoid repetition and potential confusion.
29
-
30
- [discrete]
31
- ==== Workplace Search
32
-
33
- - Body parameter renamed to `document_ids` in `delete_documents`:
34
-
35
- [source,rb]
36
- ----------------------------
37
- client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
38
- ----------------------------
@@ -15,10 +15,18 @@ documents = [
15
15
 
16
16
  response = client.index_documents(content_source_id, body: documents)
17
17
 
18
+ # Retrieve a document by ID from a specified content source
19
+ client.document(content_source_id, document_id: '75015d85370d')
20
+
18
21
  # Delete Documents
19
- response = client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
22
+ client.delete_documents(content_source_id, document_ids: ['e68fbc2688f1', 'c535e226aee3'])
23
+
24
+ # Delete all documents for a given content source
25
+ client.delete_all_documents(content_source_id)
20
26
  ----------------------------
21
27
 
28
+ [discrete]
29
+ [[ws-oauth-authentication]]
22
30
  === OAuth Authentication
23
31
 
24
32
  You need to configure the OAuth Application for Search in order to use the Workplace Search client's `search` and `create_analytics` endpoints. You need to follow the steps in https://www.elastic.co/guide/en/workplace-search/current/building-custom-search-workplace-search.html#configuring-search-oauth[Configuring the OAuth Application for Search] to retrieve the credentials: Client ID and Client Secret to request access tokens from the authentication server.
@@ -101,9 +109,18 @@ client.put_external_identity(content_source_id, user: 'elastic_user', body: body
101
109
  client.delete_external_identity(content_source_id, user: 'elastic_user')
102
110
  ----------------------------
103
111
 
112
+ === Search
113
+
114
+ You need to set up <<ws-oauth-authentication>> and use the access token for Search. See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-search-api.html[Search API Reference] for available parameters and more details about search.
115
+
116
+ [source,rb]
117
+ ----------------------------
118
+ client.search(body: {query: 'search query'}, access_token: access_token)
119
+ ----------------------------
120
+
104
121
  === Create Analytics Event
105
122
 
106
- You need to set up OAuth Authentication for analytics events.
123
+ You need to set up <<ws-oauth-authentication>> to use analytics events.
107
124
 
108
125
  [source,rb]
109
126
  ----------------------------
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
48
48
  s.require_paths = ['lib']
49
49
 
50
- s.add_dependency 'elasticsearch-transport', '>= 7.11', '< 7.14'
50
+ s.add_dependency 'elasticsearch-transport', '7.13.0.pre'
51
51
  s.add_runtime_dependency 'jwt', '>= 1.5', '< 3.0'
52
52
  s.add_development_dependency 'awesome_print'
53
53
  s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION)
@@ -23,6 +23,8 @@ module Elastic
23
23
  # Read-Only - Update the read-only flag's state
24
24
  # Update the read-only flag's state
25
25
  #
26
+ # @option arguments [Object] :body
27
+ # @option body [Boolean] :enabled
26
28
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
27
29
  #
28
30
  # @see https://www.elastic.co/guide/en/enterprise-search/current/read-only-api.html#setting-read-only-state
@@ -22,18 +22,6 @@ require 'elastic/enterprise-search/utils'
22
22
  require 'elasticsearch-transport'
23
23
 
24
24
  module Elastic
25
- # If the version is X.X.X.pre/alpha/beta, use X.X.Xp for the meta-header:
26
- def self.client_meta_version
27
- regexp = /^([0-9]+\.[0-9]+\.[0-9]+)\.?([a-z0-9.-]+)?$/
28
- match = Elastic::EnterpriseSearch::VERSION.match(regexp)
29
- return "#{match[1]}p" if match[2]
30
-
31
- Elastic::EnterpriseSearch::VERSION
32
- end
33
-
34
- META_HEADER_SERVICE_VERSION = [:ent, client_meta_version].freeze
35
- ENTERPRISE_SERVICE_VERSION = [:ent, client_meta_version].freeze
36
-
37
25
  module EnterpriseSearch
38
26
  # API client for the {Elastic Enterprise Search API}[https://www.elastic.co/enterprise-search].
39
27
  # This is the main client from which the Workplace Search and App Search clients inherit.
@@ -60,6 +60,10 @@ module Elastic
60
60
  end
61
61
 
62
62
  def setup_authentication_header
63
+ basic_auth_header
64
+ end
65
+
66
+ def basic_auth_header
63
67
  credentials = Base64.strict_encode64("#{http_auth[:user]}:#{http_auth[:password]}")
64
68
  "Basic #{credentials}"
65
69
  end
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Elastic
21
21
  module EnterpriseSearch
22
- VERSION = '7.12.1'
22
+ VERSION = '7.13.0.pre'
23
23
  end
24
24
  end
@@ -33,6 +33,17 @@ require 'elastic/workplace-search/workplace_search'
33
33
  require 'elastic/app-search/app_search'
34
34
 
35
35
  module Elastic
36
+ # If the version is X.X.X.pre/alpha/beta, use X.X.Xp for the meta-header:
37
+ def self.client_meta_version
38
+ regexp = /^([0-9]+\.[0-9]+\.[0-9]+)\.?([a-z0-9.-]+)?$/
39
+ match = Elastic::EnterpriseSearch::VERSION.match(regexp)
40
+ return "#{match[1]}p" if match[2]
41
+
42
+ Elastic::EnterpriseSearch::VERSION
43
+ end
44
+
45
+ ENTERPRISE_SERVICE_VERSION = [:ent, client_meta_version].freeze
46
+
36
47
  module EnterpriseSearch
37
48
  end
38
49
  end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to Elasticsearch B.V. under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright
6
+ # ownership. Elasticsearch B.V. licenses this file to you under
7
+ # the Apache License, Version 2.0 (the "License"); you may
8
+ # not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Elastic
21
+ module EnterpriseSearch
22
+ module WorkplaceSearch
23
+ module Actions
24
+ # ContentSources - Retrieves a content source by ID
25
+ # Retrieves a content source by ID
26
+ #
27
+ # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
+ # @param arguments [Hash] endpoint arguments
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
+ #
31
+ # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#get-content-source-api
32
+ #
33
+ def content_source(content_source_id, arguments = {})
34
+ raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
35
+
36
+ headers = arguments.delete(:headers) || {}
37
+
38
+ request(
39
+ :get,
40
+ "api/ws/v1/sources/#{content_source_id}/",
41
+ arguments,
42
+ {},
43
+ headers
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -22,11 +22,11 @@ module Elastic
22
22
  module WorkplaceSearch
23
23
  module Actions
24
24
  # Analytics - Capture click and feedback analytic events
25
- # Capture Analytic Events
25
+ # Capture Analytic events for click and feedback
26
26
  #
27
27
  # @param arguments [Hash] endpoint arguments
28
28
  # @option arguments [String] :access_token OAuth Access Token (*Required*)
29
- # @option arguments [Object] :body
29
+ # @option arguments [Object] :body Workplace Search analytics event (Required: type, query_id, page, content_source_id, document_id, rank)
30
30
  # @option body [String] :type
31
31
  # @option body [String] :query_id query identifier for the event
32
32
  # @option body [Integer] :page page number of the document in the query result set
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to Elasticsearch B.V. under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright
6
+ # ownership. Elasticsearch B.V. licenses this file to you under
7
+ # the Apache License, Version 2.0 (the "License"); you may
8
+ # not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Elastic
21
+ module EnterpriseSearch
22
+ module WorkplaceSearch
23
+ module Actions
24
+ # ContentSources - Create a content source
25
+ # Create a custom content source
26
+ #
27
+ # @param arguments [Hash] endpoint arguments
28
+ # @option arguments [Object] :body Definition to create a Workplace Search Content Source (Required: name)
29
+ # @option body [String] :name The human readable display name for this Content Source.
30
+ # @option body :schema The schema that each document in this Content Source will adhere to.
31
+ # @option body :display The display details which governs which fields will be displayed, and in what order, in the search results.
32
+ # @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page.
33
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
34
+ #
35
+ # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#create-content-source-api
36
+ #
37
+ def create_content_source(arguments = {})
38
+ body = arguments.delete(:body) || {}
39
+ headers = arguments.delete(:headers) || {}
40
+
41
+ request(
42
+ :post,
43
+ 'api/ws/v1/sources/',
44
+ arguments,
45
+ body,
46
+ headers
47
+ )
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -27,6 +27,8 @@ module Elastic
27
27
  # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
28
  # @param arguments [Hash] endpoint arguments
29
29
  # @option arguments [Object] :body (Required: source_user_id, user)
30
+ # @option body [String] :source_user_id
31
+ # @option body [String] :user
30
32
  # @option arguments [Hash] :headers optional HTTP headers to send with the request
31
33
  #
32
34
  # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#add-external-identity
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to Elasticsearch B.V. under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright
6
+ # ownership. Elasticsearch B.V. licenses this file to you under
7
+ # the Apache License, Version 2.0 (the "License"); you may
8
+ # not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Elastic
21
+ module EnterpriseSearch
22
+ module WorkplaceSearch
23
+ module Actions
24
+ # Documents - Deletes all documents in a custom content source
25
+ # Deletes all documents in a custom content source
26
+ #
27
+ # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
+ # @param arguments [Hash] endpoint arguments
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
+ #
31
+ # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#delete-all-documents
32
+ #
33
+ def delete_all_documents(content_source_id, arguments = {})
34
+ raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
35
+
36
+ headers = arguments.delete(:headers) || {}
37
+
38
+ request(
39
+ :delete,
40
+ "api/ws/v1/sources/#{content_source_id}/documents/",
41
+ arguments,
42
+ {},
43
+ headers
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Licensed to Elasticsearch B.V. under one or more contributor
4
+ # license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright
6
+ # ownership. Elasticsearch B.V. licenses this file to you under
7
+ # the Apache License, Version 2.0 (the "License"); you may
8
+ # not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+
20
+ module Elastic
21
+ module EnterpriseSearch
22
+ module WorkplaceSearch
23
+ module Actions
24
+ # ContentSources - Deletes a content source by ID
25
+ # Deletes a content source by ID
26
+ #
27
+ # @param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (*Required*)
28
+ # @param arguments [Hash] endpoint arguments
29
+ # @option arguments [Hash] :headers optional HTTP headers to send with the request
30
+ #
31
+ # @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources-api.html#remove-content-source-api
32
+ #
33
+ def delete_content_source(content_source_id, arguments = {})
34
+ raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
35
+
36
+ headers = arguments.delete(:headers) || {}
37
+
38
+ request(
39
+ :delete,
40
+ "api/ws/v1/sources/#{content_source_id}/",
41
+ arguments,
42
+ {},
43
+ headers
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end