require "uri" module PureCloud class ContentManagementApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Query audits # # @param body Allows for a filtered query returning facet information # @param [Hash] opts the optional parameters # @return [QueryResults] def create_auditquery(body, opts = {}) data, status_code, headers = create_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 create_auditquery_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_auditquery ..." end # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling create_auditquery" if body.nil? # resource path path = "/api/v1/contentmanagement/auditquery".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_auditquery\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 [String] :expand Expand some document fields # @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 [DocumentEntityListing] def get_documents(workspace_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand some document fields # @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_documents_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_documents ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_documents" if workspace_id.nil? if opts[:'expand'] && !['acl', 'workspace'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl, workspace' end # resource path path = "/api/v1/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'] = opts[:'expand'] 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add a document. # # @param [Hash] opts the optional parameters # @option opts [DocumentUpload] :body Document # @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 create_documents(opts = {}) data, status_code, headers = create_documents_with_http_info(opts) return data end # Add a document. # # @param [Hash] opts the optional parameters # @option opts [DocumentUpload] :body Document # @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 create_documents_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_documents ..." end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_documents\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 [String] :expand Expand some document fields # @return [Document] def get_document(document_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand some document fields # @return [Array<(Document, Fixnum, Hash)>] Document data, response status code and response headers def get_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_document ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling get_document" if document_id.nil? if opts[:'expand'] && !['lockInfo', 'acl', 'workspace'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of lockInfo, acl, workspace' end # resource path path = "/api/v1/contentmanagement/documents/{documentId}".sub('{format}','json').sub('{' + 'documentId' + '}', document_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_document\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 [Hash] opts the optional parameters # @option opts [DocumentUpdate] :body Document # @option opts [String] :expand Expand some document fields # @option opts [BOOLEAN] :override Override any lock on the document # @return [Document] def create_document(document_id, opts = {}) data, status_code, headers = create_document_with_http_info(document_id, opts) return data end # Update a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [DocumentUpdate] :body Document # @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 create_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_document ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling create_document" if document_id.nil? if opts[:'expand'] && !['acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl' end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers 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_document(document_id, opts = {}) delete_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_document_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_document ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling delete_document" if document_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_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 # @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 [DocumentAuditEntityListing] def get_document_audits(document_id, opts = {}) data, status_code, headers = get_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_document_audits_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_document_audits ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling get_document_audits" if document_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_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: 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 # @return [nil] def get_document_content(document_id, opts = {}) get_document_content_with_http_info(document_id, opts) return nil 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: 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 # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_document_content_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_document_content ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling get_document_content" if document_id.nil? if opts[:'disposition'] && !['attachment', 'inline'].include?(opts[:'disposition']) fail 'invalid value for "disposition", must be one of attachment, inline' end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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#get_document_content\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 [Hash] opts the optional parameters # @option opts [ReplaceRequest] :body Replace Request # @option opts [BOOLEAN] :override Override any lock on the document # @return [ReplaceResponse] def create_document_content(document_id, opts = {}) data, status_code, headers = create_document_content_with_http_info(document_id, opts) return data end # Replace the contents of a document. # # @param document_id Document ID # @param [Hash] opts the optional parameters # @option opts [ReplaceRequest] :body Replace Request # @option opts [BOOLEAN] :override Override any lock on the document # @return [Array<(ReplaceResponse, Fixnum, Hash)>] ReplaceResponse data, response status code and response headers def create_document_content_with_http_info(document_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_document_content ..." end # verify the required parameter 'document_id' is set fail "Missing the required parameter 'document_id' when calling create_document_content" if document_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_document_content\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 # @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 [String] :expand Expand some document fields # @return [QueryResults] def get_query(query_phrase, opts = {}) data, status_code, headers = get_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 [String] :expand Expand some document fields # @return [Array<(QueryResults, Fixnum, Hash)>] QueryResults data, response status code and response headers def get_query_with_http_info(query_phrase, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_query ..." end # verify the required parameter 'query_phrase' is set fail "Missing the required parameter 'query_phrase' when calling get_query" if query_phrase.nil? if opts[:'expand'] && !['acl', 'workspace'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl, workspace' end # resource path path = "/api/v1/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'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_query\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 create_query(body, opts = {}) data, status_code, headers = create_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 create_query_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_query ..." end # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling create_query" if body.nil? if opts[:'expand'] && !['acl', 'workspace'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl, workspace' end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_query\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_securityprofiles(opts = {}) data, status_code, headers = get_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_securityprofiles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_securityprofiles ..." end # resource path path = "/api/v1/contentmanagement/securityprofiles".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_securityprofiles\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_security_profile(security_profile_id, opts = {}) data, status_code, headers = get_security_profile_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_security_profile_with_http_info(security_profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_security_profile ..." end # verify the required parameter 'security_profile_id' is set fail "Missing the required parameter 'security_profile_id' when calling get_security_profile" if security_profile_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_security_profile\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 # @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 [nil] def get_shared_shared(shared_id, opts = {}) get_shared_shared_with_http_info(shared_id, opts) return nil 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<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_shared_shared_with_http_info(shared_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_shared_shared ..." end # verify the required parameter 'shared_id' is set fail "Missing the required parameter 'shared_id' when calling get_shared_shared" if shared_id.nil? if opts[:'disposition'] && !['attachment', 'inline', 'none'].include?(opts[:'disposition']) fail 'invalid value for "disposition", must be one of attachment, inline, none' end if opts[:'expand'] && !['document.acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of document.acl' end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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#get_shared_shared\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 [String] :expand Expand share fields # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @return [ShareEntityListing] def get_shares(opts = {}) data, status_code, headers = get_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 [String] :expand Expand share fields # @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_shares_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_shares ..." end if opts[:'expand'] && !['member'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of member' end # resource path path = "/api/v1/contentmanagement/shares".sub('{format}','json') # query parameters query_params = {} query_params[:'entityId'] = opts[:'entity_id'] if opts[:'entity_id'] query_params[:'expand'] = opts[:'expand'] 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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_shares\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 [Hash] opts the optional parameters # @option opts [CreateShareRequest] :body CreateShareRequest - entity id and type and a single member or list of members are required # @return [CreateShareResponse] def create_shares(opts = {}) data, status_code, headers = create_shares_with_http_info(opts) return data end # Creates a new share or updates an existing share if the entity has already been shared # # @param [Hash] opts the optional parameters # @option opts [CreateShareRequest] :body CreateShareRequest - entity id and type and a single member or list of members are required # @return [Array<(CreateShareResponse, Fixnum, Hash)>] CreateShareResponse data, response status code and response headers def create_shares_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_shares ..." end # resource path path = "/api/v1/contentmanagement/shares".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_shares\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 [String] :expand Expand share fields # @return [Share] def get_share(share_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand share fields # @return [Array<(Share, Fixnum, Hash)>] Share data, response status code and response headers def get_share_with_http_info(share_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_share ..." end # verify the required parameter 'share_id' is set fail "Missing the required parameter 'share_id' when calling get_share" if share_id.nil? if opts[:'expand'] && !['member'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of member' end # resource path path = "/api/v1/contentmanagement/shares/{shareId}".sub('{format}','json').sub('{' + 'shareId' + '}', share_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_share\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_share(share_id, opts = {}) delete_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_share_with_http_info(share_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_share ..." end # verify the required parameter 'share_id' is set fail "Missing the required parameter 'share_id' when calling delete_share" if share_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_share\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 # @option opts [Integer] :page_number Page number # @return [CommandStatusEntityListing] def get_status(opts = {}) data, status_code, headers = get_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_status_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_status ..." end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_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_status_status(status_id, opts = {}) data, status_code, headers = get_status_status_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_status_status_with_http_info(status_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_status_status ..." end # verify the required parameter 'status_id' is set fail "Missing the required parameter 'status_id' when calling get_status_status" if status_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_status_status\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_status_status(status_id, opts = {}) delete_status_status_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_status_status_with_http_info(status_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_status_status ..." end # verify the required parameter 'status_id' is set fail "Missing the required parameter 'status_id' when calling delete_status_status" if status_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_status_status\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 # @option opts [Integer] :page_number Page number # @option opts [String] :access Requested access level # @option opts [String] :expand Expand some workspace fields # @return [WorkspaceEntityListing] def get_workspaces(opts = {}) data, status_code, headers = get_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 [String] :access Requested access level # @option opts [String] :expand Expand some workspace fields # @return [Array<(WorkspaceEntityListing, Fixnum, Hash)>] WorkspaceEntityListing data, response status code and response headers def get_workspaces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspaces ..." end if opts[:'access'] && !['content', 'admin', 'document:create', 'document:viewContent', 'document:viewMetadata', 'document:download', 'document:delete', 'document:update', 'document:share', 'document:shareView', 'document:email', 'document:print', 'document:auditView', 'document:replace', 'document:tag', 'tag:create', 'tag:view', 'tag:update', 'tag:apply', 'tag:remove', 'tag:delete'].include?(opts[:'access']) fail 'invalid value for "access", must be one of content, admin, document:create, document:viewContent, document:viewMetadata, document:download, document:delete, document:update, document:share, document:shareView, document:email, document:print, document:auditView, document:replace, document:tag, tag:create, tag:view, tag:update, tag:apply, tag:remove, tag:delete' end if opts[:'expand'] && !['summary', 'acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of summary, acl' end # resource path path = "/api/v1/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'] = opts[:'access'] if opts[:'access'] query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create a group workspace # # @param [Hash] opts the optional parameters # @option opts [WorkspaceCreate] :body Workspace # @return [Workspace] def create_workspaces(opts = {}) data, status_code, headers = create_workspaces_with_http_info(opts) return data end # Create a group workspace # # @param [Hash] opts the optional parameters # @option opts [WorkspaceCreate] :body Workspace # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def create_workspaces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_workspaces ..." end # resource path path = "/api/v1/contentmanagement/workspaces".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_workspaces\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 [String] :expand Expand some workspace fields # @return [Workspace] def get_workspace(workspace_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand some workspace fields # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def get_workspace_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspace ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_workspace" if workspace_id.nil? if opts[:'expand'] && !['summary', 'acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of summary, acl' end # resource path path = "/api/v1/contentmanagement/workspaces/{workspaceId}".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspace\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 [Hash] opts the optional parameters # @option opts [Workspace] :body Workspace # @return [Workspace] def update_workspace(workspace_id, opts = {}) data, status_code, headers = update_workspace_with_http_info(workspace_id, opts) return data end # Update a workspace # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [Workspace] :body Workspace # @return [Array<(Workspace, Fixnum, Hash)>] Workspace data, response status code and response headers def update_workspace_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#update_workspace ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling update_workspace" if workspace_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, 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#update_workspace\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_workspace(workspace_id, opts = {}) delete_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_workspace_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_workspace ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling delete_workspace" if workspace_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_workspace\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 # @option opts [Integer] :page_number Page number # @option opts [String] :expand Expand workspace member fields # @return [WorkspaceMemberEntityListing] def get_workspace_members(workspace_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand workspace member fields # @return [Array<(WorkspaceMemberEntityListing, Fixnum, Hash)>] WorkspaceMemberEntityListing data, response status code and response headers def get_workspace_members_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspace_members ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_workspace_members" if workspace_id.nil? if opts[:'expand'] && !['member'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of member' end # resource path path = "/api/v1/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'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspace_members\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 [String] :expand Expand workspace member fields # @return [WorkspaceMember] def get_workspace_members_by_member_id(workspace_id, member_id, opts = {}) data, status_code, headers = get_workspace_members_by_member_id_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 [String] :expand Expand workspace member fields # @return [Array<(WorkspaceMember, Fixnum, Hash)>] WorkspaceMember data, response status code and response headers def get_workspace_members_by_member_id_with_http_info(workspace_id, member_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspace_members_by_member_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_workspace_members_by_member_id" if workspace_id.nil? # verify the required parameter 'member_id' is set fail "Missing the required parameter 'member_id' when calling get_workspace_members_by_member_id" if member_id.nil? if opts[:'expand'] && !['member'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of member' end # resource path path = "/api/v1/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'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspace_members_by_member_id\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 [Hash] opts the optional parameters # @option opts [WorkspaceMember] :body Workspace # @return [WorkspaceMember] def update_workspace_members_by_member_id(workspace_id, member_id, opts = {}) data, status_code, headers = update_workspace_members_by_member_id_with_http_info(workspace_id, member_id, opts) return data end # Add a member to a workspace # # @param workspace_id Workspace ID # @param member_id Member ID # @param [Hash] opts the optional parameters # @option opts [WorkspaceMember] :body Workspace # @return [Array<(WorkspaceMember, Fixnum, Hash)>] WorkspaceMember data, response status code and response headers def update_workspace_members_by_member_id_with_http_info(workspace_id, member_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#update_workspace_members_by_member_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling update_workspace_members_by_member_id" if workspace_id.nil? # verify the required parameter 'member_id' is set fail "Missing the required parameter 'member_id' when calling update_workspace_members_by_member_id" if member_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, 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#update_workspace_members_by_member_id\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_workspace_members_by_member_id(workspace_id, member_id, opts = {}) delete_workspace_members_by_member_id_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_workspace_members_by_member_id_with_http_info(workspace_id, member_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_workspace_members_by_member_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling delete_workspace_members_by_member_id" if workspace_id.nil? # verify the required parameter 'member_id' is set fail "Missing the required parameter 'member_id' when calling delete_workspace_members_by_member_id" if member_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_workspace_members_by_member_id\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 # @option opts [Integer] :page_number Page number # @option opts [String] :expand Expand some document fields # @return [TagValueEntityListing] def get_workspace_tagvalues(workspace_id, opts = {}) data, status_code, headers = get_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 [String] :expand Expand some document fields # @return [Array<(TagValueEntityListing, Fixnum, Hash)>] TagValueEntityListing data, response status code and response headers def get_workspace_tagvalues_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspace_tagvalues ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_workspace_tagvalues" if workspace_id.nil? if opts[:'expand'] && !['acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl' end # resource path path = "/api/v1/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'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspace_tagvalues\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 [Hash] opts the optional parameters # @option opts [TagValue] :body tag # @return [TagValue] def create_workspace_tagvalues(workspace_id, opts = {}) data, status_code, headers = create_workspace_tagvalues_with_http_info(workspace_id, opts) return data end # Create a workspace tag # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [TagValue] :body tag # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def create_workspace_tagvalues_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_workspace_tagvalues ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling create_workspace_tagvalues" if workspace_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_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 [Hash] opts the optional parameters # @option opts [TagQueryRequest] :body query # @option opts [String] :expand Expand some document fields # @return [TagValueEntityListing] def create_workspace_tagvalues_query(workspace_id, opts = {}) data, status_code, headers = create_workspace_tagvalues_query_with_http_info(workspace_id, opts) return data end # Perform a prefix query on tags in the workspace # # @param workspace_id Workspace ID # @param [Hash] opts the optional parameters # @option opts [TagQueryRequest] :body query # @option opts [String] :expand Expand some document fields # @return [Array<(TagValueEntityListing, Fixnum, Hash)>] TagValueEntityListing data, response status code and response headers def create_workspace_tagvalues_query_with_http_info(workspace_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#create_workspace_tagvalues_query ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling create_workspace_tagvalues_query" if workspace_id.nil? if opts[:'expand'] && !['acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl' end # resource path path = "/api/v1/contentmanagement/workspaces/{workspaceId}/tagvalues/query".sub('{format}','json').sub('{' + 'workspaceId' + '}', workspace_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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#create_workspace_tagvalues_query\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 [String] :expand Expand some document fields # @return [TagValue] def get_workspace_tagvalues_by_tag_id(workspace_id, tag_id, opts = {}) data, status_code, headers = get_workspace_tagvalues_by_tag_id_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 [String] :expand Expand some document fields # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def get_workspace_tagvalues_by_tag_id_with_http_info(workspace_id, tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#get_workspace_tagvalues_by_tag_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling get_workspace_tagvalues_by_tag_id" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail "Missing the required parameter 'tag_id' when calling get_workspace_tagvalues_by_tag_id" if tag_id.nil? if opts[:'expand'] && !['acl'].include?(opts[:'expand']) fail 'invalid value for "expand", must be one of acl' end # resource path path = "/api/v1/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'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, 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_workspace_tagvalues_by_tag_id\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 [Hash] opts the optional parameters # @option opts [TagValue] :body Workspace # @return [TagValue] def update_workspace_tagvalues_by_tag_id(workspace_id, tag_id, opts = {}) data, status_code, headers = update_workspace_tagvalues_by_tag_id_with_http_info(workspace_id, tag_id, 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 [Hash] opts the optional parameters # @option opts [TagValue] :body Workspace # @return [Array<(TagValue, Fixnum, Hash)>] TagValue data, response status code and response headers def update_workspace_tagvalues_by_tag_id_with_http_info(workspace_id, tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#update_workspace_tagvalues_by_tag_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling update_workspace_tagvalues_by_tag_id" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail "Missing the required parameter 'tag_id' when calling update_workspace_tagvalues_by_tag_id" if tag_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, 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#update_workspace_tagvalues_by_tag_id\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_workspace_tagvalues_by_tag_id(workspace_id, tag_id, opts = {}) delete_workspace_tagvalues_by_tag_id_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_workspace_tagvalues_by_tag_id_with_http_info(workspace_id, tag_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: ContentManagementApi#delete_workspace_tagvalues_by_tag_id ..." end # verify the required parameter 'workspace_id' is set fail "Missing the required parameter 'workspace_id' when calling delete_workspace_tagvalues_by_tag_id" if workspace_id.nil? # verify the required parameter 'tag_id' is set fail "Missing the required parameter 'tag_id' when calling delete_workspace_tagvalues_by_tag_id" if tag_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, 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_workspace_tagvalues_by_tag_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end