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