Class: SchwarmCli::Client::SkillFiles
- Inherits:
-
Resource
- Object
- Resource
- SchwarmCli::Client::SkillFiles
show all
- Defined in:
- lib/schwarm_cli/client/skill_files.rb
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create(skill_id:, **attributes) ⇒ Object
15
16
17
|
# File 'lib/schwarm_cli/client/skill_files.rb', line 15
def create(skill_id:, **attributes)
post("/api/v2/skills/#{skill_id}/files", { skill_file: attributes }).body
end
|
#destroy(skill_id:, id:) ⇒ Object
23
24
25
26
|
# File 'lib/schwarm_cli/client/skill_files.rb', line 23
def destroy(skill_id:, id:)
delete("/api/v2/skills/#{skill_id}/files/#{id}")
nil
end
|
#find(skill_id:, id:) ⇒ Object
11
12
13
|
# File 'lib/schwarm_cli/client/skill_files.rb', line 11
def find(skill_id:, id:)
get("/api/v2/skills/#{skill_id}/files/#{id}").body
end
|
#list(skill_id:, page: nil, per_page: nil) ⇒ Object
6
7
8
9
|
# File 'lib/schwarm_cli/client/skill_files.rb', line 6
def list(skill_id:, page: nil, per_page: nil)
params = { page:, per_page: }.compact
get("/api/v2/skills/#{skill_id}/files", params).body
end
|
#update(skill_id:, id:, **attributes) ⇒ Object
19
20
21
|
# File 'lib/schwarm_cli/client/skill_files.rb', line 19
def update(skill_id:, id:, **attributes)
patch("/api/v2/skills/#{skill_id}/files/#{id}", { skill_file: attributes }).body
end
|