=begin #Tripletex API OpenAPI spec version: 2.69.5 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.24 =end require 'uri' module TripletexRubyClient class ProjectperiodApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get the budget status for the project period # # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [ResponseWrapperProjectBudgetStatus] def get_budget_status(id, opts = {}) data, _status_code, _headers = get_budget_status_with_http_info(id, opts) data end # Get the budget status for the project period # # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [Array<(ResponseWrapperProjectBudgetStatus, Fixnum, Hash)>] ResponseWrapperProjectBudgetStatus data, response status code and response headers def get_budget_status_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.get_budget_status ...' 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 ProjectperiodApi.get_budget_status" end # resource path local_var_path = '/project/{id}/period/budgetStatus'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ResponseWrapperProjectBudgetStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#get_budget_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Find hourlist report by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [ResponseWrapperProjectPeriodHourlyReport] def hourlist_report(date_from, date_to, id, opts = {}) data, _status_code, _headers = hourlist_report_with_http_info(date_from, date_to, id, opts) data end # Find hourlist report by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [Array<(ResponseWrapperProjectPeriodHourlyReport, Fixnum, Hash)>] ResponseWrapperProjectPeriodHourlyReport data, response status code and response headers def hourlist_report_with_http_info(date_from, date_to, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.hourlist_report ...' end # verify the required parameter 'date_from' is set if @api_client.config.client_side_validation && date_from.nil? fail ArgumentError, "Missing the required parameter 'date_from' when calling ProjectperiodApi.hourlist_report" end # verify the required parameter 'date_to' is set if @api_client.config.client_side_validation && date_to.nil? fail ArgumentError, "Missing the required parameter 'date_to' when calling ProjectperiodApi.hourlist_report" 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 ProjectperiodApi.hourlist_report" end # resource path local_var_path = '/project/{id}/period/hourlistReport'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'dateFrom'] = date_from query_params[:'dateTo'] = date_to query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ResponseWrapperProjectPeriodHourlyReport') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#hourlist_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Find invoiced info by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [ResponseWrapperProjectPeriodInvoiced] def invoiced(date_from, date_to, id, opts = {}) data, _status_code, _headers = invoiced_with_http_info(date_from, date_to, id, opts) data end # Find invoiced info by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [Array<(ResponseWrapperProjectPeriodInvoiced, Fixnum, Hash)>] ResponseWrapperProjectPeriodInvoiced data, response status code and response headers def invoiced_with_http_info(date_from, date_to, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.invoiced ...' end # verify the required parameter 'date_from' is set if @api_client.config.client_side_validation && date_from.nil? fail ArgumentError, "Missing the required parameter 'date_from' when calling ProjectperiodApi.invoiced" end # verify the required parameter 'date_to' is set if @api_client.config.client_side_validation && date_to.nil? fail ArgumentError, "Missing the required parameter 'date_to' when calling ProjectperiodApi.invoiced" 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 ProjectperiodApi.invoiced" end # resource path local_var_path = '/project/{id}/period/invoiced'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'dateFrom'] = date_from query_params[:'dateTo'] = date_to query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ResponseWrapperProjectPeriodInvoiced') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#invoiced\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Find invoicing reserve by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [ResponseWrapperProjectPeriodInvoicingReserve] def invoicing_reserve(date_from, date_to, id, opts = {}) data, _status_code, _headers = invoicing_reserve_with_http_info(date_from, date_to, id, opts) data end # Find invoicing reserve by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [Array<(ResponseWrapperProjectPeriodInvoicingReserve, Fixnum, Hash)>] ResponseWrapperProjectPeriodInvoicingReserve data, response status code and response headers def invoicing_reserve_with_http_info(date_from, date_to, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.invoicing_reserve ...' end # verify the required parameter 'date_from' is set if @api_client.config.client_side_validation && date_from.nil? fail ArgumentError, "Missing the required parameter 'date_from' when calling ProjectperiodApi.invoicing_reserve" end # verify the required parameter 'date_to' is set if @api_client.config.client_side_validation && date_to.nil? fail ArgumentError, "Missing the required parameter 'date_to' when calling ProjectperiodApi.invoicing_reserve" 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 ProjectperiodApi.invoicing_reserve" end # resource path local_var_path = '/project/{id}/period/invoicingReserve'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'dateFrom'] = date_from query_params[:'dateTo'] = date_to query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ResponseWrapperProjectPeriodInvoicingReserve') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#invoicing_reserve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Find overall status by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [Integer] :from From index (default to 0) # @option opts [Integer] :count Number of elements to return (default to 1000) # @option opts [String] :sorting Sorting pattern # @option opts [String] :fields Fields filter pattern # @return [ListResponseProjectPeriodMonthlyStatus] def monthly_status(date_from, date_to, id, opts = {}) data, _status_code, _headers = monthly_status_with_http_info(date_from, date_to, id, opts) data end # Find overall status by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [Integer] :from From index # @option opts [Integer] :count Number of elements to return # @option opts [String] :sorting Sorting pattern # @option opts [String] :fields Fields filter pattern # @return [Array<(ListResponseProjectPeriodMonthlyStatus, Fixnum, Hash)>] ListResponseProjectPeriodMonthlyStatus data, response status code and response headers def monthly_status_with_http_info(date_from, date_to, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.monthly_status ...' end # verify the required parameter 'date_from' is set if @api_client.config.client_side_validation && date_from.nil? fail ArgumentError, "Missing the required parameter 'date_from' when calling ProjectperiodApi.monthly_status" end # verify the required parameter 'date_to' is set if @api_client.config.client_side_validation && date_to.nil? fail ArgumentError, "Missing the required parameter 'date_to' when calling ProjectperiodApi.monthly_status" 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 ProjectperiodApi.monthly_status" end # resource path local_var_path = '/project/{id}/period/monthlyStatus'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'dateFrom'] = date_from query_params[:'dateTo'] = date_to query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'sorting'] = opts[:'sorting'] if !opts[:'sorting'].nil? query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ListResponseProjectPeriodMonthlyStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#monthly_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Find overall status by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [ResponseWrapperProjectPeriodOverallStatus] def overall_status(date_from, date_to, id, opts = {}) data, _status_code, _headers = overall_status_with_http_info(date_from, date_to, id, opts) data end # Find overall status by project period. # # @param date_from Format is yyyy-MM-dd (from and incl.). # @param date_to Format is yyyy-MM-dd (to and excl.). # @param id Element ID # @param [Hash] opts the optional parameters # @option opts [String] :fields Fields filter pattern # @return [Array<(ResponseWrapperProjectPeriodOverallStatus, Fixnum, Hash)>] ResponseWrapperProjectPeriodOverallStatus data, response status code and response headers def overall_status_with_http_info(date_from, date_to, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProjectperiodApi.overall_status ...' end # verify the required parameter 'date_from' is set if @api_client.config.client_side_validation && date_from.nil? fail ArgumentError, "Missing the required parameter 'date_from' when calling ProjectperiodApi.overall_status" end # verify the required parameter 'date_to' is set if @api_client.config.client_side_validation && date_to.nil? fail ArgumentError, "Missing the required parameter 'date_to' when calling ProjectperiodApi.overall_status" 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 ProjectperiodApi.overall_status" end # resource path local_var_path = '/project/{id}/period/overallStatus'.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'dateFrom'] = date_from query_params[:'dateTo'] = date_to query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['tokenAuthScheme'] 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 => 'ResponseWrapperProjectPeriodOverallStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: ProjectperiodApi#overall_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end