osdn-client 0.0.20160304

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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/lib/osdn-client.rb +45 -0
  3. data/lib/osdn-client/api/default_api.rb +148 -0
  4. data/lib/osdn-client/api/project_api.rb +1752 -0
  5. data/lib/osdn-client/api/project_frs_api.rb +1033 -0
  6. data/lib/osdn-client/api/project_news_api.rb +673 -0
  7. data/lib/osdn-client/api/user_api.rb +76 -0
  8. data/lib/osdn-client/api_client.rb +318 -0
  9. data/lib/osdn-client/api_error.rb +24 -0
  10. data/lib/osdn-client/configuration.rb +177 -0
  11. data/lib/osdn-client/models/group.rb +298 -0
  12. data/lib/osdn-client/models/group_tool_flags.rb +236 -0
  13. data/lib/osdn-client/models/news.rb +206 -0
  14. data/lib/osdn-client/models/package.rb +198 -0
  15. data/lib/osdn-client/models/pong.rb +176 -0
  16. data/lib/osdn-client/models/rel_file.rb +256 -0
  17. data/lib/osdn-client/models/release.rb +228 -0
  18. data/lib/osdn-client/models/simple_chamber.rb +176 -0
  19. data/lib/osdn-client/models/simple_group.rb +176 -0
  20. data/lib/osdn-client/models/simple_user.rb +166 -0
  21. data/lib/osdn-client/models/skill.rb +176 -0
  22. data/lib/osdn-client/models/token.rb +186 -0
  23. data/lib/osdn-client/models/user.rb +272 -0
  24. data/lib/osdn-client/version.rb +3 -0
  25. data/osdn-client.gemspec +32 -0
  26. data/spec/api/DefaultApi_spec.rb +58 -0
  27. data/spec/api/ProjectApi_spec.rb +472 -0
  28. data/spec/api/ProjectFrsApi_spec.rb +285 -0
  29. data/spec/api/ProjectNewsApi_spec.rb +194 -0
  30. data/spec/api/UserApi_spec.rb +39 -0
  31. data/spec/models/GroupToolFlags_spec.rb +124 -0
  32. data/spec/models/Group_spec.rb +184 -0
  33. data/spec/models/News_spec.rb +94 -0
  34. data/spec/models/Package_spec.rb +84 -0
  35. data/spec/models/Pong_spec.rb +64 -0
  36. data/spec/models/RelFile_spec.rb +144 -0
  37. data/spec/models/Release_spec.rb +114 -0
  38. data/spec/models/SimpleChamber_spec.rb +64 -0
  39. data/spec/models/SimpleGroup_spec.rb +64 -0
  40. data/spec/models/SimpleUser_spec.rb +54 -0
  41. data/spec/models/Skill_spec.rb +64 -0
  42. data/spec/models/Token_spec.rb +74 -0
  43. data/spec/models/User_spec.rb +154 -0
  44. metadata +284 -0
