=begin #Fatture in Cloud API v2 - API Reference #Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. The version of the OpenAPI document: 2.0.20 Contact: info@fattureincloud.it Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.1.0 =end require 'cgi' module FattureInCloud_Ruby_Sdk class UserApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get User Info # Gets the current user's info. # @param [Hash] opts the optional parameters # @return [GetUserInfoResponse] def get_user_info(opts = {}) data, _status_code, _headers = get_user_info_with_http_info(opts) data end # Get User Info # Gets the current user's info. # @param [Hash] opts the optional parameters # @return [Array<(GetUserInfoResponse, Integer, Hash)>] GetUserInfoResponse data, response status code and response headers def get_user_info_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.get_user_info ...' end # resource path local_var_path = '/user/info' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetUserInfoResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow'] new_options = opts.merge( :operation => :"UserApi.get_user_info", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#get_user_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List User Companies # Lists the companies controlled by the current user. # @param [Hash] opts the optional parameters # @return [ListUserCompaniesResponse] def list_user_companies(opts = {}) data, _status_code, _headers = list_user_companies_with_http_info(opts) data end # List User Companies # Lists the companies controlled by the current user. # @param [Hash] opts the optional parameters # @return [Array<(ListUserCompaniesResponse, Integer, Hash)>] ListUserCompaniesResponse data, response status code and response headers def list_user_companies_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserApi.list_user_companies ...' end # resource path local_var_path = '/user/companies' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListUserCompaniesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow'] new_options = opts.merge( :operation => :"UserApi.list_user_companies", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserApi#list_user_companies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end