elastic-enterprise-search 7.10.0.beta.1 → 7.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/jobs/elastic+enterprise-search-ruby+7.10.0.beta.1.yml +12 -0
- data/.ci/test-matrix.yml +2 -1
- data/.github/workflows/testing.yml +1 -1
- data/.gitignore +1 -0
- data/CONTRIBUTING.md +43 -0
- data/Gemfile +1 -0
- data/README.md +7 -225
- data/Rakefile +1 -24
- data/docs/guide/app-search-api.asciidoc +172 -0
- data/docs/guide/connecting.asciidoc +125 -0
- data/docs/guide/development.asciidoc +42 -0
- data/docs/guide/enterprise-search-api.asciidoc +46 -0
- data/docs/guide/index.asciidoc +17 -0
- data/docs/guide/installation.asciidoc +18 -0
- data/docs/guide/overview.asciidoc +59 -0
- data/docs/guide/workplace-search-api.asciidoc +121 -0
- data/elastic-enterprise-search.gemspec +5 -4
- data/lib/elastic/app-search/api/add_meta_engine_source.rb +7 -4
- data/lib/elastic/app-search/api/api_logs.rb +15 -16
- data/lib/elastic/app-search/api/count_analytics.rb +7 -5
- data/lib/elastic/app-search/api/create_curation.rb +8 -6
- data/lib/elastic/app-search/api/create_engine.rb +9 -7
- data/lib/elastic/app-search/api/create_synonym_set.rb +6 -5
- data/lib/elastic/app-search/api/curation.rb +6 -5
- data/lib/elastic/app-search/api/delete_curation.rb +6 -5
- data/lib/elastic/app-search/api/delete_documents.rb +7 -4
- data/lib/elastic/app-search/api/delete_engine.rb +5 -3
- data/lib/elastic/app-search/api/delete_meta_engine_source.rb +7 -4
- data/lib/elastic/app-search/api/delete_synonym_set.rb +6 -5
- data/lib/elastic/app-search/api/documents.rb +7 -4
- data/lib/elastic/app-search/api/engine.rb +5 -3
- data/lib/elastic/app-search/api/index_documents.rb +7 -4
- data/lib/elastic/app-search/api/list_curations.rb +7 -5
- data/lib/elastic/app-search/api/list_documents.rb +7 -5
- data/lib/elastic/app-search/api/list_engines.rb +7 -5
- data/lib/elastic/app-search/api/list_synonym_sets.rb +7 -5
- data/lib/elastic/app-search/api/log_clickthrough.rb +10 -7
- data/lib/elastic/app-search/api/multi_search.rb +8 -7
- data/lib/elastic/app-search/api/put_curation.rb +9 -8
- data/lib/elastic/app-search/api/put_documents.rb +7 -4
- data/lib/elastic/app-search/api/put_schema.rb +7 -4
- data/lib/elastic/app-search/api/put_search_settings.rb +6 -3
- data/lib/elastic/app-search/api/put_synonym_set.rb +7 -7
- data/lib/elastic/app-search/api/query_suggestion.rb +8 -6
- data/lib/elastic/app-search/api/reset_search_settings.rb +5 -3
- data/lib/elastic/app-search/api/schema.rb +6 -4
- data/lib/elastic/app-search/api/search.rb +5 -3
- data/lib/elastic/app-search/api/search_settings.rb +6 -4
- data/lib/elastic/app-search/api/synonym_set.rb +6 -5
- data/lib/elastic/app-search/api/top_clicks_analytics.rb +9 -7
- data/lib/elastic/app-search/api/top_queries_analytics.rb +8 -6
- data/lib/elastic/app-search/app_search.rb +19 -2
- data/lib/elastic/enterprise-search/api/health.rb +6 -1
- data/lib/elastic/enterprise-search/api/put_read_only.rb +5 -1
- data/lib/elastic/enterprise-search/api/read_only.rb +6 -1
- data/lib/elastic/enterprise-search/api/stats.rb +6 -2
- data/lib/elastic/enterprise-search/api/version.rb +6 -1
- data/lib/elastic/enterprise-search/client.rb +15 -2
- data/lib/elastic/enterprise-search/request.rb +25 -13
- data/lib/elastic/enterprise-search/utils.rb +5 -6
- data/lib/elastic/enterprise-search/version.rb +1 -1
- data/lib/elastic/enterprise_search.rb +1 -1
- data/lib/elastic/workplace-search/api/add_user_permissions.rb +10 -9
- data/lib/elastic/workplace-search/api/create_analytics_event.rb +59 -0
- data/lib/elastic/workplace-search/api/create_external_identity.rb +9 -7
- data/lib/elastic/workplace-search/api/delete_documents.rb +9 -7
- data/lib/elastic/workplace-search/api/delete_external_identity.rb +10 -6
- data/lib/elastic/workplace-search/api/external_identity.rb +10 -6
- data/lib/elastic/workplace-search/api/index_documents.rb +11 -8
- data/lib/elastic/workplace-search/api/list_external_identities.rb +11 -7
- data/lib/elastic/workplace-search/api/list_permissions.rb +11 -7
- data/lib/elastic/workplace-search/api/put_external_identity.rb +10 -9
- data/lib/elastic/workplace-search/api/put_user_permissions.rb +10 -9
- data/lib/elastic/workplace-search/api/remove_user_permissions.rb +10 -9
- data/lib/elastic/workplace-search/api/search.rb +19 -1
- data/lib/elastic/workplace-search/api/user_permissions.rb +10 -6
- data/lib/elastic/workplace-search/workplace_search.rb +26 -1
- data/spec/app-search/api_curations_spec.rb +97 -0
- data/spec/app-search/api_documents_spec.rb +20 -6
- data/spec/app-search/api_engines_spec.rb +4 -4
- data/{lib/generator/templates/_license.erb → spec/app-search/api_log_clickthrough_spec.rb} +18 -0
- data/spec/app-search/api_meta_engines_spec.rb +72 -0
- data/spec/app-search/api_query_suggestion_spec.rb +39 -0
- data/spec/app-search/api_schema_spec.rb +17 -3
- data/spec/app-search/api_search_settings_spec.rb +76 -0
- data/spec/app-search/api_synonyms_spec.rb +79 -0
- data/spec/app-search/client_spec.rb +20 -0
- data/spec/enterprise-search/client_spec.rb +11 -0
- data/spec/enterprise-search/request_spec.rb +22 -0
- data/spec/enterprise-search/utils_spec.rb +46 -0
- data/spec/fixtures/vcr/app_search/add_meta_engine_source.yml +109 -0
- data/spec/fixtures/vcr/app_search/api_documents.yml +56 -0
- data/spec/fixtures/vcr/app_search/{index_documents.yml → api_index_documents.yml} +11 -10
- data/spec/fixtures/vcr/app_search/api_log_clickthrough.yml +54 -0
- data/spec/fixtures/vcr/app_search/api_put_schema.yml +109 -0
- data/spec/fixtures/vcr/app_search/api_put_search_settings.yml +56 -0
- data/spec/fixtures/vcr/app_search/api_query_suggestion.yml +59 -0
- data/spec/fixtures/vcr/app_search/api_reset_search_settings.yml +56 -0
- data/spec/fixtures/vcr/app_search/{schema.yml → api_schema.yml} +12 -11
- data/spec/fixtures/vcr/app_search/api_search_settings.yml +56 -0
- data/spec/fixtures/vcr/app_search/create_curation.yml +113 -0
- data/spec/fixtures/vcr/{create_engine.yml → app_search/create_engine.yml} +0 -0
- data/spec/fixtures/vcr/app_search/create_meta_engine.yml +56 -0
- data/spec/fixtures/vcr/app_search/create_synonym_set.yml +56 -0
- data/spec/fixtures/vcr/app_search/delete_curation.yml +56 -0
- data/spec/fixtures/vcr/{delete_engine.yml → app_search/delete_engine.yml} +0 -0
- data/spec/fixtures/vcr/app_search/delete_meta_engine_source.yml +56 -0
- data/spec/fixtures/vcr/app_search/delete_synonym_set.yml +56 -0
- data/spec/fixtures/vcr/app_search/get_curation.yml +56 -0
- data/spec/fixtures/vcr/{get_engine.yml → app_search/get_engine.yml} +0 -0
- data/spec/fixtures/vcr/app_search/list_curations.yml +56 -0
- data/spec/fixtures/vcr/{list_engines.yml → app_search/list_engines.yml} +0 -0
- data/spec/fixtures/vcr/app_search/list_synonym_sets.yml +56 -0
- data/spec/fixtures/vcr/app_search/multi_query_search.yml +2 -2
- data/spec/fixtures/vcr/app_search/put_curation.yml +113 -0
- data/spec/fixtures/vcr/app_search/put_synonym_set.yml +56 -0
- data/spec/fixtures/vcr/app_search/synonym_set.yml +56 -0
- data/spec/fixtures/vcr/{add_user_permissions.yml → workplace_search/add_user_permissions.yml} +11 -9
- data/spec/fixtures/vcr/{clear_user_permissions.yml → workplace_search/clear_user_permissions.yml} +11 -9
- data/spec/fixtures/vcr/workplace_search/create_analytics_event.yml +55 -0
- data/spec/fixtures/vcr/workplace_search/create_external_identity.yml +53 -0
- data/spec/fixtures/vcr/{delete_documents.yml → workplace_search/delete_documents.yml} +11 -9
- data/spec/fixtures/vcr/workplace_search/delete_external_identity.yml +53 -0
- data/spec/fixtures/vcr/{index_documents.yml → workplace_search/index_documents.yml} +11 -9
- data/spec/fixtures/vcr/workplace_search/list_external_identities.yml +53 -0
- data/spec/fixtures/vcr/{list_permissions.yml → workplace_search/list_permissions.yml} +11 -9
- data/spec/fixtures/vcr/workplace_search/oauth_request_token.yml +57 -0
- data/spec/fixtures/vcr/workplace_search/put_external_identity.yml +53 -0
- data/spec/fixtures/vcr/{put_user_permissions.yml → workplace_search/put_user_permissions.yml} +22 -18
- data/spec/fixtures/vcr/{remove_user_permissions.yml → workplace_search/remove_user_permissions.yml} +11 -9
- data/spec/fixtures/vcr/workplace_search/retrieve_external_identity.yml +53 -0
- data/spec/fixtures/vcr/workplace_search/search_request.yml +60 -0
- data/spec/fixtures/vcr/{user_permissions_empty.yml → workplace_search/user_permissions_empty.yml} +11 -9
- data/spec/integration/enterprise_search_api_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- data/spec/workplace-search/client_spec.rb +10 -2
- data/spec/workplace-search/create_analytics_event_spec.rb +59 -0
- data/spec/workplace-search/documents_spec.rb +80 -0
- data/spec/workplace-search/external_identities_spec.rb +84 -0
- data/spec/workplace-search/{api_spec.rb → permissions_spec.rb} +14 -66
- data/spec/workplace-search/search_spec.rb +53 -0
- metadata +96 -36
- data/lib/generator/documentation_helper.rb +0 -94
- data/lib/generator/endpoint_generator.rb +0 -119
- data/lib/generator/parameters_exceptions.rb +0 -40
- data/lib/generator/parameters_helper.rb +0 -144
- data/lib/generator/templates/endpoint_template.erb +0 -29
- data/lib/generator/templates/spec_template.erb +0 -1
- data/lib/generator/utils.rb +0 -70
- data/spec/fixtures/vcr/create_document.yml +0 -54
@@ -24,27 +24,28 @@ module Elastic
|
|
24
24
|
# Permissions - Adds one or more new permissions atop existing permissions
|
25
25
|
# Add one or more permission for a given user. Permissions are added atop the existing
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option body
|
31
|
-
#
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Array] :body List of permissions
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
32
|
#
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#add-one
|
34
34
|
#
|
35
|
-
def add_user_permissions(
|
36
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def add_user_permissions(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
37
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
38
38
|
|
39
39
|
user = arguments[:user]
|
40
|
-
|
41
40
|
body = arguments.delete(:body) || {}
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
42
|
|
43
43
|
request(
|
44
44
|
:post,
|
45
|
-
"api/ws/v1/sources/#{
|
45
|
+
"api/ws/v1/sources/#{content_source_id}/permissions/#{user}/add/",
|
46
46
|
arguments,
|
47
|
-
body
|
47
|
+
body,
|
48
|
+
headers
|
48
49
|
)
|
49
50
|
end
|
50
51
|
end
|
@@ -0,0 +1,59 @@
|
|
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
|
+
# Analytics - capture click and feedback analytic events
|
25
|
+
# Capture Analytic Events
|
26
|
+
#
|
27
|
+
# @param arguments [Hash] endpoint arguments
|
28
|
+
# @option arguments [String] :access_token OAuth Access Token (*Required*)
|
29
|
+
# @option arguments [Object] :body
|
30
|
+
# @option body [String] :type
|
31
|
+
# @option body [String] :query_id query identifier for the event
|
32
|
+
# @option body [Integer] :page page number of the document in the query result set
|
33
|
+
# @option body [String] :content_source_id content source identifier for the event document
|
34
|
+
# @option body [String] :document_id document identifier for the event
|
35
|
+
# @option body [Integer] :rank rank of the document in the overall result set
|
36
|
+
# @option body [String] :event the target identifier for a click event
|
37
|
+
# @option body [Integer] :score the feedback score, constrained to the values -1 or 1
|
38
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
39
|
+
#
|
40
|
+
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-analytics-api.html
|
41
|
+
#
|
42
|
+
def create_analytics_event(arguments = {})
|
43
|
+
raise ArgumentError, "Required parameter 'access_token' missing" unless arguments[:access_token]
|
44
|
+
|
45
|
+
body = arguments.delete(:body) || {}
|
46
|
+
headers = arguments.delete(:headers) || {}
|
47
|
+
|
48
|
+
request(
|
49
|
+
:post,
|
50
|
+
'api/ws/v1/analytics/event/',
|
51
|
+
arguments,
|
52
|
+
body,
|
53
|
+
headers
|
54
|
+
)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -24,23 +24,25 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Adds a new external identity
|
25
25
|
# Adds a new external identity
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
#
|
29
|
+
# @option arguments [Object] :body (Required: source_user_id, user)
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
31
|
#
|
32
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#add-external-identity
|
33
33
|
#
|
34
|
-
def create_external_identity(
|
35
|
-
raise ArgumentError, "Required parameter '
|
34
|
+
def create_external_identity(content_source_id, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
36
|
|
37
37
|
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
38
39
|
|
39
40
|
request(
|
40
41
|
:post,
|
41
|
-
"api/ws/v1/sources/#{
|
42
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/",
|
42
43
|
arguments,
|
43
|
-
body
|
44
|
+
body,
|
45
|
+
headers
|
44
46
|
)
|
45
47
|
end
|
46
48
|
end
|
@@ -24,23 +24,25 @@ module Elastic
|
|
24
24
|
# Documents - Deletes a list of documents from a custom content source
|
25
25
|
# Remove documents from a Custom API Source
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
#
|
29
|
+
# @option arguments [Array] :body
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
31
|
#
|
32
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#destroy
|
33
33
|
#
|
34
|
-
def delete_documents(
|
35
|
-
raise ArgumentError, "Required parameter '
|
34
|
+
def delete_documents(content_source_id, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
36
|
|
37
37
|
body = arguments.delete(:body) || {}
|
38
|
+
headers = arguments.delete(:headers) || {}
|
38
39
|
|
39
40
|
request(
|
40
41
|
:post,
|
41
|
-
"api/ws/v1/sources/#{
|
42
|
+
"api/ws/v1/sources/#{content_source_id}/documents/bulk_destroy/",
|
42
43
|
arguments,
|
43
|
-
body
|
44
|
+
body,
|
45
|
+
headers
|
44
46
|
)
|
45
47
|
end
|
46
48
|
end
|
@@ -24,23 +24,27 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Deletes an external identity
|
25
25
|
# Deletes an external identity
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
31
|
#
|
31
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#remove-external-identity
|
32
33
|
#
|
33
|
-
def delete_external_identity(
|
34
|
-
raise ArgumentError, "Required parameter '
|
34
|
+
def delete_external_identity(content_source_id, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
36
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
36
37
|
|
37
38
|
user = arguments[:user]
|
38
39
|
|
40
|
+
headers = arguments.delete(:headers) || {}
|
41
|
+
|
39
42
|
request(
|
40
43
|
:delete,
|
41
|
-
"api/ws/v1/sources/#{
|
44
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/",
|
42
45
|
arguments,
|
43
|
-
{}
|
46
|
+
{},
|
47
|
+
headers
|
44
48
|
)
|
45
49
|
end
|
46
50
|
end
|
@@ -24,23 +24,27 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Retrieves an external identity
|
25
25
|
# Retrieves an external identity
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
30
31
|
#
|
31
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#show-external-identity
|
32
33
|
#
|
33
|
-
def external_identity(
|
34
|
-
raise ArgumentError, "Required parameter '
|
34
|
+
def external_identity(content_source_id, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
35
36
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
36
37
|
|
37
38
|
user = arguments[:user]
|
38
39
|
|
40
|
+
headers = arguments.delete(:headers) || {}
|
41
|
+
|
39
42
|
request(
|
40
43
|
:get,
|
41
|
-
"api/ws/v1/sources/#{
|
44
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/",
|
42
45
|
arguments,
|
43
|
-
{}
|
46
|
+
{},
|
47
|
+
headers
|
44
48
|
)
|
45
49
|
end
|
46
50
|
end
|
@@ -24,23 +24,26 @@ module Elastic
|
|
24
24
|
# Documents - Indexes one or more new documents into a custom content source, or updates one or more existing documents
|
25
25
|
# Indexes one or more new documents into a custom content source, or updates one or more existing documents
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
#
|
29
|
+
# @option arguments [Array] :documents (*Required*)
|
30
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
31
|
#
|
32
32
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-custom-sources-api.html#index-and-update
|
33
33
|
#
|
34
|
-
def index_documents(
|
35
|
-
raise ArgumentError, "Required parameter '
|
34
|
+
def index_documents(content_source_id, arguments = {})
|
35
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
36
|
+
raise ArgumentError, "Required parameter 'documents' missing" unless arguments[:documents]
|
36
37
|
|
37
|
-
|
38
|
+
documents = arguments.delete(:documents) || {}
|
39
|
+
headers = arguments.delete(:headers) || {}
|
38
40
|
|
39
41
|
request(
|
40
42
|
:post,
|
41
|
-
"api/ws/v1/sources/#{
|
43
|
+
"api/ws/v1/sources/#{content_source_id}/documents/bulk_create/",
|
42
44
|
arguments,
|
43
|
-
|
45
|
+
documents,
|
46
|
+
headers
|
44
47
|
)
|
45
48
|
end
|
46
49
|
end
|
@@ -24,21 +24,25 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Retrieves all external identities
|
25
25
|
# Retrieves all external identities
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option
|
29
|
+
# @option arguments [Integer] :current_page Which page of results to request
|
30
|
+
# @option arguments [Integer] :page_size The number of results to return in a page
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
32
|
#
|
32
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#list-external-identities
|
33
34
|
#
|
34
|
-
def list_external_identities(
|
35
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def list_external_identities(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
|
+
|
38
|
+
headers = arguments.delete(:headers) || {}
|
36
39
|
|
37
40
|
request(
|
38
41
|
:get,
|
39
|
-
"api/ws/v1/sources/#{
|
42
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/",
|
40
43
|
arguments,
|
41
|
-
{}
|
44
|
+
{},
|
45
|
+
headers
|
42
46
|
)
|
43
47
|
end
|
44
48
|
end
|
@@ -24,21 +24,25 @@ module Elastic
|
|
24
24
|
# Permissions - Lists all permissions for all users
|
25
25
|
# List all permissions for all users
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option
|
29
|
+
# @option arguments [Integer] :current_page Which page of results to request
|
30
|
+
# @option arguments [Integer] :page_size The number of results to return in a page
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
31
32
|
#
|
32
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#list
|
33
34
|
#
|
34
|
-
def list_permissions(
|
35
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def list_permissions(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
|
+
|
38
|
+
headers = arguments.delete(:headers) || {}
|
36
39
|
|
37
40
|
request(
|
38
41
|
:get,
|
39
|
-
"api/ws/v1/sources/#{
|
42
|
+
"api/ws/v1/sources/#{content_source_id}/permissions/",
|
40
43
|
arguments,
|
41
|
-
{}
|
44
|
+
{},
|
45
|
+
headers
|
42
46
|
)
|
43
47
|
end
|
44
48
|
end
|
@@ -24,27 +24,28 @@ module Elastic
|
|
24
24
|
# ExternalIdentities - Updates an external identity
|
25
25
|
# Updates an external identity
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option
|
31
|
-
#
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Object] :body (Required: source_user_id, user)
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
32
|
#
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-external-identities-api.html#update-external-identity
|
34
34
|
#
|
35
|
-
def put_external_identity(
|
36
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def put_external_identity(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
37
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
38
38
|
|
39
39
|
user = arguments[:user]
|
40
|
-
|
41
40
|
body = arguments.delete(:body) || {}
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
42
|
|
43
43
|
request(
|
44
44
|
:put,
|
45
|
-
"api/ws/v1/sources/#{
|
45
|
+
"api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/",
|
46
46
|
arguments,
|
47
|
-
body
|
47
|
+
body,
|
48
|
+
headers
|
48
49
|
)
|
49
50
|
end
|
50
51
|
end
|
@@ -24,27 +24,28 @@ module Elastic
|
|
24
24
|
# Permissions - Creates a new set of permissions or over-writes all existing permissions
|
25
25
|
# Create a set of permissions or overwrite existing permissions
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option body
|
31
|
-
#
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Array] :body List of permissions
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
32
|
#
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#add-all
|
34
34
|
#
|
35
|
-
def put_user_permissions(
|
36
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def put_user_permissions(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
37
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
38
38
|
|
39
39
|
user = arguments[:user]
|
40
|
-
|
41
40
|
body = arguments.delete(:body) || {}
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
42
|
|
43
43
|
request(
|
44
44
|
:put,
|
45
|
-
"api/ws/v1/sources/#{
|
45
|
+
"api/ws/v1/sources/#{content_source_id}/permissions/#{user}/",
|
46
46
|
arguments,
|
47
|
-
body
|
47
|
+
body,
|
48
|
+
headers
|
48
49
|
)
|
49
50
|
end
|
50
51
|
end
|
@@ -24,27 +24,28 @@ module Elastic
|
|
24
24
|
# Permissions - Removes one or more permissions from an existing set of permissions
|
25
25
|
# Remove one or more permission for a given user
|
26
26
|
#
|
27
|
-
# @param
|
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
|
-
# @option
|
30
|
-
# @option body
|
31
|
-
#
|
29
|
+
# @option arguments [String] :user The username in context (*Required*)
|
30
|
+
# @option arguments [Array] :body List of permissions
|
31
|
+
# @option arguments [Hash] :headers optional HTTP headers to send with the request
|
32
32
|
#
|
33
33
|
# @see https://www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#remove-one
|
34
34
|
#
|
35
|
-
def remove_user_permissions(
|
36
|
-
raise ArgumentError, "Required parameter '
|
35
|
+
def remove_user_permissions(content_source_id, arguments = {})
|
36
|
+
raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id
|
37
37
|
raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user]
|
38
38
|
|
39
39
|
user = arguments[:user]
|
40
|
-
|
41
40
|
body = arguments.delete(:body) || {}
|
41
|
+
headers = arguments.delete(:headers) || {}
|
42
42
|
|
43
43
|
request(
|
44
44
|
:post,
|
45
|
-
"api/ws/v1/sources/#{
|
45
|
+
"api/ws/v1/sources/#{content_source_id}/permissions/#{user}/remove/",
|
46
46
|
arguments,
|
47
|
-
body
|
47
|
+
body,
|
48
|
+
headers
|
48
49
|
)
|
49
50
|
end
|
50
51
|
end
|