module Agilix::Buzz::Commands::Resource
Public Instance Methods
api.copy_resources [ {sourceentityid: 57025, destinationentityid: 57031, sourcepath: “banner.css” }]
# File lib/agilix/buzz/commands/resource.rb, line 7 def copy_resources(items = []) options = items.map do |item| argument_cleaner(required_params: %i( sourceentityid destinationentityid ), optional_params: %i( sourcepath destinationpath ), options: item ) end authenticated_bulk_post cmd: "copyresources", root_node: "resource", body: options end
api.delete_documents
# File lib/agilix/buzz/commands/resource.rb, line 83 def delete_documents(items = []) options = items.map do |item| argument_cleaner(required_params: %i( enrollmentid itemid path ), optional_params: %i( ), options: item ) end authenticated_bulk_post cmd: "deletedocuments", root_node: "document", body: options end
api.delete_resources [{entityid: 57031, path: 'banner.css'}]
# File lib/agilix/buzz/commands/resource.rb, line 15 def delete_resources(items = []) options = items.map do |item| argument_cleaner(required_params: %i( entityid path ), optional_params: %i( class ), options: item ) end authenticated_bulk_post cmd: "deleteresources", root_node: "resource", body: options end
api.get_document enrollmentid: 60997
# File lib/agilix/buzz/commands/resource.rb, line 91 def get_document(options = {}) options = argument_cleaner(required_params: %i( enrollmentid itemid path ), optional_params: %i( version ), options: options ) authenticated_get cmd: "getdocument", **options end
ISSUE: Why is get command a bulk POST request api.get_document_info
# File lib/agilix/buzz/commands/resource.rb, line 98 def get_document_info(items = []) options = items.map do |item| argument_cleaner(required_params: %i( enrollmentid itemid path ), optional_params: %i( ), options: item ) end authenticated_bulk_post cmd: "getdocumentinfo", root_node: "document", body: options authenticated_get cmd: "", **options end
api.get_entity_resource_id entityid: 57025
# File lib/agilix/buzz/commands/resource.rb, line 23 def get_entity_resource_id(options = {}) options = argument_cleaner(required_params: %i( entityid ), optional_params: %i( ), options: options ) authenticated_get cmd: "getentityresourceid", **options end
api.get_resource entityid: 57031, path: “banner.css”
# File lib/agilix/buzz/commands/resource.rb, line 29 def get_resource(options = {}) options = argument_cleaner(required_params: %i( entityid path ), optional_params: %i( version packagetype attachment class ), options: options ) authenticated_get cmd: "getresource", **options end
ISSUE: This is a get request with a POST verb. The documentation only suggests getting a single resoure, so I'm not sure why it would be a bulk post syntax. it does seem to respond to multiple resources though,so we'll adapt api.get_resource_info [{entityid: 57031, path: “banner.css”}]
# File lib/agilix/buzz/commands/resource.rb, line 36 def get_resource_info2(items = []) options = items.map do |item| argument_cleaner(required_params: %i( entityid path ), optional_params: %i( class ), options: item ) end authenticated_bulk_post cmd: "getresourceinfo2", root_node: "resource", body: options end
api.get_resource_list2 entityid: 57025
# File lib/agilix/buzz/commands/resource.rb, line 45 def get_resource_list2(options = {}) options = argument_cleaner(required_params: %i( entityid ), optional_params: %i( path recurse query allversions entries class ), options: options ) authenticated_get cmd: "getresourcelist2", **options end
api.list_restorable_documents enrollmentid: 64001
# File lib/agilix/buzz/commands/resource.rb, line 107 def list_restorable_documents(options = {}) options = argument_cleaner(required_params: %i( enrollmentid itemid ), optional_params: %i( ), options: options ) authenticated_get cmd: "listrestorabledocuments", **options end
api.list_restorable_resources entityid: 57025
# File lib/agilix/buzz/commands/resource.rb, line 52 def list_restorable_resources(options = {}) options = argument_cleaner(required_params: %i( entityid ), optional_params: %i( ), options: options ) authenticated_get cmd: "listrestorableresources", **options end
file_name = “my-file.pdf” file = File.open file_name api.put_resource file, {entityid: 57025, path: file_name}
# File lib/agilix/buzz/commands/resource.rb, line 60 def put_resource(file, options = {}) options = argument_cleaner(required_params: %i( entityid path ), optional_params: %i( status class drophistory contenttype ), options: options ) # authenticated_query_post cmd: "putresource", **options authenticated_query_post query_params: {cmd: "putresource", **options }, file: file end
api.put_resource_folders [{entityid: 57031, path: 'test/folder-1'}]
# File lib/agilix/buzz/commands/resource.rb, line 67 def put_resource_folders(items = []) options = items.map do |item| argument_cleaner(required_params: %i( entityid path ), optional_params: %i( ), options: item ) end authenticated_bulk_post cmd: "putresourcefolders", root_node: "folder", body: options end
api.restore_documents
# File lib/agilix/buzz/commands/resource.rb, line 114 def restore_documents(items = []) options = items.map do |item| argument_cleaner(required_params: %i( enrollmentid itemid path), optional_params: %i( version ), options: item ) end authenticated_bulk_post cmd: "restoredocuments", root_node: "document", body: options end
api.restore_resources [{entityid: 57031, path: 'banner.css'}]
# File lib/agilix/buzz/commands/resource.rb, line 75 def restore_resources(items = []) options = items.map do |item| argument_cleaner(required_params: %i( entityid path ), optional_params: %i( class ), options: item ) end authenticated_bulk_post cmd: "restoreresources", root_node: "resource", body: options end