osdn-client 0.0.20161003 → 0.0.20171120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +168 -6
  3. data/docs/FrsAdminPrefs.md +9 -0
  4. data/docs/Group.md +1 -3
  5. data/docs/GroupProfile.md +10 -0
  6. data/docs/GroupProfilePerLanguage.md +10 -0
  7. data/docs/GroupToolFlags.md +1 -2
  8. data/docs/History.md +15 -0
  9. data/docs/I18NText.md +9 -0
  10. data/docs/ProjectApi.md +4021 -209
  11. data/docs/ProjectBzr.md +22 -0
  12. data/docs/ProjectFrsApi.md +118 -4
  13. data/docs/ProjectGit.md +27 -0
  14. data/docs/ProjectHg.md +22 -0
  15. data/docs/ProjectSCM.md +22 -0
  16. data/docs/ProjectSCMApi.md +1214 -0
  17. data/docs/ProjectSCMLastCommit.md +11 -0
  18. data/docs/ProjectSvn.md +25 -0
  19. data/docs/ProjectTicketApi.md +1847 -0
  20. data/docs/ProjectTicketComment.md +13 -0
  21. data/docs/ProjectTicketComponent.md +14 -0
  22. data/docs/ProjectTicketComponentSummary.md +10 -0
  23. data/docs/ProjectTicketComponentSummarySummarizedBy.md +12 -0
  24. data/docs/ProjectTicketHistory.md +14 -0
  25. data/docs/ProjectTicketItem.md +25 -0
  26. data/docs/ProjectTicketMilestone.md +14 -0
  27. data/docs/ProjectTicketMilestoneSummary.md +10 -0
  28. data/docs/ProjectTicketMilestoneSummarySummarizedBy.md +12 -0
  29. data/docs/ProjectTicketPrefs.md +13 -0
  30. data/docs/ProjectTicketType.md +15 -0
  31. data/docs/ProjectTicketTypeInstructionPerLanguage.md +9 -0
  32. data/docs/ProjectTicketTypeInstructions.md +9 -0
  33. data/docs/ProjectTicketTypeSummary.md +10 -0
  34. data/docs/ProjectTicketTypeSummarySummarizedBy.md +12 -0
  35. data/docs/ProjectWeb.md +8 -0
  36. data/docs/ScmHook.md +18 -0
  37. data/docs/SummariadByComponent.md +7 -0
  38. data/docs/SummariadByComponentInner.md +10 -0
  39. data/docs/SummariadByMilestone.md +7 -0
  40. data/docs/SummariadByMilestoneInner.md +10 -0
  41. data/docs/SummariadByOwner.md +7 -0
  42. data/docs/SummariadByOwnerInner.md +10 -0
  43. data/docs/SummariadByPriority.md +7 -0
  44. data/docs/SummariadByPriorityInner.md +10 -0
  45. data/docs/SummariadBySeverity.md +7 -0
  46. data/docs/SummariadBySeverityInner.md +10 -0
  47. data/docs/SummariadByType.md +7 -0
  48. data/docs/SummariadByTypeInner.md +10 -0
  49. data/docs/User.md +5 -3
  50. data/docs/UserApi.md +279 -0
  51. data/docs/UserImages.md +12 -0
  52. data/docs/UserStats.md +33 -0
  53. data/lib/osdn-client.rb +45 -1
  54. data/lib/osdn-client/api/default_api.rb +1 -1
  55. data/lib/osdn-client/api/project_api.rb +4574 -396
  56. data/lib/osdn-client/api/project_frs_api.rb +122 -5
  57. data/lib/osdn-client/api/project_news_api.rb +1 -1
  58. data/lib/osdn-client/api/project_scm_api.rb +1310 -0
  59. data/lib/osdn-client/api/project_ticket_api.rb +2124 -0
  60. data/lib/osdn-client/api/user_api.rb +294 -1
  61. data/lib/osdn-client/api_client.rb +1 -1
  62. data/lib/osdn-client/api_error.rb +1 -1
  63. data/lib/osdn-client/configuration.rb +1 -1
  64. data/lib/osdn-client/models/frs_admin_prefs.rb +208 -0
  65. data/lib/osdn-client/models/group.rb +8 -26
  66. data/lib/osdn-client/models/group_profile.rb +223 -0
  67. data/lib/osdn-client/models/group_profile_per_language.rb +217 -0
  68. data/lib/osdn-client/models/group_tool_flags.rb +11 -20
  69. data/lib/osdn-client/models/history.rb +262 -0
  70. data/lib/osdn-client/models/i18_n_text.rb +208 -0
  71. data/lib/osdn-client/models/news.rb +1 -1
  72. data/lib/osdn-client/models/package.rb +1 -1
  73. data/lib/osdn-client/models/pong.rb +1 -1
  74. data/lib/osdn-client/models/project_bzr.rb +329 -0
  75. data/lib/osdn-client/models/project_git.rb +374 -0
  76. data/lib/osdn-client/models/project_hg.rb +329 -0
  77. data/lib/osdn-client/models/project_scm.rb +329 -0
  78. data/lib/osdn-client/models/project_scm_last_commit.rb +226 -0
  79. data/lib/osdn-client/models/project_svn.rb +356 -0
  80. data/lib/osdn-client/models/project_ticket_comment.rb +244 -0
  81. data/lib/osdn-client/models/project_ticket_component.rb +253 -0
  82. data/lib/osdn-client/models/project_ticket_component_summary.rb +217 -0
  83. data/lib/osdn-client/models/project_ticket_component_summary_summarized_by.rb +235 -0
  84. data/lib/osdn-client/models/project_ticket_history.rb +253 -0
  85. data/lib/osdn-client/models/project_ticket_item.rb +356 -0
  86. data/lib/osdn-client/models/project_ticket_milestone.rb +253 -0
  87. data/lib/osdn-client/models/project_ticket_milestone_summary.rb +217 -0
  88. data/lib/osdn-client/models/project_ticket_milestone_summary_summarized_by.rb +235 -0
  89. data/lib/osdn-client/models/project_ticket_prefs.rb +244 -0
  90. data/lib/osdn-client/models/project_ticket_type.rb +266 -0
  91. data/lib/osdn-client/models/project_ticket_type_instruction_per_language.rb +208 -0
  92. data/lib/osdn-client/models/project_ticket_type_instructions.rb +212 -0
  93. data/lib/osdn-client/models/project_ticket_type_summary.rb +217 -0
  94. data/lib/osdn-client/models/project_ticket_type_summary_summarized_by.rb +235 -0
  95. data/lib/osdn-client/models/project_web.rb +199 -0
  96. data/lib/osdn-client/models/rel_file.rb +1 -1
  97. data/lib/osdn-client/models/release.rb +1 -1
  98. data/lib/osdn-client/models/scm_hook.rb +289 -0
  99. data/lib/osdn-client/models/simple_chamber.rb +1 -1
  100. data/lib/osdn-client/models/simple_group.rb +1 -1
  101. data/lib/osdn-client/models/simple_user.rb +1 -1
  102. data/lib/osdn-client/models/skill.rb +1 -1
  103. data/lib/osdn-client/models/summariad_by_component.rb +190 -0
  104. data/lib/osdn-client/models/summariad_by_component_inner.rb +217 -0
  105. data/lib/osdn-client/models/summariad_by_milestone.rb +190 -0
  106. data/lib/osdn-client/models/summariad_by_milestone_inner.rb +217 -0
  107. data/lib/osdn-client/models/summariad_by_owner.rb +190 -0
  108. data/lib/osdn-client/models/summariad_by_owner_inner.rb +217 -0
  109. data/lib/osdn-client/models/summariad_by_priority.rb +190 -0
  110. data/lib/osdn-client/models/summariad_by_priority_inner.rb +217 -0
  111. data/lib/osdn-client/models/summariad_by_severity.rb +190 -0
  112. data/lib/osdn-client/models/summariad_by_severity_inner.rb +217 -0
  113. data/lib/osdn-client/models/summariad_by_type.rb +190 -0
  114. data/lib/osdn-client/models/summariad_by_type_inner.rb +217 -0
  115. data/lib/osdn-client/models/token.rb +1 -1
  116. data/lib/osdn-client/models/user.rb +38 -18
  117. data/lib/osdn-client/models/user_images.rb +235 -0
  118. data/lib/osdn-client/models/user_stats.rb +424 -0
  119. data/lib/osdn-client/version.rb +2 -2
  120. data/osdn-client.gemspec +1 -1
  121. data/spec/api/default_api_spec.rb +1 -1
  122. data/spec/api/project_api_spec.rb +899 -3
  123. data/spec/api/project_frs_api_spec.rb +28 -3
  124. data/spec/api/project_news_api_spec.rb +1 -1
  125. data/spec/api/project_scm_api_spec.rb +324 -0
  126. data/spec/api/project_ticket_api_spec.rb +488 -0
  127. data/spec/api/user_api_spec.rb +63 -1
  128. data/spec/api_client_spec.rb +1 -1
  129. data/spec/configuration_spec.rb +1 -1
  130. data/spec/models/frs_admin_prefs_spec.rb +59 -0
  131. data/spec/models/group_profile_per_language_spec.rb +65 -0
  132. data/spec/models/group_profile_spec.rb +65 -0
  133. data/spec/models/group_spec.rb +2 -14
  134. data/spec/models/group_tool_flags_spec.rb +3 -9
  135. data/spec/models/history_spec.rb +95 -0
  136. data/spec/models/i18_n_text_spec.rb +59 -0
  137. data/spec/models/news_spec.rb +1 -1
  138. data/spec/models/package_spec.rb +1 -1
  139. data/spec/models/pong_spec.rb +1 -1
  140. data/spec/models/project_bzr_spec.rb +137 -0
  141. data/spec/models/project_git_spec.rb +167 -0
  142. data/spec/models/project_hg_spec.rb +137 -0
  143. data/spec/models/project_scm_last_commit_spec.rb +71 -0
  144. data/spec/models/project_scm_spec.rb +137 -0
  145. data/spec/models/project_svn_spec.rb +155 -0
  146. data/spec/models/project_ticket_comment_spec.rb +83 -0
  147. data/spec/models/project_ticket_component_spec.rb +89 -0
  148. data/spec/models/project_ticket_component_summary_spec.rb +65 -0
  149. data/spec/models/project_ticket_component_summary_summarized_by_spec.rb +77 -0
  150. data/spec/models/project_ticket_history_spec.rb +89 -0
  151. data/spec/models/project_ticket_item_spec.rb +155 -0
  152. data/spec/models/project_ticket_milestone_spec.rb +89 -0
  153. data/spec/models/project_ticket_milestone_summary_spec.rb +65 -0
  154. data/spec/models/project_ticket_milestone_summary_summarized_by_spec.rb +77 -0
  155. data/spec/models/project_ticket_prefs_spec.rb +83 -0
  156. data/spec/models/project_ticket_type_instruction_per_language_spec.rb +59 -0
  157. data/spec/models/project_ticket_type_instructions_spec.rb +59 -0
  158. data/spec/models/project_ticket_type_spec.rb +95 -0
  159. data/spec/models/project_ticket_type_summary_spec.rb +65 -0
  160. data/spec/models/project_ticket_type_summary_summarized_by_spec.rb +77 -0
  161. data/spec/models/project_web_spec.rb +53 -0
  162. data/spec/models/rel_file_spec.rb +1 -1
  163. data/spec/models/release_spec.rb +1 -1
  164. data/spec/models/scm_hook_spec.rb +113 -0
  165. data/spec/models/simple_chamber_spec.rb +1 -1
  166. data/spec/models/simple_group_spec.rb +1 -1
  167. data/spec/models/simple_user_spec.rb +1 -1
  168. data/spec/models/skill_spec.rb +1 -1
  169. data/spec/models/summariad_by_component_inner_spec.rb +65 -0
  170. data/spec/models/summariad_by_component_spec.rb +47 -0
  171. data/spec/models/summariad_by_milestone_inner_spec.rb +65 -0
  172. data/spec/models/summariad_by_milestone_spec.rb +47 -0
  173. data/spec/models/summariad_by_owner_inner_spec.rb +65 -0
  174. data/spec/models/summariad_by_owner_spec.rb +47 -0
  175. data/spec/models/summariad_by_priority_inner_spec.rb +65 -0
  176. data/spec/models/summariad_by_priority_spec.rb +47 -0
  177. data/spec/models/summariad_by_severity_inner_spec.rb +65 -0
  178. data/spec/models/summariad_by_severity_spec.rb +47 -0
  179. data/spec/models/summariad_by_type_inner_spec.rb +65 -0
  180. data/spec/models/summariad_by_type_spec.rb +47 -0
  181. data/spec/models/token_spec.rb +1 -1
  182. data/spec/models/user_images_spec.rb +77 -0
  183. data/spec/models/user_spec.rb +16 -4
  184. data/spec/models/user_stats_spec.rb +203 -0
  185. data/spec/spec_helper.rb +1 -1
  186. metadata +179 -3
