osdn-client 0.0.20160304 → 0.0.20160711
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +201 -0
- data/README.md +182 -0
- data/docs/DefaultApi.md +115 -0
- data/docs/Group.md +23 -0
- data/docs/GroupToolFlags.md +17 -0
- data/docs/News.md +14 -0
- data/docs/Package.md +13 -0
- data/docs/Pong.md +11 -0
- data/docs/ProjectApi.md +1511 -0
- data/docs/ProjectFrsApi.md +888 -0
- data/docs/ProjectNewsApi.md +576 -0
- data/docs/RelFile.md +19 -0
- data/docs/Release.md +16 -0
- data/docs/SimpleChamber.md +11 -0
- data/docs/SimpleGroup.md +11 -0
- data/docs/SimpleUser.md +10 -0
- data/docs/Skill.md +11 -0
- data/docs/Token.md +12 -0
- data/docs/User.md +20 -0
- data/docs/UserApi.md +63 -0
- data/lib/osdn-client.rb +32 -9
- data/lib/osdn-client/api/default_api.rb +50 -39
- data/lib/osdn-client/api/project_api.rb +661 -773
- data/lib/osdn-client/api/project_frs_api.rb +350 -412
- data/lib/osdn-client/api/project_news_api.rb +217 -244
- data/lib/osdn-client/api/user_api.rb +35 -20
- data/lib/osdn-client/api_client.rb +74 -13
- data/lib/osdn-client/api_error.rb +23 -0
- data/lib/osdn-client/configuration.rb +45 -1
- data/lib/osdn-client/models/group.rb +103 -65
- data/lib/osdn-client/models/group_tool_flags.rb +91 -47
- data/lib/osdn-client/models/news.rb +85 -38
- data/lib/osdn-client/models/package.rb +83 -35
- data/lib/osdn-client/models/pong.rb +79 -29
- data/lib/osdn-client/models/rel_file.rb +95 -53
- data/lib/osdn-client/models/release.rb +89 -44
- data/lib/osdn-client/models/simple_chamber.rb +79 -29
- data/lib/osdn-client/models/simple_group.rb +79 -29
- data/lib/osdn-client/models/simple_user.rb +77 -26
- data/lib/osdn-client/models/skill.rb +79 -29
- data/lib/osdn-client/models/token.rb +81 -32
- data/lib/osdn-client/models/user.rb +97 -56
- data/lib/osdn-client/version.rb +24 -1
- data/osdn-client.gemspec +30 -7
- data/spec/api/default_api_spec.rb +73 -0
- data/spec/api/{ProjectApi_spec.rb → project_api_spec.rb} +187 -264
- data/spec/api/{ProjectFrsApi_spec.rb → project_frs_api_spec.rb} +103 -136
- data/spec/api/{ProjectNewsApi_spec.rb → project_news_api_spec.rb} +71 -88
- data/spec/api/user_api_spec.rb +58 -0
- data/spec/api_client_spec.rb +315 -0
- data/spec/configuration_spec.rb +48 -0
- data/spec/models/group_spec.rb +143 -0
- data/spec/models/group_tool_flags_spec.rb +107 -0
- data/spec/models/news_spec.rb +89 -0
- data/spec/models/package_spec.rb +83 -0
- data/spec/models/pong_spec.rb +71 -0
- data/spec/models/rel_file_spec.rb +119 -0
- data/spec/models/release_spec.rb +101 -0
- data/spec/models/simple_chamber_spec.rb +71 -0
- data/spec/models/simple_group_spec.rb +71 -0
- data/spec/models/simple_user_spec.rb +65 -0
- data/spec/models/skill_spec.rb +71 -0
- data/spec/models/token_spec.rb +77 -0
- data/spec/models/user_spec.rb +125 -0
- data/spec/spec_helper.rb +122 -0
- metadata +87 -59
- data/spec/api/DefaultApi_spec.rb +0 -58
- data/spec/api/UserApi_spec.rb +0 -39
- data/spec/models/GroupToolFlags_spec.rb +0 -124
- data/spec/models/Group_spec.rb +0 -184
- data/spec/models/News_spec.rb +0 -94
- data/spec/models/Package_spec.rb +0 -84
- data/spec/models/Pong_spec.rb +0 -64
- data/spec/models/RelFile_spec.rb +0 -144
- data/spec/models/Release_spec.rb +0 -114
- data/spec/models/SimpleChamber_spec.rb +0 -64
- data/spec/models/SimpleGroup_spec.rb +0 -64
- data/spec/models/SimpleUser_spec.rb +0 -54
- data/spec/models/Skill_spec.rb +0 -64
- data/spec/models/Token_spec.rb +0 -74
- data/spec/models/User_spec.rb +0 -154
@@ -1,3 +1,26 @@
|
|
1
|
+
=begin
|
2
|
+
#OSDN REST API v0 beta
|
3
|
+
|
4
|
+
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.jp/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.jp/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20160304
|
7
|
+
Contact: admin@osdn.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
1
24
|
require "uri"
|
2
25
|
|
3
26
|
module OSDNClient
|
@@ -9,30 +32,28 @@ module OSDNClient
|
|
9
32
|
end
|
10
33
|
|
11
34
|
#
|
12
|
-
# Get user profile.
|
35
|
+
# Get user profile.
|
13
36
|
# @param id_or_name numeric user id or user name
|
14
37
|
# @param [Hash] opts the optional parameters
|
15
38
|
# @return [User]
|
16
39
|
def get_user(id_or_name, opts = {})
|
17
|
-
data,
|
40
|
+
data, _status_code, _headers = get_user_with_http_info(id_or_name, opts)
|
18
41
|
return data
|
19
42
|
end
|
20
43
|
|
21
44
|
#
|
22
|
-
# Get user profile.
|
45
|
+
# Get user profile.
|
23
46
|
# @param id_or_name numeric user id or user name
|
24
47
|
# @param [Hash] opts the optional parameters
|
25
48
|
# @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
|
26
49
|
def get_user_with_http_info(id_or_name, opts = {})
|
27
50
|
if @api_client.config.debugging
|
28
|
-
@api_client.config.logger.debug "Calling API: UserApi
|
51
|
+
@api_client.config.logger.debug "Calling API: UserApi.get_user ..."
|
29
52
|
end
|
30
|
-
|
31
53
|
# verify the required parameter 'id_or_name' is set
|
32
|
-
fail "Missing the required parameter 'id_or_name' when calling get_user" if id_or_name.nil?
|
33
|
-
|
54
|
+
fail ArgumentError, "Missing the required parameter 'id_or_name' when calling UserApi.get_user" if id_or_name.nil?
|
34
55
|
# resource path
|
35
|
-
|
56
|
+
local_var_path = "/user/{id_or_name}".sub('{format}','json').sub('{' + 'id_or_name' + '}', id_or_name.to_s)
|
36
57
|
|
37
58
|
# query parameters
|
38
59
|
query_params = {}
|
@@ -41,22 +62,20 @@ module OSDNClient
|
|
41
62
|
header_params = {}
|
42
63
|
|
43
64
|
# HTTP header 'Accept' (if needed)
|
44
|
-
|
45
|
-
|
65
|
+
local_header_accept = []
|
66
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
46
67
|
|
47
68
|
# HTTP header 'Content-Type'
|
48
|
-
|
49
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(
|
69
|
+
local_header_content_type = ['application/x-www-form-urlencoded']
|
70
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
50
71
|
|
51
72
|
# form parameters
|
52
73
|
form_params = {}
|
53
74
|
|
54
75
|
# http body (model)
|
55
76
|
post_body = nil
|
56
|
-
|
57
|
-
|
58
|
-
auth_names = ['oauth2-implicit']
|
59
|
-
data, status_code, headers = @api_client.call_api(:GET, path,
|
77
|
+
auth_names = ['oauth2-code', 'oauth2-implicit']
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
60
79
|
:header_params => header_params,
|
61
80
|
:query_params => query_params,
|
62
81
|
:form_params => form_params,
|
@@ -70,7 +89,3 @@ module OSDNClient
|
|
70
89
|
end
|
71
90
|
end
|
72
91
|
end
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
@@ -1,3 +1,26 @@
|
|
1
|
+
=begin
|
2
|
+
#OSDN REST API v0 beta
|
3
|
+
|
4
|
+
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.jp/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.jp/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20160304
|
7
|
+
Contact: admin@osdn.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
1
24
|
require 'date'
|
2
25
|
require 'json'
|
3
26
|
require 'logger'
|
@@ -15,9 +38,11 @@ module OSDNClient
|
|
15
38
|
# @return [Hash]
|
16
39
|
attr_accessor :default_headers
|
17
40
|
|
41
|
+
# Initializes the ApiClient
|
42
|
+
# @option config [Configuration] Configuraiton for initializing the object, default to Configuration.default
|
18
43
|
def initialize(config = Configuration.default)
|
19
44
|
@config = config
|
20
|
-
@user_agent = "
|
45
|
+
@user_agent = "Swagger-Codegen/#{VERSION}/ruby"
|
21
46
|
@default_headers = {
|
22
47
|
'Content-Type' => "application/json",
|
23
48
|
'User-Agent' => @user_agent
|
@@ -55,6 +80,15 @@ module OSDNClient
|
|
55
80
|
return data, response.code, response.headers
|
56
81
|
end
|
57
82
|
|
83
|
+
# Builds the HTTP request
|
84
|
+
#
|
85
|
+
# @param [String] http_method HTTP method/verb (e.g. POST)
|
86
|
+
# @param [String] path URL path (e.g. /account/new)
|
87
|
+
# @option opts [Hash] :header_params Header parameters
|
88
|
+
# @option opts [Hash] :query_params Query parameters
|
89
|
+
# @option opts [Hash] :form_params Query parameters
|
90
|
+
# @option opts [Object] :body HTTP body (JSON/XML)
|
91
|
+
# @return [Typhoeus::Request] A Typhoeus Request
|
58
92
|
def build_request(http_method, path, opts = {})
|
59
93
|
url = build_request_url(path)
|
60
94
|
http_method = http_method.to_sym.downcase
|
@@ -63,22 +97,27 @@ module OSDNClient
|
|
63
97
|
query_params = opts[:query_params] || {}
|
64
98
|
form_params = opts[:form_params] || {}
|
65
99
|
|
66
|
-
|
67
100
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
68
|
-
|
101
|
+
|
102
|
+
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
103
|
+
_verify_ssl_host = @config.verify_ssl_host ? 2 : 0
|
69
104
|
|
70
105
|
req_opts = {
|
71
106
|
:method => http_method,
|
72
107
|
:headers => header_params,
|
73
108
|
:params => query_params,
|
109
|
+
:params_encoding => @config.params_encoding,
|
74
110
|
:timeout => @config.timeout,
|
75
111
|
:ssl_verifypeer => @config.verify_ssl,
|
112
|
+
:ssl_verifyhost => _verify_ssl_host,
|
76
113
|
:sslcert => @config.cert_file,
|
77
114
|
:sslkey => @config.key_file,
|
78
|
-
:cainfo => @config.ssl_ca_cert,
|
79
115
|
:verbose => @config.debugging
|
80
116
|
}
|
81
117
|
|
118
|
+
# set custom cert, if provided
|
119
|
+
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
120
|
+
|
82
121
|
if [:post, :patch, :put, :delete].include?(http_method)
|
83
122
|
req_body = build_request_body(header_params, form_params, opts[:body])
|
84
123
|
req_opts.update :body => req_body
|
@@ -95,17 +134,23 @@ module OSDNClient
|
|
95
134
|
# application/json
|
96
135
|
# application/json; charset=UTF8
|
97
136
|
# APPLICATION/JSON
|
137
|
+
# @param [String] mime MIME
|
138
|
+
# @return [Boolean] True if the MIME is applicaton/json
|
98
139
|
def json_mime?(mime)
|
99
|
-
|
140
|
+
!(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
|
100
141
|
end
|
101
142
|
|
102
143
|
# Deserialize the response to the given return type.
|
103
144
|
#
|
145
|
+
# @param [Response] response HTTP response
|
104
146
|
# @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
|
105
147
|
def deserialize(response, return_type)
|
106
148
|
body = response.body
|
107
149
|
return nil if body.nil? || body.empty?
|
108
150
|
|
151
|
+
# return response body directly for String return type
|
152
|
+
return body if return_type == 'String'
|
153
|
+
|
109
154
|
# handle file downloading - save response body into a tmp file and return the File instance
|
110
155
|
return download_file(response) if return_type == 'File'
|
111
156
|
|
@@ -128,6 +173,9 @@ module OSDNClient
|
|
128
173
|
end
|
129
174
|
|
130
175
|
# Convert data to the given return type.
|
176
|
+
# @param [Object] data Data to be converted
|
177
|
+
# @param [String] return_type Return type
|
178
|
+
# @return [Mixed] Data in a particular type
|
131
179
|
def convert_to_type(data, return_type)
|
132
180
|
return nil if data.nil?
|
133
181
|
case return_type
|
@@ -146,7 +194,7 @@ module OSDNClient
|
|
146
194
|
# parse date time (expecting ISO 8601 format)
|
147
195
|
Date.parse data
|
148
196
|
when 'Object'
|
149
|
-
# generic object, return directly
|
197
|
+
# generic object (usually a Hash), return directly
|
150
198
|
data
|
151
199
|
when /\AArray<(.+)>\z/
|
152
200
|
# e.g. Array<Pet>
|
@@ -173,7 +221,7 @@ module OSDNClient
|
|
173
221
|
# @return [Tempfile] the file downloaded
|
174
222
|
def download_file(response)
|
175
223
|
content_disposition = response.headers['Content-Disposition']
|
176
|
-
if content_disposition
|
224
|
+
if content_disposition and content_disposition =~ /filename=/i
|
177
225
|
filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
|
178
226
|
prefix = sanitize_filename(filename)
|
179
227
|
else
|
@@ -200,7 +248,7 @@ module OSDNClient
|
|
200
248
|
# @param [String] filename the filename to be sanitized
|
201
249
|
# @return [String] the sanitized filename
|
202
250
|
def sanitize_filename(filename)
|
203
|
-
filename.gsub
|
251
|
+
filename.gsub(/.*[\/\\]/, '')
|
204
252
|
end
|
205
253
|
|
206
254
|
def build_request_url(path)
|
@@ -209,6 +257,12 @@ module OSDNClient
|
|
209
257
|
URI.encode(@config.base_url + path)
|
210
258
|
end
|
211
259
|
|
260
|
+
# Builds the HTTP request body
|
261
|
+
#
|
262
|
+
# @param [Hash] header_params Header parameters
|
263
|
+
# @param [Hash] form_params Query parameters
|
264
|
+
# @param [Object] body HTTP body (JSON/XML)
|
265
|
+
# @return [String] HTTP body data in the form of string
|
212
266
|
def build_request_body(header_params, form_params, body)
|
213
267
|
# http form
|
214
268
|
if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
|
@@ -232,6 +286,10 @@ module OSDNClient
|
|
232
286
|
end
|
233
287
|
|
234
288
|
# Update hearder and query params based on authentication settings.
|
289
|
+
#
|
290
|
+
# @param [Hash] header_params Header parameters
|
291
|
+
# @param [Hash] form_params Query parameters
|
292
|
+
# @param [String] auth_names Authentication scheme name
|
235
293
|
def update_params_for_auth!(header_params, query_params, auth_names)
|
236
294
|
Array(auth_names).each do |auth_name|
|
237
295
|
auth_setting = @config.auth_settings[auth_name]
|
@@ -244,6 +302,9 @@ module OSDNClient
|
|
244
302
|
end
|
245
303
|
end
|
246
304
|
|
305
|
+
# Sets user agent in HTTP header
|
306
|
+
#
|
307
|
+
# @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
|
247
308
|
def user_agent=(user_agent)
|
248
309
|
@user_agent = user_agent
|
249
310
|
@default_headers['User-Agent'] = @user_agent
|
@@ -274,14 +335,14 @@ module OSDNClient
|
|
274
335
|
# @param [Object] model object to be converted into JSON string
|
275
336
|
# @return [String] JSON string representation of the object
|
276
337
|
def object_to_http_body(model)
|
277
|
-
return if model.nil?
|
278
|
-
|
338
|
+
return model if model.nil? || model.is_a?(String)
|
339
|
+
local_body = nil
|
279
340
|
if model.is_a?(Array)
|
280
|
-
|
341
|
+
local_body = model.map{|m| object_to_hash(m) }
|
281
342
|
else
|
282
|
-
|
343
|
+
local_body = object_to_hash(model)
|
283
344
|
end
|
284
|
-
|
345
|
+
local_body.to_json
|
285
346
|
end
|
286
347
|
|
287
348
|
# Convert object(non-array) to hash.
|
@@ -1,3 +1,26 @@
|
|
1
|
+
=begin
|
2
|
+
#OSDN REST API v0 beta
|
3
|
+
|
4
|
+
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.jp/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.jp/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20160304
|
7
|
+
Contact: admin@osdn.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
1
24
|
module OSDNClient
|
2
25
|
class ApiError < StandardError
|
3
26
|
attr_reader :code, :response_headers, :response_body
|
@@ -1,3 +1,26 @@
|
|
1
|
+
=begin
|
2
|
+
#OSDN REST API v0 beta
|
3
|
+
|
4
|
+
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.jp/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.jp/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20160304
|
7
|
+
Contact: admin@osdn.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
1
24
|
require 'uri'
|
2
25
|
|
3
26
|
module OSDNClient
|
@@ -64,7 +87,7 @@ module OSDNClient
|
|
64
87
|
# Default to 0 (never times out).
|
65
88
|
attr_accessor :timeout
|
66
89
|
|
67
|
-
### TLS/SSL
|
90
|
+
### TLS/SSL setting
|
68
91
|
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
69
92
|
# Default to true.
|
70
93
|
#
|
@@ -73,6 +96,16 @@ module OSDNClient
|
|
73
96
|
# @return [true, false]
|
74
97
|
attr_accessor :verify_ssl
|
75
98
|
|
99
|
+
### TLS/SSL setting
|
100
|
+
# Set this to false to skip verifying SSL host name
|
101
|
+
# Default to true.
|
102
|
+
#
|
103
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
104
|
+
#
|
105
|
+
# @return [true, false]
|
106
|
+
attr_accessor :verify_ssl_host
|
107
|
+
|
108
|
+
### TLS/SSL setting
|
76
109
|
# Set this to customize the certificate file to verify the peer.
|
77
110
|
#
|
78
111
|
# @return [String] the path to the certificate file
|
@@ -81,12 +114,21 @@ module OSDNClient
|
|
81
114
|
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
82
115
|
attr_accessor :ssl_ca_cert
|
83
116
|
|
117
|
+
### TLS/SSL setting
|
84
118
|
# Client certificate file (for client certificate)
|
85
119
|
attr_accessor :cert_file
|
86
120
|
|
121
|
+
### TLS/SSL setting
|
87
122
|
# Client private key file (for client certificate)
|
88
123
|
attr_accessor :key_file
|
89
124
|
|
125
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
126
|
+
# Default to nil.
|
127
|
+
#
|
128
|
+
# @see The params_encoding option of Ethon. Related source code:
|
129
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
130
|
+
attr_accessor :params_encoding
|
131
|
+
|
90
132
|
attr_accessor :inject_format
|
91
133
|
|
92
134
|
attr_accessor :force_ending_format
|
@@ -99,6 +141,8 @@ module OSDNClient
|
|
99
141
|
@api_key_prefix = {}
|
100
142
|
@timeout = 0
|
101
143
|
@verify_ssl = true
|
144
|
+
@verify_ssl_host = true
|
145
|
+
@params_encoding = nil
|
102
146
|
@cert_file = nil
|
103
147
|
@key_file = nil
|
104
148
|
@debugging = false
|
@@ -1,6 +1,30 @@
|
|
1
|
+
=begin
|
2
|
+
#OSDN REST API v0 beta
|
3
|
+
|
4
|
+
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.jp/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.jp/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20160304
|
7
|
+
Contact: admin@osdn.jp
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
1
24
|
require 'date'
|
2
25
|
|
3
26
|
module OSDNClient
|
27
|
+
|
4
28
|
class Group
|
5
29
|
attr_accessor :id
|
6
30
|
|
@@ -34,42 +58,26 @@ module OSDNClient
|
|
34
58
|
|
35
59
|
attr_accessor :members
|
36
60
|
|
61
|
+
|
37
62
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
63
|
def self.attribute_map
|
39
64
|
{
|
40
|
-
|
41
65
|
:'id' => :'id',
|
42
|
-
|
43
66
|
:'name' => :'name',
|
44
|
-
|
45
67
|
:'display_name' => :'display_name',
|
46
|
-
|
47
68
|
:'last_update' => :'last_update',
|
48
|
-
|
49
69
|
:'description' => :'description',
|
50
|
-
|
51
70
|
:'description_html' => :'description_html',
|
52
|
-
|
53
71
|
:'start_date' => :'start_date',
|
54
|
-
|
55
72
|
:'license' => :'license',
|
56
|
-
|
57
73
|
:'license_other' => :'license_other',
|
58
|
-
|
59
74
|
:'url' => :'url',
|
60
|
-
|
61
75
|
:'homepage' => :'homepage',
|
62
|
-
|
63
76
|
:'logo_image' => :'logo_image',
|
64
|
-
|
65
77
|
:'banner_image' => :'banner_image',
|
66
|
-
|
67
78
|
:'thumbnail_image' => :'thumbnail_image',
|
68
|
-
|
69
79
|
:'tools' => :'tools',
|
70
|
-
|
71
80
|
:'members' => :'members'
|
72
|
-
|
73
81
|
}
|
74
82
|
end
|
75
83
|
|
@@ -92,86 +100,100 @@ module OSDNClient
|
|
92
100
|
:'thumbnail_image' => :'String',
|
93
101
|
:'tools' => :'GroupToolFlags',
|
94
102
|
:'members' => :'Array<SimpleUser>'
|
95
|
-
|
96
103
|
}
|
97
104
|
end
|
98
105
|
|
106
|
+
# Initializes the object
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
108
|
def initialize(attributes = {})
|
100
109
|
return unless attributes.is_a?(Hash)
|
101
110
|
|
102
111
|
# convert string to symbol for hash key
|
103
|
-
attributes = attributes.
|
112
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
104
113
|
|
105
|
-
|
106
|
-
if attributes[:'id']
|
114
|
+
if attributes.has_key?(:'id')
|
107
115
|
self.id = attributes[:'id']
|
108
116
|
end
|
109
|
-
|
110
|
-
if attributes
|
117
|
+
|
118
|
+
if attributes.has_key?(:'name')
|
111
119
|
self.name = attributes[:'name']
|
112
120
|
end
|
113
|
-
|
114
|
-
if attributes
|
121
|
+
|
122
|
+
if attributes.has_key?(:'display_name')
|
115
123
|
self.display_name = attributes[:'display_name']
|
116
124
|
end
|
117
|
-
|
118
|
-
if attributes
|
125
|
+
|
126
|
+
if attributes.has_key?(:'last_update')
|
119
127
|
self.last_update = attributes[:'last_update']
|
120
128
|
end
|
121
|
-
|
122
|
-
if attributes
|
129
|
+
|
130
|
+
if attributes.has_key?(:'description')
|
123
131
|
self.description = attributes[:'description']
|
124
132
|
end
|
125
|
-
|
126
|
-
if attributes
|
133
|
+
|
134
|
+
if attributes.has_key?(:'description_html')
|
127
135
|
self.description_html = attributes[:'description_html']
|
128
136
|
end
|
129
|
-
|
130
|
-
if attributes
|
137
|
+
|
138
|
+
if attributes.has_key?(:'start_date')
|
131
139
|
self.start_date = attributes[:'start_date']
|
132
140
|
end
|
133
|
-
|
134
|
-
if attributes
|
141
|
+
|
142
|
+
if attributes.has_key?(:'license')
|
135
143
|
self.license = attributes[:'license']
|
136
144
|
end
|
137
|
-
|
138
|
-
if attributes
|
145
|
+
|
146
|
+
if attributes.has_key?(:'license_other')
|
139
147
|
self.license_other = attributes[:'license_other']
|
140
148
|
end
|
141
|
-
|
142
|
-
if attributes
|
149
|
+
|
150
|
+
if attributes.has_key?(:'url')
|
143
151
|
self.url = attributes[:'url']
|
144
152
|
end
|
145
|
-
|
146
|
-
if attributes
|
153
|
+
|
154
|
+
if attributes.has_key?(:'homepage')
|
147
155
|
self.homepage = attributes[:'homepage']
|
148
156
|
end
|
149
|
-
|
150
|
-
if attributes
|
157
|
+
|
158
|
+
if attributes.has_key?(:'logo_image')
|
151
159
|
self.logo_image = attributes[:'logo_image']
|
152
160
|
end
|
153
|
-
|
154
|
-
if attributes
|
161
|
+
|
162
|
+
if attributes.has_key?(:'banner_image')
|
155
163
|
self.banner_image = attributes[:'banner_image']
|
156
164
|
end
|
157
|
-
|
158
|
-
if attributes
|
165
|
+
|
166
|
+
if attributes.has_key?(:'thumbnail_image')
|
159
167
|
self.thumbnail_image = attributes[:'thumbnail_image']
|
160
168
|
end
|
161
|
-
|
162
|
-
if attributes
|
169
|
+
|
170
|
+
if attributes.has_key?(:'tools')
|
163
171
|
self.tools = attributes[:'tools']
|
164
172
|
end
|
165
|
-
|
166
|
-
if attributes
|
173
|
+
|
174
|
+
if attributes.has_key?(:'members')
|
167
175
|
if (value = attributes[:'members']).is_a?(Array)
|
168
176
|
self.members = value
|
169
177
|
end
|
170
178
|
end
|
171
|
-
|
179
|
+
|
172
180
|
end
|
173
181
|
|
174
|
-
#
|
182
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
183
|
+
# @return Array for valid properies with the reasons
|
184
|
+
def list_invalid_properties
|
185
|
+
invalid_properties = Array.new
|
186
|
+
return invalid_properties
|
187
|
+
end
|
188
|
+
|
189
|
+
# Check to see if the all the properties in the model are valid
|
190
|
+
# @return true if the model is valid
|
191
|
+
def valid?
|
192
|
+
return true
|
193
|
+
end
|
194
|
+
|
195
|
+
# Checks equality by comparing each attribute.
|
196
|
+
# @param [Object] Object to be compared
|
175
197
|
def ==(o)
|
176
198
|
return true if self.equal?(o)
|
177
199
|
self.class == o.class &&
|
@@ -194,35 +216,41 @@ module OSDNClient
|
|
194
216
|
end
|
195
217
|
|
196
218
|
# @see the `==` method
|
219
|
+
# @param [Object] Object to be compared
|
197
220
|
def eql?(o)
|
198
221
|
self == o
|
199
222
|
end
|
200
223
|
|
201
|
-
#
|
224
|
+
# Calculates hash code according to all attributes.
|
225
|
+
# @return [Fixnum] Hash code
|
202
226
|
def hash
|
203
227
|
[id, name, display_name, last_update, description, description_html, start_date, license, license_other, url, homepage, logo_image, banner_image, thumbnail_image, tools, members].hash
|
204
228
|
end
|
205
229
|
|
206
|
-
#
|
230
|
+
# Builds the object from hash
|
231
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
232
|
+
# @return [Object] Returns the model itself
|
207
233
|
def build_from_hash(attributes)
|
208
234
|
return nil unless attributes.is_a?(Hash)
|
209
235
|
self.class.swagger_types.each_pair do |key, type|
|
210
236
|
if type =~ /^Array<(.*)>/i
|
237
|
+
# check to ensure the input is an array given that the the attribute
|
238
|
+
# is documented as an array but the input is not
|
211
239
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
212
240
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
213
|
-
else
|
214
|
-
#TODO show warning in debug mode
|
215
241
|
end
|
216
242
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
217
243
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
218
|
-
else
|
219
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
220
|
-
end
|
244
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
221
245
|
end
|
222
246
|
|
223
247
|
self
|
224
248
|
end
|
225
249
|
|
250
|
+
# Deserializes the data based on type
|
251
|
+
# @param string type Data type
|
252
|
+
# @param string value Value to be deserialized
|
253
|
+
# @return [Object] Deserialized data
|
226
254
|
def _deserialize(type, value)
|
227
255
|
case type.to_sym
|
228
256
|
when :DateTime
|
@@ -241,6 +269,9 @@ module OSDNClient
|
|
241
269
|
else
|
242
270
|
false
|
243
271
|
end
|
272
|
+
when :Object
|
273
|
+
# generic object (usually a Hash), return directly
|
274
|
+
value
|
244
275
|
when /\AArray<(?<inner_type>.+)>\z/
|
245
276
|
inner_type = Regexp.last_match[:inner_type]
|
246
277
|
value.map { |v| _deserialize(inner_type, v) }
|
@@ -253,21 +284,25 @@ module OSDNClient
|
|
253
284
|
end
|
254
285
|
end
|
255
286
|
else # model
|
256
|
-
|
257
|
-
|
287
|
+
temp_model = OSDNClient.const_get(type).new
|
288
|
+
temp_model.build_from_hash(value)
|
258
289
|
end
|
259
290
|
end
|
260
291
|
|
292
|
+
# Returns the string representation of the object
|
293
|
+
# @return [String] String presentation of the object
|
261
294
|
def to_s
|
262
295
|
to_hash.to_s
|
263
296
|
end
|
264
297
|
|
265
|
-
# to_body is an alias to
|
298
|
+
# to_body is an alias to to_hash (backward compatibility)
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
266
300
|
def to_body
|
267
301
|
to_hash
|
268
302
|
end
|
269
303
|
|
270
|
-
#
|
304
|
+
# Returns the object in the form of hash
|
305
|
+
# @return [Hash] Returns the object in the form of hash
|
271
306
|
def to_hash
|
272
307
|
hash = {}
|
273
308
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -278,8 +313,10 @@ module OSDNClient
|
|
278
313
|
hash
|
279
314
|
end
|
280
315
|
|
281
|
-
#
|
316
|
+
# Outputs non-array value in the form of hash
|
282
317
|
# For object, use to_hash. Otherwise, just return the value
|
318
|
+
# @param [Object] value Any valid value
|
319
|
+
# @return [Hash] Returns the value in the form of hash
|
283
320
|
def _to_hash(value)
|
284
321
|
if value.is_a?(Array)
|
285
322
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -295,4 +332,5 @@ module OSDNClient
|
|
295
332
|
end
|
296
333
|
|
297
334
|
end
|
335
|
+
|
298
336
|
end
|