# frozen_string_literal: true module RubyLokaliseApi module Rest module Contributors # Returns all contributors for the given project # # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-contributors-get # @return [RubyLokaliseApi::Collection::Contributor] # @param project_id [String] # @param params [Hash] def contributors(project_id, params = {}) c_r RubyLokaliseApi::Collections::Contributor, :all, project_id, params end # Returns a single contributor for the given project # # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get # @return [RubyLokaliseApi::Resources::Contributor] # @param project_id [String] # @param contributor_id [String, Integer] def contributor(project_id, contributor_id) c_r RubyLokaliseApi::Resources::Contributor, :find, [project_id, contributor_id] end # Creates one or more contributors inside the given project # # @see https://app.lokalise.com/api2docs/curl/#transition-create-contributors-post # @return [RubyLokaliseApi::Collection::Contributor] # @param project_id [String] # @param params [Hash, Array] def create_contributors(project_id, params) c_r RubyLokaliseApi::Resources::Contributor, :create, project_id, params, :contributors end # Updates the given contributor inside the given project # # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-contributor-put # @return [RubyLokaliseApi::Resources::Contributor] # @param project_id [String] # @param contributor_id [String, Integer] # @param params [Hash] def update_contributor(project_id, contributor_id, params) c_r RubyLokaliseApi::Resources::Contributor, :update, [project_id, contributor_id], params end # Deletes contributor inside the given project # # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete # @return [Hash] # @param project_id [String] # @param contributor_id [String, Integer] def destroy_contributor(project_id, contributor_id) c_r RubyLokaliseApi::Resources::Contributor, :destroy, [project_id, contributor_id] end end end end