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,199 @@
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 ProjectWeb
29
+ attr_accessor :homepage
30
+
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'homepage' => :'homepage'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'homepage' => :'String'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
+
54
+ if attributes.has_key?(:'homepage')
55
+ self.homepage = attributes[:'homepage']
56
+ end
57
+
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properies with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ return invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ return true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ homepage == o.homepage
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [homepage].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def build_from_hash(attributes)
97
+ return nil unless attributes.is_a?(Hash)
98
+ self.class.swagger_types.each_pair do |key, type|
99
+ if type =~ /^Array<(.*)>/i
100
+ # check to ensure the input is an array given that the the attribute
101
+ # is documented as an array but the input is not
102
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
104
+ end
105
+ elsif !attributes[self.class.attribute_map[key]].nil?
106
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
107
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
108
+ end
109
+
110
+ self
111
+ end
112
+
113
+ # Deserializes the data based on type
114
+ # @param string type Data type
115
+ # @param string value Value to be deserialized
116
+ # @return [Object] Deserialized data
117
+ def _deserialize(type, value)
118
+ case type.to_sym
119
+ when :DateTime
120
+ DateTime.parse(value)
121
+ when :Date
122
+ Date.parse(value)
123
+ when :String
124
+ value.to_s
125
+ when :Integer
126
+ value.to_i
127
+ when :Float
128
+ value.to_f
129
+ when :BOOLEAN
130
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
131
+ true
132
+ else
133
+ false
134
+ end
135
+ when :Object
136
+ # generic object (usually a Hash), return directly
137
+ value
138
+ when /\AArray<(?<inner_type>.+)>\z/
139
+ inner_type = Regexp.last_match[:inner_type]
140
+ value.map { |v| _deserialize(inner_type, v) }
141
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
142
+ k_type = Regexp.last_match[:k_type]
143
+ v_type = Regexp.last_match[:v_type]
144
+ {}.tap do |hash|
145
+ value.each do |k, v|
146
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
147
+ end
148
+ end
149
+ else # model
150
+ temp_model = OSDNClient.const_get(type).new
151
+ temp_model.build_from_hash(value)
152
+ end
153
+ end
154
+
155
+ # Returns the string representation of the object
156
+ # @return [String] String presentation of the object
157
+ def to_s
158
+ to_hash.to_s
159
+ end
160
+
161
+ # to_body is an alias to to_hash (backward compatibility)
162
+ # @return [Hash] Returns the object in the form of hash
163
+ def to_body
164
+ to_hash
165
+ end
166
+
167
+ # Returns the object in the form of hash
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_hash
170
+ hash = {}
171
+ self.class.attribute_map.each_pair do |attr, param|
172
+ value = self.send(attr)
173
+ next if value.nil?
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ # Outputs non-array value in the form of hash
180
+ # For object, use to_hash. Otherwise, just return the value
181
+ # @param [Object] value Any valid value
182
+ # @return [Hash] Returns the value in the form of hash
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map{ |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+
199
+ end
@@ -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.20161003
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.20161003
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
 
@@ -0,0 +1,289 @@
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 ScmHook
29
+ attr_accessor :id
30
+
31
+ attr_accessor :repository_id
32
+
33
+ attr_accessor :repository_type
34
+
35
+ attr_accessor :chamber_id
36
+
37
+ attr_accessor :group_id
38
+
39
+ attr_accessor :target_url
40
+
41
+ attr_accessor :message
42
+
43
+ attr_accessor :error_count
44
+
45
+ attr_accessor :disabled
46
+
47
+ attr_accessor :triggered_at
48
+
49
+ attr_accessor :errors_at
50
+
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'repository_id' => :'repository_id',
57
+ :'repository_type' => :'repository_type',
58
+ :'chamber_id' => :'chamber_id',
59
+ :'group_id' => :'group_id',
60
+ :'target_url' => :'target_url',
61
+ :'message' => :'message',
62
+ :'error_count' => :'error_count',
63
+ :'disabled' => :'disabled',
64
+ :'triggered_at' => :'triggered_at',
65
+ :'errors_at' => :'errors_at'
66
+ }
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.swagger_types
71
+ {
72
+ :'id' => :'Integer',
73
+ :'repository_id' => :'Integer',
74
+ :'repository_type' => :'String',
75
+ :'chamber_id' => :'Integer',
76
+ :'group_id' => :'Integer',
77
+ :'target_url' => :'String',
78
+ :'message' => :'String',
79
+ :'error_count' => :'Integer',
80
+ :'disabled' => :'BOOLEAN',
81
+ :'triggered_at' => :'DateTime',
82
+ :'errors_at' => :'DateTime'
83
+ }
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ return unless attributes.is_a?(Hash)
90
+
91
+ # convert string to symbol for hash key
92
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
93
+
94
+ if attributes.has_key?(:'id')
95
+ self.id = attributes[:'id']
96
+ end
97
+
98
+ if attributes.has_key?(:'repository_id')
99
+ self.repository_id = attributes[:'repository_id']
100
+ end
101
+
102
+ if attributes.has_key?(:'repository_type')
103
+ self.repository_type = attributes[:'repository_type']
104
+ end
105
+
106
+ if attributes.has_key?(:'chamber_id')
107
+ self.chamber_id = attributes[:'chamber_id']
108
+ end
109
+
110
+ if attributes.has_key?(:'group_id')
111
+ self.group_id = attributes[:'group_id']
112
+ end
113
+
114
+ if attributes.has_key?(:'target_url')
115
+ self.target_url = attributes[:'target_url']
116
+ end
117
+
118
+ if attributes.has_key?(:'message')
119
+ self.message = attributes[:'message']
120
+ end
121
+
122
+ if attributes.has_key?(:'error_count')
123
+ self.error_count = attributes[:'error_count']
124
+ end
125
+
126
+ if attributes.has_key?(:'disabled')
127
+ self.disabled = attributes[:'disabled']
128
+ end
129
+
130
+ if attributes.has_key?(:'triggered_at')
131
+ self.triggered_at = attributes[:'triggered_at']
132
+ end
133
+
134
+ if attributes.has_key?(:'errors_at')
135
+ self.errors_at = attributes[:'errors_at']
136
+ end
137
+
138
+ end
139
+
140
+ # Show invalid properties with the reasons. Usually used together with valid?
141
+ # @return Array for valid properies with the reasons
142
+ def list_invalid_properties
143
+ invalid_properties = Array.new
144
+ return invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ return true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ id == o.id &&
159
+ repository_id == o.repository_id &&
160
+ repository_type == o.repository_type &&
161
+ chamber_id == o.chamber_id &&
162
+ group_id == o.group_id &&
163
+ target_url == o.target_url &&
164
+ message == o.message &&
165
+ error_count == o.error_count &&
166
+ disabled == o.disabled &&
167
+ triggered_at == o.triggered_at &&
168
+ errors_at == o.errors_at
169
+ end
170
+
171
+ # @see the `==` method
172
+ # @param [Object] Object to be compared
173
+ def eql?(o)
174
+ self == o
175
+ end
176
+
177
+ # Calculates hash code according to all attributes.
178
+ # @return [Fixnum] Hash code
179
+ def hash
180
+ [id, repository_id, repository_type, chamber_id, group_id, target_url, message, error_count, disabled, triggered_at, errors_at].hash
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.swagger_types.each_pair do |key, type|
189
+ if type =~ /^Array<(.*)>/i
190
+ # check to ensure the input is an array given that the the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
194
+ end
195
+ elsif !attributes[self.class.attribute_map[key]].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :DateTime
210
+ DateTime.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :BOOLEAN
220
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ temp_model = OSDNClient.const_get(type).new
241
+ temp_model.build_from_hash(value)
242
+ end
243
+ end
244
+
245
+ # Returns the string representation of the object
246
+ # @return [String] String presentation of the object
247
+ def to_s
248
+ to_hash.to_s
249
+ end
250
+
251
+ # to_body is an alias to to_hash (backward compatibility)
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_body
254
+ to_hash
255
+ end
256
+
257
+ # Returns the object in the form of hash
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_hash
260
+ hash = {}
261
+ self.class.attribute_map.each_pair do |attr, param|
262
+ value = self.send(attr)
263
+ next if value.nil?
264
+ hash[param] = _to_hash(value)
265
+ end
266
+ hash
267
+ end
268
+
269
+ # Outputs non-array value in the form of hash
270
+ # For object, use to_hash. Otherwise, just return the value
271
+ # @param [Object] value Any valid value
272
+ # @return [Hash] Returns the value in the form of hash
273
+ def _to_hash(value)
274
+ if value.is_a?(Array)
275
+ value.compact.map{ |v| _to_hash(v) }
276
+ elsif value.is_a?(Hash)
277
+ {}.tap do |hash|
278
+ value.each { |k, v| hash[k] = _to_hash(v) }
279
+ end
280
+ elsif value.respond_to? :to_hash
281
+ value.to_hash
282
+ else
283
+ value
284
+ end
285
+ end
286
+
287
+ end
288
+
289
+ end