=begin #Web API Swagger specification #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.0-SNAPSHOT =end require "uri" module GroupDocsPlatformCloud class UsageApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get usage logs for some period. # # @param start The period start. # @param _end The period end. # @param [Hash] opts the optional parameters # @return [File] def usage_get_user_usage(start, _end, opts = {}) data, _status_code, _headers = usage_get_user_usage_with_http_info(start, _end, opts) return data end # Get usage logs for some period. # # @param start The period start. # @param _end The period end. # @param [Hash] opts the optional parameters # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def usage_get_user_usage_with_http_info(start, _end, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageApi.usage_get_user_usage ..." end # verify the required parameter 'start' is set if @api_client.config.client_side_validation && start.nil? fail ArgumentError, "Missing the required parameter 'start' when calling UsageApi.usage_get_user_usage" end # verify the required parameter '_end' is set if @api_client.config.client_side_validation && _end.nil? fail ArgumentError, "Missing the required parameter '_end' when calling UsageApi.usage_get_user_usage" end # resource path local_var_path = "/usage" # query parameters query_params = {} query_params[:'start'] = start query_params[:'end'] = _end # 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 = [] 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageApi#usage_get_user_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get usage for current subscription period. # # @param [Hash] opts the optional parameters # @return [File] def usage_get_user_usage_current_month(opts = {}) data, _status_code, _headers = usage_get_user_usage_current_month_with_http_info(opts) return data end # Get usage for current subscription period. # # @param [Hash] opts the optional parameters # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def usage_get_user_usage_current_month_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageApi.usage_get_user_usage_current_month ..." end # resource path local_var_path = "/usage/currentPeriod" # 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 = [] 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageApi#usage_get_user_usage_current_month\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get summary usage for current subscription period. # # @param [Hash] opts the optional parameters # @return [UserUsageSummaryResponse] def usage_get_user_usage_current_period_summary(opts = {}) data, _status_code, _headers = usage_get_user_usage_current_period_summary_with_http_info(opts) return data end # Get summary usage for current subscription period. # # @param [Hash] opts the optional parameters # @return [Array<(UserUsageSummaryResponse, Fixnum, Hash)>] UserUsageSummaryResponse data, response status code and response headers def usage_get_user_usage_current_period_summary_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageApi.usage_get_user_usage_current_period_summary ..." end # resource path local_var_path = "/usage/summary" # 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 = [] 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 => 'UserUsageSummaryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageApi#usage_get_user_usage_current_period_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get usage logs for previous subscription period. # # @param [Hash] opts the optional parameters # @return [File] def usage_get_user_usage_previous_month(opts = {}) data, _status_code, _headers = usage_get_user_usage_previous_month_with_http_info(opts) return data end # Get usage logs for previous subscription period. # # @param [Hash] opts the optional parameters # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers def usage_get_user_usage_previous_month_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsageApi.usage_get_user_usage_previous_month ..." end # resource path local_var_path = "/usage/previousPeriod" # 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 = [] 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 => 'File') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsageApi#usage_get_user_usage_previous_month\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end