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