-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a request to delete a collection item
- Loading branch information
bourda_c
committed
May 22, 2024
1 parent
28afa9d
commit 4b25e9a
Showing
5 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/kaze_client/request/requests/collections/items/delete_collection_item_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module KazeClient | ||
|
||
# @author [email protected] | ||
# Delete a collection item | ||
# @see KazeClient::Request | ||
# @see KazeClient::Utils::FinalRequest | ||
# @see KazeClient::Utils::AuthentifiedRequest | ||
# @since 0.4.1 | ||
class DeleteCollectionItemRequest < Utils::FinalRequest | ||
|
||
include Utils::AuthentifiedRequest | ||
|
||
# @param collection_id [String] | ||
# @param item_id [String] | ||
def initialize(collection_id, item_id) | ||
super(:delete, "api/collections/#{collection_id}/items/#{item_id}") | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
lib/kaze_client/request/requests/jobs/update_job_cell_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
module KazeClient | ||
|
||
# @author [email protected] | ||
# Update a given job cell. | ||
# @see KazeClient::Request | ||
# @see KazeClient::Utils::FinalRequest | ||
# @see KazeClient::Utils::AuthentifiedRequest | ||
# @since 0.1.0 | ||
class UpdateJobCell < Utils::FinalRequest | ||
|
||
include Utils::AuthentifiedRequest | ||
|
||
# @return [String] The id of the target job. | ||
attr_reader :job_id | ||
|
||
# @return [String] The id of the target cell. | ||
attr_reader :cell_id | ||
|
||
# @return [Hash] The workflow used to update the cell. | ||
attr_reader :cell_data | ||
|
||
def initialize(job_id, cell_id, cell_data, skip_version_check: false) | ||
super(:put, "api/jobs/#{job_id}/cells/#{cell_id}") | ||
|
||
@body = { | ||
data: { | ||
cell_id => { | ||
data: cell_data | ||
} | ||
}, | ||
skip_version_check: skip_version_check ? 1 : 0 | ||
} | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters