Class: OSDNClient::ProjectNewsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/osdn-client/api/project_news_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProjectNewsApi

Returns a new instance of ProjectNewsApi.


7
8
9
# File 'lib/osdn-client/api/project_news_api.rb', line 7

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.


5
6
7
# File 'lib/osdn-client/api/project_news_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#create_news(title, body, group_id, opts = {}) ⇒ String

Parameters:

  • title

    news title

  • body

    news body in OSDN Wiki format.

  • group_id

    group_id the news created in

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

    the optional parameters

Returns:

  • (String)

77
78
79
80
# File 'lib/osdn-client/api/project_news_api.rb', line 77

def create_news(title, body, group_id, opts = {})
  data, status_code, headers = create_news_with_http_info(title, body, group_id, opts)
  return data
end

#create_news_0(id_or_name, title, body, opts = {}) ⇒ String

Parameters:

  • id_or_name

    numeric project id or project name

  • title

    news title

  • body

    news body in OSDN Wiki format.

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

    the optional parameters

Returns:

  • (String)

400
401
402
403
# File 'lib/osdn-client/api/project_news_api.rb', line 400

def create_news_0(id_or_name, title, body, opts = {})
  data, status_code, headers = create_news_0_with_http_info(id_or_name, title, body, opts)
  return data
end

#create_news_0_with_http_info(id_or_name, title, body, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Returns String data, response status code and response headers.

Parameters:

  • id_or_name

    numeric project id or project name

  • title

    news title

  • body

    news body in OSDN Wiki format.

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

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers


412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/osdn-client/api/project_news_api.rb', line 412