@@ -0,0 +1,244 @@
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 ProjectTicketComment
29
+ attr_accessor :id
30
+
31
+ attr_accessor :ticket_id
32
+
33
+ attr_accessor :comment
34
+
35
+ attr_accessor :comment_html
36
+
37
+ attr_accessor :submitted_by
38
+
39
+ attr_accessor :submitted_at
40
+
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'id' => :'id',
46
+ :'ticket_id' => :'ticket_id',
47
+ :'comment' => :'comment',
48
+ :'comment_html' => :'comment_html',
49
+ :'submitted_by' => :'submitted_by',
50
+ :'submitted_at' => :'submitted_at'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.swagger_types
56
+ {
57
+ :'id' => :'Integer',
58
+ :'ticket_id' => :'Integer',
59
+ :'comment' => :'String',
60
+ :'comment_html' => :'String',
61
+ :'submitted_by' => :'Integer',
62
+ :'submitted_at' => :'DateTime'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
+
74
+ if attributes.has_key?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.has_key?(:'ticket_id')
79
+ self.ticket_id = attributes[:'ticket_id']
80
+ end
81
+
82
+ if attributes.has_key?(:'comment')
83
+ self.comment = attributes[:'comment']
84
+ end
85
+
86
+ if attributes.has_key?(:'comment_html')
87
+ self.comment_html = attributes[:'comment_html']
88
+ end
89
+
90
+ if attributes.has_key?(:'submitted_by')
91
+ self.submitted_by = attributes[:'submitted_by']
92
+ end
93
+
94
+ if attributes.has_key?(:'submitted_at')
95
+ self.submitted_at = attributes[:'submitted_at']
96
+ end
97
+
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properies with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ return invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ id == o.id &&
119
+ ticket_id == o.ticket_id &&
120
+ comment == o.comment &&
121
+ comment_html == o.comment_html &&
122
+ submitted_by == o.submitted_by &&
123
+ submitted_at == o.submitted_at
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [id, ticket_id, comment, comment_html, submitted_by, submitted_at].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.swagger_types.each_pair do |key, type|
144
+ if type =~ /^Array<(.*)>/i
145
+ # check to ensure the input is an array given that the the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :BOOLEAN
175
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ temp_model = OSDNClient.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map{ |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,253 @@
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 ProjectTicketComponent
29
+ attr_accessor :id
30
+
31
+ attr_accessor :name
32
+
33
+ attr_accessor :description
34
+
35
+ attr_accessor :owner
36
+
37
+ attr_accessor :active
38
+
39
+ attr_accessor :is_editable
40
+
41
+ attr_accessor :summary
42
+
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'id' => :'id',
48
+ :'name' => :'name',
49
+ :'description' => :'description',
50
+ :'owner' => :'owner',
51
+ :'active' => :'active',
52
+ :'is_editable' => :'is_editable',
53
+ :'summary' => :'summary'
54
+ }
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.swagger_types
59
+ {
60
+ :'id' => :'Integer',
61
+ :'name' => :'String',
62
+ :'description' => :'String',
63
+ :'owner' => :'Integer',
64
+ :'active' => :'BOOLEAN',
65
+ :'is_editable' => :'BOOLEAN',
66
+ :'summary' => :'ProjectTicketComponentSummary'
67
+ }
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ return unless attributes.is_a?(Hash)
74
+
75
+ # convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
77
+
78
+ if attributes.has_key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.has_key?(:'name')
83
+ self.name = attributes[:'name']
84
+ end
85
+
86
+ if attributes.has_key?(:'description')
87
+ self.description = attributes[:'description']
88
+ end
89
+
90
+ if attributes.has_key?(:'owner')
91
+ self.owner = attributes[:'owner']
92
+ end
93
+
94
+ if attributes.has_key?(:'active')
95
+ self.active = attributes[:'active']
96
+ end
97
+
98
+ if attributes.has_key?(:'is_editable')
99
+ self.is_editable = attributes[:'is_editable']
100
+ end
101
+
102
+ if attributes.has_key?(:'summary')
103
+ self.summary = attributes[:'summary']
104
+ end
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
113
+ end
114
+
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
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ id == o.id &&
127
+ name == o.name &&
128
+ description == o.description &&
129
+ owner == o.owner &&
130
+ active == o.active &&
131
+ is_editable == o.is_editable &&
132
+ summary == o.summary
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Fixnum] Hash code
143
+ def hash
144
+ [id, name, description, owner, active, is_editable, summary].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ self.class.swagger_types.each_pair do |key, type|
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
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
162
+ end
163
+
164
+ self
165
+ end
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
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :DateTime
174
+ DateTime.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :BOOLEAN
184
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ temp_model = OSDNClient.const_get(type).new
205
+ temp_model.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ next if value.nil?
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
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
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map{ |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+
253
+ end