=begin #RadioManager #RadioManager OpenAPI spec version: 2.0 Contact: support@pluxbox.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.2.3 =end require "uri" module RadioManagerClient class UserApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Remove user from station by Id # Remove user from station by Id # @param id id of User # @param [Hash] opts the optional parameters # @return [Success] def delete_user_by_id(id, opts = {}) data, _status_code, _headers = delete_user_by_id_with_http_info(id, opts) return data end # Remove user from station by Id # Remove user from station by Id # @param id id of User # @param [Hash] opts the optional parameters # @return [Array<(Success, Fixnum, Hash)>] Success data, response status code and response headers def delete_user_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserApi.delete_user_by_id ..." end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UserApi.delete_user_by_id" end if @api_client.config.client_side_validation && id < 0 fail ArgumentError, 'invalid value for "id" when calling UserApi.delete_user_by_id, must be greater than or equal to 0.' end # resource path local_var_path = "/users/{id}".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API Key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Success') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#delete_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get user by id # Get user by id # @param id id of User # @param [Hash] opts the optional parameters # @return [UserResult] def get_user_by_id(id, opts = {}) data, _status_code, _headers = get_user_by_id_with_http_info(id, opts) return data end # Get user by id # Get user by id # @param id id of User # @param [Hash] opts the optional parameters # @return [Array<(UserResult, Fixnum, Hash)>] UserResult data, response status code and response headers def get_user_by_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserApi.get_user_by_id ..." end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UserApi.get_user_by_id" end if @api_client.config.client_side_validation && id < 0 fail ArgumentError, 'invalid value for "id" when calling UserApi.get_user_by_id, must be greater than or equal to 0.' end # resource path local_var_path = "/users/{id}".sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API Key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#get_user_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Invite user by mail # Invite user by mail # @param data Data **(Required)** # @param [Hash] opts the optional parameters # @return [InviteUserSuccess] def invite_user_by_mail(data, opts = {}) data, _status_code, _headers = invite_user_by_mail_with_http_info(data, opts) return data end # Invite user by mail # Invite user by mail # @param data Data **(Required)** # @param [Hash] opts the optional parameters # @return [Array<(InviteUserSuccess, Fixnum, Hash)>] InviteUserSuccess data, response status code and response headers def invite_user_by_mail_with_http_info(data, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserApi.invite_user_by_mail ..." end # verify the required parameter 'data' is set if @api_client.config.client_side_validation && data.nil? fail ArgumentError, "Missing the required parameter 'data' when calling UserApi.invite_user_by_mail" end # resource path local_var_path = "/users/invite" # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(data) auth_names = ['API Key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InviteUserSuccess') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#invite_user_by_mail\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get all users. # List all users. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Current page *(Optional)* (default to 1) # @option opts [Integer] :role_id Search on Role ID *(Optional)* # @return [UserResults] def list_users(opts = {}) data, _status_code, _headers = list_users_with_http_info(opts) return data end # Get all users. # List all users. # @param [Hash] opts the optional parameters # @option opts [Integer] :page Current page *(Optional)* # @option opts [Integer] :role_id Search on Role ID *(Optional)* # @return [Array<(UserResults, Fixnum, Hash)>] UserResults data, response status code and response headers def list_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserApi.list_users ..." end if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0 fail ArgumentError, 'invalid value for "opts[:"page"]" when calling UserApi.list_users, must be greater than or equal to 0.' end # resource path local_var_path = "/users" # query parameters query_params = {} query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'role_id'] = opts[:'role_id'] if !opts[:'role_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API Key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end