Class: IndexeaClient::MessageApi

Inherits:
Object
  • Object
show all
Defined in:
lib/indexea_client/api/message_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MessageApi

Returns a new instance of MessageApi.



16
17
18
# File 'lib/indexea_client/api/message_api.rb', line 16

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



14
15
16
# File 'lib/indexea_client/api/message_api.rb', line 14

def api_client
  @api_client
end

Instance Method Details

#message_delete(id, opts = {}) ⇒ BOOLEAN

删除消息 删除消息

Parameters:

  • id

    消息编号

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (BOOLEAN)


24
25
26
27
# File 'lib/indexea_client/api/message_api.rb', line 24

def message_delete(id, opts = {})
  data, _status_code, _headers = message_delete_with_http_info(id, opts)
  data
end

#message_delete_with_http_info(id, opts = {}) ⇒ Array<(BOOLEAN, Integer, Hash)>

删除消息 删除消息

Parameters:

  • id

    消息编号

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BOOLEAN, Integer, Hash)>)

    BOOLEAN data, response status code and response headers



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/indexea_client/api/message_api.rb', line 34

def message_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessageApi.message_delete ...'
  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 MessageApi.message_delete"
  end
  # resource path
  local_var_path = '/accounts/message'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'BOOLEAN' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MessageApi#message_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#message_feedback(content, type, opts = {}) ⇒ BOOLEAN

反馈意见

Parameters:

  • content
  • type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (BOOLEAN)


81
82
83
84
# File 'lib/indexea_client/api/message_api.rb', line 81

def message_feedback(content, type, opts = {})
  data, _status_code, _headers = message_feedback_with_http_info(content, type, opts)
  data
end

#message_feedback_with_http_info(content, type, opts = {}) ⇒ Array<(BOOLEAN, Integer, Hash)>

反馈意见

Parameters:

  • content
  • type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BOOLEAN, Integer, Hash)>)

    BOOLEAN data, response status code and response headers



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/indexea_client/api/message_api.rb', line 91

def message_feedback_with_http_info(content, type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessageApi.message_feedback ...'
  end
  # verify the required parameter 'content' is set
  if @api_client.config.client_side_validation && content.nil?
    fail ArgumentError, "Missing the required parameter 'content' when calling MessageApi.message_feedback"
  end
  # verify the required parameter 'type' is set
  if @api_client.config.client_side_validation && type.nil?
    fail ArgumentError, "Missing the required parameter 'type' when calling MessageApi.message_feedback"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['general', 'bugs', 'feature'].include?(type)
    fail ArgumentError, "invalid value for 'type', must be one of general, bugs, feature"
  end
  # resource path
  local_var_path = '/accounts/feedback'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['content'] = content
  form_params['type'] = type

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'BOOLEAN' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MessageApi#message_feedback\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#message_list(scope, size, opts = {}) ⇒ Messages

获取我相关的消息信息,包括未读消息数量、最新消息等

Parameters:

  • scope
  • size

    消息数量

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    用于翻页的起始位置 (default to 0)

Returns:



150
151
152
153
# File 'lib/indexea_client/api/message_api.rb', line 150

def message_list(scope, size, opts = {})
  data, _status_code, _headers = message_list_with_http_info(scope, size, opts)
  data
end

#message_list_with_http_info(scope, size, opts = {}) ⇒ Array<(Messages, Integer, Hash)>

获取我相关的消息信息,包括未读消息数量、最新消息等

Parameters:

  • scope
  • size

    消息数量

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :from (Integer)

    用于翻页的起始位置

Returns:

  • (Array<(Messages, Integer, Hash)>)

    Messages data, response status code and response headers



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/indexea_client/api/message_api.rb', line 161

def message_list_with_http_info(scope, size, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessageApi.message_list ...'
  end
  # verify the required parameter 'scope' is set
  if @api_client.config.client_side_validation && scope.nil?
    fail ArgumentError, "Missing the required parameter 'scope' when calling MessageApi.message_list"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['all', 'unread', 'read'].include?(scope)
    fail ArgumentError, "invalid value for 'scope', must be one of all, unread, read"
  end
  # verify the required parameter 'size' is set
  if @api_client.config.client_side_validation && size.nil?
    fail ArgumentError, "Missing the required parameter 'size' when calling MessageApi.message_list"
  end
  # resource path
  local_var_path = '/accounts/message'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'scope'] = scope
  query_params[:'size'] = size
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Messages' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MessageApi#message_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#message_read(id, opts = {}) ⇒ Messages

标识消息为已读 标识消息为已读

Parameters:

  • id

    消息编号,多个消息使用逗号隔开

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



218
219
220
221
# File 'lib/indexea_client/api/message_api.rb', line 218

def message_read(id, opts = {})
  data, _status_code, _headers = message_read_with_http_info(id, opts)
  data
end

#message_read_with_http_info(id, opts = {}) ⇒ Array<(Messages, Integer, Hash)>

标识消息为已读 标识消息为已读

Parameters:

  • id

    消息编号,多个消息使用逗号隔开

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Messages, Integer, Hash)>)

    Messages data, response status code and response headers



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/indexea_client/api/message_api.rb', line 228

def message_read_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessageApi.message_read ...'
  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 MessageApi.message_read"
  end
  # resource path
  local_var_path = '/accounts/message'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Messages' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MessageApi#message_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#message_send(receiver, msg, opts = {}) ⇒ Message

发送消息 发送站内消息给某人

Parameters:

  • receiver
  • msg
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



276
277
278
279
# File 'lib/indexea_client/api/message_api.rb', line 276

def message_send(receiver, msg, opts = {})
  data, _status_code, _headers = message_send_with_http_info(receiver, msg, opts)
  data
end

#message_send_with_http_info(receiver, msg, opts = {}) ⇒ Array<(Message, Integer, Hash)>

发送消息 发送站内消息给某人

Parameters:

  • receiver
  • msg
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Message, Integer, Hash)>)

    Message data, response status code and response headers



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/indexea_client/api/message_api.rb', line 287

def message_send_with_http_info(receiver, msg, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: MessageApi.message_send ...'
  end
  # verify the required parameter 'receiver' is set
  if @api_client.config.client_side_validation && receiver.nil?
    fail ArgumentError, "Missing the required parameter 'receiver' when calling MessageApi.message_send"
  end
  # verify the required parameter 'msg' is set
  if @api_client.config.client_side_validation && msg.nil?
    fail ArgumentError, "Missing the required parameter 'msg' when calling MessageApi.message_send"
  end
  # resource path
  local_var_path = '/accounts/message'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[: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/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}
  form_params['receiver'] = receiver
  form_params['msg'] = msg

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'Message' 

  auth_names = opts[:auth_names] || ['TokenAuth']
  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 => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: MessageApi#message_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end