osdn-client 0.0.20160304

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/lib/osdn-client.rb +45 -0
  3. data/lib/osdn-client/api/default_api.rb +148 -0
  4. data/lib/osdn-client/api/project_api.rb +1752 -0
  5. data/lib/osdn-client/api/project_frs_api.rb +1033 -0
  6. data/lib/osdn-client/api/project_news_api.rb +673 -0
  7. data/lib/osdn-client/api/user_api.rb +76 -0
  8. data/lib/osdn-client/api_client.rb +318 -0
  9. data/lib/osdn-client/api_error.rb +24 -0
  10. data/lib/osdn-client/configuration.rb +177 -0
  11. data/lib/osdn-client/models/group.rb +298 -0
  12. data/lib/osdn-client/models/group_tool_flags.rb +236 -0
  13. data/lib/osdn-client/models/news.rb +206 -0
  14. data/lib/osdn-client/models/package.rb +198 -0
  15. data/lib/osdn-client/models/pong.rb +176 -0
  16. data/lib/osdn-client/models/rel_file.rb +256 -0
  17. data/lib/osdn-client/models/release.rb +228 -0
  18. data/lib/osdn-client/models/simple_chamber.rb +176 -0
  19. data/lib/osdn-client/models/simple_group.rb +176 -0
  20. data/lib/osdn-client/models/simple_user.rb +166 -0
  21. data/lib/osdn-client/models/skill.rb +176 -0
  22. data/lib/osdn-client/models/token.rb +186 -0
  23. data/lib/osdn-client/models/user.rb +272 -0
  24. data/lib/osdn-client/version.rb +3 -0
  25. data/osdn-client.gemspec +32 -0
  26. data/spec/api/DefaultApi_spec.rb +58 -0
  27. data/spec/api/ProjectApi_spec.rb +472 -0
  28. data/spec/api/ProjectFrsApi_spec.rb +285 -0
  29. data/spec/api/ProjectNewsApi_spec.rb +194 -0
  30. data/spec/api/UserApi_spec.rb +39 -0
  31. data/spec/models/GroupToolFlags_spec.rb +124 -0
  32. data/spec/models/Group_spec.rb +184 -0
  33. data/spec/models/News_spec.rb +94 -0
  34. data/spec/models/Package_spec.rb +84 -0
  35. data/spec/models/Pong_spec.rb +64 -0
  36. data/spec/models/RelFile_spec.rb +144 -0
  37. data/spec/models/Release_spec.rb +114 -0
  38. data/spec/models/SimpleChamber_spec.rb +64 -0
  39. data/spec/models/SimpleGroup_spec.rb +64 -0
  40. data/spec/models/SimpleUser_spec.rb +54 -0
  41. data/spec/models/Skill_spec.rb +64 -0
  42. data/spec/models/Token_spec.rb +74 -0
  43. data/spec/models/User_spec.rb +154 -0
  44. metadata +284 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4333bcb030a0193de28d7f1c701bc262bd15443b