@@ -0,0 +1,206 @@
1
+ require 'date'
2
+
3
+ module OSDNClient
4
+ class News
5
+ attr_accessor :id
6
+
7
+ attr_accessor :url
8
+
9
+ attr_accessor :title
10
+
11
+ attr_accessor :body
12
+
13
+ attr_accessor :body_html
14
+
15
+ attr_accessor :last_update
16
+
17
+ attr_accessor :submitter
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+
23
+ :'id' => :'id',
24
+
25
+ :'url' => :'url',
26
+
27
+ :'title' => :'title',
28
+
29
+ :'body' => :'body',
30
+
31
+ :'body_html' => :'body_html',
32
+
33
+ :'last_update' => :'last_update',
34
+
35
+ :'submitter' => :'submitter'
36
+
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'id' => :'Integer',
44
+ :'url' => :'String',
45
+ :'title' => :'String',
46
+ :'body' => :'String',
47
+ :'body_html' => :'String',
48
+ :'last_update' => :'DateTime',
49
+ :'submitter' => :'SimpleUser'
50
+
51
+ }
52
+ end
53
+
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
59
+
60
+
61
+ if attributes[:'id']
62
+ self.id = attributes[:'id']
63
+ end
64
+
65
+ if attributes[:'url']
66
+ self.url = attributes[:'url']
67
+ end
68
+
69
+ if attributes[:'title']
70
+ self.title = attributes[:'title']
71
+ end
72
+
73
+ if attributes[:'body']
74
+ self.body = attributes[:'body']
75
+ end
76
+
77
+ if attributes[:'body_html']
78
+ self.body_html = attributes[:'body_html']
79
+ end
80
+
81
+ if attributes[:'last_update']
82
+ self.last_update = attributes[:'last_update']
83
+ end
84
+
85
+ if attributes[:'submitter']
86
+ self.submitter = attributes[:'submitter']
87
+ end
88
+
89
+ end
90
+
91
+ # Check equality by comparing each attribute.
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ id == o.id &&
96
+ url == o.url &&
97
+ title == o.title &&
98
+ body == o.body &&
99
+ body_html == o.body_html &&
100
+ last_update == o.last_update &&
101
+ submitter == o.submitter
102
+ end
103
+
104
+ # @see the `==` method
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculate hash code according to all attributes.
110
+ def hash
111
+ [id, url, title, body, body_html, last_update, submitter].hash
112
+ end
113
+
114
+ # build the object from hash
115
+ def build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ self.class.swagger_types.each_pair do |key, type|
118
+ if type =~ /^Array<(.*)>/i
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ else
122
+ #TODO show warning in debug mode
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ 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
129
+ end
130
+
131
+ self
132
+ end
133
+
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ _model = OSDNClient.const_get(type).new
165
+ _model.build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_body (backward compatibility))
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # return the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Method to output non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map{ |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end
@@ -0,0 +1,198 @@
1
+ require 'date'
2
+
3
+ module OSDNClient
4
+ class Package
5
+ attr_accessor :id
6
+
7
+ attr_accessor :name
8
+
9
+ attr_accessor :url
10
+
11
+ attr_accessor :visibility
12
+
13
+ attr_accessor :group_id
14
+
15
+ attr_accessor :releases
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+
21
+ :'id' => :'id',
22
+
23
+ :'name' => :'name',
24
+
25
+ :'url' => :'url',
26
+
27
+ :'visibility' => :'visibility',
28
+
29
+ :'group_id' => :'group_id',
30
+
31
+ :'releases' => :'releases'
32
+
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'id' => :'Integer',
40
+ :'name' => :'String',
41
+ :'url' => :'String',
42
+ :'visibility' => :'String',
43
+ :'group_id' => :'Integer',
44
+ :'releases' => :'Array<Release>'
45
+
46
+ }
47
+ end
48
+
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
54
+
55
+
56
+ if attributes[:'id']
57
+ self.id = attributes[:'id']
58
+ end
59
+
60
+ if attributes[:'name']
61
+ self.name = attributes[:'name']
62
+ end
63
+
64
+ if attributes[:'url']
65
+ self.url = attributes[:'url']
66
+ end
67
+
68
+ if attributes[:'visibility']
69
+ self.visibility = attributes[:'visibility']
70
+ end
71
+
72
+ if attributes[:'group_id']
73
+ self.group_id = attributes[:'group_id']
74
+ end
75
+
76
+ if attributes[:'releases']
77
+ if (value = attributes[:'releases']).is_a?(Array)
78
+ self.releases = value
79
+ end
80
+ end
81
+
82
+ end
83
+
84
+ # Check equality by comparing each attribute.
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ id == o.id &&
89
+ name == o.name &&
90
+ url == o.url &&
91
+ visibility == o.visibility &&
92
+ group_id == o.group_id &&
93
+ releases == o.releases
94
+ end
95
+
96
+ # @see the `==` method
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculate hash code according to all attributes.
102
+ def hash
103
+ [id, name, url, visibility, group_id, releases].hash
104
+ end
105
+
106
+ # build the object from hash
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /^Array<(.*)>/i
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
113
+ else
114
+ #TODO show warning in debug mode
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ else
119
+ # data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ _model = OSDNClient.const_get(type).new
157
+ _model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_body (backward compatibility))
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ # return the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Method to output non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
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
+ end
@@ -0,0 +1,176 @@
1
+ require 'date'
2
+
3
+ module OSDNClient
4
+ class Pong
5
+ attr_accessor :time
6
+
7
+ attr_accessor :loggedin
8
+
9
+ attr_accessor :login_id
10
+
11
+ attr_accessor :login_name
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+
17
+ :'time' => :'time',
18
+
19
+ :'loggedin' => :'loggedin',
20
+
21
+ :'login_id' => :'login_id',
22
+
23
+ :'login_name' => :'login_name'
24
+
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'time' => :'DateTime',
32
+ :'loggedin' => :'BOOLEAN',
33
+ :'login_id' => :'Integer',
34
+ :'login_name' => :'String'
35
+
36
+ }
37
+ end
38
+
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
44
+
45
+
46
+ if attributes[:'time']
47
+ self.time = attributes[:'time']
48
+ end
49
+
50
+ if attributes[:'loggedin']
51
+ self.loggedin = attributes[:'loggedin']
52
+ end
53
+
54
+ if attributes[:'login_id']
55
+ self.login_id = attributes[:'login_id']
56
+ end
57
+
58
+ if attributes[:'login_name']
59
+ self.login_name = attributes[:'login_name']
60
+ end
61
+
62
+ end
63
+
64
+ # Check equality by comparing each attribute.
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ time == o.time &&
69
+ loggedin == o.loggedin &&
70
+ login_id == o.login_id &&
71
+ login_name == o.login_name
72
+ end
73
+
74
+ # @see the `==` method
75
+ def eql?(o)
76
+ self == o
77
+ end
78
+
79
+ # Calculate hash code according to all attributes.
80
+ def hash
81
+ [time, loggedin, login_id, login_name].hash
82
+ end
83
+
84
+ # build the object from hash
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /^Array<(.*)>/i
89
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
90
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
91
+ else
92
+ #TODO show warning in debug mode
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ else
97
+ # data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+ end
100
+
101
+ self
102
+ end
103
+
104
+ def _deserialize(type, value)
105
+ case type.to_sym
106
+ when :DateTime
107
+ DateTime.parse(value)
108
+ when :Date
109
+ Date.parse(value)
110
+ when :String
111
+ value.to_s
112
+ when :Integer
113
+ value.to_i
114
+ when :Float
115
+ value.to_f
116
+ when :BOOLEAN
117
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
118
+ true
119
+ else
120
+ false
121
+ end
122
+ when /\AArray<(?<inner_type>.+)>\z/
123
+ inner_type = Regexp.last_match[:inner_type]
124
+ value.map { |v| _deserialize(inner_type, v) }
125
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
126
+ k_type = Regexp.last_match[:k_type]
127
+ v_type = Regexp.last_match[:v_type]
128
+ {}.tap do |hash|
129
+ value.each do |k, v|
130
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
131
+ end
132
+ end
133
+ else # model
134
+ _model = OSDNClient.const_get(type).new
135
+ _model.build_from_hash(value)
136
+ end
137
+ end
138
+
139
+ def to_s
140
+ to_hash.to_s
141
+ end
142
+
143
+ # to_body is an alias to to_body (backward compatibility))
144
+ def to_body
145
+ to_hash
146
+ end
147
+
148
+ # return the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ next if value.nil?
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ # Method to output non-array value in the form of hash
160
+ # For object, use to_hash. Otherwise, just return the value
161
+ def _to_hash(value)
162
+ if value.is_a?(Array)
163
+ value.compact.map{ |v| _to_hash(v) }
164
+ elsif value.is_a?(Hash)
165
+ {}.tap do |hash|
166
+ value.each { |k, v| hash[k] = _to_hash(v) }
167
+ end
168
+ elsif value.respond_to? :to_hash
169
+ value.to_hash
170
+ else
171
+ value
172
+ end
173
+ end
174
+
175
+ end
176
+ end