class OSDNClient::UserApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/osdn-client/api/user_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_user(id_or_name, opts = {}) click to toggle source

Get user profile. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [User]

# File lib/osdn-client/api/user_api.rb, line 39
def get_user(id_or_name, opts = {})
  data, _status_code, _headers = get_user_with_http_info(id_or_name, opts)
  return data
end
get_user_history(id_or_name, opts = {}) click to toggle source

get user monthly stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<History>]

# File lib/osdn-client/api/user_api.rb, line 96
def get_user_history(id_or_name, opts = {})
  data, _status_code, _headers = get_user_history_with_http_info(id_or_name, opts)
  return data
end
get_user_history_with_http_info(id_or_name, opts = {}) click to toggle source

get user monthly stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<(Array<History>, Fixnum, Hash)>] Array<History> data, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 106
def get_user_history_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.get_user_history ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.get_user_history" if id_or_name.nil?
  # resource path
  local_var_path = "/user/{id_or_name}/history".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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 => 'Array<History>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_stats_daily(id_or_name, opts = {}) click to toggle source

get user daily stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<UserStats>]

# File lib/osdn-client/api/user_api.rb, line 153
def get_user_stats_daily(id_or_name, opts = {})
  data, _status_code, _headers = get_user_stats_daily_with_http_info(id_or_name, opts)
  return data
end
get_user_stats_daily_with_http_info(id_or_name, opts = {}) click to toggle source

get user daily stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<(Array<UserStats>, Fixnum, Hash)>] Array<UserStats> data, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 163
def get_user_stats_daily_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.get_user_stats_daily ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.get_user_stats_daily" if id_or_name.nil?
  # resource path
  local_var_path = "/user/{id_or_name}/stats/daily".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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 => 'Array<UserStats>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user_stats_daily\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_stats_monthly(id_or_name, opts = {}) click to toggle source

get user monthly stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<UserStats>]

# File lib/osdn-client/api/user_api.rb, line 210
def get_user_stats_monthly(id_or_name, opts = {})
  data, _status_code, _headers = get_user_stats_monthly_with_http_info(id_or_name, opts)
  return data
end
get_user_stats_monthly_with_http_info(id_or_name, opts = {}) click to toggle source

get user monthly stats. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<(Array<UserStats>, Fixnum, Hash)>] Array<UserStats> data, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 220
def get_user_stats_monthly_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.get_user_stats_monthly ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.get_user_stats_monthly" if id_or_name.nil?
  # resource path
  local_var_path = "/user/{id_or_name}/stats/monthly".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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 => 'Array<UserStats>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user_stats_monthly\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_user_with_http_info(id_or_name, opts = {}) click to toggle source

Get user profile. @param id_or_name numeric user id or user name @param [Hash] opts the optional parameters @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 49
def get_user_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.get_user ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.get_user" if id_or_name.nil?
  # resource path
  local_var_path = "/user/{id_or_name}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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 => 'User')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_user_icon(id_or_name, image, opts = {}) click to toggle source

Update user icon, the image will be resized to 12x12 automatically. @param id_or_name numeric user id or user name @param image The image data to update, you need to send with multipart/form-data. @param [Hash] opts the optional parameters @return [nil]

# File lib/osdn-client/api/user_api.rb, line 268
def update_user_icon(id_or_name, image, opts = {})
  update_user_icon_with_http_info(id_or_name, image, opts)
  return nil
end
update_user_icon_with_http_info(id_or_name, image, opts = {}) click to toggle source

Update user icon, the image will be resized to 12x12 automatically. @param id_or_name numeric user id or user name @param image The image data to update, you need to send with multipart/form-data. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 279
def update_user_icon_with_http_info(id_or_name, image, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.update_user_icon ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.update_user_icon" if id_or_name.nil?
  # verify the required parameter 'image' is set
  fail ArgumentError, "Missing the required parameter 'image' when calling UserApi.update_user_icon" if image.nil?
  # resource path
  local_var_path = "/user/{id_or_name}/icon".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["image"] = image

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#update_user_icon\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_user_photo(id_or_name, image, opts = {}) click to toggle source

Update user profile photo. @param id_or_name numeric user id or user name @param image The image data to update, you need to send with multipart/form-data. @param [Hash] opts the optional parameters @return [nil]

# File lib/osdn-client/api/user_api.rb, line 329
def update_user_photo(id_or_name, image, opts = {})
  update_user_photo_with_http_info(id_or_name, image, opts)
  return nil
end
update_user_photo_with_http_info(id_or_name, image, opts = {}) click to toggle source

Update user profile photo. @param id_or_name numeric user id or user name @param image The image data to update, you need to send with multipart/form-data. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/osdn-client/api/user_api.rb, line 340
def update_user_photo_with_http_info(id_or_name, image, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserApi.update_user_photo ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.update_user_photo" if id_or_name.nil?
  # verify the required parameter 'image' is set
  fail ArgumentError, "Missing the required parameter 'image' when calling UserApi.update_user_photo" if image.nil?
  # resource path
  local_var_path = "/user/{id_or_name}/photo".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = []
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["image"] = image

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  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)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UserApi#update_user_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end