osdn-client 0.0.20160304 → 0.0.20160711
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +201 -0
- data/README.md +182 -0
- data/docs/DefaultApi.md +115 -0
- data/docs/Group.md +23 -0
- data/docs/GroupToolFlags.md +17 -0
- data/docs/News.md +14 -0
- data/docs/Package.md +13 -0
- data/docs/Pong.md +11 -0
- data/docs/ProjectApi.md +1511 -0
- data/docs/ProjectFrsApi.md +888 -0
- data/docs/ProjectNewsApi.md +576 -0
- data/docs/RelFile.md +19 -0
- data/docs/Release.md +16 -0
- data/docs/SimpleChamber.md +11 -0
- data/docs/SimpleGroup.md +11 -0
- data/docs/SimpleUser.md +10 -0
- data/docs/Skill.md +11 -0
- data/docs/Token.md +12 -0
- data/docs/User.md +20 -0
- data/docs/UserApi.md +63 -0
- data/lib/osdn-client.rb +32 -9
- data/lib/osdn-client/api/default_api.rb +50 -39
- data/lib/osdn-client/api/project_api.rb +661 -773
- data/lib/osdn-client/api/project_frs_api.rb +350 -412
- data/lib/osdn-client/api/project_news_api.rb +217 -244
- data/lib/osdn-client/api/user_api.rb +35 -20
- data/lib/osdn-client/api_client.rb +74 -13
- data/lib/osdn-client/api_error.rb +23 -0
- data/lib/osdn-client/configuration.rb +45 -1
- data/lib/osdn-client/models/group.rb +103 -65
- data/lib/osdn-client/models/group_tool_flags.rb +91 -47
- data/lib/osdn-client/models/news.rb +85 -38
- data/lib/osdn-client/models/package.rb +83 -35
- data/lib/osdn-client/models/pong.rb +79 -29
- data/lib/osdn-client/models/rel_file.rb +95 -53
- data/lib/osdn-client/models/release.rb +89 -44
- data/lib/osdn-client/models/simple_chamber.rb +79 -29
- data/lib/osdn-client/models/simple_group.rb +79 -29
- data/lib/osdn-client/models/simple_user.rb +77 -26
- data/lib/osdn-client/models/skill.rb +79 -29
- data/lib/osdn-client/models/token.rb +81 -32
- data/lib/osdn-client/models/user.rb +97 -56
- data/lib/osdn-client/version.rb +24 -1
- data/osdn-client.gemspec +30 -7
- data/spec/api/default_api_spec.rb +73 -0
- data/spec/api/{ProjectApi_spec.rb → project_api_spec.rb} +187 -264
- data/spec/api/{ProjectFrsApi_spec.rb → project_frs_api_spec.rb} +103 -136
- data/spec/api/{ProjectNewsApi_spec.rb → project_news_api_spec.rb} +71 -88
- data/spec/api/user_api_spec.rb +58 -0
- data/spec/api_client_spec.rb +315 -0
- data/spec/configuration_spec.rb +48 -0
- data/spec/models/group_spec.rb +143 -0
- data/spec/models/group_tool_flags_spec.rb +107 -0
- data/spec/models/news_spec.rb +89 -0
- data/spec/models/package_spec.rb +83 -0
- data/spec/models/pong_spec.rb +71 -0
- data/spec/models/rel_file_spec.rb +119 -0
- data/spec/models/release_spec.rb +101 -0
- data/spec/models/simple_chamber_spec.rb +71 -0
- data/spec/models/simple_group_spec.rb +71 -0
- data/spec/models/simple_user_spec.rb +65 -0
- data/spec/models/skill_spec.rb +71 -0
- data/spec/models/token_spec.rb +77 -0
- data/spec/models/user_spec.rb +125 -0
- data/spec/spec_helper.rb +122 -0
- metadata +87 -59
- data/spec/api/DefaultApi_spec.rb +0 -58
- data/spec/api/UserApi_spec.rb +0 -39
- data/spec/models/GroupToolFlags_spec.rb +0 -124
- data/spec/models/Group_spec.rb +0 -184
- data/spec/models/News_spec.rb +0 -94
- data/spec/models/Package_spec.rb +0 -84
- data/spec/models/Pong_spec.rb +0 -64
- data/spec/models/RelFile_spec.rb +0 -144
- data/spec/models/Release_spec.rb +0 -114
- data/spec/models/SimpleChamber_spec.rb +0 -64
- data/spec/models/SimpleGroup_spec.rb +0 -64
- data/spec/models/SimpleUser_spec.rb +0 -54
- data/spec/models/Skill_spec.rb +0 -64
- data/spec/models/Token_spec.rb +0 -74
- data/spec/models/User_spec.rb +0 -154
@@ -1,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 GroupToolFlags
|
5
29
|
attr_accessor :cvs
|
6
30
|
|
@@ -22,30 +46,20 @@ module OSDNClient
|
|
22
46
|
|
23
47
|
attr_accessor :ml
|
24
48
|
|
49
|
+
|
25
50
|
# Attribute mapping from ruby-style variable name to JSON key.
|
26
51
|
def self.attribute_map
|
27
52
|
{
|
28
|
-
|
29
53
|
:'cvs' => :'cvs',
|
30
|
-
|
31
54
|
:'git' => :'git',
|
32
|
-
|
33
55
|
:'svn' => :'svn',
|
34
|
-
|
35
56
|
:'bzr' => :'bzr',
|
36
|
-
|
37
57
|
:'scm' => :'scm',
|
38
|
-
|
39
58
|
:'frs' => :'frs',
|
40
|
-
|
41
59
|
:'tikcet' => :'tikcet',
|
42
|
-
|
43
60
|
:'wiki' => :'wiki',
|
44
|
-
|
45
61
|
:'forum' => :'forum',
|
46
|
-
|
47
62
|
:'ml' => :'ml'
|
48
|
-
|
49
63
|
}
|
50
64
|
end
|
51
65
|
|
@@ -62,60 +76,74 @@ module OSDNClient
|
|
62
76
|
:'wiki' => :'BOOLEAN',
|
63
77
|
:'forum' => :'BOOLEAN',
|
64
78
|
:'ml' => :'BOOLEAN'
|
65
|
-
|
66
79
|
}
|
67
80
|
end
|
68
81
|
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
84
|
def initialize(attributes = {})
|
70
85
|
return unless attributes.is_a?(Hash)
|
71
86
|
|
72
87
|
# convert string to symbol for hash key
|
73
|
-
attributes = attributes.
|
88
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
74
89
|
|
75
|
-
|
76
|
-
if attributes[:'cvs']
|
90
|
+
if attributes.has_key?(:'cvs')
|
77
91
|
self.cvs = attributes[:'cvs']
|
78
92
|
end
|
79
|
-
|
80
|
-
if attributes
|
93
|
+
|
94
|
+
if attributes.has_key?(:'git')
|
81
95
|
self.git = attributes[:'git']
|
82
96
|
end
|
83
|
-
|
84
|
-
if attributes
|
97
|
+
|
98
|
+
if attributes.has_key?(:'svn')
|
85
99
|
self.svn = attributes[:'svn']
|
86
100
|
end
|
87
|
-
|
88
|
-
if attributes
|
101
|
+
|
102
|
+
if attributes.has_key?(:'bzr')
|
89
103
|
self.bzr = attributes[:'bzr']
|
90
104
|
end
|
91
|
-
|
92
|
-
if attributes
|
105
|
+
|
106
|
+
if attributes.has_key?(:'scm')
|
93
107
|
self.scm = attributes[:'scm']
|
94
108
|
end
|
95
|
-
|
96
|
-
if attributes
|
109
|
+
|
110
|
+
if attributes.has_key?(:'frs')
|
97
111
|
self.frs = attributes[:'frs']
|
98
112
|
end
|
99
|
-
|
100
|
-
if attributes
|
113
|
+
|
114
|
+
if attributes.has_key?(:'tikcet')
|
101
115
|
self.tikcet = attributes[:'tikcet']
|
102
116
|
end
|
103
|
-
|
104
|
-
if attributes
|
117
|
+
|
118
|
+
if attributes.has_key?(:'wiki')
|
105
119
|
self.wiki = attributes[:'wiki']
|
106
120
|
end
|
107
|
-
|
108
|
-
if attributes
|
121
|
+
|
122
|
+
if attributes.has_key?(:'forum')
|
109
123
|
self.forum = attributes[:'forum']
|
110
124
|
end
|
111
|
-
|
112
|
-
if attributes
|
125
|
+
|
126
|
+
if attributes.has_key?(:'ml')
|
113
127
|
self.ml = attributes[:'ml']
|
114
128
|
end
|
115
|
-
|
129
|
+
|
130
|
+
end
|
131
|
+
|
132
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
133
|
+
# @return Array for valid properies with the reasons
|
134
|
+
def list_invalid_properties
|
135
|
+
invalid_properties = Array.new
|
136
|
+
return invalid_properties
|
116
137
|
end
|
117
138
|
|
118
|
-
# Check
|
139
|
+
# Check to see if the all the properties in the model are valid
|
140
|
+
# @return true if the model is valid
|
141
|
+
def valid?
|
142
|
+
return true
|
143
|
+
end
|
144
|
+
|
145
|
+
# Checks equality by comparing each attribute.
|
146
|
+
# @param [Object] Object to be compared
|
119
147
|
def ==(o)
|
120
148
|
return true if self.equal?(o)
|
121
149
|
self.class == o.class &&
|
@@ -132,35 +160,41 @@ module OSDNClient
|
|
132
160
|
end
|
133
161
|
|
134
162
|
# @see the `==` method
|
163
|
+
# @param [Object] Object to be compared
|
135
164
|
def eql?(o)
|
136
165
|
self == o
|
137
166
|
end
|
138
167
|
|
139
|
-
#
|
168
|
+
# Calculates hash code according to all attributes.
|
169
|
+
# @return [Fixnum] Hash code
|
140
170
|
def hash
|
141
171
|
[cvs, git, svn, bzr, scm, frs, tikcet, wiki, forum, ml].hash
|
142
172
|
end
|
143
173
|
|
144
|
-
#
|
174
|
+
# Builds the object from hash
|
175
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
176
|
+
# @return [Object] Returns the model itself
|
145
177
|
def build_from_hash(attributes)
|
146
178
|
return nil unless attributes.is_a?(Hash)
|
147
179
|
self.class.swagger_types.each_pair do |key, type|
|
148
180
|
if type =~ /^Array<(.*)>/i
|
181
|
+
# check to ensure the input is an array given that the the attribute
|
182
|
+
# is documented as an array but the input is not
|
149
183
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
184
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
151
|
-
else
|
152
|
-
#TODO show warning in debug mode
|
153
185
|
end
|
154
186
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
155
187
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
156
|
-
else
|
157
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
158
|
-
end
|
188
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
159
189
|
end
|
160
190
|
|
161
191
|
self
|
162
192
|
end
|
163
193
|
|
194
|
+
# Deserializes the data based on type
|
195
|
+
# @param string type Data type
|
196
|
+
# @param string value Value to be deserialized
|
197
|
+
# @return [Object] Deserialized data
|
164
198
|
def _deserialize(type, value)
|
165
199
|
case type.to_sym
|
166
200
|
when :DateTime
|
@@ -179,6 +213,9 @@ module OSDNClient
|
|
179
213
|
else
|
180
214
|
false
|
181
215
|
end
|
216
|
+
when :Object
|
217
|
+
# generic object (usually a Hash), return directly
|
218
|
+
value
|
182
219
|
when /\AArray<(?<inner_type>.+)>\z/
|
183
220
|
inner_type = Regexp.last_match[:inner_type]
|
184
221
|
value.map { |v| _deserialize(inner_type, v) }
|
@@ -191,21 +228,25 @@ module OSDNClient
|
|
191
228
|
end
|
192
229
|
end
|
193
230
|
else # model
|
194
|
-
|
195
|
-
|
231
|
+
temp_model = OSDNClient.const_get(type).new
|
232
|
+
temp_model.build_from_hash(value)
|
196
233
|
end
|
197
234
|
end
|
198
235
|
|
236
|
+
# Returns the string representation of the object
|
237
|
+
# @return [String] String presentation of the object
|
199
238
|
def to_s
|
200
239
|
to_hash.to_s
|
201
240
|
end
|
202
241
|
|
203
|
-
# to_body is an alias to
|
242
|
+
# to_body is an alias to to_hash (backward compatibility)
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
204
244
|
def to_body
|
205
245
|
to_hash
|
206
246
|
end
|
207
247
|
|
208
|
-
#
|
248
|
+
# Returns the object in the form of hash
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
209
250
|
def to_hash
|
210
251
|
hash = {}
|
211
252
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -216,8 +257,10 @@ module OSDNClient
|
|
216
257
|
hash
|
217
258
|
end
|
218
259
|
|
219
|
-
#
|
260
|
+
# Outputs non-array value in the form of hash
|
220
261
|
# For object, use to_hash. Otherwise, just return the value
|
262
|
+
# @param [Object] value Any valid value
|
263
|
+
# @return [Hash] Returns the value in the form of hash
|
221
264
|
def _to_hash(value)
|
222
265
|
if value.is_a?(Array)
|
223
266
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -233,4 +276,5 @@ module OSDNClient
|
|
233
276
|
end
|
234
277
|
|
235
278
|
end
|
279
|
+
|
236
280
|
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 News
|
5
29
|
attr_accessor :id
|
6
30
|
|
@@ -16,24 +40,17 @@ module OSDNClient
|
|
16
40
|
|
17
41
|
attr_accessor :submitter
|
18
42
|
|
43
|
+
|
19
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
45
|
def self.attribute_map
|
21
46
|
{
|
22
|
-
|
23
47
|
:'id' => :'id',
|
24
|
-
|
25
48
|
:'url' => :'url',
|
26
|
-
|
27
49
|
:'title' => :'title',
|
28
|
-
|
29
50
|
:'body' => :'body',
|
30
|
-
|
31
51
|
:'body_html' => :'body_html',
|
32
|
-
|
33
52
|
:'last_update' => :'last_update',
|
34
|
-
|
35
53
|
:'submitter' => :'submitter'
|
36
|
-
|
37
54
|
}
|
38
55
|
end
|
39
56
|
|
@@ -47,48 +64,62 @@ module OSDNClient
|
|
47
64
|
:'body_html' => :'String',
|
48
65
|
:'last_update' => :'DateTime',
|
49
66
|
:'submitter' => :'SimpleUser'
|
50
|
-
|
51
67
|
}
|
52
68
|
end
|
53
69
|
|
70
|
+
# Initializes the object
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
54
72
|
def initialize(attributes = {})
|
55
73
|
return unless attributes.is_a?(Hash)
|
56
74
|
|
57
75
|
# convert string to symbol for hash key
|
58
|
-
attributes = attributes.
|
76
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
59
77
|
|
60
|
-
|
61
|
-
if attributes[:'id']
|
78
|
+
if attributes.has_key?(:'id')
|
62
79
|
self.id = attributes[:'id']
|
63
80
|
end
|
64
|
-
|
65
|
-
if attributes
|
81
|
+
|
82
|
+
if attributes.has_key?(:'url')
|
66
83
|
self.url = attributes[:'url']
|
67
84
|
end
|
68
|
-
|
69
|
-
if attributes
|
85
|
+
|
86
|
+
if attributes.has_key?(:'title')
|
70
87
|
self.title = attributes[:'title']
|
71
88
|
end
|
72
|
-
|
73
|
-
if attributes
|
89
|
+
|
90
|
+
if attributes.has_key?(:'body')
|
74
91
|
self.body = attributes[:'body']
|
75
92
|
end
|
76
|
-
|
77
|
-
if attributes
|
93
|
+
|
94
|
+
if attributes.has_key?(:'body_html')
|
78
95
|
self.body_html = attributes[:'body_html']
|
79
96
|
end
|
80
|
-
|
81
|
-
if attributes
|
97
|
+
|
98
|
+
if attributes.has_key?(:'last_update')
|
82
99
|
self.last_update = attributes[:'last_update']
|
83
100
|
end
|
84
|
-
|
85
|
-
if attributes
|
101
|
+
|
102
|
+
if attributes.has_key?(:'submitter')
|
86
103
|
self.submitter = attributes[:'submitter']
|
87
104
|
end
|
88
|
-
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properies with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
invalid_properties = Array.new
|
112
|
+
return invalid_properties
|
89
113
|
end
|
90
114
|
|
91
|
-
# Check
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
return true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
92
123
|
def ==(o)
|
93
124
|
return true if self.equal?(o)
|
94
125
|
self.class == o.class &&
|
@@ -102,35 +133,41 @@ module OSDNClient
|
|
102
133
|
end
|
103
134
|
|
104
135
|
# @see the `==` method
|
136
|
+
# @param [Object] Object to be compared
|
105
137
|
def eql?(o)
|
106
138
|
self == o
|
107
139
|
end
|
108
140
|
|
109
|
-
#
|
141
|
+
# Calculates hash code according to all attributes.
|
142
|
+
# @return [Fixnum] Hash code
|
110
143
|
def hash
|
111
144
|
[id, url, title, body, body_html, last_update, submitter].hash
|
112
145
|
end
|
113
146
|
|
114
|
-
#
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
115
150
|
def build_from_hash(attributes)
|
116
151
|
return nil unless attributes.is_a?(Hash)
|
117
152
|
self.class.swagger_types.each_pair do |key, type|
|
118
153
|
if type =~ /^Array<(.*)>/i
|
154
|
+
# check to ensure the input is an array given that the the attribute
|
155
|
+
# is documented as an array but the input is not
|
119
156
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
120
157
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
121
|
-
else
|
122
|
-
#TODO show warning in debug mode
|
123
158
|
end
|
124
159
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
125
160
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
126
|
-
else
|
127
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
128
|
-
end
|
161
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
129
162
|
end
|
130
163
|
|
131
164
|
self
|
132
165
|
end
|
133
166
|
|
167
|
+
# Deserializes the data based on type
|
168
|
+
# @param string type Data type
|
169
|
+
# @param string value Value to be deserialized
|
170
|
+
# @return [Object] Deserialized data
|
134
171
|
def _deserialize(type, value)
|
135
172
|
case type.to_sym
|
136
173
|
when :DateTime
|
@@ -149,6 +186,9 @@ module OSDNClient
|
|
149
186
|
else
|
150
187
|
false
|
151
188
|
end
|
189
|
+
when :Object
|
190
|
+
# generic object (usually a Hash), return directly
|
191
|
+
value
|
152
192
|
when /\AArray<(?<inner_type>.+)>\z/
|
153
193
|
inner_type = Regexp.last_match[:inner_type]
|
154
194
|
value.map { |v| _deserialize(inner_type, v) }
|
@@ -161,21 +201,25 @@ module OSDNClient
|
|
161
201
|
end
|
162
202
|
end
|
163
203
|
else # model
|
164
|
-
|
165
|
-
|
204
|
+
temp_model = OSDNClient.const_get(type).new
|
205
|
+
temp_model.build_from_hash(value)
|
166
206
|
end
|
167
207
|
end
|
168
208
|
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
169
211
|
def to_s
|
170
212
|
to_hash.to_s
|
171
213
|
end
|
172
214
|
|
173
|
-
# to_body is an alias to
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
174
217
|
def to_body
|
175
218
|
to_hash
|
176
219
|
end
|
177
220
|
|
178
|
-
#
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
179
223
|
def to_hash
|
180
224
|
hash = {}
|
181
225
|
self.class.attribute_map.each_pair do |attr, param|
|
@@ -186,8 +230,10 @@ module OSDNClient
|
|
186
230
|
hash
|
187
231
|
end
|
188
232
|
|
189
|
-
#
|
233
|
+
# Outputs non-array value in the form of hash
|
190
234
|
# For object, use to_hash. Otherwise, just return the value
|
235
|
+
# @param [Object] value Any valid value
|
236
|
+
# @return [Hash] Returns the value in the form of hash
|
191
237
|
def _to_hash(value)
|
192
238
|
if value.is_a?(Array)
|
193
239
|
value.compact.map{ |v| _to_hash(v) }
|
@@ -203,4 +249,5 @@ module OSDNClient
|
|
203
249
|
end
|
204
250
|
|
205
251
|
end
|
252
|
+
|
206
253
|
end
|