From 76316780d9270d696d591bafd723a15b067a19e4 Mon Sep 17 00:00:00 2001 From: bourda_c Date: Fri, 26 Apr 2024 11:24:37 +0200 Subject: [PATCH] add UserRequest --- CHANGELOG.md | 1 + .../requests/jobs/update_job_cell_request.rb | 2 +- .../request/requests/user_request.rb | 21 +++++++++++++++++++ lib/kaze_client/requests.rb | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/kaze_client/request/requests/user_request.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 39680fb..f12931c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Add new request: Update a collection's item. - Add new request: Update a job's cell. - Add new request: Delete a collection's item. +- Fetch the details for the given user. ## [0.4.0] - 2023-09-12 diff --git a/lib/kaze_client/request/requests/jobs/update_job_cell_request.rb b/lib/kaze_client/request/requests/jobs/update_job_cell_request.rb index ece3400..1215786 100644 --- a/lib/kaze_client/request/requests/jobs/update_job_cell_request.rb +++ b/lib/kaze_client/request/requests/jobs/update_job_cell_request.rb @@ -7,7 +7,7 @@ module KazeClient # @see KazeClient::Request # @see KazeClient::Utils::FinalRequest # @see KazeClient::Utils::AuthentifiedRequest - # @since 0.1.0 + # @since 0.4.1 class UpdateJobCell < Utils::FinalRequest include Utils::AuthentifiedRequest diff --git a/lib/kaze_client/request/requests/user_request.rb b/lib/kaze_client/request/requests/user_request.rb new file mode 100644 index 0000000..1b8fe47 --- /dev/null +++ b/lib/kaze_client/request/requests/user_request.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module KazeClient + + # @author bourda_c@modulotech.fr + # Show a given user's informations. + # @see KazeClient::Request + # @see KazeClient::Utils::FinalRequest + # @see KazeClient::Utils::AuthentifiedRequest + # @since 0.4.1 + class UserRequest < Utils::FinalRequest + + include Utils::AuthentifiedRequest + + def initialize(user_id) + super(:get, "api/users/#{user_id}") + end + + end + +end diff --git a/lib/kaze_client/requests.rb b/lib/kaze_client/requests.rb index f590f3f..70f801d 100644 --- a/lib/kaze_client/requests.rb +++ b/lib/kaze_client/requests.rb @@ -50,3 +50,4 @@ require_relative 'request/requests/upload_image_request' require_relative 'request/requests/upload_attachment_request' require_relative 'request/requests/users_request' +require_relative 'request/requests/user_request'