osdn-client 0.0.20161003 → 0.0.20171120
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 +5 -5
- data/README.md +168 -6
- data/docs/FrsAdminPrefs.md +9 -0
- data/docs/Group.md +1 -3
- data/docs/GroupProfile.md +10 -0
- data/docs/GroupProfilePerLanguage.md +10 -0
- data/docs/GroupToolFlags.md +1 -2
- data/docs/History.md +15 -0
- data/docs/I18NText.md +9 -0
- data/docs/ProjectApi.md +4021 -209
- data/docs/ProjectBzr.md +22 -0
- data/docs/ProjectFrsApi.md +118 -4
- data/docs/ProjectGit.md +27 -0
- data/docs/ProjectHg.md +22 -0
- data/docs/ProjectSCM.md +22 -0
- data/docs/ProjectSCMApi.md +1214 -0
- data/docs/ProjectSCMLastCommit.md +11 -0
- data/docs/ProjectSvn.md +25 -0
- data/docs/ProjectTicketApi.md +1847 -0
- data/docs/ProjectTicketComment.md +13 -0
- data/docs/ProjectTicketComponent.md +14 -0
- data/docs/ProjectTicketComponentSummary.md +10 -0
- data/docs/ProjectTicketComponentSummarySummarizedBy.md +12 -0
- data/docs/ProjectTicketHistory.md +14 -0
- data/docs/ProjectTicketItem.md +25 -0
- data/docs/ProjectTicketMilestone.md +14 -0
- data/docs/ProjectTicketMilestoneSummary.md +10 -0
- data/docs/ProjectTicketMilestoneSummarySummarizedBy.md +12 -0
- data/docs/ProjectTicketPrefs.md +13 -0
- data/docs/ProjectTicketType.md +15 -0
- data/docs/ProjectTicketTypeInstructionPerLanguage.md +9 -0
- data/docs/ProjectTicketTypeInstructions.md +9 -0
- data/docs/ProjectTicketTypeSummary.md +10 -0
- data/docs/ProjectTicketTypeSummarySummarizedBy.md +12 -0
- data/docs/ProjectWeb.md +8 -0
- data/docs/ScmHook.md +18 -0
- data/docs/SummariadByComponent.md +7 -0
- data/docs/SummariadByComponentInner.md +10 -0
- data/docs/SummariadByMilestone.md +7 -0
- data/docs/SummariadByMilestoneInner.md +10 -0
- data/docs/SummariadByOwner.md +7 -0
- data/docs/SummariadByOwnerInner.md +10 -0
- data/docs/SummariadByPriority.md +7 -0
- data/docs/SummariadByPriorityInner.md +10 -0
- data/docs/SummariadBySeverity.md +7 -0
- data/docs/SummariadBySeverityInner.md +10 -0
- data/docs/SummariadByType.md +7 -0
- data/docs/SummariadByTypeInner.md +10 -0
- data/docs/User.md +5 -3
- data/docs/UserApi.md +279 -0
- data/docs/UserImages.md +12 -0
- data/docs/UserStats.md +33 -0
- data/lib/osdn-client.rb +45 -1
- data/lib/osdn-client/api/default_api.rb +1 -1
- data/lib/osdn-client/api/project_api.rb +4574 -396
- data/lib/osdn-client/api/project_frs_api.rb +122 -5
- data/lib/osdn-client/api/project_news_api.rb +1 -1
- data/lib/osdn-client/api/project_scm_api.rb +1310 -0
- data/lib/osdn-client/api/project_ticket_api.rb +2124 -0
- data/lib/osdn-client/api/user_api.rb +294 -1
- data/lib/osdn-client/api_client.rb +1 -1
- data/lib/osdn-client/api_error.rb +1 -1
- data/lib/osdn-client/configuration.rb +1 -1
- data/lib/osdn-client/models/frs_admin_prefs.rb +208 -0
- data/lib/osdn-client/models/group.rb +8 -26
- data/lib/osdn-client/models/group_profile.rb +223 -0
- data/lib/osdn-client/models/group_profile_per_language.rb +217 -0
- data/lib/osdn-client/models/group_tool_flags.rb +11 -20
- data/lib/osdn-client/models/history.rb +262 -0
- data/lib/osdn-client/models/i18_n_text.rb +208 -0
- data/lib/osdn-client/models/news.rb +1 -1
- data/lib/osdn-client/models/package.rb +1 -1
- data/lib/osdn-client/models/pong.rb +1 -1
- data/lib/osdn-client/models/project_bzr.rb +329 -0
- data/lib/osdn-client/models/project_git.rb +374 -0
- data/lib/osdn-client/models/project_hg.rb +329 -0
- data/lib/osdn-client/models/project_scm.rb +329 -0
- data/lib/osdn-client/models/project_scm_last_commit.rb +226 -0
- data/lib/osdn-client/models/project_svn.rb +356 -0
- data/lib/osdn-client/models/project_ticket_comment.rb +244 -0
- data/lib/osdn-client/models/project_ticket_component.rb +253 -0
- data/lib/osdn-client/models/project_ticket_component_summary.rb +217 -0
- data/lib/osdn-client/models/project_ticket_component_summary_summarized_by.rb +235 -0
- data/lib/osdn-client/models/project_ticket_history.rb +253 -0
- data/lib/osdn-client/models/project_ticket_item.rb +356 -0
- data/lib/osdn-client/models/project_ticket_milestone.rb +253 -0
- data/lib/osdn-client/models/project_ticket_milestone_summary.rb +217 -0
- data/lib/osdn-client/models/project_ticket_milestone_summary_summarized_by.rb +235 -0
- data/lib/osdn-client/models/project_ticket_prefs.rb +244 -0
- data/lib/osdn-client/models/project_ticket_type.rb +266 -0
- data/lib/osdn-client/models/project_ticket_type_instruction_per_language.rb +208 -0
- data/lib/osdn-client/models/project_ticket_type_instructions.rb +212 -0
- data/lib/osdn-client/models/project_ticket_type_summary.rb +217 -0
- data/lib/osdn-client/models/project_ticket_type_summary_summarized_by.rb +235 -0
- data/lib/osdn-client/models/project_web.rb +199 -0
- data/lib/osdn-client/models/rel_file.rb +1 -1
- data/lib/osdn-client/models/release.rb +1 -1
- data/lib/osdn-client/models/scm_hook.rb +289 -0
- data/lib/osdn-client/models/simple_chamber.rb +1 -1
- data/lib/osdn-client/models/simple_group.rb +1 -1
- data/lib/osdn-client/models/simple_user.rb +1 -1
- data/lib/osdn-client/models/skill.rb +1 -1
- data/lib/osdn-client/models/summariad_by_component.rb +190 -0
- data/lib/osdn-client/models/summariad_by_component_inner.rb +217 -0
- data/lib/osdn-client/models/summariad_by_milestone.rb +190 -0
- data/lib/osdn-client/models/summariad_by_milestone_inner.rb +217 -0
- data/lib/osdn-client/models/summariad_by_owner.rb +190 -0
- data/lib/osdn-client/models/summariad_by_owner_inner.rb +217 -0
- data/lib/osdn-client/models/summariad_by_priority.rb +190 -0
- data/lib/osdn-client/models/summariad_by_priority_inner.rb +217 -0
- data/lib/osdn-client/models/summariad_by_severity.rb +190 -0
- data/lib/osdn-client/models/summariad_by_severity_inner.rb +217 -0
- data/lib/osdn-client/models/summariad_by_type.rb +190 -0
- data/lib/osdn-client/models/summariad_by_type_inner.rb +217 -0
- data/lib/osdn-client/models/token.rb +1 -1
- data/lib/osdn-client/models/user.rb +38 -18
- data/lib/osdn-client/models/user_images.rb +235 -0
- data/lib/osdn-client/models/user_stats.rb +424 -0
- data/lib/osdn-client/version.rb +2 -2
- data/osdn-client.gemspec +1 -1
- data/spec/api/default_api_spec.rb +1 -1
- data/spec/api/project_api_spec.rb +899 -3
- data/spec/api/project_frs_api_spec.rb +28 -3
- data/spec/api/project_news_api_spec.rb +1 -1
- data/spec/api/project_scm_api_spec.rb +324 -0
- data/spec/api/project_ticket_api_spec.rb +488 -0
- data/spec/api/user_api_spec.rb +63 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/frs_admin_prefs_spec.rb +59 -0
- data/spec/models/group_profile_per_language_spec.rb +65 -0
- data/spec/models/group_profile_spec.rb +65 -0
- data/spec/models/group_spec.rb +2 -14
- data/spec/models/group_tool_flags_spec.rb +3 -9
- data/spec/models/history_spec.rb +95 -0
- data/spec/models/i18_n_text_spec.rb +59 -0
- data/spec/models/news_spec.rb +1 -1
- data/spec/models/package_spec.rb +1 -1
- data/spec/models/pong_spec.rb +1 -1
- data/spec/models/project_bzr_spec.rb +137 -0
- data/spec/models/project_git_spec.rb +167 -0
- data/spec/models/project_hg_spec.rb +137 -0
- data/spec/models/project_scm_last_commit_spec.rb +71 -0
- data/spec/models/project_scm_spec.rb +137 -0
- data/spec/models/project_svn_spec.rb +155 -0
- data/spec/models/project_ticket_comment_spec.rb +83 -0
- data/spec/models/project_ticket_component_spec.rb +89 -0
- data/spec/models/project_ticket_component_summary_spec.rb +65 -0
- data/spec/models/project_ticket_component_summary_summarized_by_spec.rb +77 -0
- data/spec/models/project_ticket_history_spec.rb +89 -0
- data/spec/models/project_ticket_item_spec.rb +155 -0
- data/spec/models/project_ticket_milestone_spec.rb +89 -0
- data/spec/models/project_ticket_milestone_summary_spec.rb +65 -0
- data/spec/models/project_ticket_milestone_summary_summarized_by_spec.rb +77 -0
- data/spec/models/project_ticket_prefs_spec.rb +83 -0
- data/spec/models/project_ticket_type_instruction_per_language_spec.rb +59 -0
- data/spec/models/project_ticket_type_instructions_spec.rb +59 -0
- data/spec/models/project_ticket_type_spec.rb +95 -0
- data/spec/models/project_ticket_type_summary_spec.rb +65 -0
- data/spec/models/project_ticket_type_summary_summarized_by_spec.rb +77 -0
- data/spec/models/project_web_spec.rb +53 -0
- data/spec/models/rel_file_spec.rb +1 -1
- data/spec/models/release_spec.rb +1 -1
- data/spec/models/scm_hook_spec.rb +113 -0
- data/spec/models/simple_chamber_spec.rb +1 -1
- data/spec/models/simple_group_spec.rb +1 -1
- data/spec/models/simple_user_spec.rb +1 -1
- data/spec/models/skill_spec.rb +1 -1
- data/spec/models/summariad_by_component_inner_spec.rb +65 -0
- data/spec/models/summariad_by_component_spec.rb +47 -0
- data/spec/models/summariad_by_milestone_inner_spec.rb +65 -0
- data/spec/models/summariad_by_milestone_spec.rb +47 -0
- data/spec/models/summariad_by_owner_inner_spec.rb +65 -0
- data/spec/models/summariad_by_owner_spec.rb +47 -0
- data/spec/models/summariad_by_priority_inner_spec.rb +65 -0
- data/spec/models/summariad_by_priority_spec.rb +47 -0
- data/spec/models/summariad_by_severity_inner_spec.rb +65 -0
- data/spec/models/summariad_by_severity_spec.rb +47 -0
- data/spec/models/summariad_by_type_inner_spec.rb +65 -0
- data/spec/models/summariad_by_type_spec.rb +47 -0
- data/spec/models/token_spec.rb +1 -1
- data/spec/models/user_images_spec.rb +77 -0
- data/spec/models/user_spec.rb +16 -4
- data/spec/models/user_stats_spec.rb +203 -0
- data/spec/spec_helper.rb +1 -1
- metadata +179 -3
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.net/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.net/projects/osdn-codes/releases/p14859 .
|
5
5
|
|
6
|
-
OpenAPI spec version: 0.0.
|
6
|
+
OpenAPI spec version: 0.0.20171120
|
7
7
|
Contact: admin@osdn.net
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
#OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.net/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.net/projects/osdn-codes/releases/p14859 .
|
5
5
|
|
6
|
-
OpenAPI spec version: 0.0.
|
6
|
+
OpenAPI spec version: 0.0.20171120
|
7
7
|
Contact: admin@osdn.net
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
9
|
|
@@ -32,11 +32,13 @@ module OSDNClient
|
|
32
32
|
|
33
33
|
attr_accessor :display_name
|
34
34
|
|
35
|
-
attr_accessor :
|
35
|
+
attr_accessor :authorized_keys
|
36
36
|
|
37
|
-
attr_accessor :
|
37
|
+
attr_accessor :email
|
38
38
|
|
39
|
-
attr_accessor :
|
39
|
+
attr_accessor :ranking
|
40
|
+
|
41
|
+
attr_accessor :blog
|
40
42
|
|
41
43
|
attr_accessor :timezone
|
42
44
|
|
@@ -46,6 +48,8 @@ module OSDNClient
|
|
46
48
|
|
47
49
|
attr_accessor :language
|
48
50
|
|
51
|
+
attr_accessor :images
|
52
|
+
|
49
53
|
attr_accessor :groups
|
50
54
|
|
51
55
|
attr_accessor :chambers
|
@@ -59,13 +63,15 @@ module OSDNClient
|
|
59
63
|
:'id' => :'id',
|
60
64
|
:'name' => :'name',
|
61
65
|
:'display_name' => :'display_name',
|
62
|
-
:'unix_status' => :'unix_status',
|
63
|
-
:'unix_uid' => :'unix_uid',
|
64
66
|
:'authorized_keys' => :'authorized_keys',
|
67
|
+
:'email' => :'email',
|
68
|
+
:'ranking' => :'ranking',
|
69
|
+
:'blog' => :'blog',
|
65
70
|
:'timezone' => :'timezone',
|
66
71
|
:'last_update' => :'last_update',
|
67
72
|
:'add_date' => :'add_date',
|
68
73
|
:'language' => :'language',
|
74
|
+
:'images' => :'images',
|
69
75
|
:'groups' => :'groups',
|
70
76
|
:'chambers' => :'chambers',
|
71
77
|
:'skills' => :'skills'
|
@@ -78,13 +84,15 @@ module OSDNClient
|
|
78
84
|
:'id' => :'Integer',
|
79
85
|
:'name' => :'String',
|
80
86
|
:'display_name' => :'String',
|
81
|
-
:'
|
82
|
-
:'
|
83
|
-
:'
|
87
|
+
:'authorized_keys' => :'Array<String>',
|
88
|
+
:'email' => :'String',
|
89
|
+
:'ranking' => :'Integer',
|
90
|
+
:'blog' => :'String',
|
84
91
|
:'timezone' => :'String',
|
85
92
|
:'last_update' => :'DateTime',
|
86
93
|
:'add_date' => :'DateTime',
|
87
94
|
:'language' => :'String',
|
95
|
+
:'images' => :'UserImages',
|
88
96
|
:'groups' => :'Array<SimpleGroup>',
|
89
97
|
:'chambers' => :'Array<SimpleChamber>',
|
90
98
|
:'skills' => :'Array<Skill>'
|
@@ -111,16 +119,22 @@ module OSDNClient
|
|
111
119
|
self.display_name = attributes[:'display_name']
|
112
120
|
end
|
113
121
|
|
114
|
-
if attributes.has_key?(:'
|
115
|
-
|
122
|
+
if attributes.has_key?(:'authorized_keys')
|
123
|
+
if (value = attributes[:'authorized_keys']).is_a?(Array)
|
124
|
+
self.authorized_keys = value
|
125
|
+
end
|
116
126
|
end
|
117
127
|
|
118
|
-
if attributes.has_key?(:'
|
119
|
-
self.
|
128
|
+
if attributes.has_key?(:'email')
|
129
|
+
self.email = attributes[:'email']
|
120
130
|
end
|
121
131
|
|
122
|
-
if attributes.has_key?(:'
|
123
|
-
self.
|
132
|
+
if attributes.has_key?(:'ranking')
|
133
|
+
self.ranking = attributes[:'ranking']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.has_key?(:'blog')
|
137
|
+
self.blog = attributes[:'blog']
|
124
138
|
end
|
125
139
|
|
126
140
|
if attributes.has_key?(:'timezone')
|
@@ -139,6 +153,10 @@ module OSDNClient
|
|
139
153
|
self.language = attributes[:'language']
|
140
154
|
end
|
141
155
|
|
156
|
+
if attributes.has_key?(:'images')
|
157
|
+
self.images = attributes[:'images']
|
158
|
+
end
|
159
|
+
|
142
160
|
if attributes.has_key?(:'groups')
|
143
161
|
if (value = attributes[:'groups']).is_a?(Array)
|
144
162
|
self.groups = value
|
@@ -180,13 +198,15 @@ module OSDNClient
|
|
180
198
|
id == o.id &&
|
181
199
|
name == o.name &&
|
182
200
|
display_name == o.display_name &&
|
183
|
-
unix_status == o.unix_status &&
|
184
|
-
unix_uid == o.unix_uid &&
|
185
201
|
authorized_keys == o.authorized_keys &&
|
202
|
+
email == o.email &&
|
203
|
+
ranking == o.ranking &&
|
204
|
+
blog == o.blog &&
|
186
205
|
timezone == o.timezone &&
|
187
206
|
last_update == o.last_update &&
|
188
207
|
add_date == o.add_date &&
|
189
208
|
language == o.language &&
|
209
|
+
images == o.images &&
|
190
210
|
groups == o.groups &&
|
191
211
|
chambers == o.chambers &&
|
192
212
|
skills == o.skills
|
@@ -201,7 +221,7 @@ module OSDNClient
|
|
201
221
|
# Calculates hash code according to all attributes.
|
202
222
|
# @return [Fixnum] Hash code
|
203
223
|
def hash
|
204
|
-
[id, name, display_name,
|
224
|
+
[id, name, display_name, authorized_keys, email, ranking, blog, timezone, last_update, add_date, language, images, groups, chambers, skills].hash
|
205
225
|
end
|
206
226
|
|
207
227
|
# Builds the object from hash
|
@@ -0,0 +1,235 @@
|
|
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.net/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.net/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20171120
|
7
|
+
Contact: admin@osdn.net
|
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
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module OSDNClient
|
27
|
+
|
28
|
+
class UserImages
|
29
|
+
attr_accessor :icon
|
30
|
+
|
31
|
+
attr_accessor :photo_36
|
32
|
+
|
33
|
+
attr_accessor :photo_92
|
34
|
+
|
35
|
+
attr_accessor :photo_128
|
36
|
+
|
37
|
+
attr_accessor :photo_256
|
38
|
+
|
39
|
+
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
41
|
+
def self.attribute_map
|
42
|
+
{
|
43
|
+
:'icon' => :'icon',
|
44
|
+
:'photo_36' => :'photo_36',
|
45
|
+
:'photo_92' => :'photo_92',
|
46
|
+
:'photo_128' => :'photo_128',
|
47
|
+
:'photo_256' => :'photo_256'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.swagger_types
|
53
|
+
{
|
54
|
+
:'icon' => :'String',
|
55
|
+
:'photo_36' => :'String',
|
56
|
+
:'photo_92' => :'String',
|
57
|
+
:'photo_128' => :'String',
|
58
|
+
:'photo_256' => :'String'
|
59
|
+
}
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
return unless attributes.is_a?(Hash)
|
66
|
+
|
67
|
+
# convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
69
|
+
|
70
|
+
if attributes.has_key?(:'icon')
|
71
|
+
self.icon = attributes[:'icon']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.has_key?(:'photo_36')
|
75
|
+
self.photo_36 = attributes[:'photo_36']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.has_key?(:'photo_92')
|
79
|
+
self.photo_92 = attributes[:'photo_92']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.has_key?(:'photo_128')
|
83
|
+
self.photo_128 = attributes[:'photo_128']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.has_key?(:'photo_256')
|
87
|
+
self.photo_256 = attributes[:'photo_256']
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
93
|
+
# @return Array for valid properies with the reasons
|
94
|
+
def list_invalid_properties
|
95
|
+
invalid_properties = Array.new
|
96
|
+
return invalid_properties
|
97
|
+
end
|
98
|
+
|
99
|
+
# Check to see if the all the properties in the model are valid
|
100
|
+
# @return true if the model is valid
|
101
|
+
def valid?
|
102
|
+
return true
|
103
|
+
end
|
104
|
+
|
105
|
+
# Checks equality by comparing each attribute.
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def ==(o)
|
108
|
+
return true if self.equal?(o)
|
109
|
+
self.class == o.class &&
|
110
|
+
icon == o.icon &&
|
111
|
+
photo_36 == o.photo_36 &&
|
112
|
+
photo_92 == o.photo_92 &&
|
113
|
+
photo_128 == o.photo_128 &&
|
114
|
+
photo_256 == o.photo_256
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Fixnum] Hash code
|
125
|
+
def hash
|
126
|
+
[icon, photo_36, photo_92, photo_128, photo_256].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
self.class.swagger_types.each_pair do |key, type|
|
135
|
+
if type =~ /^Array<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
140
|
+
end
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
143
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
144
|
+
end
|
145
|
+
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Deserializes the data based on type
|
150
|
+
# @param string type Data type
|
151
|
+
# @param string value Value to be deserialized
|
152
|
+
# @return [Object] Deserialized data
|
153
|
+
def _deserialize(type, value)
|
154
|
+
case type.to_sym
|
155
|
+
when :DateTime
|
156
|
+
DateTime.parse(value)
|
157
|
+
when :Date
|
158
|
+
Date.parse(value)
|
159
|
+
when :String
|
160
|
+
value.to_s
|
161
|
+
when :Integer
|
162
|
+
value.to_i
|
163
|
+
when :Float
|
164
|
+
value.to_f
|
165
|
+
when :BOOLEAN
|
166
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
167
|
+
true
|
168
|
+
else
|
169
|
+
false
|
170
|
+
end
|
171
|
+
when :Object
|
172
|
+
# generic object (usually a Hash), return directly
|
173
|
+
value
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
177
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each do |k, v|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
else # model
|
186
|
+
temp_model = OSDNClient.const_get(type).new
|
187
|
+
temp_model.build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
next if value.nil?
|
210
|
+
hash[param] = _to_hash(value)
|
211
|
+
end
|
212
|
+
hash
|
213
|
+
end
|
214
|
+
|
215
|
+
# Outputs non-array value in the form of hash
|
216
|
+
# For object, use to_hash. Otherwise, just return the value
|
217
|
+
# @param [Object] value Any valid value
|
218
|
+
# @return [Hash] Returns the value in the form of hash
|
219
|
+
def _to_hash(value)
|
220
|
+
if value.is_a?(Array)
|
221
|
+
value.compact.map{ |v| _to_hash(v) }
|
222
|
+
elsif value.is_a?(Hash)
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
225
|
+
end
|
226
|
+
elsif value.respond_to? :to_hash
|
227
|
+
value.to_hash
|
228
|
+
else
|
229
|
+
value
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
@@ -0,0 +1,424 @@
|
|
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.net/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.net/projects/osdn-codes/releases/p14859 .
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.20171120
|
7
|
+
Contact: admin@osdn.net
|
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
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module OSDNClient
|
27
|
+
|
28
|
+
class UserStats
|
29
|
+
attr_accessor :date
|
30
|
+
|
31
|
+
attr_accessor :user_point
|
32
|
+
|
33
|
+
attr_accessor :news_count
|
34
|
+
|
35
|
+
attr_accessor :git_count
|
36
|
+
|
37
|
+
attr_accessor :svn_count
|
38
|
+
|
39
|
+
attr_accessor :hg_count
|
40
|
+
|
41
|
+
attr_accessor :bzr_count
|
42
|
+
|
43
|
+
attr_accessor :cvs_count
|
44
|
+
|
45
|
+
attr_accessor :wiki_count
|
46
|
+
|
47
|
+
attr_accessor :forum_count
|
48
|
+
|
49
|
+
attr_accessor :forum_misc_count
|
50
|
+
|
51
|
+
attr_accessor :ticket_open_count
|
52
|
+
|
53
|
+
attr_accessor :ticket_close_count
|
54
|
+
|
55
|
+
attr_accessor :ticket_comment_count
|
56
|
+
|
57
|
+
attr_accessor :ticket_owner_count
|
58
|
+
|
59
|
+
attr_accessor :ticket_misc_count
|
60
|
+
|
61
|
+
attr_accessor :ticket_milestone_count
|
62
|
+
|
63
|
+
attr_accessor :group_approved_count
|
64
|
+
|
65
|
+
attr_accessor :group_history_count
|
66
|
+
|
67
|
+
attr_accessor :ghosted_submit_count
|
68
|
+
|
69
|
+
attr_accessor :ghosted_approve_count
|
70
|
+
|
71
|
+
attr_accessor :project_review_submit_count
|
72
|
+
|
73
|
+
attr_accessor :project_review_update_count
|
74
|
+
|
75
|
+
attr_accessor :project_review_rating_submit_count
|
76
|
+
|
77
|
+
attr_accessor :chamber_file_count
|
78
|
+
|
79
|
+
attr_accessor :chamber_vcs_count
|
80
|
+
|
81
|
+
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'date' => :'date',
|
86
|
+
:'user_point' => :'user_point',
|
87
|
+
:'news_count' => :'news_count',
|
88
|
+
:'git_count' => :'git_count',
|
89
|
+
:'svn_count' => :'svn_count',
|
90
|
+
:'hg_count' => :'hg_count',
|
91
|
+
:'bzr_count' => :'bzr_count',
|
92
|
+
:'cvs_count' => :'cvs_count',
|
93
|
+
:'wiki_count' => :'wiki_count',
|
94
|
+
:'forum_count' => :'forum_count',
|
95
|
+
:'forum_misc_count' => :'forum_misc_count',
|
96
|
+
:'ticket_open_count' => :'ticket_open_count',
|
97
|
+
:'ticket_close_count' => :'ticket_close_count',
|
98
|
+
:'ticket_comment_count' => :'ticket_comment_count',
|
99
|
+
:'ticket_owner_count' => :'ticket_owner_count',
|
100
|
+
:'ticket_misc_count' => :'ticket_misc_count',
|
101
|
+
:'ticket_milestone_count' => :'ticket_milestone_count',
|
102
|
+
:'group_approved_count' => :'group_approved_count',
|
103
|
+
:'group_history_count' => :'group_history_count',
|
104
|
+
:'ghosted_submit_count' => :'ghosted_submit_count',
|
105
|
+
:'ghosted_approve_count' => :'ghosted_approve_count',
|
106
|
+
:'project_review_submit_count' => :'project_review_submit_count',
|
107
|
+
:'project_review_update_count' => :'project_review_update_count',
|
108
|
+
:'project_review_rating_submit_count' => :'project_review_rating_submit_count',
|
109
|
+
:'chamber_file_count' => :'chamber_file_count',
|
110
|
+
:'chamber_vcs_count' => :'chamber_vcs_count'
|
111
|
+
}
|
112
|
+
end
|
113
|
+
|
114
|
+
# Attribute type mapping.
|
115
|
+
def self.swagger_types
|
116
|
+
{
|
117
|
+
:'date' => :'String',
|
118
|
+
:'user_point' => :'Integer',
|
119
|
+
:'news_count' => :'Integer',
|
120
|
+
:'git_count' => :'Integer',
|
121
|
+
:'svn_count' => :'Integer',
|
122
|
+
:'hg_count' => :'Integer',
|
123
|
+
:'bzr_count' => :'Integer',
|
124
|
+
:'cvs_count' => :'Integer',
|
125
|
+
:'wiki_count' => :'Integer',
|
126
|
+
:'forum_count' => :'Integer',
|
127
|
+
:'forum_misc_count' => :'Integer',
|
128
|
+
:'ticket_open_count' => :'Integer',
|
129
|
+
:'ticket_close_count' => :'Integer',
|
130
|
+
:'ticket_comment_count' => :'Integer',
|
131
|
+
:'ticket_owner_count' => :'Integer',
|
132
|
+
:'ticket_misc_count' => :'Integer',
|
133
|
+
:'ticket_milestone_count' => :'Integer',
|
134
|
+
:'group_approved_count' => :'Integer',
|
135
|
+
:'group_history_count' => :'Integer',
|
136
|
+
:'ghosted_submit_count' => :'Integer',
|
137
|
+
:'ghosted_approve_count' => :'Integer',
|
138
|
+
:'project_review_submit_count' => :'Integer',
|
139
|
+
:'project_review_update_count' => :'Integer',
|
140
|
+
:'project_review_rating_submit_count' => :'Integer',
|
141
|
+
:'chamber_file_count' => :'Integer',
|
142
|
+
:'chamber_vcs_count' => :'Integer'
|
143
|
+
}
|
144
|
+
end
|
145
|
+
|
146
|
+
# Initializes the object
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
def initialize(attributes = {})
|
149
|
+
return unless attributes.is_a?(Hash)
|
150
|
+
|
151
|
+
# convert string to symbol for hash key
|
152
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
153
|
+
|
154
|
+
if attributes.has_key?(:'date')
|
155
|
+
self.date = attributes[:'date']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.has_key?(:'user_point')
|
159
|
+
self.user_point = attributes[:'user_point']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.has_key?(:'news_count')
|
163
|
+
self.news_count = attributes[:'news_count']
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.has_key?(:'git_count')
|
167
|
+
self.git_count = attributes[:'git_count']
|
168
|
+
end
|
169
|
+
|
170
|
+
if attributes.has_key?(:'svn_count')
|
171
|
+
self.svn_count = attributes[:'svn_count']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.has_key?(:'hg_count')
|
175
|
+
self.hg_count = attributes[:'hg_count']
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.has_key?(:'bzr_count')
|
179
|
+
self.bzr_count = attributes[:'bzr_count']
|
180
|
+
end
|
181
|
+
|
182
|
+
if attributes.has_key?(:'cvs_count')
|
183
|
+
self.cvs_count = attributes[:'cvs_count']
|
184
|
+
end
|
185
|
+
|
186
|
+
if attributes.has_key?(:'wiki_count')
|
187
|
+
self.wiki_count = attributes[:'wiki_count']
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.has_key?(:'forum_count')
|
191
|
+
self.forum_count = attributes[:'forum_count']
|
192
|
+
end
|
193
|
+
|
194
|
+
if attributes.has_key?(:'forum_misc_count')
|
195
|
+
self.forum_misc_count = attributes[:'forum_misc_count']
|
196
|
+
end
|
197
|
+
|
198
|
+
if attributes.has_key?(:'ticket_open_count')
|
199
|
+
self.ticket_open_count = attributes[:'ticket_open_count']
|
200
|
+
end
|
201
|
+
|
202
|
+
if attributes.has_key?(:'ticket_close_count')
|
203
|
+
self.ticket_close_count = attributes[:'ticket_close_count']
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.has_key?(:'ticket_comment_count')
|
207
|
+
self.ticket_comment_count = attributes[:'ticket_comment_count']
|
208
|
+
end
|
209
|
+
|
210
|
+
if attributes.has_key?(:'ticket_owner_count')
|
211
|
+
self.ticket_owner_count = attributes[:'ticket_owner_count']
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.has_key?(:'ticket_misc_count')
|
215
|
+
self.ticket_misc_count = attributes[:'ticket_misc_count']
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.has_key?(:'ticket_milestone_count')
|
219
|
+
self.ticket_milestone_count = attributes[:'ticket_milestone_count']
|
220
|
+
end
|
221
|
+
|
222
|
+
if attributes.has_key?(:'group_approved_count')
|
223
|
+
self.group_approved_count = attributes[:'group_approved_count']
|
224
|
+
end
|
225
|
+
|
226
|
+
if attributes.has_key?(:'group_history_count')
|
227
|
+
self.group_history_count = attributes[:'group_history_count']
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.has_key?(:'ghosted_submit_count')
|
231
|
+
self.ghosted_submit_count = attributes[:'ghosted_submit_count']
|
232
|
+
end
|
233
|
+
|
234
|
+
if attributes.has_key?(:'ghosted_approve_count')
|
235
|
+
self.ghosted_approve_count = attributes[:'ghosted_approve_count']
|
236
|
+
end
|
237
|
+
|
238
|
+
if attributes.has_key?(:'project_review_submit_count')
|
239
|
+
self.project_review_submit_count = attributes[:'project_review_submit_count']
|
240
|
+
end
|
241
|
+
|
242
|
+
if attributes.has_key?(:'project_review_update_count')
|
243
|
+
self.project_review_update_count = attributes[:'project_review_update_count']
|
244
|
+
end
|
245
|
+
|
246
|
+
if attributes.has_key?(:'project_review_rating_submit_count')
|
247
|
+
self.project_review_rating_submit_count = attributes[:'project_review_rating_submit_count']
|
248
|
+
end
|
249
|
+
|
250
|
+
if attributes.has_key?(:'chamber_file_count')
|
251
|
+
self.chamber_file_count = attributes[:'chamber_file_count']
|
252
|
+
end
|
253
|
+
|
254
|
+
if attributes.has_key?(:'chamber_vcs_count')
|
255
|
+
self.chamber_vcs_count = attributes[:'chamber_vcs_count']
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
261
|
+
# @return Array for valid properies with the reasons
|
262
|
+
def list_invalid_properties
|
263
|
+
invalid_properties = Array.new
|
264
|
+
return invalid_properties
|
265
|
+
end
|
266
|
+
|
267
|
+
# Check to see if the all the properties in the model are valid
|
268
|
+
# @return true if the model is valid
|
269
|
+
def valid?
|
270
|
+
return true
|
271
|
+
end
|
272
|
+
|
273
|
+
# Checks equality by comparing each attribute.
|
274
|
+
# @param [Object] Object to be compared
|
275
|
+
def ==(o)
|
276
|
+
return true if self.equal?(o)
|
277
|
+
self.class == o.class &&
|
278
|
+
date == o.date &&
|
279
|
+
user_point == o.user_point &&
|
280
|
+
news_count == o.news_count &&
|
281
|
+
git_count == o.git_count &&
|
282
|
+
svn_count == o.svn_count &&
|
283
|
+
hg_count == o.hg_count &&
|
284
|
+
bzr_count == o.bzr_count &&
|
285
|
+
cvs_count == o.cvs_count &&
|
286
|
+
wiki_count == o.wiki_count &&
|
287
|
+
forum_count == o.forum_count &&
|
288
|
+
forum_misc_count == o.forum_misc_count &&
|
289
|
+
ticket_open_count == o.ticket_open_count &&
|
290
|
+
ticket_close_count == o.ticket_close_count &&
|
291
|
+
ticket_comment_count == o.ticket_comment_count &&
|
292
|
+
ticket_owner_count == o.ticket_owner_count &&
|
293
|
+
ticket_misc_count == o.ticket_misc_count &&
|
294
|
+
ticket_milestone_count == o.ticket_milestone_count &&
|
295
|
+
group_approved_count == o.group_approved_count &&
|
296
|
+
group_history_count == o.group_history_count &&
|
297
|
+
ghosted_submit_count == o.ghosted_submit_count &&
|
298
|
+
ghosted_approve_count == o.ghosted_approve_count &&
|
299
|
+
project_review_submit_count == o.project_review_submit_count &&
|
300
|
+
project_review_update_count == o.project_review_update_count &&
|
301
|
+
project_review_rating_submit_count == o.project_review_rating_submit_count &&
|
302
|
+
chamber_file_count == o.chamber_file_count &&
|
303
|
+
chamber_vcs_count == o.chamber_vcs_count
|
304
|
+
end
|
305
|
+
|
306
|
+
# @see the `==` method
|
307
|
+
# @param [Object] Object to be compared
|
308
|
+
def eql?(o)
|
309
|
+
self == o
|
310
|
+
end
|
311
|
+
|
312
|
+
# Calculates hash code according to all attributes.
|
313
|
+
# @return [Fixnum] Hash code
|
314
|
+
def hash
|
315
|
+
[date, user_point, news_count, git_count, svn_count, hg_count, bzr_count, cvs_count, wiki_count, forum_count, forum_misc_count, ticket_open_count, ticket_close_count, ticket_comment_count, ticket_owner_count, ticket_misc_count, ticket_milestone_count, group_approved_count, group_history_count, ghosted_submit_count, ghosted_approve_count, project_review_submit_count, project_review_update_count, project_review_rating_submit_count, chamber_file_count, chamber_vcs_count].hash
|
316
|
+
end
|
317
|
+
|
318
|
+
# Builds the object from hash
|
319
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
320
|
+
# @return [Object] Returns the model itself
|
321
|
+
def build_from_hash(attributes)
|
322
|
+
return nil unless attributes.is_a?(Hash)
|
323
|
+
self.class.swagger_types.each_pair do |key, type|
|
324
|
+
if type =~ /^Array<(.*)>/i
|
325
|
+
# check to ensure the input is an array given that the the attribute
|
326
|
+
# is documented as an array but the input is not
|
327
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
328
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
329
|
+
end
|
330
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
331
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
332
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
333
|
+
end
|
334
|
+
|
335
|
+
self
|
336
|
+
end
|
337
|
+
|
338
|
+
# Deserializes the data based on type
|
339
|
+
# @param string type Data type
|
340
|
+
# @param string value Value to be deserialized
|
341
|
+
# @return [Object] Deserialized data
|
342
|
+
def _deserialize(type, value)
|
343
|
+
case type.to_sym
|
344
|
+
when :DateTime
|
345
|
+
DateTime.parse(value)
|
346
|
+
when :Date
|
347
|
+
Date.parse(value)
|
348
|
+
when :String
|
349
|
+
value.to_s
|
350
|
+
when :Integer
|
351
|
+
value.to_i
|
352
|
+
when :Float
|
353
|
+
value.to_f
|
354
|
+
when :BOOLEAN
|
355
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
356
|
+
true
|
357
|
+
else
|
358
|
+
false
|
359
|
+
end
|
360
|
+
when :Object
|
361
|
+
# generic object (usually a Hash), return directly
|
362
|
+
value
|
363
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
364
|
+
inner_type = Regexp.last_match[:inner_type]
|
365
|
+
value.map { |v| _deserialize(inner_type, v) }
|
366
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
367
|
+
k_type = Regexp.last_match[:k_type]
|
368
|
+
v_type = Regexp.last_match[:v_type]
|
369
|
+
{}.tap do |hash|
|
370
|
+
value.each do |k, v|
|
371
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
372
|
+
end
|
373
|
+
end
|
374
|
+
else # model
|
375
|
+
temp_model = OSDNClient.const_get(type).new
|
376
|
+
temp_model.build_from_hash(value)
|
377
|
+
end
|
378
|
+
end
|
379
|
+
|
380
|
+
# Returns the string representation of the object
|
381
|
+
# @return [String] String presentation of the object
|
382
|
+
def to_s
|
383
|
+
to_hash.to_s
|
384
|
+
end
|
385
|
+
|
386
|
+
# to_body is an alias to to_hash (backward compatibility)
|
387
|
+
# @return [Hash] Returns the object in the form of hash
|
388
|
+
def to_body
|
389
|
+
to_hash
|
390
|
+
end
|
391
|
+
|
392
|
+
# Returns the object in the form of hash
|
393
|
+
# @return [Hash] Returns the object in the form of hash
|
394
|
+
def to_hash
|
395
|
+
hash = {}
|
396
|
+
self.class.attribute_map.each_pair do |attr, param|
|
397
|
+
value = self.send(attr)
|
398
|
+
next if value.nil?
|
399
|
+
hash[param] = _to_hash(value)
|
400
|
+
end
|
401
|
+
hash
|
402
|
+
end
|
403
|
+
|
404
|
+
# Outputs non-array value in the form of hash
|
405
|
+
# For object, use to_hash. Otherwise, just return the value
|
406
|
+
# @param [Object] value Any valid value
|
407
|
+
# @return [Hash] Returns the value in the form of hash
|
408
|
+
def _to_hash(value)
|
409
|
+
if value.is_a?(Array)
|
410
|
+
value.compact.map{ |v| _to_hash(v) }
|
411
|
+
elsif value.is_a?(Hash)
|
412
|
+
{}.tap do |hash|
|
413
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
414
|
+
end
|
415
|
+
elsif value.respond_to? :to_hash
|
416
|
+
value.to_hash
|
417
|
+
else
|
418
|
+
value
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
end
|
423
|
+
|
424
|
+
end
|