Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LinkedCollections and fix a typo #16

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

- Add new request: list items linked to a collection.

## [0.4.0] - 2023-09-12

- Require `AddTagRequest`
Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ GEM

PLATFORMS
aarch64-linux
arm64-darwin-22
x86_64-darwin-20

DEPENDENCIES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ItemRequest < Utils::FinalRequest
include Utils::AuthentifiedRequest

def initialize(collection_id, item_id)
super(:get, "api/collection/#{collection_id}/items/#{item_id}")
super(:get, "api/collections/#{collection_id}/items/#{item_id}")
end

end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true

module KazeClient

module Collection

module Item

class LinkedCollectionsRequest < Utils::FinalRequest

include Utils::AuthentifiedRequest
include Utils::ListRequest

# @author [email protected]
# Fetch all items linked to a given item
# @see KazeClient::Request
# @see KazeClient::Utils::FinalRequest
# @see KazeClient::Utils::AuthentifiedRequest
# @see KazeClient::Utils::ListRequest
# @since 0.4.1
def initialize(collection_id, collection_item_id)
super(:get, "api/collections/#{collection_id}/items/#{collection_item_id}/linked_collections")
end

end

end

end

end
1 change: 1 addition & 0 deletions lib/kaze_client/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
require_relative 'request/requests/collections/items/items_request'
require_relative 'request/requests/collections/items/create_link_request'
require_relative 'request/requests/collections/items/create_collection_item_request'
require_relative 'request/requests/collections/items/linked_collections_request'

# => Tags
require_relative 'request/requests/tags/tag_request'
Expand Down
Loading