class OSDNClient::ProjectNewsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

create_news(title, body, group_id, opts = {}) click to toggle source

@param title news title @param body news body in OSDN Wiki format. @param group_id group_id the news created in @param [Hash] opts the optional parameters @return [String]

# File lib/osdn-client/api/project_news_api.rb, line 41
def create_news(title, body, group_id, opts = {})
  data, _status_code, _headers = create_news_with_http_info(title, body, group_id, opts)
  return data
end
create_news_0(id_or_name, title, body, opts = {}) click to toggle source

@param id_or_name numeric project id or project name @param title news title @param body news body in OSDN Wiki format. @param [Hash] opts the optional parameters @return [String]

# File lib/osdn-client/api/project_news_api.rb, line 109
def create_news_0(id_or_name, title, body, opts = {})
  data, _status_code, _headers = create_news_0_with_http_info(id_or_name, title, body, opts)
  return data
end
create_news_0_with_http_info(id_or_name, title, body, opts = {}) click to toggle source

@param id_or_name numeric project id or project name @param title news title @param body news body in OSDN Wiki format. @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 121
def create_news_0_with_http_info(id_or_name, title, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.create_news_0 ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling ProjectNewsApi.create_news_0" if id_or_name.nil?
  # verify the required parameter 'title' is set
  fail ArgumentError, "Missing the required parameter 'title' when calling ProjectNewsApi.create_news_0" if title.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling ProjectNewsApi.create_news_0" if body.nil?
  # resource path
  local_var_path = "/project/{id_or_name}/news".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 = {}
  form_params["title"] = title
  form_params["body"] = body

  # 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,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#create_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_news_with_http_info(title, body, group_id, opts = {}) click to toggle source

@param title news title @param body news body in OSDN Wiki format. @param group_id group_id the news created in @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 53
def create_news_with_http_info(title, body, group_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.create_news ..."
  end
  # verify the required parameter 'title' is set
  fail ArgumentError, "Missing the required parameter 'title' when calling ProjectNewsApi.create_news" if title.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling ProjectNewsApi.create_news" if body.nil?
  # verify the required parameter 'group_id' is set
  fail ArgumentError, "Missing the required parameter 'group_id' when calling ProjectNewsApi.create_news" if group_id.nil?
  # resource path
  local_var_path = "/news".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'group_id'] = group_id

  # 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 = {}
  form_params["title"] = title
  form_params["body"] = body

  # 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,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#create_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_news(news_id, opts = {}) click to toggle source

@param news_id @param [Hash] opts the optional parameters @return [nil]

# File lib/osdn-client/api/project_news_api.rb, line 174
def delete_news(news_id, opts = {})
  delete_news_with_http_info(news_id, opts)
  return nil
end
delete_news_0(id_or_name, news_id, opts = {}) click to toggle source

@param id_or_name numeric project id or project name @param news_id @param [Hash] opts the optional parameters @return [nil]

# File lib/osdn-client/api/project_news_api.rb, line 231
def delete_news_0(id_or_name, news_id, opts = {})
  delete_news_0_with_http_info(id_or_name, news_id, opts)
  return nil
end
delete_news_0_with_http_info(id_or_name, news_id, opts = {}) click to toggle source

@param id_or_name numeric project id or project name @param news_id @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 242
def delete_news_0_with_http_info(id_or_name, news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.delete_news_0 ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling ProjectNewsApi.delete_news_0" if id_or_name.nil?
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.delete_news_0" if news_id.nil?
  # resource path
  local_var_path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'news_id' + '}', news_id.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(:DELETE, 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: ProjectNewsApi#delete_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_news_with_http_info(news_id, opts = {}) click to toggle source

@param news_id @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 184
def delete_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.delete_news ..."
  end
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.delete_news" if news_id.nil?
  # resource path
  local_var_path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.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(:DELETE, 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: ProjectNewsApi#delete_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_news(news_id, opts = {}) click to toggle source

Get single news object. @param news_id @param [Hash] opts the optional parameters @return [News]

# File lib/osdn-client/api/project_news_api.rb, line 290
def get_news(news_id, opts = {})
  data, _status_code, _headers = get_news_with_http_info(news_id, opts)
  return data
end
get_news_0(id_or_name, news_id, opts = {}) click to toggle source

Get single news object. @param id_or_name numeric project id or project name @param news_id @param [Hash] opts the optional parameters @return [News]

# File lib/osdn-client/api/project_news_api.rb, line 348
def get_news_0(id_or_name, news_id, opts = {})
  data, _status_code, _headers = get_news_0_with_http_info(id_or_name, news_id, opts)
  return data
end
get_news_0_with_http_info(id_or_name, news_id, opts = {}) click to toggle source

Get single news object. @param id_or_name numeric project id or project name @param news_id @param [Hash] opts the optional parameters @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 359
def get_news_0_with_http_info(id_or_name, news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.get_news_0 ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling ProjectNewsApi.get_news_0" if id_or_name.nil?
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.get_news_0" if news_id.nil?
  # resource path
  local_var_path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'news_id' + '}', news_id.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 => 'News')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#get_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_news_with_http_info(news_id, opts = {}) click to toggle source

Get single news object. @param news_id @param [Hash] opts the optional parameters @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 300
def get_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.get_news ..."
  end
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.get_news" if news_id.nil?
  # resource path
  local_var_path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.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 => 'News')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#get_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_news(opts = {}) click to toggle source

@param [Hash] opts the optional parameters @option opts [Integer] :group_id filter by group ID @return [Array<News>]

# File lib/osdn-client/api/project_news_api.rb, line 408
def list_news(opts = {})
  data, _status_code, _headers = list_news_with_http_info(opts)
  return data
end
list_news_0(id_or_name, opts = {}) click to toggle source

Get news list of spscified project. @param id_or_name numeric project id or project name @param [Hash] opts the optional parameters @return [Array<News>]

# File lib/osdn-client/api/project_news_api.rb, line 464
def list_news_0(id_or_name, opts = {})
  data, _status_code, _headers = list_news_0_with_http_info(id_or_name, opts)
  return data
end
list_news_0_with_http_info(id_or_name, opts = {}) click to toggle source

Get news list of spscified project. @param id_or_name numeric project id or project name @param [Hash] opts the optional parameters @return [Array<(Array<News>, Fixnum, Hash)>] Array<News> data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 474
def list_news_0_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.list_news_0 ..."
  end
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling ProjectNewsApi.list_news_0" if id_or_name.nil?
  # resource path
  local_var_path = "/project/{id_or_name}/news".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<News>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#list_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_news_with_http_info(opts = {}) click to toggle source

@param [Hash] opts the optional parameters @option opts [Integer] :group_id filter by group ID @return [Array<(Array<News>, Fixnum, Hash)>] Array<News> data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 418
def list_news_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.list_news ..."
  end
  # resource path
  local_var_path = "/news".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'group_id'] = opts[:'group_id'] if !opts[:'group_id'].nil?

  # 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<News>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#list_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_news(news_id, opts = {}) click to toggle source

@param news_id @param [Hash] opts the optional parameters @option opts [String] :title news title @option opts [String] :body news body in OSDN Wiki format. @return [News]

# File lib/osdn-client/api/project_news_api.rb, line 523
def update_news(news_id, opts = {})
  data, _status_code, _headers = update_news_with_http_info(news_id, opts)
  return data
end
update_news_0(news_id, id_or_name, opts = {}) click to toggle source

@param news_id @param id_or_name numeric project id or project name @param [Hash] opts the optional parameters @option opts [String] :title news title @option opts [String] :body news body in OSDN Wiki format. @return [News]

# File lib/osdn-client/api/project_news_api.rb, line 587
def update_news_0(news_id, id_or_name, opts = {})
  data, _status_code, _headers = update_news_0_with_http_info(news_id, id_or_name, opts)
  return data
end
update_news_0_with_http_info(news_id, id_or_name, opts = {}) click to toggle source

@param news_id @param id_or_name numeric project id or project name @param [Hash] opts the optional parameters @option opts [String] :title news title @option opts [String] :body news body in OSDN Wiki format. @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 600
def update_news_0_with_http_info(news_id, id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.update_news_0 ..."
  end
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.update_news_0" if news_id.nil?
  # verify the required parameter 'id_or_name' is set
  fail ArgumentError, "Missing the required parameter 'id_or_name' when calling ProjectNewsApi.update_news_0" if id_or_name.nil?
  # resource path
  local_var_path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s).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 = {}
  form_params["title"] = opts[:'title'] if !opts[:'title'].nil?
  form_params["body"] = opts[:'body'] if !opts[:'body'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'News')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#update_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_news_with_http_info(news_id, opts = {}) click to toggle source

@param news_id @param [Hash] opts the optional parameters @option opts [String] :title news title @option opts [String] :body news body in OSDN Wiki format. @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers

# File lib/osdn-client/api/project_news_api.rb, line 535
def update_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi.update_news ..."
  end
  # verify the required parameter 'news_id' is set
  fail ArgumentError, "Missing the required parameter 'news_id' when calling ProjectNewsApi.update_news" if news_id.nil?
  # resource path
  local_var_path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.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 = {}
  form_params["title"] = opts[:'title'] if !opts[:'title'].nil?
  form_params["body"] = opts[:'body'] if !opts[:'body'].nil?

  # http body (model)
  post_body = nil
  auth_names = ['oauth2-code', 'oauth2-implicit']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'News')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProjectNewsApi#update_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end