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,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 Package
|
5
29
|
attr_accessor :id
|
6
30
|
|
@@ -14,22 +38,16 @@ module OSDNClient
|
|
14
38
|
|
15
39
|
attr_accessor :releases
|
16
40
|
|
41
|
+
|
17
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
18
43
|
def self.attribute_map
|
19
44
|
{
|
20
|
-
|
21
45
|
:'id' => :'id',
|
22
|
-
|
23
46
|
:'name' => :'name',
|
24
|
-
|
25
47
|
:'url' => :'url',
|
26
|
-
|
27
48
|
:'visibility' => :'visibility',
|
28
|
-
|
29
49
|
:'group_id' => :'group_id',
|
30
|
-
|
31
50
|
:'releases' => :'releases'
|
32
|
-
|
33
51
|
}
|
34
52
|
end
|
35
53
|
|
@@ -42,46 +60,60 @@ module OSDNClient
|
|
42
60
|
:'visibility' => :'String',
|
43
61
|
:'group_id' => :'Integer',
|
44
62
|
:'releases' => :'Array<Release>'
|
45
|
-
|
46
63
|
}
|
47
64
|
end
|
48
65
|
|
66
|
+
# Initializes the object
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
68
|
def initialize(attributes = {})
|
50
69
|
return unless attributes.is_a?(Hash)
|
51
70
|
|
52
71
|
# convert string to symbol for hash key
|
53
|
-
attributes = attributes.
|
72
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
54
73
|
|
55
|
-
|
56
|
-
if attributes[:'id']
|
74
|
+
if attributes.has_key?(:'id')
|
57
75
|
self.id = attributes[:'id']
|
58
76
|
end
|
59
|
-
|
60
|
-
if attributes
|
77
|
+
|
78
|
+
if attributes.has_key?(:'name')
|
61
79
|
self.name = attributes[:'name']
|
62
80
|
end
|
63
|
-
|
64
|
-
if attributes
|
81
|
+
|
82
|
+
if attributes.has_key?(:'url')
|
65
83
|
self.url = attributes[:'url']
|
66
84
|
end
|
67
|
-
|
68
|
-
if attributes
|
85
|
+
|
86
|
+
if attributes.has_key?(:'visibility')
|
69
87
|
self.visibility = attributes[:'visibility']
|
70
88
|
end
|
71
|
-
|
72
|
-
if attributes
|
89
|
+
|
90
|
+
if attributes.has_key?(:'group_id')
|
73
91
|
self.group_id = attributes[:'group_id']
|
74
92
|
end
|
75
|
-
|
76
|
-
if attributes
|
93
|
+
|
94
|
+
if attributes.has_key?(:'releases')
|
77
95
|
if (value = attributes[:'releases']).is_a?(Array)
|
78
96
|
self.releases = value
|
79
97
|
end
|
80
98
|
end
|
81
|
-
|
99
|
+
|
82
100
|
end
|
83
101
|
|
84
|
-
#
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
103
|
+
# @return Array for valid properies with the reasons
|
104
|
+
def list_invalid_properties
|
105
|
+
invalid_properties = Array.new
|
106
|
+
return invalid_properties
|
107
|
+
end
|
108
|
+
|
109
|
+
# Check to see if the all the properties in the model are valid
|
110
|
+
# @return true if the model is valid
|
111
|
+
def valid?
|
112
|
+
return true
|
113
|
+
end
|
114
|
+
|
115
|
+
# Checks equality by comparing each attribute.
|
116
|
+
# @param [Object] Object to be compared
|
85
117
|
def ==(o)
|
86
118
|
return true if self.equal?(o)
|
87
119
|
self.class == o.class &&
|
@@ -94,35 +126,41 @@ module OSDNClient
|
|
94
126
|
end
|
95
127
|
|
96
128
|
# @see the `==` method
|
129
|
+
# @param [Object] Object to be compared
|
97
130
|
def eql?(o)
|
98
131
|
self == o
|
99
132
|
end
|
100
133
|
|
101
|
-
#
|
134
|
+
# Calculates hash code according to all attributes.
|
135
|
+
# @return [Fixnum] Hash code
|
102
136
|
def hash
|
103
137
|
[id, name, url, visibility, group_id, releases].hash
|
104
138
|
end
|
105
139
|
|
106
|
-
#
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
107
143
|
def build_from_hash(attributes)
|
108
144
|
return nil unless attributes.is_a?(Hash)
|
109
145
|
self.class.swagger_types.each_pair do |key, type|
|
110
146
|
if type =~ /^Array<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the the attribute
|
148
|
+
# is documented as an array but the input is not
|
111
149
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
112
150
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
113
|
-
else
|
114
|
-
#TODO show warning in debug mode
|
115
151
|
end
|
116
152
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
153
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
-
else
|
119
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
120
|
-
end
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
155
|
end
|
122
156
|
|
123
157
|
self
|
124
158
|
end
|
125
159
|
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
126
164
|
def _deserialize(type, value)
|
127
165
|
case type.to_sym
|
128
166
|
when :DateTime
|
@@ -141,6 +179,9 @@ module OSDNClient
|
|
141
179
|
else
|
142
180
|
false
|
143
181
|
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
144
185
|
when /\AArray<(?<inner_type>.+)>\z/
|
145
186
|
inner_type = Regexp.last_match[:inner_type]
|
146
187
|
value.map { |v| _deserialize(inner_type, v) }
|
@@ -153,21 +194,25 @@ module OSDNClient
|
|
153
194
|
end
|
154
195
|
end
|
155
196
|
else # model
|
156
|
-
|
157
|
-
|
197
|
+
temp_model = OSDNClient.const_get(type).new
|
198
|
+
temp_model.build_from_hash(value)
|
158
199
|
end
|
159
200
|
end
|
160
201
|
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
161
204
|
def to_s
|
162
205
|
to_hash.to_s
|
163
206
|
end
|
164
207
|
|
165
|
-
# to_body is an alias to
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
166
210
|
def to_body
|
167
211
|
to_hash
|
168
212
|
end
|
169
213
|
|
170
|
-
#
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
171
216
|
def to_hash
|
172
217
|
hash = {}
|
173
218
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -178,8 +223,10 @@ module OSDNClient
|
|
178
223
|
hash
|
179
224
|
end
|
180
225
|
|
181
|
-
#
|
226
|
+
# Outputs non-array value in the form of hash
|
182
227
|
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
183
230
|
def _to_hash(value)
|
184
231
|
if value.is_a?(Array)
|
185
232
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -195,4 +242,5 @@ module OSDNClient
|
|
195
242
|
end
|
196
243
|
|
197
244
|
end
|
245
|
+
|
198
246
|
end
|
@@ -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 Pong
|
5
29
|
attr_accessor :time
|
6
30
|
|
@@ -10,18 +34,14 @@ module OSDNClient
|
|
10
34
|
|
11
35
|
attr_accessor :login_name
|
12
36
|
|
37
|
+
|
13
38
|
# Attribute mapping from ruby-style variable name to JSON key.
|
14
39
|
def self.attribute_map
|
15
40
|
{
|
16
|
-
|
17
41
|
:'time' => :'time',
|
18
|
-
|
19
42
|
:'loggedin' => :'loggedin',
|
20
|
-
|
21
43
|
:'login_id' => :'login_id',
|
22
|
-
|
23
44
|
:'login_name' => :'login_name'
|
24
|
-
|
25
45
|
}
|
26
46
|
end
|
27
47
|
|
@@ -32,36 +52,50 @@ module OSDNClient
|
|
32
52
|
:'loggedin' => :'BOOLEAN',
|
33
53
|
:'login_id' => :'Integer',
|
34
54
|
:'login_name' => :'String'
|
35
|
-
|
36
55
|
}
|
37
56
|
end
|
38
57
|
|
58
|
+
# Initializes the object
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
60
|
def initialize(attributes = {})
|
40
61
|
return unless attributes.is_a?(Hash)
|
41
62
|
|
42
63
|
# convert string to symbol for hash key
|
43
|
-
attributes = attributes.
|
64
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
44
65
|
|
45
|
-
|
46
|
-
if attributes[:'time']
|
66
|
+
if attributes.has_key?(:'time')
|
47
67
|
self.time = attributes[:'time']
|
48
68
|
end
|
49
|
-
|
50
|
-
if attributes
|
69
|
+
|
70
|
+
if attributes.has_key?(:'loggedin')
|
51
71
|
self.loggedin = attributes[:'loggedin']
|
52
72
|
end
|
53
|
-
|
54
|
-
if attributes
|
73
|
+
|
74
|
+
if attributes.has_key?(:'login_id')
|
55
75
|
self.login_id = attributes[:'login_id']
|
56
76
|
end
|
57
|
-
|
58
|
-
if attributes
|
77
|
+
|
78
|
+
if attributes.has_key?(:'login_name')
|
59
79
|
self.login_name = attributes[:'login_name']
|
60
80
|
end
|
61
|
-
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properies with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
invalid_properties = Array.new
|
88
|
+
return invalid_properties
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check to see if the all the properties in the model are valid
|
92
|
+
# @return true if the model is valid
|
93
|
+
def valid?
|
94
|
+
return true
|
62
95
|
end
|
63
96
|
|
64
|
-
#
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
65
99
|
def ==(o)
|
66
100
|
return true if self.equal?(o)
|
67
101
|
self.class == o.class &&
|
@@ -72,35 +106,41 @@ module OSDNClient
|
|
72
106
|
end
|
73
107
|
|
74
108
|
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
75
110
|
def eql?(o)
|
76
111
|
self == o
|
77
112
|
end
|
78
113
|
|
79
|
-
#
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Fixnum] Hash code
|
80
116
|
def hash
|
81
117
|
[time, loggedin, login_id, login_name].hash
|
82
118
|
end
|
83
119
|
|
84
|
-
#
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
85
123
|
def build_from_hash(attributes)
|
86
124
|
return nil unless attributes.is_a?(Hash)
|
87
125
|
self.class.swagger_types.each_pair do |key, type|
|
88
126
|
if type =~ /^Array<(.*)>/i
|
127
|
+
# check to ensure the input is an array given that the the attribute
|
128
|
+
# is documented as an array but the input is not
|
89
129
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
90
130
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
91
|
-
else
|
92
|
-
#TODO show warning in debug mode
|
93
131
|
end
|
94
132
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
95
133
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
96
|
-
else
|
97
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
98
|
-
end
|
134
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
99
135
|
end
|
100
136
|
|
101
137
|
self
|
102
138
|
end
|
103
139
|
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
104
144
|
def _deserialize(type, value)
|
105
145
|
case type.to_sym
|
106
146
|
when :DateTime
|
@@ -119,6 +159,9 @@ module OSDNClient
|
|
119
159
|
else
|
120
160
|
false
|
121
161
|
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
122
165
|
when /\AArray<(?<inner_type>.+)>\z/
|
123
166
|
inner_type = Regexp.last_match[:inner_type]
|
124
167
|
value.map { |v| _deserialize(inner_type, v) }
|
@@ -131,21 +174,25 @@ module OSDNClient
|
|
131
174
|
end
|
132
175
|
end
|
133
176
|
else # model
|
134
|
-
|
135
|
-
|
177
|
+
temp_model = OSDNClient.const_get(type).new
|
178
|
+
temp_model.build_from_hash(value)
|
136
179
|
end
|
137
180
|
end
|
138
181
|
|
182
|
+
# Returns the string representation of the object
|
183
|
+
# @return [String] String presentation of the object
|
139
184
|
def to_s
|
140
185
|
to_hash.to_s
|
141
186
|
end
|
142
187
|
|
143
|
-
# to_body is an alias to
|
188
|
+
# to_body is an alias to to_hash (backward compatibility)
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
144
190
|
def to_body
|
145
191
|
to_hash
|
146
192
|
end
|
147
193
|
|
148
|
-
#
|
194
|
+
# Returns the object in the form of hash
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
149
196
|
def to_hash
|
150
197
|
hash = {}
|
151
198
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -156,8 +203,10 @@ module OSDNClient
|
|
156
203
|
hash
|
157
204
|
end
|
158
205
|
|
159
|
-
#
|
206
|
+
# Outputs non-array value in the form of hash
|
160
207
|
# For object, use to_hash. Otherwise, just return the value
|
208
|
+
# @param [Object] value Any valid value
|
209
|
+
# @return [Hash] Returns the value in the form of hash
|
161
210
|
def _to_hash(value)
|
162
211
|
if value.is_a?(Array)
|
163
212
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -173,4 +222,5 @@ module OSDNClient
|
|
173
222
|
end
|
174
223
|
|
175
224
|
end
|
225
|
+
|
176
226
|
end
|