osdn-client 0.0.20160304
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/osdn-client.rb +45 -0
- data/lib/osdn-client/api/default_api.rb +148 -0
- data/lib/osdn-client/api/project_api.rb +1752 -0
- data/lib/osdn-client/api/project_frs_api.rb +1033 -0
- data/lib/osdn-client/api/project_news_api.rb +673 -0
- data/lib/osdn-client/api/user_api.rb +76 -0
- data/lib/osdn-client/api_client.rb +318 -0
- data/lib/osdn-client/api_error.rb +24 -0
- data/lib/osdn-client/configuration.rb +177 -0
- data/lib/osdn-client/models/group.rb +298 -0
- data/lib/osdn-client/models/group_tool_flags.rb +236 -0
- data/lib/osdn-client/models/news.rb +206 -0
- data/lib/osdn-client/models/package.rb +198 -0
- data/lib/osdn-client/models/pong.rb +176 -0
- data/lib/osdn-client/models/rel_file.rb +256 -0
- data/lib/osdn-client/models/release.rb +228 -0
- data/lib/osdn-client/models/simple_chamber.rb +176 -0
- data/lib/osdn-client/models/simple_group.rb +176 -0
- data/lib/osdn-client/models/simple_user.rb +166 -0
- data/lib/osdn-client/models/skill.rb +176 -0
- data/lib/osdn-client/models/token.rb +186 -0
- data/lib/osdn-client/models/user.rb +272 -0
- data/lib/osdn-client/version.rb +3 -0
- data/osdn-client.gemspec +32 -0
- data/spec/api/DefaultApi_spec.rb +58 -0
- data/spec/api/ProjectApi_spec.rb +472 -0
- data/spec/api/ProjectFrsApi_spec.rb +285 -0
- data/spec/api/ProjectNewsApi_spec.rb +194 -0
- data/spec/api/UserApi_spec.rb +39 -0
- data/spec/models/GroupToolFlags_spec.rb +124 -0
- data/spec/models/Group_spec.rb +184 -0
- data/spec/models/News_spec.rb +94 -0
- data/spec/models/Package_spec.rb +84 -0
- data/spec/models/Pong_spec.rb +64 -0
- data/spec/models/RelFile_spec.rb +144 -0
- data/spec/models/Release_spec.rb +114 -0
- data/spec/models/SimpleChamber_spec.rb +64 -0
- data/spec/models/SimpleGroup_spec.rb +64 -0
- data/spec/models/SimpleUser_spec.rb +54 -0
- data/spec/models/Skill_spec.rb +64 -0
- data/spec/models/Token_spec.rb +74 -0
- data/spec/models/User_spec.rb +154 -0
- metadata +284 -0
@@ -0,0 +1,673 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
module OSDNClient
|
4
|
+
class ProjectNewsApi
|
5
|
+
attr_accessor :api_client
|
6
|
+
|
7
|
+
def initialize(api_client = ApiClient.default)
|
8
|
+
@api_client = api_client
|
9
|
+
end
|
10
|
+
|
11
|
+
#
|
12
|
+
#
|
13
|
+
# @param [Hash] opts the optional parameters
|
14
|
+
# @option opts [Integer] :group_id filter by group ID
|
15
|
+
# @return [Array<News>]
|
16
|
+
def list_news(opts = {})
|
17
|
+
data, status_code, headers = list_news_with_http_info(opts)
|
18
|
+
return data
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
#
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [Integer] :group_id filter by group ID
|
25
|
+
# @return [Array<(Array<News>, Fixnum, Hash)>] Array<News> data, response status code and response headers
|
26
|
+
def list_news_with_http_info(opts = {})
|
27
|
+
if @api_client.config.debugging
|
28
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#list_news ..."
|
29
|
+
end
|
30
|
+
|
31
|
+
# resource path
|
32
|
+
path = "/news".sub('{format}','json')
|
33
|
+
|
34
|
+
# query parameters
|
35
|
+
query_params = {}
|
36
|
+
query_params[:'group_id'] = opts[:'group_id'] if opts[:'group_id']
|
37
|
+
|
38
|
+
# header parameters
|
39
|
+
header_params = {}
|
40
|
+
|
41
|
+
# HTTP header 'Accept' (if needed)
|
42
|
+
_header_accept = []
|
43
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
44
|
+
|
45
|
+
# HTTP header 'Content-Type'
|
46
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
47
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
48
|
+
|
49
|
+
# form parameters
|
50
|
+
form_params = {}
|
51
|
+
|
52
|
+
# http body (model)
|
53
|
+
post_body = nil
|
54
|
+
|
55
|
+
|
56
|
+
auth_names = ['oauth2-implicit']
|
57
|
+
data, status_code, headers = @api_client.call_api(:GET, path,
|
58
|
+
:header_params => header_params,
|
59
|
+
:query_params => query_params,
|
60
|
+
:form_params => form_params,
|
61
|
+
:body => post_body,
|
62
|
+
:auth_names => auth_names,
|
63
|
+
:return_type => 'Array<News>')
|
64
|
+
if @api_client.config.debugging
|
65
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#list_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
66
|
+
end
|
67
|
+
return data, status_code, headers
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
#
|
72
|
+
# @param title news title
|
73
|
+
# @param body news body in OSDN Wiki format.
|
74
|
+
# @param group_id group_id the news created in
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @return [String]
|
77
|
+
def create_news(title, body, group_id, opts = {})
|
78
|
+
data, status_code, headers = create_news_with_http_info(title, body, group_id, opts)
|
79
|
+
return data
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
#
|
84
|
+
# @param title news title
|
85
|
+
# @param body news body in OSDN Wiki format.
|
86
|
+
# @param group_id group_id the news created in
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
89
|
+
def create_news_with_http_info(title, body, group_id, opts = {})
|
90
|
+
if @api_client.config.debugging
|
91
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#create_news ..."
|
92
|
+
end
|
93
|
+
|
94
|
+
# verify the required parameter 'title' is set
|
95
|
+
fail "Missing the required parameter 'title' when calling create_news" if title.nil?
|
96
|
+
|
97
|
+
# verify the required parameter 'body' is set
|
98
|
+
fail "Missing the required parameter 'body' when calling create_news" if body.nil?
|
99
|
+
|
100
|
+
# verify the required parameter 'group_id' is set
|
101
|
+
fail "Missing the required parameter 'group_id' when calling create_news" if group_id.nil?
|
102
|
+
|
103
|
+
# resource path
|
104
|
+
path = "/news".sub('{format}','json')
|
105
|
+
|
106
|
+
# query parameters
|
107
|
+
query_params = {}
|
108
|
+
query_params[:'group_id'] = group_id
|
109
|
+
|
110
|
+
# header parameters
|
111
|
+
header_params = {}
|
112
|
+
|
113
|
+
# HTTP header 'Accept' (if needed)
|
114
|
+
_header_accept = []
|
115
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
116
|
+
|
117
|
+
# HTTP header 'Content-Type'
|
118
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
119
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
120
|
+
|
121
|
+
# form parameters
|
122
|
+
form_params = {}
|
123
|
+
form_params["title"] = title
|
124
|
+
form_params["body"] = body
|
125
|
+
|
126
|
+
# http body (model)
|
127
|
+
post_body = nil
|
128
|
+
|
129
|
+
|
130
|
+
auth_names = ['oauth2-implicit']
|
131
|
+
data, status_code, headers = @api_client.call_api(:POST, path,
|
132
|
+
:header_params => header_params,
|
133
|
+
:query_params => query_params,
|
134
|
+
:form_params => form_params,
|
135
|
+
:body => post_body,
|
136
|
+
:auth_names => auth_names,
|
137
|
+
:return_type => 'String')
|
138
|
+
if @api_client.config.debugging
|
139
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#create_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
140
|
+
end
|
141
|
+
return data, status_code, headers
|
142
|
+
end
|
143
|
+
|
144
|
+
#
|
145
|
+
# Get single news object.
|
146
|
+
# @param news_id
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @return [News]
|
149
|
+
def get_news(news_id, opts = {})
|
150
|
+
data, status_code, headers = get_news_with_http_info(news_id, opts)
|
151
|
+
return data
|
152
|
+
end
|
153
|
+
|
154
|
+
#
|
155
|
+
# Get single news object.
|
156
|
+
# @param news_id
|
157
|
+
# @param [Hash] opts the optional parameters
|
158
|
+
# @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
|
159
|
+
def get_news_with_http_info(news_id, opts = {})
|
160
|
+
if @api_client.config.debugging
|
161
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#get_news ..."
|
162
|
+
end
|
163
|
+
|
164
|
+
# verify the required parameter 'news_id' is set
|
165
|
+
fail "Missing the required parameter 'news_id' when calling get_news" if news_id.nil?
|
166
|
+
|
167
|
+
# resource path
|
168
|
+
path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)
|
169
|
+
|
170
|
+
# query parameters
|
171
|
+
query_params = {}
|
172
|
+
|
173
|
+
# header parameters
|
174
|
+
header_params = {}
|
175
|
+
|
176
|
+
# HTTP header 'Accept' (if needed)
|
177
|
+
_header_accept = []
|
178
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
179
|
+
|
180
|
+
# HTTP header 'Content-Type'
|
181
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
182
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
183
|
+
|
184
|
+
# form parameters
|
185
|
+
form_params = {}
|
186
|
+
|
187
|
+
# http body (model)
|
188
|
+
post_body = nil
|
189
|
+
|
190
|
+
|
191
|
+
auth_names = ['oauth2-implicit']
|
192
|
+
data, status_code, headers = @api_client.call_api(:GET, path,
|
193
|
+
:header_params => header_params,
|
194
|
+
:query_params => query_params,
|
195
|
+
:form_params => form_params,
|
196
|
+
:body => post_body,
|
197
|
+
:auth_names => auth_names,
|
198
|
+
:return_type => 'News')
|
199
|
+
if @api_client.config.debugging
|
200
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#get_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
201
|
+
end
|
202
|
+
return data, status_code, headers
|
203
|
+
end
|
204
|
+
|
205
|
+
#
|
206
|
+
#
|
207
|
+
# @param news_id
|
208
|
+
# @param [Hash] opts the optional parameters
|
209
|
+
# @return [nil]
|
210
|
+
def delete_news(news_id, opts = {})
|
211
|
+
delete_news_with_http_info(news_id, opts)
|
212
|
+
return nil
|
213
|
+
end
|
214
|
+
|
215
|
+
#
|
216
|
+
#
|
217
|
+
# @param news_id
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
220
|
+
def delete_news_with_http_info(news_id, opts = {})
|
221
|
+
if @api_client.config.debugging
|
222
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#delete_news ..."
|
223
|
+
end
|
224
|
+
|
225
|
+
# verify the required parameter 'news_id' is set
|
226
|
+
fail "Missing the required parameter 'news_id' when calling delete_news" if news_id.nil?
|
227
|
+
|
228
|
+
# resource path
|
229
|
+
path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)
|
230
|
+
|
231
|
+
# query parameters
|
232
|
+
query_params = {}
|
233
|
+
|
234
|
+
# header parameters
|
235
|
+
header_params = {}
|
236
|
+
|
237
|
+
# HTTP header 'Accept' (if needed)
|
238
|
+
_header_accept = []
|
239
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
240
|
+
|
241
|
+
# HTTP header 'Content-Type'
|
242
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
243
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
244
|
+
|
245
|
+
# form parameters
|
246
|
+
form_params = {}
|
247
|
+
|
248
|
+
# http body (model)
|
249
|
+
post_body = nil
|
250
|
+
|
251
|
+
|
252
|
+
auth_names = ['oauth2-implicit']
|
253
|
+
data, status_code, headers = @api_client.call_api(:DELETE, path,
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names)
|
259
|
+
if @api_client.config.debugging
|
260
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#delete_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
261
|
+
end
|
262
|
+
return data, status_code, headers
|
263
|
+
end
|
264
|
+
|
265
|
+
#
|
266
|
+
#
|
267
|
+
# @param news_id
|
268
|
+
# @param [Hash] opts the optional parameters
|
269
|
+
# @option opts [String] :title news title
|
270
|
+
# @option opts [String] :body news body in OSDN Wiki format.
|
271
|
+
# @return [News]
|
272
|
+
def update_news(news_id, opts = {})
|
273
|
+
data, status_code, headers = update_news_with_http_info(news_id, opts)
|
274
|
+
return data
|
275
|
+
end
|
276
|
+
|
277
|
+
#
|
278
|
+
#
|
279
|
+
# @param news_id
|
280
|
+
# @param [Hash] opts the optional parameters
|
281
|
+
# @option opts [String] :title news title
|
282
|
+
# @option opts [String] :body news body in OSDN Wiki format.
|
283
|
+
# @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
|
284
|
+
def update_news_with_http_info(news_id, opts = {})
|
285
|
+
if @api_client.config.debugging
|
286
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#update_news ..."
|
287
|
+
end
|
288
|
+
|
289
|
+
# verify the required parameter 'news_id' is set
|
290
|
+
fail "Missing the required parameter 'news_id' when calling update_news" if news_id.nil?
|
291
|
+
|
292
|
+
# resource path
|
293
|
+
path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)
|
294
|
+
|
295
|
+
# query parameters
|
296
|
+
query_params = {}
|
297
|
+
|
298
|
+
# header parameters
|
299
|
+
header_params = {}
|
300
|
+
|
301
|
+
# HTTP header 'Accept' (if needed)
|
302
|
+
_header_accept = []
|
303
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
304
|
+
|
305
|
+
# HTTP header 'Content-Type'
|
306
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
307
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
308
|
+
|
309
|
+
# form parameters
|
310
|
+
form_params = {}
|
311
|
+
form_params["title"] = opts[:'title'] if opts[:'title']
|
312
|
+
form_params["body"] = opts[:'body'] if opts[:'body']
|
313
|
+
|
314
|
+
# http body (model)
|
315
|
+
post_body = nil
|
316
|
+
|
317
|
+
|
318
|
+
auth_names = ['oauth2-implicit']
|
319
|
+
data, status_code, headers = @api_client.call_api(:PATCH, path,
|
320
|
+
:header_params => header_params,
|
321
|
+
:query_params => query_params,
|
322
|
+
:form_params => form_params,
|
323
|
+
:body => post_body,
|
324
|
+
:auth_names => auth_names,
|
325
|
+
:return_type => 'News')
|
326
|
+
if @api_client.config.debugging
|
327
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#update_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
328
|
+
end
|
329
|
+
return data, status_code, headers
|
330
|
+
end
|
331
|
+
|
332
|
+
#
|
333
|
+
# Get news list of spscified project.
|
334
|
+
# @param id_or_name numeric project id or project name
|
335
|
+
# @param [Hash] opts the optional parameters
|
336
|
+
# @return [Array<News>]
|
337
|
+
def list_news_0(id_or_name, opts = {})
|
338
|
+
data, status_code, headers = list_news_0_with_http_info(id_or_name, opts)
|
339
|
+
return data
|
340
|
+
end
|
341
|
+
|
342
|
+
#
|
343
|
+
# Get news list of spscified project.
|
344
|
+
# @param id_or_name numeric project id or project name
|
345
|
+
# @param [Hash] opts the optional parameters
|
346
|
+
# @return [Array<(Array<News>, Fixnum, Hash)>] Array<News> data, response status code and response headers
|
347
|
+
def list_news_0_with_http_info(id_or_name, opts = {})
|
348
|
+
if @api_client.config.debugging
|
349
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#list_news_0 ..."
|
350
|
+
end
|
351
|
+
|
352
|
+
# verify the required parameter 'id_or_name' is set
|
353
|
+
fail "Missing the required parameter 'id_or_name' when calling list_news_0" if id_or_name.nil?
|
354
|
+
|
355
|
+
# resource path
|
356
|
+
path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
|
357
|
+
|
358
|
+
# query parameters
|
359
|
+
query_params = {}
|
360
|
+
|
361
|
+
# header parameters
|
362
|
+
header_params = {}
|
363
|
+
|
364
|
+
# HTTP header 'Accept' (if needed)
|
365
|
+
_header_accept = []
|
366
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
367
|
+
|
368
|
+
# HTTP header 'Content-Type'
|
369
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
370
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
371
|
+
|
372
|
+
# form parameters
|
373
|
+
form_params = {}
|
374
|
+
|
375
|
+
# http body (model)
|
376
|
+
post_body = nil
|
377
|
+
|
378
|
+
|
379
|
+
auth_names = ['oauth2-implicit']
|
380
|
+
data, status_code, headers = @api_client.call_api(:GET, path,
|
381
|
+
:header_params => header_params,
|
382
|
+
:query_params => query_params,
|
383
|
+
:form_params => form_params,
|
384
|
+
:body => post_body,
|
385
|
+
:auth_names => auth_names,
|
386
|
+
:return_type => 'Array<News>')
|
387
|
+
if @api_client.config.debugging
|
388
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#list_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
389
|
+
end
|
390
|
+
return data, status_code, headers
|
391
|
+
end
|
392
|
+
|
393
|
+
#
|
394
|
+
#
|
395
|
+
# @param id_or_name numeric project id or project name
|
396
|
+
# @param title news title
|
397
|
+
# @param body news body in OSDN Wiki format.
|
398
|
+
# @param [Hash] opts the optional parameters
|
399
|
+
# @return [String]
|
400
|
+
def create_news_0(id_or_name, title, body, opts = {})
|
401
|
+
data, status_code, headers = create_news_0_with_http_info(id_or_name, title, body, opts)
|
402
|
+
return data
|
403
|
+
end
|
404
|
+
|
405
|
+
#
|
406
|
+
#
|
407
|
+
# @param id_or_name numeric project id or project name
|
408
|
+
# @param title news title
|
409
|
+
# @param body news body in OSDN Wiki format.
|
410
|
+
# @param [Hash] opts the optional parameters
|
411
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
412
|
+
def create_news_0_with_http_info(id_or_name, title, body, opts = {})
|
413
|
+
if @api_client.config.debugging
|
414
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#create_news_0 ..."
|
415
|
+
end
|
416
|
+
|
417
|
+
# verify the required parameter 'id_or_name' is set
|
418
|
+
fail "Missing the required parameter 'id_or_name' when calling create_news_0" if id_or_name.nil?
|
419
|
+
|
420
|
+
# verify the required parameter 'title' is set
|
421
|
+
fail "Missing the required parameter 'title' when calling create_news_0" if title.nil?
|
422
|
+
|
423
|
+
# verify the required parameter 'body' is set
|
424
|
+
fail "Missing the required parameter 'body' when calling create_news_0" if body.nil?
|
425
|
+
|
426
|
+
# resource path
|
427
|
+
path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
|
428
|
+
|
429
|
+
# query parameters
|
430
|
+
query_params = {}
|
431
|
+
|
432
|
+
# header parameters
|
433
|
+
header_params = {}
|
434
|
+
|
435
|
+
# HTTP header 'Accept' (if needed)
|
436
|
+
_header_accept = []
|
437
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
438
|
+
|
439
|
+
# HTTP header 'Content-Type'
|
440
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
441
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
442
|
+
|
443
|
+
# form parameters
|
444
|
+
form_params = {}
|
445
|
+
form_params["title"] = title
|
446
|
+
form_params["body"] = body
|
447
|
+
|
448
|
+
# http body (model)
|
449
|
+
post_body = nil
|
450
|
+
|
451
|
+
|
452
|
+
auth_names = ['oauth2-implicit']
|
453
|
+
data, status_code, headers = @api_client.call_api(:POST, path,
|
454
|
+
:header_params => header_params,
|
455
|
+
:query_params => query_params,
|
456
|
+
:form_params => form_params,
|
457
|
+
:body => post_body,
|
458
|
+
:auth_names => auth_names,
|
459
|
+
:return_type => 'String')
|
460
|
+
if @api_client.config.debugging
|
461
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#create_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
462
|
+
end
|
463
|
+
return data, status_code, headers
|
464
|
+
end
|
465
|
+
|
466
|
+
#
|
467
|
+
# Get single news object.
|
468
|
+
# @param id_or_name numeric project id or project name
|
469
|
+
# @param news_id
|
470
|
+
# @param [Hash] opts the optional parameters
|
471
|
+
# @return [News]
|
472
|
+
def get_news_0(id_or_name, news_id, opts = {})
|
473
|
+
data, status_code, headers = get_news_0_with_http_info(id_or_name, news_id, opts)
|
474
|
+
return data
|
475
|
+
end
|
476
|
+
|
477
|
+
#
|
478
|
+
# Get single news object.
|
479
|
+
# @param id_or_name numeric project id or project name
|
480
|
+
# @param news_id
|
481
|
+
# @param [Hash] opts the optional parameters
|
482
|
+
# @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
|
483
|
+
def get_news_0_with_http_info(id_or_name, news_id, opts = {})
|
484
|
+
if @api_client.config.debugging
|
485
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#get_news_0 ..."
|
486
|
+
end
|
487
|
+
|
488
|
+
# verify the required parameter 'id_or_name' is set
|
489
|
+
fail "Missing the required parameter 'id_or_name' when calling get_news_0" if id_or_name.nil?
|
490
|
+
|
491
|
+
# verify the required parameter 'news_id' is set
|
492
|
+
fail "Missing the required parameter 'news_id' when calling get_news_0" if news_id.nil?
|
493
|
+
|
494
|
+
# resource path
|
495
|
+
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)
|
496
|
+
|
497
|
+
# query parameters
|
498
|
+
query_params = {}
|
499
|
+
|
500
|
+
# header parameters
|
501
|
+
header_params = {}
|
502
|
+
|
503
|
+
# HTTP header 'Accept' (if needed)
|
504
|
+
_header_accept = []
|
505
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
506
|
+
|
507
|
+
# HTTP header 'Content-Type'
|
508
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
509
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
510
|
+
|
511
|
+
# form parameters
|
512
|
+
form_params = {}
|
513
|
+
|
514
|
+
# http body (model)
|
515
|
+
post_body = nil
|
516
|
+
|
517
|
+
|
518
|
+
auth_names = ['oauth2-implicit']
|
519
|
+
data, status_code, headers = @api_client.call_api(:GET, path,
|
520
|
+
:header_params => header_params,
|
521
|
+
:query_params => query_params,
|
522
|
+
:form_params => form_params,
|
523
|
+
:body => post_body,
|
524
|
+
:auth_names => auth_names,
|
525
|
+
:return_type => 'News')
|
526
|
+
if @api_client.config.debugging
|
527
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#get_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
528
|
+
end
|
529
|
+
return data, status_code, headers
|
530
|
+
end
|
531
|
+
|
532
|
+
#
|
533
|
+
#
|
534
|
+
# @param id_or_name numeric project id or project name
|
535
|
+
# @param news_id
|
536
|
+
# @param [Hash] opts the optional parameters
|
537
|
+
# @return [nil]
|
538
|
+
def delete_news_0(id_or_name, news_id, opts = {})
|
539
|
+
delete_news_0_with_http_info(id_or_name, news_id, opts)
|
540
|
+
return nil
|
541
|
+
end
|
542
|
+
|
543
|
+
#
|
544
|
+
#
|
545
|
+
# @param id_or_name numeric project id or project name
|
546
|
+
# @param news_id
|
547
|
+
# @param [Hash] opts the optional parameters
|
548
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
549
|
+
def delete_news_0_with_http_info(id_or_name, news_id, opts = {})
|
550
|
+
if @api_client.config.debugging
|
551
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#delete_news_0 ..."
|
552
|
+
end
|
553
|
+
|
554
|
+
# verify the required parameter 'id_or_name' is set
|
555
|
+
fail "Missing the required parameter 'id_or_name' when calling delete_news_0" if id_or_name.nil?
|
556
|
+
|
557
|
+
# verify the required parameter 'news_id' is set
|
558
|
+
fail "Missing the required parameter 'news_id' when calling delete_news_0" if news_id.nil?
|
559
|
+
|
560
|
+
# resource path
|
561
|
+
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)
|
562
|
+
|
563
|
+
# query parameters
|
564
|
+
query_params = {}
|
565
|
+
|
566
|
+
# header parameters
|
567
|
+
header_params = {}
|
568
|
+
|
569
|
+
# HTTP header 'Accept' (if needed)
|
570
|
+
_header_accept = []
|
571
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
572
|
+
|
573
|
+
# HTTP header 'Content-Type'
|
574
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
575
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
576
|
+
|
577
|
+
# form parameters
|
578
|
+
form_params = {}
|
579
|
+
|
580
|
+
# http body (model)
|
581
|
+
post_body = nil
|
582
|
+
|
583
|
+
|
584
|
+
auth_names = ['oauth2-implicit']
|
585
|
+
data, status_code, headers = @api_client.call_api(:DELETE, path,
|
586
|
+
:header_params => header_params,
|
587
|
+
:query_params => query_params,
|
588
|
+
:form_params => form_params,
|
589
|
+
:body => post_body,
|
590
|
+
:auth_names => auth_names)
|
591
|
+
if @api_client.config.debugging
|
592
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#delete_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
593
|
+
end
|
594
|
+
return data, status_code, headers
|
595
|
+
end
|
596
|
+
|
597
|
+
#
|
598
|
+
#
|
599
|
+
# @param news_id
|
600
|
+
# @param id_or_name numeric project id or project name
|
601
|
+
# @param [Hash] opts the optional parameters
|
602
|
+
# @option opts [String] :title news title
|
603
|
+
# @option opts [String] :body news body in OSDN Wiki format.
|
604
|
+
# @return [News]
|
605
|
+
def update_news_0(news_id, id_or_name, opts = {})
|
606
|
+
data, status_code, headers = update_news_0_with_http_info(news_id, id_or_name, opts)
|
607
|
+
return data
|
608
|
+
end
|
609
|
+
|
610
|
+
#
|
611
|
+
#
|
612
|
+
# @param news_id
|
613
|
+
# @param id_or_name numeric project id or project name
|
614
|
+
# @param [Hash] opts the optional parameters
|
615
|
+
# @option opts [String] :title news title
|
616
|
+
# @option opts [String] :body news body in OSDN Wiki format.
|
617
|
+
# @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
|
618
|
+
def update_news_0_with_http_info(news_id, id_or_name, opts = {})
|
619
|
+
if @api_client.config.debugging
|
620
|
+
@api_client.config.logger.debug "Calling API: ProjectNewsApi#update_news_0 ..."
|
621
|
+
end
|
622
|
+
|
623
|
+
# verify the required parameter 'news_id' is set
|
624
|
+
fail "Missing the required parameter 'news_id' when calling update_news_0" if news_id.nil?
|
625
|
+
|
626
|
+
# verify the required parameter 'id_or_name' is set
|
627
|
+
fail "Missing the required parameter 'id_or_name' when calling update_news_0" if id_or_name.nil?
|
628
|
+
|
629
|
+
# resource path
|
630
|
+
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)
|
631
|
+
|
632
|
+
# query parameters
|
633
|
+
query_params = {}
|
634
|
+
|
635
|
+
# header parameters
|
636
|
+
header_params = {}
|
637
|
+
|
638
|
+
# HTTP header 'Accept' (if needed)
|
639
|
+
_header_accept = []
|
640
|
+
_header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
641
|
+
|
642
|
+
# HTTP header 'Content-Type'
|
643
|
+
_header_content_type = ['application/x-www-form-urlencoded']
|
644
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
|
645
|
+
|
646
|
+
# form parameters
|
647
|
+
form_params = {}
|
648
|
+
form_params["title"] = opts[:'title'] if opts[:'title']
|
649
|
+
form_params["body"] = opts[:'body'] if opts[:'body']
|
650
|
+
|
651
|
+
# http body (model)
|
652
|
+
post_body = nil
|
653
|
+
|
654
|
+
|
655
|
+
auth_names = ['oauth2-implicit']
|
656
|
+
data, status_code, headers = @api_client.call_api(:PATCH, path,
|
657
|
+
:header_params => header_params,
|
658
|
+
:query_params => query_params,
|
659
|
+
:form_params => form_params,
|
660
|
+
:body => post_body,
|
661
|
+
:auth_names => auth_names,
|
662
|
+
:return_type => 'News')
|
663
|
+
if @api_client.config.debugging
|
664
|
+
@api_client.config.logger.debug "API called: ProjectNewsApi#update_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
665
|
+
end
|
666
|
+
return data, status_code, headers
|
667
|
+
end
|
668
|
+
end
|
669
|
+
end
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
|