def create_news_0_with_http_info(id_or_name, title, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#create_news_0 ..."
  end
  
  # verify the required parameter 'id_or_name' is set
  fail "Missing the required parameter 'id_or_name' when calling create_news_0" if id_or_name.nil?
  
  # verify the required parameter 'title' is set
  fail "Missing the required parameter 'title' when calling create_news_0" if title.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling create_news_0" if body.nil?
  
  # resource path
  path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["title"] = title
  form_params["body"] = body

  # http body (model)
  post_body = nil
  

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

#create_news_with_http_info(title, body, group_id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Returns String data, response status code and response headers.

Parameters:

  • title

    news title

  • body

    news body in OSDN Wiki format.

  • group_id

    group_id the news created in

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

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers


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

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

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

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["title"] = title
  form_params["body"] = body

  # http body (model)
  post_body = nil
  

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

#delete_news(news_id, opts = {}) ⇒ nil

Parameters:

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

    the optional parameters

Returns:

  • (nil)

210
211
212
213
# File 'lib/osdn-client/api/project_news_api.rb', line 210

def delete_news(news_id, opts = {})
  delete_news_with_http_info(news_id, opts)
  return nil
end

#delete_news_0(id_or_name, news_id, opts = {}) ⇒ nil

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:

  • (nil)

538
539
540
541
# File 'lib/osdn-client/api/project_news_api.rb', line 538

def delete_news_0(id_or_name, news_id, opts = {})
  delete_news_0_with_http_info(id_or_name, news_id, opts)
  return nil
end

#delete_news_0_with_http_info(id_or_name, news_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers


549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
# File 'lib/osdn-client/api/project_news_api.rb', line 549

def delete_news_0_with_http_info(id_or_name, news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#delete_news_0 ..."
  end
  
  # verify the required parameter 'id_or_name' is set
  fail "Missing the required parameter 'id_or_name' when calling delete_news_0" if id_or_name.nil?
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling delete_news_0" if news_id.nil?
  
  # resource path
  path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'news_id' + '}', news_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#delete_news_with_http_info(news_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Returns nil, response status code and response headers.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers


220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/osdn-client/api/project_news_api.rb', line 220

def delete_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#delete_news ..."
  end
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling delete_news" if news_id.nil?
  
  # resource path
  path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#get_news(news_id, opts = {}) ⇒ News

Get single news object.

Parameters:

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

    the optional parameters

Returns:


149
150
151
152
# File 'lib/osdn-client/api/project_news_api.rb', line 149

def get_news(news_id, opts = {})
  data, status_code, headers = get_news_with_http_info(news_id, opts)
  return data
end

#get_news_0(id_or_name, news_id, opts = {}) ⇒ News

Get single news object.

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:


472
473
474
475
# File 'lib/osdn-client/api/project_news_api.rb', line 472

def get_news_0(id_or_name, news_id, opts = {})
  data, status_code, headers = get_news_0_with_http_info(id_or_name, news_id, opts)
  return data
end

#get_news_0_with_http_info(id_or_name, news_id, opts = {}) ⇒ Array<(News, Fixnum, Hash)>

Get single news object.

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:

  • (Array<(News, Fixnum, Hash)>)

    News data, response status code and response headers


483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
# File 'lib/osdn-client/api/project_news_api.rb', line 483

def get_news_0_with_http_info(id_or_name, news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#get_news_0 ..."
  end
  
  # verify the required parameter 'id_or_name' is set
  fail "Missing the required parameter 'id_or_name' when calling get_news_0" if id_or_name.nil?
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling get_news_0" if news_id.nil?
  
  # resource path
  path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s).sub('{' + 'news_id' + '}', news_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#get_news_with_http_info(news_id, opts = {}) ⇒ Array<(News, Fixnum, Hash)>

Get single news object.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(News, Fixnum, Hash)>)

    News data, response status code and response headers


159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/osdn-client/api/project_news_api.rb', line 159

def get_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#get_news ..."
  end
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling get_news" if news_id.nil?
  
  # resource path
  path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#list_news(opts = {}) ⇒ Array<News>

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :group_id (Integer)

    filter by group ID

Returns:


16
17
18
19
# File 'lib/osdn-client/api/project_news_api.rb', line 16

def list_news(opts = {})
  data, status_code, headers = list_news_with_http_info(opts)
  return data
end

#list_news_0(id_or_name, opts = {}) ⇒ Array<News>

Get news list of spscified project.

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:


337
338
339
340
# File 'lib/osdn-client/api/project_news_api.rb', line 337

def list_news_0(id_or_name, opts = {})
  data, status_code, headers = list_news_0_with_http_info(id_or_name, opts)
  return data
end

#list_news_0_with_http_info(id_or_name, opts = {}) ⇒ Array<(Array<News>, Fixnum, Hash)>

Get news list of spscified project.

Parameters:

  • id_or_name

    numeric project id or project name

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

    the optional parameters

Returns:

  • (Array<(Array<News>, Fixnum, Hash)>)

    Array<News> data, response status code and response headers


347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/osdn-client/api/project_news_api.rb', line 347

def list_news_0_with_http_info(id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#list_news_0 ..."
  end
  
  # verify the required parameter 'id_or_name' is set
  fail "Missing the required parameter 'id_or_name' when calling list_news_0" if id_or_name.nil?
  
  # resource path
  path = "/project/{id_or_name}/news".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#list_news_with_http_info(opts = {}) ⇒ Array<(Array<News>, Fixnum, Hash)>

Returns Array<News> data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :group_id (Integer)

    filter by group ID

Returns:

  • (Array<(Array<News>, Fixnum, Hash)>)

    Array<News> data, response status code and response headers


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/osdn-client/api/project_news_api.rb', line 26

def list_news_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#list_news ..."
  end
  
  # resource path
  path = "/news".sub('{format}','json')

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

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

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

#update_news(news_id, opts = {}) ⇒ News

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    news title

  • :body (String)

    news body in OSDN Wiki format.

Returns:


272
273
274
275
# File 'lib/osdn-client/api/project_news_api.rb', line 272

def update_news(news_id, opts = {})
  data, status_code, headers = update_news_with_http_info(news_id, opts)
  return data
end

#update_news_0(news_id, id_or_name, opts = {}) ⇒ News

Parameters:

  • news_id
  • id_or_name

    numeric project id or project name

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    news title

  • :body (String)

    news body in OSDN Wiki format.

Returns:


605
606
607
608
# File 'lib/osdn-client/api/project_news_api.rb', line 605

def update_news_0(news_id, id_or_name, opts = {})
  data, status_code, headers = update_news_0_with_http_info(news_id, id_or_name, opts)
  return data
end

#update_news_0_with_http_info(news_id, id_or_name, opts = {}) ⇒ Array<(News, Fixnum, Hash)>

Returns News data, response status code and response headers.

Parameters:

  • news_id
  • id_or_name

    numeric project id or project name

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    news title

  • :body (String)

    news body in OSDN Wiki format.

Returns:

  • (Array<(News, Fixnum, Hash)>)

    News data, response status code and response headers


618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/osdn-client/api/project_news_api.rb', line 618

def update_news_0_with_http_info(news_id, id_or_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#update_news_0 ..."
  end
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling update_news_0" if news_id.nil?
  
  # verify the required parameter 'id_or_name' is set
  fail "Missing the required parameter 'id_or_name' when calling update_news_0" if id_or_name.nil?
  
  # resource path
  path = "/project/{id_or_name}/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s).sub('{' + 'id_or_name' + '}', id_or_name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["title"] = opts[:'title'] if opts[:'title']
  form_params["body"] = opts[:'body'] if opts[:'body']

  # http body (model)
  post_body = nil
  

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

#update_news_with_http_info(news_id, opts = {}) ⇒ Array<(News, Fixnum, Hash)>

Returns News data, response status code and response headers.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :title (String)

    news title

  • :body (String)

    news body in OSDN Wiki format.

Returns:

  • (Array<(News, Fixnum, Hash)>)

    News data, response status code and response headers


284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/osdn-client/api/project_news_api.rb', line 284

def update_news_with_http_info(news_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ProjectNewsApi#update_news ..."
  end
  
  # verify the required parameter 'news_id' is set
  fail "Missing the required parameter 'news_id' when calling update_news" if news_id.nil?
  
  # resource path
  path = "/news/{news_id}".sub('{format}','json').sub('{' + 'news_id' + '}', news_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = []
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/x-www-form-urlencoded']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["title"] = opts[:'title'] if opts[:'title']
  form_params["body"] = opts[:'body'] if opts[:'body']

  # http body (model)
  post_body = nil
  

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