Skip to content

Latest commit

 

History

History
135 lines (92 loc) · 3.03 KB

LastApi.md

File metadata and controls

135 lines (92 loc) · 3.03 KB

EjabberdHttpClient::LastApi

All URIs are relative to http://localhost

Method HTTP request Description
get_last POST /api/get_last Get last activity information.
set_last POST /api/set_last Set last activity information.

get_last

get_last(get_last_request)

Get last activity information.

Examples

require 'time'
require 'ejabberd_http_client'

api_instance = EjabberdHttpClient::LastApi.new
get_last_request = EjabberdHttpClient::GetLastRequest.new # GetLastRequest |

begin
  # Get last activity information.
  result = api_instance.get_last(get_last_request)
  p result
rescue EjabberdHttpClient::ApiError => e
  puts "Error when calling LastApi->get_last: #{e}"
end

Using the get_last_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_last_with_http_info(get_last_request)

begin
  # Get last activity information.
  data, status_code, headers = api_instance.get_last_with_http_info(get_last_request)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <GetLast200Response>
rescue EjabberdHttpClient::ApiError => e
  puts "Error when calling LastApi->get_last_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
get_last_request GetLastRequest

Return type

GetLast200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

set_last

Integer set_last(opts)

Set last activity information.

Examples

require 'time'
require 'ejabberd_http_client'

api_instance = EjabberdHttpClient::LastApi.new
opts = {
  set_last_request: EjabberdHttpClient::SetLastRequest.new # SetLastRequest |
}

begin
  # Set last activity information.
  result = api_instance.set_last(opts)
  p result
rescue EjabberdHttpClient::ApiError => e
  puts "Error when calling LastApi->set_last: #{e}"
end

Using the set_last_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(Integer, Integer, Hash)> set_last_with_http_info(opts)

begin
  # Set last activity information.
  data, status_code, headers = api_instance.set_last_with_http_info(opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => Integer
rescue EjabberdHttpClient::ApiError => e
  puts "Error when calling LastApi->set_last_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
set_last_request SetLastRequest [optional]

Return type

Integer

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json