4
+ data.tar.gz: 248daa14b9b13b10d7052aa8b72bd9766a081d47
5
+ SHA512:
6
+ metadata.gz: ba7549ade26f977dadf98ea601b195eab5a9641c18cec158a8bf5dc4361dc20777efd1bee18c22f7eb1564de7ab258fb14222d6378564ec6692dbe20fd3c019e
7
+ data.tar.gz: 180332e0bb055ffbf8020abc114ba300e4610f544d3cd00e4da7019b68dbfe7ae3dfc4adebbedc3d810ebf45bd34be6660890f98f4b94832548dbec56a4b244f
@@ -0,0 +1,45 @@
1
+ # Common files
2
+ require 'osdn-client/api_client'
3
+ require 'osdn-client/api_error'
4
+ require 'osdn-client/version'
5
+ require 'osdn-client/configuration'
6
+
7
+ # Models
8
+ require 'osdn-client/models/simple_user'
9
+ require 'osdn-client/models/user'
10
+ require 'osdn-client/models/simple_group'
11
+ require 'osdn-client/models/group'
12
+ require 'osdn-client/models/group_tool_flags'
13
+ require 'osdn-client/models/simple_chamber'
14
+ require 'osdn-client/models/skill'
15
+ require 'osdn-client/models/news'
16
+ require 'osdn-client/models/package'
17
+ require 'osdn-client/models/release'
18
+ require 'osdn-client/models/rel_file'
19
+ require 'osdn-client/models/token'
20
+ require 'osdn-client/models/pong'
21
+
22
+ # APIs
23
+ require 'osdn-client/api/project_api'
24
+ require 'osdn-client/api/user_api'
25
+ require 'osdn-client/api/project_frs_api'
26
+ require 'osdn-client/api/project_news_api'
27
+ require 'osdn-client/api/default_api'
28
+
29
+ module OSDNClient
30
+ class << self
31
+ # Customize default settings for the SDK using block.
32
+ # OSDNClient.configure do |config|
33
+ # config.username = "xxx"
34
+ # config.password = "xxx"
35
+ # end
36
+ # If no block given, return the default Configuration object.
37
+ def configure
38
+ if block_given?
39
+ yield(Configuration.default)
40
+ else
41
+ Configuration.default
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,148 @@
1
+ require "uri"
2
+
3
+ module OSDNClient
4
+ class DefaultApi
5
+ attr_accessor :api_client
6
+
7
+ def initialize(api_client = ApiClient.default)
8
+ @api_client = api_client
9
+ end
10
+
11
+ #
12
+ # return pong for test
13
+ # @param [Hash] opts the optional parameters
14
+ # @return [Pong]
15
+ def ping(opts = {})
16
+ data, status_code, headers = ping_with_http_info(opts)
17
+ return data
18
+ end
19
+
20
+ #
21
+ # return pong for test
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [Array<(Pong, Fixnum, Hash)>] Pong data, response status code and response headers
24
+ def ping_with_http_info(opts = {})
25
+ if @api_client.config.debugging
26
+ @api_client.config.logger.debug "Calling API: DefaultApi#ping ..."
27
+ end
28
+
29
+ # resource path
30
+ path = "/ping".sub('{format}','json')
31
+
32
+ # query parameters
33
+ query_params = {}
34
+
35
+ # header parameters
36
+ header_params = {}
37
+
38
+ # HTTP header 'Accept' (if needed)
39
+ _header_accept = []
40
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
41
+
42
+ # HTTP header 'Content-Type'
43
+ _header_content_type = ['application/x-www-form-urlencoded']
44
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
45
+
46
+ # form parameters
47
+ form_params = {}
48
+
49
+ # http body (model)
50
+ post_body = nil
51
+
52
+
53
+ auth_names = ['oauth2-implicit']
54
+ data, status_code, headers = @api_client.call_api(:GET, path,
55
+ :header_params => header_params,
56
+ :query_params => query_params,
57
+ :form_params => form_params,
58
+ :body => post_body,
59
+ :auth_names => auth_names,
60
+ :return_type => 'Pong')
61
+ if @api_client.config.debugging
62
+ @api_client.config.logger.debug "API called: DefaultApi#ping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
63
+ end
64
+ return data, status_code, headers
65
+ end
66
+
67
+ #
68
+ # Get access token by access code.
69
+ # @param client_id Your application ID
70
+ # @param client_secret Your application secret (key)
71
+ # @param [Hash] opts the optional parameters
72
+ # @option opts [String] :grant_type \&quot;authorization_code\&quot; or \&quot;refresh_token\&quot;
73
+ # @option opts [String] :code Set auth code issued by https://osdn.jp/account/oauth2ui/authorize for grant_type=authorization_code
74
+ # @option opts [String] :refresh_token Set refresh token to update access token.
75
+ # @return [Token]
76
+ def token(client_id, client_secret, opts = {})
77
+ data, status_code, headers = token_with_http_info(client_id, client_secret, opts)
78
+ return data
79
+ end
80
+
81
+ #
82
+ # Get access token by access code.
83
+ # @param client_id Your application ID
84
+ # @param client_secret Your application secret (key)
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [String] :grant_type \&quot;authorization_code\&quot; or \&quot;refresh_token\&quot;
87
+ # @option opts [String] :code Set auth code issued by https://osdn.jp/account/oauth2ui/authorize for grant_type=authorization_code
88
+ # @option opts [String] :refresh_token Set refresh token to update access token.
89
+ # @return [Array<(Token, Fixnum, Hash)>] Token data, response status code and response headers
90
+ def token_with_http_info(client_id, client_secret, opts = {})
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "Calling API: DefaultApi#token ..."
93
+ end
94
+
95
+ # verify the required parameter 'client_id' is set
96
+ fail "Missing the required parameter 'client_id' when calling token" if client_id.nil?
97
+
98
+ # verify the required parameter 'client_secret' is set
99
+ fail "Missing the required parameter 'client_secret' when calling token" if client_secret.nil?
100
+
101
+ # resource path
102
+ path = "/token".sub('{format}','json')
103
+
104
+ # query parameters
105
+ query_params = {}
106
+
107
+ # header parameters
108
+ header_params = {}
109
+
110
+ # HTTP header 'Accept' (if needed)
111
+ _header_accept = []
112
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
113
+
114
+ # HTTP header 'Content-Type'
115
+ _header_content_type = ['application/x-www-form-urlencoded']
116
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
117
+
118
+ # form parameters
119
+ form_params = {}
120
+ form_params["client_id"] = client_id
121
+ form_params["client_secret"] = client_secret
122
+ form_params["grant_type"] = opts[:'grant_type'] if opts[:'grant_type']
123
+ form_params["code"] = opts[:'code'] if opts[:'code']
124
+ form_params["refresh_token"] = opts[:'refresh_token'] if opts[:'refresh_token']
125
+
126
+ # http body (model)
127
+ post_body = nil
128
+
129
+
130
+ auth_names = []
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 => 'Token')
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug "API called: DefaultApi#token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
140
+ end
141
+ return data, status_code, headers
142
+ end
143
+ end
144
+ end
145
+
146
+
147
+
148
+
@@ -0,0 +1,1752 @@
1
+ require "uri"
2
+
3
+ module OSDNClient
4
+ class ProjectApi
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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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: ProjectApi#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 project info.
334
+ # @param id_or_name numeric project id or project name
335
+ # @param [Hash] opts the optional parameters
336
+ # @return [Group]
337
+ def get_project(id_or_name, opts = {})
338
+ data, status_code, headers = get_project_with_http_info(id_or_name, opts)
339
+ return data
340
+ end
341
+
342
+ #
343
+ # Get project info.
344
+ # @param id_or_name numeric project id or project name
345
+ # @param [Hash] opts the optional parameters
346
+ # @return [Array<(Group, Fixnum, Hash)>] Group data, response status code and response headers
347
+ def get_project_with_http_info(id_or_name, opts = {})
348
+ if @api_client.config.debugging
349
+ @api_client.config.logger.debug "Calling API: ProjectApi#get_project ..."
350
+ end
351
+
352
+ # verify the required parameter 'id_or_name' is set
353
+ fail "Missing the required parameter 'id_or_name' when calling get_project" if id_or_name.nil?
354
+
355
+ # resource path
356
+ path = "/project/{id_or_name}".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 => 'Group')
387
+ if @api_client.config.debugging
388
+ @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
389
+ end
390
+ return data, status_code, headers
391
+ end
392
+
393
+ #
394
+ # Get package list of specified project.
395
+ # @param id_or_name numeric project id or project name
396
+ # @param [Hash] opts the optional parameters
397
+ # @return [Array<Package>]
398
+ def list_packages(id_or_name, opts = {})
399
+ data, status_code, headers = list_packages_with_http_info(id_or_name, opts)
400
+ return data
401
+ end
402
+
403
+ #
404
+ # Get package list of specified project.
405
+ # @param id_or_name numeric project id or project name
406
+ # @param [Hash] opts the optional parameters
407
+ # @return [Array<(Array<Package>, Fixnum, Hash)>] Array<Package> data, response status code and response headers
408
+ def list_packages_with_http_info(id_or_name, opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug "Calling API: ProjectApi#list_packages ..."
411
+ end
412
+
413
+ # verify the required parameter 'id_or_name' is set
414
+ fail "Missing the required parameter 'id_or_name' when calling list_packages" if id_or_name.nil?
415
+
416
+ # resource path
417
+ path = "/project/{id_or_name}/frs".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
418
+
419
+ # query parameters
420
+ query_params = {}
421
+
422
+ # header parameters
423
+ header_params = {}
424
+
425
+ # HTTP header 'Accept' (if needed)
426
+ _header_accept = []
427
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
428
+
429
+ # HTTP header 'Content-Type'
430
+ _header_content_type = ['application/x-www-form-urlencoded']
431
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
432
+
433
+ # form parameters
434
+ form_params = {}
435
+
436
+ # http body (model)
437
+ post_body = nil
438
+
439
+
440
+ auth_names = ['oauth2-implicit']
441
+ data, status_code, headers = @api_client.call_api(:GET, path,
442
+ :header_params => header_params,
443
+ :query_params => query_params,
444
+ :form_params => form_params,
445
+ :body => post_body,
446
+ :auth_names => auth_names,
447
+ :return_type => 'Array<Package>')
448
+ if @api_client.config.debugging
449
+ @api_client.config.logger.debug "API called: ProjectApi#list_packages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
450
+ end
451
+ return data, status_code, headers
452
+ end
453
+
454
+ #
455
+ # Create a package.
456
+ # @param id_or_name numeric project id or project name
457
+ # @param name package name
458
+ # @param [Hash] opts the optional parameters
459
+ # @option opts [String] :visibility visibility status (public, hidden or private)
460
+ # @return [Package]
461
+ def create_package(id_or_name, name, opts = {})
462
+ data, status_code, headers = create_package_with_http_info(id_or_name, name, opts)
463
+ return data
464
+ end
465
+
466
+ #
467
+ # Create a package.
468
+ # @param id_or_name numeric project id or project name
469
+ # @param name package name
470
+ # @param [Hash] opts the optional parameters
471
+ # @option opts [String] :visibility visibility status (public, hidden or private)
472
+ # @return [Array<(Package, Fixnum, Hash)>] Package data, response status code and response headers
473
+ def create_package_with_http_info(id_or_name, name, opts = {})
474
+ if @api_client.config.debugging
475
+ @api_client.config.logger.debug "Calling API: ProjectApi#create_package ..."
476
+ end
477
+
478
+ # verify the required parameter 'id_or_name' is set
479
+ fail "Missing the required parameter 'id_or_name' when calling create_package" if id_or_name.nil?
480
+
481
+ # verify the required parameter 'name' is set
482
+ fail "Missing the required parameter 'name' when calling create_package" if name.nil?
483
+
484
+ # resource path
485
+ path = "/project/{id_or_name}/frs".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
486
+
487
+ # query parameters
488
+ query_params = {}
489
+
490
+ # header parameters
491
+ header_params = {}
492
+
493
+ # HTTP header 'Accept' (if needed)
494
+ _header_accept = []
495
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
496
+
497
+ # HTTP header 'Content-Type'
498
+ _header_content_type = ['application/x-www-form-urlencoded']
499
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
500
+
501
+ # form parameters
502
+ form_params = {}
503
+ form_params["name"] = name
504
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
505
+
506
+ # http body (model)
507
+ post_body = nil
508
+
509
+
510
+ auth_names = ['oauth2-implicit']
511
+ data, status_code, headers = @api_client.call_api(:POST, path,
512
+ :header_params => header_params,
513
+ :query_params => query_params,
514
+ :form_params => form_params,
515
+ :body => post_body,
516
+ :auth_names => auth_names,
517
+ :return_type => 'Package')
518
+ if @api_client.config.debugging
519
+ @api_client.config.logger.debug "API called: ProjectApi#create_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
520
+ end
521
+ return data, status_code, headers
522
+ end
523
+
524
+ #
525
+ # Get specified package info and release list of the package.
526
+ # @param id_or_name numeric project id or project name
527
+ # @param package_id
528
+ # @param [Hash] opts the optional parameters
529
+ # @return [Package]
530
+ def get_package(id_or_name, package_id, opts = {})
531
+ data, status_code, headers = get_package_with_http_info(id_or_name, package_id, opts)
532
+ return data
533
+ end
534
+
535
+ #
536
+ # Get specified package info and release list of the package.
537
+ # @param id_or_name numeric project id or project name
538
+ # @param package_id
539
+ # @param [Hash] opts the optional parameters
540
+ # @return [Array<(Package, Fixnum, Hash)>] Package data, response status code and response headers
541
+ def get_package_with_http_info(id_or_name, package_id, opts = {})
542
+ if @api_client.config.debugging
543
+ @api_client.config.logger.debug "Calling API: ProjectApi#get_package ..."
544
+ end
545
+
546
+ # verify the required parameter 'id_or_name' is set
547
+ fail "Missing the required parameter 'id_or_name' when calling get_package" if id_or_name.nil?
548
+
549
+ # verify the required parameter 'package_id' is set
550
+ fail "Missing the required parameter 'package_id' when calling get_package" if package_id.nil?
551
+
552
+ # resource path
553
+ path = "/project/{id_or_name}/frs/{package_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s)
554
+
555
+ # query parameters
556
+ query_params = {}
557
+
558
+ # header parameters
559
+ header_params = {}
560
+
561
+ # HTTP header 'Accept' (if needed)
562
+ _header_accept = []
563
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
564
+
565
+ # HTTP header 'Content-Type'
566
+ _header_content_type = ['application/x-www-form-urlencoded']
567
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
568
+
569
+ # form parameters
570
+ form_params = {}
571
+
572
+ # http body (model)
573
+ post_body = nil
574
+
575
+
576
+ auth_names = ['oauth2-implicit']
577
+ data, status_code, headers = @api_client.call_api(:GET, path,
578
+ :header_params => header_params,
579
+ :query_params => query_params,
580
+ :form_params => form_params,
581
+ :body => post_body,
582
+ :auth_names => auth_names,
583
+ :return_type => 'Package')
584
+ if @api_client.config.debugging
585
+ @api_client.config.logger.debug "API called: ProjectApi#get_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
586
+ end
587
+ return data, status_code, headers
588
+ end
589
+
590
+ #
591
+ # Create new release in specified package.
592
+ # @param id_or_name numeric project id or project name
593
+ # @param package_id
594
+ # @param name Release name
595
+ # @param [Hash] opts the optional parameters
596
+ # @option opts [String] :visibility visibility status (public, hidden or private)
597
+ # @option opts [String] :time Release datetime. If you set future time, the release hide until specified time.
598
+ # @option opts [String] :release_note Release note body text.
599
+ # @option opts [String] :change_log Changelog body text.
600
+ # @return [Release]
601
+ def create_release(id_or_name, package_id, name, opts = {})
602
+ data, status_code, headers = create_release_with_http_info(id_or_name, package_id, name, opts)
603
+ return data
604
+ end
605
+
606
+ #
607
+ # Create new release in specified package.
608
+ # @param id_or_name numeric project id or project name
609
+ # @param package_id
610
+ # @param name Release name
611
+ # @param [Hash] opts the optional parameters
612
+ # @option opts [String] :visibility visibility status (public, hidden or private)
613
+ # @option opts [String] :time Release datetime. If you set future time, the release hide until specified time.
614
+ # @option opts [String] :release_note Release note body text.
615
+ # @option opts [String] :change_log Changelog body text.
616
+ # @return [Array<(Release, Fixnum, Hash)>] Release data, response status code and response headers
617
+ def create_release_with_http_info(id_or_name, package_id, name, opts = {})
618
+ if @api_client.config.debugging
619
+ @api_client.config.logger.debug "Calling API: ProjectApi#create_release ..."
620
+ end
621
+
622
+ # verify the required parameter 'id_or_name' is set
623
+ fail "Missing the required parameter 'id_or_name' when calling create_release" if id_or_name.nil?
624
+
625
+ # verify the required parameter 'package_id' is set
626
+ fail "Missing the required parameter 'package_id' when calling create_release" if package_id.nil?
627
+
628
+ # verify the required parameter 'name' is set
629
+ fail "Missing the required parameter 'name' when calling create_release" if name.nil?
630
+
631
+ # resource path
632
+ path = "/project/{id_or_name}/frs/{package_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s)
633
+
634
+ # query parameters
635
+ query_params = {}
636
+
637
+ # header parameters
638
+ header_params = {}
639
+
640
+ # HTTP header 'Accept' (if needed)
641
+ _header_accept = []
642
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
643
+
644
+ # HTTP header 'Content-Type'
645
+ _header_content_type = ['application/x-www-form-urlencoded']
646
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
647
+
648
+ # form parameters
649
+ form_params = {}
650
+ form_params["name"] = name
651
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
652
+ form_params["time"] = opts[:'time'] if opts[:'time']
653
+ form_params["release_note"] = opts[:'release_note'] if opts[:'release_note']
654
+ form_params["change_log"] = opts[:'change_log'] if opts[:'change_log']
655
+
656
+ # http body (model)
657
+ post_body = nil
658
+
659
+
660
+ auth_names = ['oauth2-implicit']
661
+ data, status_code, headers = @api_client.call_api(:POST, path,
662
+ :header_params => header_params,
663
+ :query_params => query_params,
664
+ :form_params => form_params,
665
+ :body => post_body,
666
+ :auth_names => auth_names,
667
+ :return_type => 'Release')
668
+ if @api_client.config.debugging
669
+ @api_client.config.logger.debug "API called: ProjectApi#create_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
670
+ end
671
+ return data, status_code, headers
672
+ end
673
+
674
+ #
675
+ # Delete taret package.
676
+ # @param id_or_name numeric project id or project name
677
+ # @param package_id
678
+ # @param [Hash] opts the optional parameters
679
+ # @return [nil]
680
+ def delete_package(id_or_name, package_id, opts = {})
681
+ delete_package_with_http_info(id_or_name, package_id, opts)
682
+ return nil
683
+ end
684
+
685
+ #
686
+ # Delete taret package.
687
+ # @param id_or_name numeric project id or project name
688
+ # @param package_id
689
+ # @param [Hash] opts the optional parameters
690
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
691
+ def delete_package_with_http_info(id_or_name, package_id, opts = {})
692
+ if @api_client.config.debugging
693
+ @api_client.config.logger.debug "Calling API: ProjectApi#delete_package ..."
694
+ end
695
+
696
+ # verify the required parameter 'id_or_name' is set
697
+ fail "Missing the required parameter 'id_or_name' when calling delete_package" if id_or_name.nil?
698
+
699
+ # verify the required parameter 'package_id' is set
700
+ fail "Missing the required parameter 'package_id' when calling delete_package" if package_id.nil?
701
+
702
+ # resource path
703
+ path = "/project/{id_or_name}/frs/{package_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s)
704
+
705
+ # query parameters
706
+ query_params = {}
707
+
708
+ # header parameters
709
+ header_params = {}
710
+
711
+ # HTTP header 'Accept' (if needed)
712
+ _header_accept = []
713
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
714
+
715
+ # HTTP header 'Content-Type'
716
+ _header_content_type = ['application/x-www-form-urlencoded']
717
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
718
+
719
+ # form parameters
720
+ form_params = {}
721
+
722
+ # http body (model)
723
+ post_body = nil
724
+
725
+
726
+ auth_names = ['oauth2-implicit']
727
+ data, status_code, headers = @api_client.call_api(:DELETE, path,
728
+ :header_params => header_params,
729
+ :query_params => query_params,
730
+ :form_params => form_params,
731
+ :body => post_body,
732
+ :auth_names => auth_names)
733
+ if @api_client.config.debugging
734
+ @api_client.config.logger.debug "API called: ProjectApi#delete_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
735
+ end
736
+ return data, status_code, headers
737
+ end
738
+
739
+ #
740
+ # Update tagret package.
741
+ # @param id_or_name numeric project id or project name
742
+ # @param package_id
743
+ # @param [Hash] opts the optional parameters
744
+ # @option opts [String] :name package name
745
+ # @option opts [String] :visibility visibility status (public, hidden or private)
746
+ # @return [Package]
747
+ def update_package(id_or_name, package_id, opts = {})
748
+ data, status_code, headers = update_package_with_http_info(id_or_name, package_id, opts)
749
+ return data
750
+ end
751
+
752
+ #
753
+ # Update tagret package.
754
+ # @param id_or_name numeric project id or project name
755
+ # @param package_id
756
+ # @param [Hash] opts the optional parameters
757
+ # @option opts [String] :name package name
758
+ # @option opts [String] :visibility visibility status (public, hidden or private)
759
+ # @return [Array<(Package, Fixnum, Hash)>] Package data, response status code and response headers
760
+ def update_package_with_http_info(id_or_name, package_id, opts = {})
761
+ if @api_client.config.debugging
762
+ @api_client.config.logger.debug "Calling API: ProjectApi#update_package ..."
763
+ end
764
+
765
+ # verify the required parameter 'id_or_name' is set
766
+ fail "Missing the required parameter 'id_or_name' when calling update_package" if id_or_name.nil?
767
+
768
+ # verify the required parameter 'package_id' is set
769
+ fail "Missing the required parameter 'package_id' when calling update_package" if package_id.nil?
770
+
771
+ # resource path
772
+ path = "/project/{id_or_name}/frs/{package_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s)
773
+
774
+ # query parameters
775
+ query_params = {}
776
+
777
+ # header parameters
778
+ header_params = {}
779
+
780
+ # HTTP header 'Accept' (if needed)
781
+ _header_accept = []
782
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
783
+
784
+ # HTTP header 'Content-Type'
785
+ _header_content_type = ['application/x-www-form-urlencoded']
786
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
787
+
788
+ # form parameters
789
+ form_params = {}
790
+ form_params["name"] = opts[:'name'] if opts[:'name']
791
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
792
+
793
+ # http body (model)
794
+ post_body = nil
795
+
796
+
797
+ auth_names = ['oauth2-implicit']
798
+ data, status_code, headers = @api_client.call_api(:PATCH, path,
799
+ :header_params => header_params,
800
+ :query_params => query_params,
801
+ :form_params => form_params,
802
+ :body => post_body,
803
+ :auth_names => auth_names,
804
+ :return_type => 'Package')
805
+ if @api_client.config.debugging
806
+ @api_client.config.logger.debug "API called: ProjectApi#update_package\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
807
+ end
808
+ return data, status_code, headers
809
+ end
810
+
811
+ #
812
+ # Get release draft in specified package. If draft is not exist, it will be created automatically.
813
+ # @param id_or_name numeric project id or project name
814
+ # @param package_id
815
+ # @param [Hash] opts the optional parameters
816
+ # @return [Release]
817
+ def draft_release(id_or_name, package_id, opts = {})
818
+ data, status_code, headers = draft_release_with_http_info(id_or_name, package_id, opts)
819
+ return data
820
+ end
821
+
822
+ #
823
+ # Get release draft in specified package. If draft is not exist, it will be created automatically.
824
+ # @param id_or_name numeric project id or project name
825
+ # @param package_id
826
+ # @param [Hash] opts the optional parameters
827
+ # @return [Array<(Release, Fixnum, Hash)>] Release data, response status code and response headers
828
+ def draft_release_with_http_info(id_or_name, package_id, opts = {})
829
+ if @api_client.config.debugging
830
+ @api_client.config.logger.debug "Calling API: ProjectApi#draft_release ..."
831
+ end
832
+
833
+ # verify the required parameter 'id_or_name' is set
834
+ fail "Missing the required parameter 'id_or_name' when calling draft_release" if id_or_name.nil?
835
+
836
+ # verify the required parameter 'package_id' is set
837
+ fail "Missing the required parameter 'package_id' when calling draft_release" if package_id.nil?
838
+
839
+ # resource path
840
+ path = "/project/{id_or_name}/frs/{package_id}/draft".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s)
841
+
842
+ # query parameters
843
+ query_params = {}
844
+
845
+ # header parameters
846
+ header_params = {}
847
+
848
+ # HTTP header 'Accept' (if needed)
849
+ _header_accept = []
850
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
851
+
852
+ # HTTP header 'Content-Type'
853
+ _header_content_type = ['application/x-www-form-urlencoded']
854
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
855
+
856
+ # form parameters
857
+ form_params = {}
858
+
859
+ # http body (model)
860
+ post_body = nil
861
+
862
+
863
+ auth_names = ['oauth2-implicit']
864
+ data, status_code, headers = @api_client.call_api(:GET, path,
865
+ :header_params => header_params,
866
+ :query_params => query_params,
867
+ :form_params => form_params,
868
+ :body => post_body,
869
+ :auth_names => auth_names,
870
+ :return_type => 'Release')
871
+ if @api_client.config.debugging
872
+ @api_client.config.logger.debug "API called: ProjectApi#draft_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
873
+ end
874
+ return data, status_code, headers
875
+ end
876
+
877
+ #
878
+ # Get specified release info and file list of the release.
879
+ # @param id_or_name numeric project id or project name
880
+ # @param package_id
881
+ # @param release_id
882
+ # @param [Hash] opts the optional parameters
883
+ # @return [Release]
884
+ def get_release(id_or_name, package_id, release_id, opts = {})
885
+ data, status_code, headers = get_release_with_http_info(id_or_name, package_id, release_id, opts)
886
+ return data
887
+ end
888
+
889
+ #
890
+ # Get specified release info and file list of the release.
891
+ # @param id_or_name numeric project id or project name
892
+ # @param package_id
893
+ # @param release_id
894
+ # @param [Hash] opts the optional parameters
895
+ # @return [Array<(Release, Fixnum, Hash)>] Release data, response status code and response headers
896
+ def get_release_with_http_info(id_or_name, package_id, release_id, opts = {})
897
+ if @api_client.config.debugging
898
+ @api_client.config.logger.debug "Calling API: ProjectApi#get_release ..."
899
+ end
900
+
901
+ # verify the required parameter 'id_or_name' is set
902
+ fail "Missing the required parameter 'id_or_name' when calling get_release" if id_or_name.nil?
903
+
904
+ # verify the required parameter 'package_id' is set
905
+ fail "Missing the required parameter 'package_id' when calling get_release" if package_id.nil?
906
+
907
+ # verify the required parameter 'release_id' is set
908
+ fail "Missing the required parameter 'release_id' when calling get_release" if release_id.nil?
909
+
910
+ # resource path
911
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s)
912
+
913
+ # query parameters
914
+ query_params = {}
915
+
916
+ # header parameters
917
+ header_params = {}
918
+
919
+ # HTTP header 'Accept' (if needed)
920
+ _header_accept = []
921
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
922
+
923
+ # HTTP header 'Content-Type'
924
+ _header_content_type = ['application/x-www-form-urlencoded']
925
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
926
+
927
+ # form parameters
928
+ form_params = {}
929
+
930
+ # http body (model)
931
+ post_body = nil
932
+
933
+
934
+ auth_names = ['oauth2-implicit']
935
+ data, status_code, headers = @api_client.call_api(:GET, path,
936
+ :header_params => header_params,
937
+ :query_params => query_params,
938
+ :form_params => form_params,
939
+ :body => post_body,
940
+ :auth_names => auth_names,
941
+ :return_type => 'Release')
942
+ if @api_client.config.debugging
943
+ @api_client.config.logger.debug "API called: ProjectApi#get_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
944
+ end
945
+ return data, status_code, headers
946
+ end
947
+
948
+ #
949
+ # Create new file in target release.
950
+ # @param id_or_name numeric project id or project name
951
+ # @param package_id
952
+ # @param release_id
953
+ # @param file Upload file in \&quot;multipart/form-data\&quot;.
954
+ # @param [Hash] opts the optional parameters
955
+ # @option opts [String] :visibility visibility status (public, hidden or private)
956
+ # @return [RelFile]
957
+ def create_release_file(id_or_name, package_id, release_id, file, opts = {})
958
+ data, status_code, headers = create_release_file_with_http_info(id_or_name, package_id, release_id, file, opts)
959
+ return data
960
+ end
961
+
962
+ #
963
+ # Create new file in target release.
964
+ # @param id_or_name numeric project id or project name
965
+ # @param package_id
966
+ # @param release_id
967
+ # @param file Upload file in \&quot;multipart/form-data\&quot;.
968
+ # @param [Hash] opts the optional parameters
969
+ # @option opts [String] :visibility visibility status (public, hidden or private)
970
+ # @return [Array<(RelFile, Fixnum, Hash)>] RelFile data, response status code and response headers
971
+ def create_release_file_with_http_info(id_or_name, package_id, release_id, file, opts = {})
972
+ if @api_client.config.debugging
973
+ @api_client.config.logger.debug "Calling API: ProjectApi#create_release_file ..."
974
+ end
975
+
976
+ # verify the required parameter 'id_or_name' is set
977
+ fail "Missing the required parameter 'id_or_name' when calling create_release_file" if id_or_name.nil?
978
+
979
+ # verify the required parameter 'package_id' is set
980
+ fail "Missing the required parameter 'package_id' when calling create_release_file" if package_id.nil?
981
+
982
+ # verify the required parameter 'release_id' is set
983
+ fail "Missing the required parameter 'release_id' when calling create_release_file" if release_id.nil?
984
+
985
+ # verify the required parameter 'file' is set
986
+ fail "Missing the required parameter 'file' when calling create_release_file" if file.nil?
987
+
988
+ # resource path
989
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s)
990
+
991
+ # query parameters
992
+ query_params = {}
993
+
994
+ # header parameters
995
+ header_params = {}
996
+
997
+ # HTTP header 'Accept' (if needed)
998
+ _header_accept = []
999
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1000
+
1001
+ # HTTP header 'Content-Type'
1002
+ _header_content_type = ['multipart/form-data']
1003
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1004
+
1005
+ # form parameters
1006
+ form_params = {}
1007
+ form_params["file"] = file
1008
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
1009
+
1010
+ # http body (model)
1011
+ post_body = nil
1012
+
1013
+
1014
+ auth_names = ['oauth2-implicit']
1015
+ data, status_code, headers = @api_client.call_api(:POST, path,
1016
+ :header_params => header_params,
1017
+ :query_params => query_params,
1018
+ :form_params => form_params,
1019
+ :body => post_body,
1020
+ :auth_names => auth_names,
1021
+ :return_type => 'RelFile')
1022
+ if @api_client.config.debugging
1023
+ @api_client.config.logger.debug "API called: ProjectApi#create_release_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1024
+ end
1025
+ return data, status_code, headers
1026
+ end
1027
+
1028
+ #
1029
+ # Delete target release.
1030
+ # @param id_or_name numeric project id or project name
1031
+ # @param package_id
1032
+ # @param release_id
1033
+ # @param [Hash] opts the optional parameters
1034
+ # @return [nil]
1035
+ def delete_release(id_or_name, package_id, release_id, opts = {})
1036
+ delete_release_with_http_info(id_or_name, package_id, release_id, opts)
1037
+ return nil
1038
+ end
1039
+
1040
+ #
1041
+ # Delete target release.
1042
+ # @param id_or_name numeric project id or project name
1043
+ # @param package_id
1044
+ # @param release_id
1045
+ # @param [Hash] opts the optional parameters
1046
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
1047
+ def delete_release_with_http_info(id_or_name, package_id, release_id, opts = {})
1048
+ if @api_client.config.debugging
1049
+ @api_client.config.logger.debug "Calling API: ProjectApi#delete_release ..."
1050
+ end
1051
+
1052
+ # verify the required parameter 'id_or_name' is set
1053
+ fail "Missing the required parameter 'id_or_name' when calling delete_release" if id_or_name.nil?
1054
+
1055
+ # verify the required parameter 'package_id' is set
1056
+ fail "Missing the required parameter 'package_id' when calling delete_release" if package_id.nil?
1057
+
1058
+ # verify the required parameter 'release_id' is set
1059
+ fail "Missing the required parameter 'release_id' when calling delete_release" if release_id.nil?
1060
+
1061
+ # resource path
1062
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s)
1063
+
1064
+ # query parameters
1065
+ query_params = {}
1066
+
1067
+ # header parameters
1068
+ header_params = {}
1069
+
1070
+ # HTTP header 'Accept' (if needed)
1071
+ _header_accept = []
1072
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1073
+
1074
+ # HTTP header 'Content-Type'
1075
+ _header_content_type = ['application/x-www-form-urlencoded']
1076
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1077
+
1078
+ # form parameters
1079
+ form_params = {}
1080
+
1081
+ # http body (model)
1082
+ post_body = nil
1083
+
1084
+
1085
+ auth_names = ['oauth2-implicit']
1086
+ data, status_code, headers = @api_client.call_api(:DELETE, path,
1087
+ :header_params => header_params,
1088
+ :query_params => query_params,
1089
+ :form_params => form_params,
1090
+ :body => post_body,
1091
+ :auth_names => auth_names)
1092
+ if @api_client.config.debugging
1093
+ @api_client.config.logger.debug "API called: ProjectApi#delete_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1094
+ end
1095
+ return data, status_code, headers
1096
+ end
1097
+
1098
+ #
1099
+ # Update target release.\n(Note: If you update draft release, the release will be public automatically.)
1100
+ # @param id_or_name numeric project id or project name
1101
+ # @param package_id
1102
+ # @param release_id
1103
+ # @param [Hash] opts the optional parameters
1104
+ # @option opts [String] :visibility visibility status (public, hidden or private)
1105
+ # @option opts [String] :name Release name
1106
+ # @option opts [String] :time Release datetime. If you set future time, the release hide until specified time.
1107
+ # @option opts [Integer] :move_to_package_id If this parameter is specified, the release move to another package.
1108
+ # @return [Release]
1109
+ def update_release(id_or_name, package_id, release_id, opts = {})
1110
+ data, status_code, headers = update_release_with_http_info(id_or_name, package_id, release_id, opts)
1111
+ return data
1112
+ end
1113
+
1114
+ #
1115
+ # Update target release.\n(Note: If you update draft release, the release will be public automatically.)
1116
+ # @param id_or_name numeric project id or project name
1117
+ # @param package_id
1118
+ # @param release_id
1119
+ # @param [Hash] opts the optional parameters
1120
+ # @option opts [String] :visibility visibility status (public, hidden or private)
1121
+ # @option opts [String] :name Release name
1122
+ # @option opts [String] :time Release datetime. If you set future time, the release hide until specified time.
1123
+ # @option opts [Integer] :move_to_package_id If this parameter is specified, the release move to another package.
1124
+ # @return [Array<(Release, Fixnum, Hash)>] Release data, response status code and response headers
1125
+ def update_release_with_http_info(id_or_name, package_id, release_id, opts = {})
1126
+ if @api_client.config.debugging
1127
+ @api_client.config.logger.debug "Calling API: ProjectApi#update_release ..."
1128
+ end
1129
+
1130
+ # verify the required parameter 'id_or_name' is set
1131
+ fail "Missing the required parameter 'id_or_name' when calling update_release" if id_or_name.nil?
1132
+
1133
+ # verify the required parameter 'package_id' is set
1134
+ fail "Missing the required parameter 'package_id' when calling update_release" if package_id.nil?
1135
+
1136
+ # verify the required parameter 'release_id' is set
1137
+ fail "Missing the required parameter 'release_id' when calling update_release" if release_id.nil?
1138
+
1139
+ # resource path
1140
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s)
1141
+
1142
+ # query parameters
1143
+ query_params = {}
1144
+
1145
+ # header parameters
1146
+ header_params = {}
1147
+
1148
+ # HTTP header 'Accept' (if needed)
1149
+ _header_accept = []
1150
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1151
+
1152
+ # HTTP header 'Content-Type'
1153
+ _header_content_type = ['application/x-www-form-urlencoded']
1154
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1155
+
1156
+ # form parameters
1157
+ form_params = {}
1158
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
1159
+ form_params["name"] = opts[:'name'] if opts[:'name']
1160
+ form_params["time"] = opts[:'time'] if opts[:'time']
1161
+ form_params["move_to_package_id"] = opts[:'move_to_package_id'] if opts[:'move_to_package_id']
1162
+
1163
+ # http body (model)
1164
+ post_body = nil
1165
+
1166
+
1167
+ auth_names = ['oauth2-implicit']
1168
+ data, status_code, headers = @api_client.call_api(:PATCH, path,
1169
+ :header_params => header_params,
1170
+ :query_params => query_params,
1171
+ :form_params => form_params,
1172
+ :body => post_body,
1173
+ :auth_names => auth_names,
1174
+ :return_type => 'Release')
1175
+ if @api_client.config.debugging
1176
+ @api_client.config.logger.debug "API called: ProjectApi#update_release\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1177
+ end
1178
+ return data, status_code, headers
1179
+ end
1180
+
1181
+ #
1182
+ # Get single file object.
1183
+ # @param id_or_name numeric project id or project name
1184
+ # @param package_id
1185
+ # @param release_id
1186
+ # @param file_id
1187
+ # @param [Hash] opts the optional parameters
1188
+ # @return [RelFile]
1189
+ def get_release_file(id_or_name, package_id, release_id, file_id, opts = {})
1190
+ data, status_code, headers = get_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts)
1191
+ return data
1192
+ end
1193
+
1194
+ #
1195
+ # Get single file object.
1196
+ # @param id_or_name numeric project id or project name
1197
+ # @param package_id
1198
+ # @param release_id
1199
+ # @param file_id
1200
+ # @param [Hash] opts the optional parameters
1201
+ # @return [Array<(RelFile, Fixnum, Hash)>] RelFile data, response status code and response headers
1202
+ def get_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts = {})
1203
+ if @api_client.config.debugging
1204
+ @api_client.config.logger.debug "Calling API: ProjectApi#get_release_file ..."
1205
+ end
1206
+
1207
+ # verify the required parameter 'id_or_name' is set
1208
+ fail "Missing the required parameter 'id_or_name' when calling get_release_file" if id_or_name.nil?
1209
+
1210
+ # verify the required parameter 'package_id' is set
1211
+ fail "Missing the required parameter 'package_id' when calling get_release_file" if package_id.nil?
1212
+
1213
+ # verify the required parameter 'release_id' is set
1214
+ fail "Missing the required parameter 'release_id' when calling get_release_file" if release_id.nil?
1215
+
1216
+ # verify the required parameter 'file_id' is set
1217
+ fail "Missing the required parameter 'file_id' when calling get_release_file" if file_id.nil?
1218
+
1219
+ # resource path
1220
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}/{file_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s).sub('{' + 'file_id' + '}', file_id.to_s)
1221
+
1222
+ # query parameters
1223
+ query_params = {}
1224
+
1225
+ # header parameters
1226
+ header_params = {}
1227
+
1228
+ # HTTP header 'Accept' (if needed)
1229
+ _header_accept = []
1230
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1231
+
1232
+ # HTTP header 'Content-Type'
1233
+ _header_content_type = ['application/x-www-form-urlencoded']
1234
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1235
+
1236
+ # form parameters
1237
+ form_params = {}
1238
+
1239
+ # http body (model)
1240
+ post_body = nil
1241
+
1242
+
1243
+ auth_names = ['oauth2-implicit']
1244
+ data, status_code, headers = @api_client.call_api(:GET, path,
1245
+ :header_params => header_params,
1246
+ :query_params => query_params,
1247
+ :form_params => form_params,
1248
+ :body => post_body,
1249
+ :auth_names => auth_names,
1250
+ :return_type => 'RelFile')
1251
+ if @api_client.config.debugging
1252
+ @api_client.config.logger.debug "API called: ProjectApi#get_release_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1253
+ end
1254
+ return data, status_code, headers
1255
+ end
1256
+
1257
+ #
1258
+ # Delete target file.
1259
+ # @param id_or_name numeric project id or project name
1260
+ # @param package_id
1261
+ # @param release_id
1262
+ # @param file_id
1263
+ # @param [Hash] opts the optional parameters
1264
+ # @return [nil]
1265
+ def delete_release_file(id_or_name, package_id, release_id, file_id, opts = {})
1266
+ delete_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts)
1267
+ return nil
1268
+ end
1269
+
1270
+ #
1271
+ # Delete target file.
1272
+ # @param id_or_name numeric project id or project name
1273
+ # @param package_id
1274
+ # @param release_id
1275
+ # @param file_id
1276
+ # @param [Hash] opts the optional parameters
1277
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
1278
+ def delete_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts = {})
1279
+ if @api_client.config.debugging
1280
+ @api_client.config.logger.debug "Calling API: ProjectApi#delete_release_file ..."
1281
+ end
1282
+
1283
+ # verify the required parameter 'id_or_name' is set
1284
+ fail "Missing the required parameter 'id_or_name' when calling delete_release_file" if id_or_name.nil?
1285
+
1286
+ # verify the required parameter 'package_id' is set
1287
+ fail "Missing the required parameter 'package_id' when calling delete_release_file" if package_id.nil?
1288
+
1289
+ # verify the required parameter 'release_id' is set
1290
+ fail "Missing the required parameter 'release_id' when calling delete_release_file" if release_id.nil?
1291
+
1292
+ # verify the required parameter 'file_id' is set
1293
+ fail "Missing the required parameter 'file_id' when calling delete_release_file" if file_id.nil?
1294
+
1295
+ # resource path
1296
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}/{file_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s).sub('{' + 'file_id' + '}', file_id.to_s)
1297
+
1298
+ # query parameters
1299
+ query_params = {}
1300
+
1301
+ # header parameters
1302
+ header_params = {}
1303
+
1304
+ # HTTP header 'Accept' (if needed)
1305
+ _header_accept = []
1306
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1307
+
1308
+ # HTTP header 'Content-Type'
1309
+ _header_content_type = ['application/x-www-form-urlencoded']
1310
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1311
+
1312
+ # form parameters
1313
+ form_params = {}
1314
+
1315
+ # http body (model)
1316
+ post_body = nil
1317
+
1318
+
1319
+ auth_names = ['oauth2-implicit']
1320
+ data, status_code, headers = @api_client.call_api(:DELETE, path,
1321
+ :header_params => header_params,
1322
+ :query_params => query_params,
1323
+ :form_params => form_params,
1324
+ :body => post_body,
1325
+ :auth_names => auth_names)
1326
+ if @api_client.config.debugging
1327
+ @api_client.config.logger.debug "API called: ProjectApi#delete_release_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1328
+ end
1329
+ return data, status_code, headers
1330
+ end
1331
+
1332
+ #
1333
+ # Change visibility of target file.
1334
+ # @param id_or_name numeric project id or project name
1335
+ # @param package_id
1336
+ # @param release_id
1337
+ # @param file_id
1338
+ # @param [Hash] opts the optional parameters
1339
+ # @option opts [String] :visibility visibility status (public, hidden or private)
1340
+ # @return [RelFile]
1341
+ def update_release_file(id_or_name, package_id, release_id, file_id, opts = {})
1342
+ data, status_code, headers = update_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts)
1343
+ return data
1344
+ end
1345
+
1346
+ #
1347
+ # Change visibility of target file.
1348
+ # @param id_or_name numeric project id or project name
1349
+ # @param package_id
1350
+ # @param release_id
1351
+ # @param file_id
1352
+ # @param [Hash] opts the optional parameters
1353
+ # @option opts [String] :visibility visibility status (public, hidden or private)
1354
+ # @return [Array<(RelFile, Fixnum, Hash)>] RelFile data, response status code and response headers
1355
+ def update_release_file_with_http_info(id_or_name, package_id, release_id, file_id, opts = {})
1356
+ if @api_client.config.debugging
1357
+ @api_client.config.logger.debug "Calling API: ProjectApi#update_release_file ..."
1358
+ end
1359
+
1360
+ # verify the required parameter 'id_or_name' is set
1361
+ fail "Missing the required parameter 'id_or_name' when calling update_release_file" if id_or_name.nil?
1362
+
1363
+ # verify the required parameter 'package_id' is set
1364
+ fail "Missing the required parameter 'package_id' when calling update_release_file" if package_id.nil?
1365
+
1366
+ # verify the required parameter 'release_id' is set
1367
+ fail "Missing the required parameter 'release_id' when calling update_release_file" if release_id.nil?
1368
+
1369
+ # verify the required parameter 'file_id' is set
1370
+ fail "Missing the required parameter 'file_id' when calling update_release_file" if file_id.nil?
1371
+
1372
+ # resource path
1373
+ path = "/project/{id_or_name}/frs/{package_id}/{release_id}/{file_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'package_id' + '}', package_id.to_s).sub('{' + 'release_id' + '}', release_id.to_s).sub('{' + 'file_id' + '}', file_id.to_s)
1374
+
1375
+ # query parameters
1376
+ query_params = {}
1377
+
1378
+ # header parameters
1379
+ header_params = {}
1380
+
1381
+ # HTTP header 'Accept' (if needed)
1382
+ _header_accept = []
1383
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1384
+
1385
+ # HTTP header 'Content-Type'
1386
+ _header_content_type = ['application/x-www-form-urlencoded']
1387
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1388
+
1389
+ # form parameters
1390
+ form_params = {}
1391
+ form_params["visibility"] = opts[:'visibility'] if opts[:'visibility']
1392
+
1393
+ # http body (model)
1394
+ post_body = nil
1395
+
1396
+
1397
+ auth_names = ['oauth2-implicit']
1398
+ data, status_code, headers = @api_client.call_api(:PATCH, path,
1399
+ :header_params => header_params,
1400
+ :query_params => query_params,
1401
+ :form_params => form_params,
1402
+ :body => post_body,
1403
+ :auth_names => auth_names,
1404
+ :return_type => 'RelFile')
1405
+ if @api_client.config.debugging
1406
+ @api_client.config.logger.debug "API called: ProjectApi#update_release_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1407
+ end
1408
+ return data, status_code, headers
1409
+ end
1410
+
1411
+ #
1412
+ # Get news list of spscified project.
1413
+ # @param id_or_name numeric project id or project name
1414
+ # @param [Hash] opts the optional parameters
1415
+ # @return [Array<News>]
1416
+ def list_news_0(id_or_name, opts = {})
1417
+ data, status_code, headers = list_news_0_with_http_info(id_or_name, opts)
1418
+ return data
1419
+ end
1420
+
1421
+ #
1422
+ # Get news list of spscified project.
1423
+ # @param id_or_name numeric project id or project name
1424
+ # @param [Hash] opts the optional parameters
1425
+ # @return [Array<(Array<News>, Fixnum, Hash)>] Array<News> data, response status code and response headers
1426
+ def list_news_0_with_http_info(id_or_name, opts = {})
1427
+ if @api_client.config.debugging
1428
+ @api_client.config.logger.debug "Calling API: ProjectApi#list_news_0 ..."
1429
+ end
1430
+
1431
+ # verify the required parameter 'id_or_name' is set
1432
+ fail "Missing the required parameter 'id_or_name' when calling list_news_0" if id_or_name.nil?
1433
+
1434
+ # resource path
1435
+ path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
1436
+
1437
+ # query parameters
1438
+ query_params = {}
1439
+
1440
+ # header parameters
1441
+ header_params = {}
1442
+
1443
+ # HTTP header 'Accept' (if needed)
1444
+ _header_accept = []
1445
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1446
+
1447
+ # HTTP header 'Content-Type'
1448
+ _header_content_type = ['application/x-www-form-urlencoded']
1449
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1450
+
1451
+ # form parameters
1452
+ form_params = {}
1453
+
1454
+ # http body (model)
1455
+ post_body = nil
1456
+
1457
+
1458
+ auth_names = ['oauth2-implicit']
1459
+ data, status_code, headers = @api_client.call_api(:GET, path,
1460
+ :header_params => header_params,
1461
+ :query_params => query_params,
1462
+ :form_params => form_params,
1463
+ :body => post_body,
1464
+ :auth_names => auth_names,
1465
+ :return_type => 'Array<News>')
1466
+ if @api_client.config.debugging
1467
+ @api_client.config.logger.debug "API called: ProjectApi#list_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1468
+ end
1469
+ return data, status_code, headers
1470
+ end
1471
+
1472
+ #
1473
+ #
1474
+ # @param id_or_name numeric project id or project name
1475
+ # @param title news title
1476
+ # @param body news body in OSDN Wiki format.
1477
+ # @param [Hash] opts the optional parameters
1478
+ # @return [String]
1479
+ def create_news_0(id_or_name, title, body, opts = {})
1480
+ data, status_code, headers = create_news_0_with_http_info(id_or_name, title, body, opts)
1481
+ return data
1482
+ end
1483
+
1484
+ #
1485
+ #
1486
+ # @param id_or_name numeric project id or project name
1487
+ # @param title news title
1488
+ # @param body news body in OSDN Wiki format.
1489
+ # @param [Hash] opts the optional parameters
1490
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
1491
+ def create_news_0_with_http_info(id_or_name, title, body, opts = {})
1492
+ if @api_client.config.debugging
1493
+ @api_client.config.logger.debug "Calling API: ProjectApi#create_news_0 ..."
1494
+ end
1495
+
1496
+ # verify the required parameter 'id_or_name' is set
1497
+ fail "Missing the required parameter 'id_or_name' when calling create_news_0" if id_or_name.nil?
1498
+
1499
+ # verify the required parameter 'title' is set
1500
+ fail "Missing the required parameter 'title' when calling create_news_0" if title.nil?
1501
+
1502
+ # verify the required parameter 'body' is set
1503
+ fail "Missing the required parameter 'body' when calling create_news_0" if body.nil?
1504
+
1505
+ # resource path
1506
+ path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
1507
+
1508
+ # query parameters
1509
+ query_params = {}
1510
+
1511
+ # header parameters
1512
+ header_params = {}
1513
+
1514
+ # HTTP header 'Accept' (if needed)
1515
+ _header_accept = []
1516
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1517
+
1518
+ # HTTP header 'Content-Type'
1519
+ _header_content_type = ['application/x-www-form-urlencoded']
1520
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1521
+
1522
+ # form parameters
1523
+ form_params = {}
1524
+ form_params["title"] = title
1525
+ form_params["body"] = body
1526
+
1527
+ # http body (model)
1528
+ post_body = nil
1529
+
1530
+
1531
+ auth_names = ['oauth2-implicit']
1532
+ data, status_code, headers = @api_client.call_api(:POST, path,
1533
+ :header_params => header_params,
1534
+ :query_params => query_params,
1535
+ :form_params => form_params,
1536
+ :body => post_body,
1537
+ :auth_names => auth_names,
1538
+ :return_type => 'String')
1539
+ if @api_client.config.debugging
1540
+ @api_client.config.logger.debug "API called: ProjectApi#create_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1541
+ end
1542
+ return data, status_code, headers
1543
+ end
1544
+
1545
+ #
1546
+ # Get single news object.
1547
+ # @param id_or_name numeric project id or project name
1548
+ # @param news_id
1549
+ # @param [Hash] opts the optional parameters
1550
+ # @return [News]
1551
+ def get_news_0(id_or_name, news_id, opts = {})
1552
+ data, status_code, headers = get_news_0_with_http_info(id_or_name, news_id, opts)
1553
+ return data
1554
+ end
1555
+
1556
+ #
1557
+ # Get single news object.
1558
+ # @param id_or_name numeric project id or project name
1559
+ # @param news_id
1560
+ # @param [Hash] opts the optional parameters
1561
+ # @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
1562
+ def get_news_0_with_http_info(id_or_name, news_id, opts = {})
1563
+ if @api_client.config.debugging
1564
+ @api_client.config.logger.debug "Calling API: ProjectApi#get_news_0 ..."
1565
+ end
1566
+
1567
+ # verify the required parameter 'id_or_name' is set
1568
+ fail "Missing the required parameter 'id_or_name' when calling get_news_0" if id_or_name.nil?
1569
+
1570
+ # verify the required parameter 'news_id' is set
1571
+ fail "Missing the required parameter 'news_id' when calling get_news_0" if news_id.nil?
1572
+
1573
+ # resource path
1574
+ 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)
1575
+
1576
+ # query parameters
1577
+ query_params = {}
1578
+
1579
+ # header parameters
1580
+ header_params = {}
1581
+
1582
+ # HTTP header 'Accept' (if needed)
1583
+ _header_accept = []
1584
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1585
+
1586
+ # HTTP header 'Content-Type'
1587
+ _header_content_type = ['application/x-www-form-urlencoded']
1588
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1589
+
1590
+ # form parameters
1591
+ form_params = {}
1592
+
1593
+ # http body (model)
1594
+ post_body = nil
1595
+
1596
+
1597
+ auth_names = ['oauth2-implicit']
1598
+ data, status_code, headers = @api_client.call_api(:GET, path,
1599
+ :header_params => header_params,
1600
+ :query_params => query_params,
1601
+ :form_params => form_params,
1602
+ :body => post_body,
1603
+ :auth_names => auth_names,
1604
+ :return_type => 'News')
1605
+ if @api_client.config.debugging
1606
+ @api_client.config.logger.debug "API called: ProjectApi#get_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1607
+ end
1608
+ return data, status_code, headers
1609
+ end
1610
+
1611
+ #
1612
+ #
1613
+ # @param id_or_name numeric project id or project name
1614
+ # @param news_id
1615
+ # @param [Hash] opts the optional parameters
1616
+ # @return [nil]
1617
+ def delete_news_0(id_or_name, news_id, opts = {})
1618
+ delete_news_0_with_http_info(id_or_name, news_id, opts)
1619
+ return nil
1620
+ end
1621
+
1622
+ #
1623
+ #
1624
+ # @param id_or_name numeric project id or project name
1625
+ # @param news_id
1626
+ # @param [Hash] opts the optional parameters
1627
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
1628
+ def delete_news_0_with_http_info(id_or_name, news_id, opts = {})
1629
+ if @api_client.config.debugging
1630
+ @api_client.config.logger.debug "Calling API: ProjectApi#delete_news_0 ..."
1631
+ end
1632
+
1633
+ # verify the required parameter 'id_or_name' is set
1634
+ fail "Missing the required parameter 'id_or_name' when calling delete_news_0" if id_or_name.nil?
1635
+
1636
+ # verify the required parameter 'news_id' is set
1637
+ fail "Missing the required parameter 'news_id' when calling delete_news_0" if news_id.nil?
1638
+
1639
+ # resource path
1640
+ 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)
1641
+
1642
+ # query parameters
1643
+ query_params = {}
1644
+
1645
+ # header parameters
1646
+ header_params = {}
1647
+
1648
+ # HTTP header 'Accept' (if needed)
1649
+ _header_accept = []
1650
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1651
+
1652
+ # HTTP header 'Content-Type'
1653
+ _header_content_type = ['application/x-www-form-urlencoded']
1654
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1655
+
1656
+ # form parameters
1657
+ form_params = {}
1658
+
1659
+ # http body (model)
1660
+ post_body = nil
1661
+
1662
+
1663
+ auth_names = ['oauth2-implicit']
1664
+ data, status_code, headers = @api_client.call_api(:DELETE, path,
1665
+ :header_params => header_params,
1666
+ :query_params => query_params,
1667
+ :form_params => form_params,
1668
+ :body => post_body,
1669
+ :auth_names => auth_names)
1670
+ if @api_client.config.debugging
1671
+ @api_client.config.logger.debug "API called: ProjectApi#delete_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1672
+ end
1673
+ return data, status_code, headers
1674
+ end
1675
+
1676
+ #
1677
+ #
1678
+ # @param news_id
1679
+ # @param id_or_name numeric project id or project name
1680
+ # @param [Hash] opts the optional parameters
1681
+ # @option opts [String] :title news title
1682
+ # @option opts [String] :body news body in OSDN Wiki format.
1683
+ # @return [News]
1684
+ def update_news_0(news_id, id_or_name, opts = {})
1685
+ data, status_code, headers = update_news_0_with_http_info(news_id, id_or_name, opts)
1686
+ return data
1687
+ end
1688
+
1689
+ #
1690
+ #
1691
+ # @param news_id
1692
+ # @param id_or_name numeric project id or project name
1693
+ # @param [Hash] opts the optional parameters
1694
+ # @option opts [String] :title news title
1695
+ # @option opts [String] :body news body in OSDN Wiki format.
1696
+ # @return [Array<(News, Fixnum, Hash)>] News data, response status code and response headers
1697
+ def update_news_0_with_http_info(news_id, id_or_name, opts = {})
1698
+ if @api_client.config.debugging
1699
+ @api_client.config.logger.debug "Calling API: ProjectApi#update_news_0 ..."
1700
+ end
1701
+
1702
+ # verify the required parameter 'news_id' is set
1703
+ fail "Missing the required parameter 'news_id' when calling update_news_0" if news_id.nil?
1704
+
1705
+ # verify the required parameter 'id_or_name' is set
1706
+ fail "Missing the required parameter 'id_or_name' when calling update_news_0" if id_or_name.nil?
1707
+
1708
+ # resource path
1709
+ 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)
1710
+
1711
+ # query parameters
1712
+ query_params = {}
1713
+
1714
+ # header parameters
1715
+ header_params = {}
1716
+
1717
+ # HTTP header 'Accept' (if needed)
1718
+ _header_accept = []
1719
+ _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
1720
+
1721
+ # HTTP header 'Content-Type'
1722
+ _header_content_type = ['application/x-www-form-urlencoded']
1723
+ header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
1724
+
1725
+ # form parameters
1726
+ form_params = {}
1727
+ form_params["title"] = opts[:'title'] if opts[:'title']
1728
+ form_params["body"] = opts[:'body'] if opts[:'body']
1729
+
1730
+ # http body (model)
1731
+ post_body = nil
1732
+
1733
+
1734
+ auth_names = ['oauth2-implicit']
1735
+ data, status_code, headers = @api_client.call_api(:PATCH, path,
1736
+ :header_params => header_params,
1737
+ :query_params => query_params,
1738
+ :form_params => form_params,
1739
+ :body => post_body,
1740
+ :auth_names => auth_names,
1741
+ :return_type => 'News')
1742
+ if @api_client.config.debugging
1743
+ @api_client.config.logger.debug "API called: ProjectApi#update_news_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1744
+ end
1745
+ return data, status_code, headers
1746
+ end
1747
+ end
1748
+ end
1749
+
1750
+
1751
+
1752
+