# frozen_string_literal: true require_relative "../../response/industries_response" require_relative "../../response/countries_response" require_relative "../../response/contributors_response" module ONEAccess module API module V1_1 # rubocop:disable Style/ClassAndModuleCamelCase class References < Base api_path "/references" class << self def industries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20) query = build_query(sort_by, is_ascending, keyword, page_number, page_size) resp = send_get("industries", Query: query.to_json) Response::IndustriesResponse.from_json(resp.body) end def countries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20) query = build_query(sort_by, is_ascending, keyword, page_number, page_size) resp = send_get("countries", Query: query.to_json) Response::CountriesResponse.from_json(resp.body) end private def build_query(sort_by, is_ascending, keyword, page_number, page_size) { SortBy: sort_by, IsAscending: is_ascending, Keyword: keyword, PageNumber: page_number, PageSize: page_size } end end end end end end