module Elastic::EnterpriseSearch::WorkplaceSearch::Actions
Public Instance Methods
Permissions - Adds one or more new permissions atop existing permissions Add one or more permission for a given user. Permissions are added atop the existing
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Array] :body List of permissions @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/add_user_permissions.rb, line 35 def add_user_permissions(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/add/", arguments, body, headers ) end
SyncJobs - Issue commands to a Content Source's sync jobs Control a content source's sync jobs
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :body Params to command a Workplace Search Content Source's sync jobs (Required: command) @option arguments [Array] :job_type The type of sync job to consider @option body :command (*Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/command_sync_jobs.rb, line 36 def command_sync_jobs(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/sync/jobs/", arguments, body, headers ) end
ContentSources - Retrieves a content source by ID Retrieves a content source by ID
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/content_source.rb, line 33 def content_source(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/", arguments, {}, headers ) end
Analytics - Capture click and feedback analytic events Capture Analytic events for click and feedback
@param arguments [Hash] endpoint arguments @option arguments [String] :access_token OAuth Access Token (Required) @option arguments [Hash] :body Workplace Search analytics event (Required: type, query_id, page, content_source_id, document_id, rank) @option body [String] :type (*Required) @option body [String] :query_id query identifier for the event (*Required) @option body [Integer] :page page number of the document in the query result set (*Required) @option body [String] :content_source_id content source identifier for the event document (*Required) @option body [String] :document_id document identifier for the event (*Required) @option body [Integer] :rank rank of the document in the overall result set (*Required) @option body [String] :event the target identifier for a click event @option body [Integer] :score the feedback score, constrained to the values -1 or 1 @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-search-analytics-api.html
# File lib/elastic/workplace-search/api/create_analytics_event.rb, line 42 def create_analytics_event(arguments = {}) raise ArgumentError, "Required parameter 'access_token' missing" unless arguments[:access_token] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, 'api/ws/v1/analytics/event/', arguments, body, headers ) end
Synonyms - Create a batch of synonym sets Create batched synonym sets
@param arguments [Hash] endpoint arguments @option arguments [Hash] :body @option body :synonyms @option body :synonym_sets @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#create-synonyms
# File lib/elastic/workplace-search/api/create_batch_synonym_sets.rb, line 35 def create_batch_synonym_sets(arguments = {}) body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, 'api/ws/v1/synonyms/', arguments, body, headers ) end
ContentSources - Create a content source Create a custom content source
@param arguments [Hash] endpoint arguments @option arguments [Hash] :body Definition to create a Workplace Search Content Source (Required: name) @option body [String] :name The human readable display name for this Content Source. (*Required) @option body :schema The schema that each document in this Content Source will adhere to. @option body :display The display details which governs which fields will be displayed, and in what order, in the search results. @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page. @option body :indexing @option body :facets @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/create_content_source.rb, line 39 def create_content_source(arguments = {}) body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, 'api/ws/v1/sources/', arguments, body, headers ) end
ExternalIdentities - Adds a new external identity Adds a new external identity
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :body (Required: source_user_id, user) @option body [String] :source_user_id (*Required) @option body [String] :user (*Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/create_external_identity.rb, line 36 def create_external_identity(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/external_identities/", arguments, body, headers ) end
- Get the authenticated user
Get the authenticated user
@param arguments [Hash] endpoint arguments @option arguments [Boolean] :get_token Whether or not to include an access token in the response. @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-search-user-api.html#get-current-user-api
# File lib/elastic/workplace-search/api/current_user.rb, line 33 def current_user(arguments = {}) headers = arguments.delete(:headers) || {} request( :get, 'api/ws/v1/whoami/', arguments, {}, headers ) end
Documents - Deletes all documents in a custom content source Deletes all documents in a custom content source
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/delete_all_documents.rb, line 33 def delete_all_documents(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id headers = arguments.delete(:headers) || {} request( :delete, "api/ws/v1/sources/#{content_source_id}/documents/", arguments, {}, headers ) end
ContentSources - Deletes a content source by ID Deletes a content source by ID
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/delete_content_source.rb, line 33 def delete_content_source(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id headers = arguments.delete(:headers) || {} request( :delete, "api/ws/v1/sources/#{content_source_id}/", arguments, {}, headers ) end
Documents - Deletes a list of documents from a custom content source Remove documents from a Custom API Source
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Array] :document_ids @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/delete_documents.rb, line 34 def delete_documents(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id document_ids = arguments.delete(:document_ids) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/documents/bulk_destroy/", arguments, document_ids, headers ) end
Documents - Deletes documents by query in a custom content source Deletes documents by query in a custom content source
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/delete_documents_by_query.rb, line 33 def delete_documents_by_query(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :delete, "api/ws/v1/sources/#{content_source_id}/documents/", arguments, body, headers ) end
ExternalIdentities - Deletes an external identity Deletes an external identity
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/delete_external_identity.rb, line 34 def delete_external_identity(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] headers = arguments.delete(:headers) || {} request( :delete, "api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/", arguments, {}, headers ) end
Synonyms - Delete a synonym set Delete a synonym set
@param arguments [Hash] endpoint arguments @option arguments [String] :synonym_set_id Unique ID for a content source document. Provided upon or returned at creation. (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#delete-synonym
# File lib/elastic/workplace-search/api/delete_synonym_set.rb, line 33 def delete_synonym_set(arguments = {}) raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id] synonym_set_id = arguments[:synonym_set_id] headers = arguments.delete(:headers) || {} request( :delete, "api/ws/v1/synonyms/#{synonym_set_id}/", arguments, {}, headers ) end
Documents - Retrieves a document by ID from the specified content source Retrieves a document by ID from the specified content source
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :document_id Unique ID for a content source document. Provided upon or returned at creation. (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/document.rb, line 34 def document(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'document_id' missing" unless arguments[:document_id] document_id = arguments[:document_id] headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/documents/#{document_id}/", arguments, {}, headers ) end
ExternalIdentities - Retrieves an external identity Retrieves an external identity
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/external_identity.rb, line 34 def external_identity(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/", arguments, {}, headers ) end
Documents - Indexes one or more new documents into a custom content source, or updates one or more existing documents Indexes one or more new documents into a custom content source, or updates one or more existing documents
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Array] :documents (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/index_documents.rb, line 34 def index_documents(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'documents' missing" unless arguments[:documents] documents = arguments.delete(:documents) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/documents/bulk_create/", arguments, documents, headers ) end
ContentSources - Retrieves all content sources Retrieves all content sources
@param arguments [Hash] endpoint arguments @option arguments [Integer] :current_page Which page of results to request @option arguments [Integer] :page_size The number of results to return in a page @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/list_content_sources.rb, line 34 def list_content_sources(arguments = {}) headers = arguments.delete(:headers) || {} request( :get, 'api/ws/v1/sources/', arguments, {}, headers ) end
ExternalIdentities - Retrieves all external identities Retrieves all external identities
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Integer] :current_page Which page of results to request @option arguments [Integer] :page_size The number of results to return in a page @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/list_external_identities.rb, line 35 def list_external_identities(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/external_identities/", arguments, {}, headers ) end
Permissions - Lists all permissions for all users List all permissions for all users
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Integer] :current_page Which page of results to request @option arguments [Integer] :page_size The number of results to return in a page @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-search-document-permissions-api.html#list
# File lib/elastic/workplace-search/api/list_permissions.rb, line 35 def list_permissions(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/permissions/", arguments, {}, headers ) end
Synonyms - Retrieves all synonym sets Retrieve a list of synonym sets
@param arguments [Hash] endpoint arguments @option arguments [Hash] :body @option body :page @option body :sort @option body :filter @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#list-synonyms
# File lib/elastic/workplace-search/api/list_synonym_sets.rb, line 36 def list_synonym_sets(arguments = {}) body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :get, 'api/ws/v1/synonyms/', arguments, body, headers ) end
ContentSources - Update a content source Update a content source
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :body Definition to update a Workplace Search Content Source (Required: name, is_searchable) @option body [String] :name The human readable display name for this Content Source. (*Required) @option body :schema The schema that each document in this Content Source will adhere to. @option body :display The display details which governs which fields will be displayed, and in what order, in the search results. @option body [Boolean] :is_searchable Whether or not this Content Source will be searchable on the search page. (*Required) @option body :indexing @option body :facets @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/put_content_source.rb, line 40 def put_content_source(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :put, "api/ws/v1/sources/#{content_source_id}/", arguments, body, headers ) end
ContentSources - Upload content source icons Upload content source icons
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [Hash] :body Definition to upload Workplace Search Custom Source icons @option body [String] :main_icon @option body [String] :alt_icon @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/put_content_source_icons.rb, line 36 def put_content_source_icons(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :put, "api/ws/v1/sources/#{content_source_id}/icon/", arguments, body, headers ) end
ExternalIdentities - Updates an external identity Updates an external identity
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Hash] :body (Required: source_user_id, user) @option body [String] :source_user_id (*Required) @option body [String] :user (*Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/put_external_identity.rb, line 37 def put_external_identity(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :put, "api/ws/v1/sources/#{content_source_id}/external_identities/#{user}/", arguments, body, headers ) end
Synonyms - Update a synonym set Update a synonym set
@param arguments [Hash] endpoint arguments @option arguments [String] :synonym_set_id Unique ID for a content source document. Provided upon or returned at creation. (Required) @option arguments [Hash] :body (Required: synonyms) @option body [Array] :synonyms A list of terms for this synonym set (*Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#update-synonym
# File lib/elastic/workplace-search/api/put_synonym_set.rb, line 35 def put_synonym_set(arguments = {}) raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id] synonym_set_id = arguments.delete(:synonym_set_id) body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :put, "api/ws/v1/synonyms/#{synonym_set_id}/", arguments, body, headers ) end
Permissions - Creates a new set of permissions or over-writes all existing permissions Create a set of permissions or overwrite existing permissions
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Array] :body List of permissions @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/put_user_permissions.rb, line 35 def put_user_permissions(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :put, "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/", arguments, body, headers ) end
Permissions - Removes one or more permissions from an existing set of permissions Remove one or more permission for a given user
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Array] :body List of permissions @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/remove_user_permissions.rb, line 35 def remove_user_permissions(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/remove/", arguments, body, headers ) end
Search - Search across available sources with various query tuning options Issue a Search Query
@param arguments [Hash] endpoint arguments @option arguments [String] :access_token OAuth Access Token (Required) @option arguments [Hash] :body @option body [String] :query A string or number used to find related documents @option body [Boolean] :automatic_query_refinement Set to false to not automatically refine the query by keywords @option body [Object] :page Paging controls for the result set @option body [Object] :search_fields Restrict the fulltext search to only specific fields @option body [Object] :result_fields Restrict the result fields for each item to the specified fields @option body :filters @option body :sort @option body [Object] :facets @option body [Object] :boosts @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-search-search-api.html
# File lib/elastic/workplace-search/api/search.rb, line 43 def search(arguments = {}) raise ArgumentError, "Required parameter 'access_token' missing" unless arguments[:access_token] body = arguments.delete(:body) || {} headers = arguments.delete(:headers) || {} request( :post, 'api/ws/v1/search/', arguments, body, headers ) end
Synonyms - Retrieve a synonym set by ID Retrieve a synonym set by ID
@param arguments [Hash] endpoint arguments @option arguments [String] :synonym_set_id Unique ID for a content source document. Provided upon or returned at creation. (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
@see www.elastic.co/guide/en/workplace-search/current/workplace-synonyms-api.html#show-synonym
# File lib/elastic/workplace-search/api/synonym_set.rb, line 33 def synonym_set(arguments = {}) raise ArgumentError, "Required parameter 'synonym_set_id' missing" unless arguments[:synonym_set_id] synonym_set_id = arguments[:synonym_set_id] headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/synonyms/#{synonym_set_id}/", arguments, {}, headers ) end
Permissions - Lists all permissions for one user List permissions for a user
@param content_source_id [String] Unique ID for a Custom API source, provided upon creation of a Custom API Source (Required) @param arguments [Hash] endpoint arguments @option arguments [String] :user The username in context (Required) @option arguments [Hash] :headers optional HTTP headers to send with the request
# File lib/elastic/workplace-search/api/user_permissions.rb, line 34 def user_permissions(content_source_id, arguments = {}) raise ArgumentError, "Required parameter 'content_source_id' missing" unless content_source_id raise ArgumentError, "Required parameter 'user' missing" unless arguments[:user] user = arguments[:user] headers = arguments.delete(:headers) || {} request( :get, "api/ws/v1/sources/#{content_source_id}/permissions/#{user}/", arguments, {}, headers ) end