=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-api/swagger-codegen.git License: ININ http://www.inin.com Terms of Service: https://developer.mypurecloud.com/tos =end require "uri" module PureCloud class ContentManagementApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :override Override any lock on the document # @return [nil] def delete_contentmanagement_document(document_id, opts = {}) delete_contentmanagement_document_with_http_info(document_id, opts) return nil end # Delete a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :override Override any lock on the document # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.delete_contentmanagement_document" if document_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'override'] = opts[:'override'] if opts[:'override'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes an existing share. # This revokes sharing rights specified in the share record # @param share_id Share ID # @param [Hash] opts the optional parameters # @return [nil] def delete_contentmanagement_share(share_id, opts = {}) delete_contentmanagement_share_with_http_info(share_id, opts) return nil end # Deletes an existing share. # This revokes sharing rights specified in the share record # @param share_id Share ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_share_with_http_info(share_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_share ..." end # verify the required parameter 'share_id' is set fail ArgumentError, "Missing the required parameter 'share_id' when calling ContentManagementApi.delete_contentmanagement_share" if share_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/shares/{shareId}".sub('{format}','json').sub('{' + 'shareId' + '}', share_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_share\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Cancel the command for this status # # @param status_id Status ID # @param [Hash] opts the optional parameters # @return [nil] def delete_contentmanagement_status_status_id(status_id, opts = {}) delete_contentmanagement_status_status_id_with_http_info(status_id, opts) return nil end # Cancel the command for this status # # @param status_id Status ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_status_status_id_with_http_info(status_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_status_status_id ..." end # verify the required parameter 'status_id' is set fail ArgumentError, "Missing the required parameter 'status_id' when calling ContentManagementApi.delete_contentmanagement_status_status_id" if status_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/status/{statusId}".sub('{format}','json').sub('{' + 'statusId' + '}', status_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_status_status_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a workspace # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :move_children_to_workspace_id New location for objects in deleted workspace. # @return [nil] def delete_contentmanagement_workspace(workspace_id, opts = {}) delete_contentmanagement_workspace_with_http_info(workspace_id, opts) return nil end # Delete a workspace # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :move_children_to_workspace_id New location for objects in deleted workspace. # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_workspace_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_workspace ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.delete_contentmanagement_workspace" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'moveChildrenToWorkspaceId'] = opts[:'move_children_to_workspace_id'] if opts[:'move_children_to_workspace_id'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_workspace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a member from a workspace # # @param workspace_id Workspace ID # @param member_id Member ID # @param [Hash] opts the optional parameters # @return [nil] def delete_contentmanagement_workspace_member(workspace_id, member_id, opts = {}) delete_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, opts) return nil end # Delete a member from a workspace # # @param workspace_id Workspace ID # @param member_id Member ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_workspace_member ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.delete_contentmanagement_workspace_member" if workspace_id.nil? # verify the required parameter 'member_id' is set fail ArgumentError, "Missing the required parameter 'member_id' when calling ContentManagementApi.delete_contentmanagement_workspace_member" if member_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/members/{memberId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'memberId' + '}', member_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_workspace_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete workspace tag # Delete a tag from a workspace. Will remove this tag from all documents. # @param workspace_id Workspace ID # @param tag_id Tag ID # @param [Hash] opts the optional parameters # @return [nil] def delete_contentmanagement_workspace_tagvalue(workspace_id, tag_id, opts = {}) delete_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, opts) return nil end # Delete workspace tag # Delete a tag from a workspace. Will remove this tag from all documents. # @param workspace_id Workspace ID # @param tag_id Tag ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.delete_contentmanagement_workspace_tagvalue ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.delete_contentmanagement_workspace_tagvalue" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContentManagementApi.delete_contentmanagement_workspace_tagvalue" if tag_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues/{tagId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'tagId' + '}', tag_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#delete_contentmanagement_workspace_tagvalue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Document] def get_contentmanagement_document(document_id, opts = {}) data, _status_code, _headers = get_contentmanagement_document_with_http_info(document_id, opts) return data end # Get a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def get_contentmanagement_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.get_contentmanagement_document" if document_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Document') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of audits for a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :transaction_filter Transaction filter # @option opts [String] :level level (default to USER) # @option opts [String] :sort_by Sort by # @option opts [String] :sort_order Sort order (default to ascending) # @return [DocumentAuditEntityListing] def get_contentmanagement_document_audits(document_id, opts = {}) data, _status_code, _headers = get_contentmanagement_document_audits_with_http_info(document_id, opts) return data end # Get a list of audits for a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :transaction_filter Transaction filter # @option opts [String] :level level # @option opts [String] :sort_by Sort by # @option opts [String] :sort_order Sort order # @return [Array<(DocumentAuditEntityListing, Fixnum, Hash)>] DocumentAuditEntityListing data, response status code and response headers def get_contentmanagement_document_audits_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_document_audits ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.get_contentmanagement_document_audits" if document_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}/audits".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'transactionFilter'] = opts[:'transaction_filter'] if opts[:'transaction_filter'] query_params[:'level'] = opts[:'level'] if opts[:'level'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentAuditEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_document_audits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [String] :disposition Request how the content will be downloaded: a file attachment or inline. Default is attachment. # @option opts [String] :content_type The requested format for the specified document. If supported, the document will be returned in that format. Example contentType=audio/wav # @return [DownloadResponse] def get_contentmanagement_document_content(document_id, opts = {}) data, _status_code, _headers = get_contentmanagement_document_content_with_http_info(document_id, opts) return data end # Download a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [String] :disposition Request how the content will be downloaded: a file attachment or inline. Default is attachment. # @option opts [String] :content_type The requested format for the specified document. If supported, the document will be returned in that format. Example contentType=audio/wav # @return [Array<(DownloadResponse, Fixnum, Hash)>] DownloadResponse data, response status code and response headers def get_contentmanagement_document_content_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_document_content ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.get_contentmanagement_document_content" if document_id.nil? if opts[:'disposition'] && !['attachment', 'inline'].include?(opts[:'disposition']) fail ArgumentError, 'invalid value for "disposition", must be one of attachment, inline' end # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}/content".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'disposition'] = opts[:'disposition'] if opts[:'disposition'] query_params[:'contentType'] = opts[:'content_type'] if opts[:'content_type'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DownloadResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_document_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of documents. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :name Name # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_by name or dateCreated # @option opts [String] :sort_order ascending or descending (default to ascending) # @return [DocumentEntityListing] def get_contentmanagement_documents(workspace_id, opts = {}) data, _status_code, _headers = get_contentmanagement_documents_with_http_info(workspace_id, opts) return data end # Get a list of documents. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :name Name # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_by name or dateCreated # @option opts [String] :sort_order ascending or descending # @return [Array<(DocumentEntityListing, Fixnum, Hash)>] DocumentEntityListing data, response status code and response headers def get_contentmanagement_documents_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_documents ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_documents" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents".sub('{format}','json') # query parameters query_params = {} query_params[:'workspaceId'] = workspace_id query_params[:'name'] = opts[:'name'] if opts[:'name'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query content # # @param query_phrase Phrase tokens are ANDed together over all searchable fields # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_by name or dateCreated (default to name) # @option opts [String] :sort_order ascending or descending (default to ascending) # @option opts [Array] :expand Which fields, if any, to expand. # @return [QueryResults] def get_contentmanagement_query(query_phrase, opts = {}) data, _status_code, _headers = get_contentmanagement_query_with_http_info(query_phrase, opts) return data end # Query content # # @param query_phrase Phrase tokens are ANDed together over all searchable fields # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_by name or dateCreated # @option opts [String] :sort_order ascending or descending # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(QueryResults, Fixnum, Hash)>] QueryResults data, response status code and response headers def get_contentmanagement_query_with_http_info(query_phrase, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_query ..." end # verify the required parameter 'query_phrase' is set fail ArgumentError, "Missing the required parameter 'query_phrase' when calling ContentManagementApi.get_contentmanagement_query" if query_phrase.nil? # resource path local_var_path = "/api/v2/contentmanagement/query".sub('{format}','json') # query parameters query_params = {} query_params[:'queryPhrase'] = query_phrase query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'QueryResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a Security Profile # # @param security_profile_id Security Profile Id # @param [Hash] opts the optional parameters # @return [SecurityProfile] def get_contentmanagement_securityprofile(security_profile_id, opts = {}) data, _status_code, _headers = get_contentmanagement_securityprofile_with_http_info(security_profile_id, opts) return data end # Get a Security Profile # # @param security_profile_id Security Profile Id # @param [Hash] opts the optional parameters # @return [Array<(SecurityProfile, Fixnum, Hash)>] SecurityProfile data, response status code and response headers def get_contentmanagement_securityprofile_with_http_info(security_profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_securityprofile ..." end # verify the required parameter 'security_profile_id' is set fail ArgumentError, "Missing the required parameter 'security_profile_id' when calling ContentManagementApi.get_contentmanagement_securityprofile" if security_profile_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/securityprofiles/{securityProfileId}".sub('{format}','json').sub('{' + 'securityProfileId' + '}', security_profile_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SecurityProfile') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_securityprofile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a List of Security Profiles # # @param [Hash] opts the optional parameters # @return [SecurityProfileEntityListing] def get_contentmanagement_securityprofiles(opts = {}) data, _status_code, _headers = get_contentmanagement_securityprofiles_with_http_info(opts) return data end # Get a List of Security Profiles # # @param [Hash] opts the optional parameters # @return [Array<(SecurityProfileEntityListing, Fixnum, Hash)>] SecurityProfileEntityListing data, response status code and response headers def get_contentmanagement_securityprofiles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_securityprofiles ..." end # resource path local_var_path = "/api/v2/contentmanagement/securityprofiles".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SecurityProfileEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_securityprofiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve details about an existing share. # # @param share_id Share ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Share] def get_contentmanagement_share(share_id, opts = {}) data, _status_code, _headers = get_contentmanagement_share_with_http_info(share_id, opts) return data end # Retrieve details about an existing share. # # @param share_id Share ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(Share, Fixnum, Hash)>] Share data, response status code and response headers def get_contentmanagement_share_with_http_info(share_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_share ..." end # verify the required parameter 'share_id' is set fail ArgumentError, "Missing the required parameter 'share_id' when calling ContentManagementApi.get_contentmanagement_share" if share_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/shares/{shareId}".sub('{format}','json').sub('{' + 'shareId' + '}', share_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Share') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_share\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get shared documents. Securely download a shared document. # This method requires the download sharing URI obtained in the get document response (downloadSharingUri). Documents may be shared between users in the same workspace. Documents may also be shared between any user by creating a content management share. # @param shared_id Shared ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :redirect Turn on or off redirect (default to true) # @option opts [String] :disposition Request how the share content will be downloaded: attached as a file or inline. Default is attachment. (default to attachment) # @option opts [String] :content_type The requested format for the specified document. If supported, the document will be returned in that format. Example contentType=audio/wav # @option opts [String] :expand Expand some document fields # @return [SharedResponse] def get_contentmanagement_shared_shared_id(shared_id, opts = {}) data, _status_code, _headers = get_contentmanagement_shared_shared_id_with_http_info(shared_id, opts) return data end # Get shared documents. Securely download a shared document. # This method requires the download sharing URI obtained in the get document response (downloadSharingUri). Documents may be shared between users in the same workspace. Documents may also be shared between any user by creating a content management share. # @param shared_id Shared ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :redirect Turn on or off redirect # @option opts [String] :disposition Request how the share content will be downloaded: attached as a file or inline. Default is attachment. # @option opts [String] :content_type The requested format for the specified document. If supported, the document will be returned in that format. Example contentType=audio/wav # @option opts [String] :expand Expand some document fields # @return [Array<(SharedResponse, Fixnum, Hash)>] SharedResponse data, response status code and response headers def get_contentmanagement_shared_shared_id_with_http_info(shared_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_shared_shared_id ..." end # verify the required parameter 'shared_id' is set fail ArgumentError, "Missing the required parameter 'shared_id' when calling ContentManagementApi.get_contentmanagement_shared_shared_id" if shared_id.nil? if opts[:'disposition'] && !['attachment', 'inline', 'none'].include?(opts[:'disposition']) fail ArgumentError, 'invalid value for "disposition", must be one of attachment, inline, none' end if opts[:'expand'] && !['document.acl'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of document.acl' end # resource path local_var_path = "/api/v2/contentmanagement/shared/{sharedId}".sub('{format}','json').sub('{' + 'sharedId' + '}', shared_id.to_s) # query parameters query_params = {} query_params[:'redirect'] = opts[:'redirect'] if opts[:'redirect'] query_params[:'disposition'] = opts[:'disposition'] if opts[:'disposition'] query_params[:'contentType'] = opts[:'content_type'] if opts[:'content_type'] query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SharedResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_shared_shared_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Gets a list of shares. You must specify at least one filter (e.g. entityId). # Failing to specify a filter will return 400. # @param [Hash] opts the optional parameters # @option opts [String] :entity_id Filters the shares returned to only the entity specified by the value of this parameter. # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @return [ShareEntityListing] def get_contentmanagement_shares(opts = {}) data, _status_code, _headers = get_contentmanagement_shares_with_http_info(opts) return data end # Gets a list of shares. You must specify at least one filter (e.g. entityId). # Failing to specify a filter will return 400. # @param [Hash] opts the optional parameters # @option opts [String] :entity_id Filters the shares returned to only the entity specified by the value of this parameter. # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @return [Array<(ShareEntityListing, Fixnum, Hash)>] ShareEntityListing data, response status code and response headers def get_contentmanagement_shares_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_shares ..." end # resource path local_var_path = "/api/v2/contentmanagement/shares".sub('{format}','json') # query parameters query_params = {} query_params[:'entityId'] = opts[:'entity_id'] if opts[:'entity_id'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ShareEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_shares\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of statuses for pending operations # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @return [CommandStatusEntityListing] def get_contentmanagement_status(opts = {}) data, _status_code, _headers = get_contentmanagement_status_with_http_info(opts) return data end # Get a list of statuses for pending operations # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @return [Array<(CommandStatusEntityListing, Fixnum, Hash)>] CommandStatusEntityListing data, response status code and response headers def get_contentmanagement_status_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_status ..." end # resource path local_var_path = "/api/v2/contentmanagement/status".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandStatusEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a status. # # @param status_id Status ID # @param [Hash] opts the optional parameters # @return [CommandStatus] def get_contentmanagement_status_status_id(status_id, opts = {}) data, _status_code, _headers = get_contentmanagement_status_status_id_with_http_info(status_id, opts) return data end # Get a status. # # @param status_id Status ID # @param [Hash] opts the optional parameters # @return [Array<(CommandStatus, Fixnum, Hash)>] CommandStatus data, response status code and response headers def get_contentmanagement_status_status_id_with_http_info(status_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_status_status_id ..." end # verify the required parameter 'status_id' is set fail ArgumentError, "Missing the required parameter 'status_id' when calling ContentManagementApi.get_contentmanagement_status_status_id" if status_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/status/{statusId}".sub('{format}','json').sub('{' + 'statusId' + '}', status_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommandStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_status_status_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get usage details. # # @param [Hash] opts the optional parameters # @return [Usage] def get_contentmanagement_usage(opts = {}) data, _status_code, _headers = get_contentmanagement_usage_with_http_info(opts) return data end # Get usage details. # # @param [Hash] opts the optional parameters # @return [Array<(Usage, Fixnum, Hash)>] Usage data, response status code and response headers def get_contentmanagement_usage_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_usage ..." end # resource path local_var_path = "/api/v2/contentmanagement/usage".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Usage') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a workspace. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Workspace] def get_contentmanagement_workspace(workspace_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_with_http_info(workspace_id, opts) return data end # Get a workspace. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def get_contentmanagement_workspace_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Workspace') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of documents. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_by name or dateCreated # @option opts [String] :sort_order ascending or descending (default to ascending) # @return [DocumentEntityListing] def get_contentmanagement_workspace_documents(workspace_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_documents_with_http_info(workspace_id, opts) return data end # Get a list of documents. # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_by name or dateCreated # @option opts [String] :sort_order ascending or descending # @return [Array<(DocumentEntityListing, Fixnum, Hash)>] DocumentEntityListing data, response status code and response headers def get_contentmanagement_workspace_documents_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace_documents ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace_documents" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/documents".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a workspace member # # @param workspace_id Workspace ID # @param member_id Member ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [WorkspaceMember] def get_contentmanagement_workspace_member(workspace_id, member_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, opts) return data end # Get a workspace member # # @param workspace_id Workspace ID # @param member_id Member ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(WorkspaceMember, Fixnum, Hash)>] WorkspaceMember data, response status code and response headers def get_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace_member ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace_member" if workspace_id.nil? # verify the required parameter 'member_id' is set fail ArgumentError, "Missing the required parameter 'member_id' when calling ContentManagementApi.get_contentmanagement_workspace_member" if member_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/members/{memberId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'memberId' + '}', member_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WorkspaceMember') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list workspace members # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [Array] :expand Which fields, if any, to expand. # @return [WorkspaceMemberEntityListing] def get_contentmanagement_workspace_members(workspace_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_members_with_http_info(workspace_id, opts) return data end # Get a list workspace members # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(WorkspaceMemberEntityListing, Fixnum, Hash)>] WorkspaceMemberEntityListing data, response status code and response headers def get_contentmanagement_workspace_members_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace_members ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace_members" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/members".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WorkspaceMemberEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a workspace tag # # @param workspace_id Workspace ID # @param tag_id Tag ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [TagValue] def get_contentmanagement_workspace_tagvalue(workspace_id, tag_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, opts) return data end # Get a workspace tag # # @param workspace_id Workspace ID # @param tag_id Tag ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def get_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace_tagvalue ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace_tagvalue" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContentManagementApi.get_contentmanagement_workspace_tagvalue" if tag_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues/{tagId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'tagId' + '}', tag_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TagValue') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace_tagvalue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of workspace tags # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :value filter the list of tags returned # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [Array] :expand Which fields, if any, to expand. # @return [TagValueEntityListing] def get_contentmanagement_workspace_tagvalues(workspace_id, opts = {}) data, _status_code, _headers = get_contentmanagement_workspace_tagvalues_with_http_info(workspace_id, opts) return data end # Get a list of workspace tags # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [String] :value filter the list of tags returned # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(TagValueEntityListing, Fixnum, Hash)>] TagValueEntityListing data, response status code and response headers def get_contentmanagement_workspace_tagvalues_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspace_tagvalues ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.get_contentmanagement_workspace_tagvalues" if workspace_id.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'value'] = opts[:'value'] if opts[:'value'] query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TagValueEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspace_tagvalues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of workspaces. # Specifying 'content' access will return all workspaces the user has document access to, while 'admin' access will return all group workspaces the user has administrative rights to. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [Array] :access Requested access level. # @option opts [Array] :expand Which fields, if any, to expand. # @return [WorkspaceEntityListing] def get_contentmanagement_workspaces(opts = {}) data, _status_code, _headers = get_contentmanagement_workspaces_with_http_info(opts) return data end # Get a list of workspaces. # Specifying 'content' access will return all workspaces the user has document access to, while 'admin' access will return all group workspaces the user has administrative rights to. # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [Array] :access Requested access level. # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(WorkspaceEntityListing, Fixnum, Hash)>] WorkspaceEntityListing data, response status code and response headers def get_contentmanagement_workspaces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.get_contentmanagement_workspaces ..." end # resource path local_var_path = "/api/v2/contentmanagement/workspaces".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'access'] = @api_client.build_collection_param(opts[:'access'], :multi) if opts[:'access'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WorkspaceEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#get_contentmanagement_workspaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query audits # # @param body Allows for a filtered query returning facet information # @param [Hash] opts the optional parameters # @return [QueryResults] def post_contentmanagement_auditquery(body, opts = {}) data, _status_code, _headers = post_contentmanagement_auditquery_with_http_info(body, opts) return data end # Query audits # # @param body Allows for a filtered query returning facet information # @param [Hash] opts the optional parameters # @return [Array<(QueryResults, Fixnum, Hash)>] QueryResults data, response status code and response headers def post_contentmanagement_auditquery_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_auditquery ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_auditquery" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/auditquery".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'QueryResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_auditquery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a document. # # @param document_id Document ID # @param body Document # @param [Hash] opts the optional parameters # @option opts [String] :expand Expand some document fields # @option opts [BOOLEAN] :override Override any lock on the document # @return [Document] def post_contentmanagement_document(document_id, body, opts = {}) data, _status_code, _headers = post_contentmanagement_document_with_http_info(document_id, body, opts) return data end # Update a document. # # @param document_id Document ID # @param body Document # @param [Hash] opts the optional parameters # @option opts [String] :expand Expand some document fields # @option opts [BOOLEAN] :override Override any lock on the document # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def post_contentmanagement_document_with_http_info(document_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_document ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.post_contentmanagement_document" if document_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_document" if body.nil? if opts[:'expand'] && !['acl'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of acl' end # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] query_params[:'override'] = opts[:'override'] if opts[:'override'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Document') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Replace the contents of a document. # # @param document_id Document ID # @param body Replace Request # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :override Override any lock on the document # @return [ReplaceResponse] def post_contentmanagement_document_content(document_id, body, opts = {}) data, _status_code, _headers = post_contentmanagement_document_content_with_http_info(document_id, body, opts) return data end # Replace the contents of a document. # # @param document_id Document ID # @param body Replace Request # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :override Override any lock on the document # @return [Array<(ReplaceResponse, Fixnum, Hash)>] ReplaceResponse data, response status code and response headers def post_contentmanagement_document_content_with_http_info(document_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_document_content ..." end # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling ContentManagementApi.post_contentmanagement_document_content" if document_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_document_content" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents/{documentId}/content".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'override'] = opts[:'override'] if opts[:'override'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReplaceResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_document_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a document. # # @param body Document # @param [Hash] opts the optional parameters # @option opts [String] :copy_source Copy a document within a workspace or to a new workspace. Provide a document ID as the copy source. # @option opts [String] :move_source Move a document to a new workspace. Provide a document ID as the move source. # @option opts [BOOLEAN] :override Override any lock on the source document # @return [Document] def post_contentmanagement_documents(body, opts = {}) data, _status_code, _headers = post_contentmanagement_documents_with_http_info(body, opts) return data end # Add a document. # # @param body Document # @param [Hash] opts the optional parameters # @option opts [String] :copy_source Copy a document within a workspace or to a new workspace. Provide a document ID as the copy source. # @option opts [String] :move_source Move a document to a new workspace. Provide a document ID as the move source. # @option opts [BOOLEAN] :override Override any lock on the source document # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def post_contentmanagement_documents_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_documents ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_documents" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/documents".sub('{format}','json') # query parameters query_params = {} query_params[:'copySource'] = opts[:'copy_source'] if opts[:'copy_source'] query_params[:'moveSource'] = opts[:'move_source'] if opts[:'move_source'] query_params[:'override'] = opts[:'override'] if opts[:'override'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Document') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query content # # @param body Allows for a filtered query returning facet information # @param [Hash] opts the optional parameters # @option opts [String] :expand Expand some document fields # @return [QueryResults] def post_contentmanagement_query(body, opts = {}) data, _status_code, _headers = post_contentmanagement_query_with_http_info(body, opts) return data end # Query content # # @param body Allows for a filtered query returning facet information # @param [Hash] opts the optional parameters # @option opts [String] :expand Expand some document fields # @return [Array<(QueryResults, Fixnum, Hash)>] QueryResults data, response status code and response headers def post_contentmanagement_query_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_query ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_query" if body.nil? if opts[:'expand'] && !['acl', 'workspace'].include?(opts[:'expand']) fail ArgumentError, 'invalid value for "expand", must be one of acl, workspace' end # resource path local_var_path = "/api/v2/contentmanagement/query".sub('{format}','json') # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'QueryResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates a new share or updates an existing share if the entity has already been shared # # @param body CreateShareRequest - entity id and type and a single member or list of members are required # @param [Hash] opts the optional parameters # @return [CreateShareResponse] def post_contentmanagement_shares(body, opts = {}) data, _status_code, _headers = post_contentmanagement_shares_with_http_info(body, opts) return data end # Creates a new share or updates an existing share if the entity has already been shared # # @param body CreateShareRequest - entity id and type and a single member or list of members are required # @param [Hash] opts the optional parameters # @return [Array<(CreateShareResponse, Fixnum, Hash)>] CreateShareResponse data, response status code and response headers def post_contentmanagement_shares_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_shares ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_shares" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/shares".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CreateShareResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_shares\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a workspace tag # # @param workspace_id Workspace ID # @param body tag # @param [Hash] opts the optional parameters # @return [TagValue] def post_contentmanagement_workspace_tagvalues(workspace_id, body, opts = {}) data, _status_code, _headers = post_contentmanagement_workspace_tagvalues_with_http_info(workspace_id, body, opts) return data end # Create a workspace tag # # @param workspace_id Workspace ID # @param body tag # @param [Hash] opts the optional parameters # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def post_contentmanagement_workspace_tagvalues_with_http_info(workspace_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_workspace_tagvalues ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.post_contentmanagement_workspace_tagvalues" if workspace_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_workspace_tagvalues" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TagValue') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_workspace_tagvalues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Perform a prefix query on tags in the workspace # # @param workspace_id Workspace ID # @param body query # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [TagValueEntityListing] def post_contentmanagement_workspace_tagvalues_query(workspace_id, body, opts = {}) data, _status_code, _headers = post_contentmanagement_workspace_tagvalues_query_with_http_info(workspace_id, body, opts) return data end # Perform a prefix query on tags in the workspace # # @param workspace_id Workspace ID # @param body query # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(TagValueEntityListing, Fixnum, Hash)>] TagValueEntityListing data, response status code and response headers def post_contentmanagement_workspace_tagvalues_query_with_http_info(workspace_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_workspace_tagvalues_query ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.post_contentmanagement_workspace_tagvalues_query" if workspace_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_workspace_tagvalues_query" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues/query".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TagValueEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_workspace_tagvalues_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a group workspace # # @param body Workspace # @param [Hash] opts the optional parameters # @return [Workspace] def post_contentmanagement_workspaces(body, opts = {}) data, _status_code, _headers = post_contentmanagement_workspaces_with_http_info(body, opts) return data end # Create a group workspace # # @param body Workspace # @param [Hash] opts the optional parameters # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def post_contentmanagement_workspaces_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.post_contentmanagement_workspaces ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.post_contentmanagement_workspaces" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Workspace') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#post_contentmanagement_workspaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a workspace # # @param workspace_id Workspace ID # @param body Workspace # @param [Hash] opts the optional parameters # @return [Workspace] def put_contentmanagement_workspace(workspace_id, body, opts = {}) data, _status_code, _headers = put_contentmanagement_workspace_with_http_info(workspace_id, body, opts) return data end # Update a workspace # # @param workspace_id Workspace ID # @param body Workspace # @param [Hash] opts the optional parameters # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def put_contentmanagement_workspace_with_http_info(workspace_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.put_contentmanagement_workspace ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.put_contentmanagement_workspace" if workspace_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.put_contentmanagement_workspace" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Workspace') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#put_contentmanagement_workspace\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a member to a workspace # # @param workspace_id Workspace ID # @param member_id Member ID # @param body Workspace Member # @param [Hash] opts the optional parameters # @return [WorkspaceMember] def put_contentmanagement_workspace_member(workspace_id, member_id, body, opts = {}) data, _status_code, _headers = put_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, body, opts) return data end # Add a member to a workspace # # @param workspace_id Workspace ID # @param member_id Member ID # @param body Workspace Member # @param [Hash] opts the optional parameters # @return [Array<(WorkspaceMember, Fixnum, Hash)>] WorkspaceMember data, response status code and response headers def put_contentmanagement_workspace_member_with_http_info(workspace_id, member_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.put_contentmanagement_workspace_member ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.put_contentmanagement_workspace_member" if workspace_id.nil? # verify the required parameter 'member_id' is set fail ArgumentError, "Missing the required parameter 'member_id' when calling ContentManagementApi.put_contentmanagement_workspace_member" if member_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.put_contentmanagement_workspace_member" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/members/{memberId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'memberId' + '}', member_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'WorkspaceMember') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#put_contentmanagement_workspace_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a workspace tag. Will update all documents with the new tag value. # # @param workspace_id Workspace ID # @param tag_id Tag ID # @param body Workspace # @param [Hash] opts the optional parameters # @return [TagValue] def put_contentmanagement_workspace_tagvalue(workspace_id, tag_id, body, opts = {}) data, _status_code, _headers = put_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, body, opts) return data end # Update a workspace tag. Will update all documents with the new tag value. # # @param workspace_id Workspace ID # @param tag_id Tag ID # @param body Workspace # @param [Hash] opts the optional parameters # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def put_contentmanagement_workspace_tagvalue_with_http_info(workspace_id, tag_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi.put_contentmanagement_workspace_tagvalue ..." end # verify the required parameter 'workspace_id' is set fail ArgumentError, "Missing the required parameter 'workspace_id' when calling ContentManagementApi.put_contentmanagement_workspace_tagvalue" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail ArgumentError, "Missing the required parameter 'tag_id' when calling ContentManagementApi.put_contentmanagement_workspace_tagvalue" if tag_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling ContentManagementApi.put_contentmanagement_workspace_tagvalue" if body.nil? # resource path local_var_path = "/api/v2/contentmanagement/workspaces/{workspaceId}/tagvalues/{tagId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s).sub('{' + 'tagId' + '}', tag_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'TagValue') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContentManagementApi#put_contentmanagement_workspace_tagvalue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end