phrase 2.13.0 → 2.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +11 -3
- data/docs/Comment.md +5 -1
- data/docs/CommentReactionsApi.md +3 -1
- data/docs/CommentRepliesApi.md +433 -0
- data/docs/CommentsApi.md +17 -5
- data/docs/CommentsListParameters.md +23 -0
- data/docs/RepliesListParameters.md +21 -0
- data/lib/phrase/api/comment_reactions_api.rb +3 -0
- data/lib/phrase/api/comment_replies_api.rb +537 -0
- data/lib/phrase/api/comments_api.rb +27 -4
- data/lib/phrase/models/comment.rb +24 -4
- data/lib/phrase/models/comments_list_parameters.rb +229 -0
- data/lib/phrase/models/replies_list_parameters.rb +217 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +3 -0
- data/spec/api/comment_reactions_api_spec.rb +1 -0
- data/spec/api/comment_replies_api_spec.rb +129 -0
- data/spec/api/comments_api_spec.rb +6 -0
- data/spec/models/comment_spec.rb +12 -0
- data/spec/models/comments_list_parameters_spec.rb +47 -0
- data/spec/models/replies_list_parameters_spec.rb +41 -0
- metadata +14 -2
@@ -6,6 +6,8 @@ module Phrase
|
|
6
6
|
|
7
7
|
attr_accessor :message
|
8
8
|
|
9
|
+
attr_accessor :has_replies
|
10
|
+
|
9
11
|
attr_accessor :user
|
10
12
|
|
11
13
|
attr_accessor :created_at
|
@@ -14,15 +16,19 @@ module Phrase
|
|
14
16
|
|
15
17
|
attr_accessor :mentioned_users
|
16
18
|
|
19
|
+
attr_accessor :locales
|
20
|
+
|
17
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
18
22
|
def self.attribute_map
|
19
23
|
{
|
20
24
|
:'id' => :'id',
|
21
25
|
:'message' => :'message',
|
26
|
+
:'has_replies' => :'has_replies',
|
22
27
|
:'user' => :'user',
|
23
28
|
:'created_at' => :'created_at',
|
24
29
|
:'updated_at' => :'updated_at',
|
25
|
-
:'mentioned_users' => :'mentioned_users'
|
30
|
+
:'mentioned_users' => :'mentioned_users',
|
31
|
+
:'locales' => :'locales'
|
26
32
|
}
|
27
33
|
end
|
28
34
|
|
@@ -31,10 +37,12 @@ module Phrase
|
|
31
37
|
{
|
32
38
|
:'id' => :'String',
|
33
39
|
:'message' => :'String',
|
40
|
+
:'has_replies' => :'Boolean',
|
34
41
|
:'user' => :'UserPreview',
|
35
42
|
:'created_at' => :'DateTime',
|
36
43
|
:'updated_at' => :'DateTime',
|
37
|
-
:'mentioned_users' => :'Array<UserPreview>'
|
44
|
+
:'mentioned_users' => :'Array<UserPreview>',
|
45
|
+
:'locales' => :'Array<LocalePreview>'
|
38
46
|
}
|
39
47
|
end
|
40
48
|
|
@@ -67,6 +75,10 @@ module Phrase
|
|
67
75
|
self.message = attributes[:'message']
|
68
76
|
end
|
69
77
|
|
78
|
+
if attributes.key?(:'has_replies')
|
79
|
+
self.has_replies = attributes[:'has_replies']
|
80
|
+
end
|
81
|
+
|
70
82
|
if attributes.key?(:'user')
|
71
83
|
self.user = attributes[:'user']
|
72
84
|
end
|
@@ -84,6 +96,12 @@ module Phrase
|
|
84
96
|
self.mentioned_users = value
|
85
97
|
end
|
86
98
|
end
|
99
|
+
|
100
|
+
if attributes.key?(:'locales')
|
101
|
+
if (value = attributes[:'locales']).is_a?(Array)
|
102
|
+
self.locales = value
|
103
|
+
end
|
104
|
+
end
|
87
105
|
end
|
88
106
|
|
89
107
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -106,10 +124,12 @@ module Phrase
|
|
106
124
|
self.class == o.class &&
|
107
125
|
id == o.id &&
|
108
126
|
message == o.message &&
|
127
|
+
has_replies == o.has_replies &&
|
109
128
|
user == o.user &&
|
110
129
|
created_at == o.created_at &&
|
111
130
|
updated_at == o.updated_at &&
|
112
|
-
mentioned_users == o.mentioned_users
|
131
|
+
mentioned_users == o.mentioned_users &&
|
132
|
+
locales == o.locales
|
113
133
|
end
|
114
134
|
|
115
135
|
# @see the `==` method
|
@@ -121,7 +141,7 @@ module Phrase
|
|
121
141
|
# Calculates hash code according to all attributes.
|
122
142
|
# @return [Integer] Hash code
|
123
143
|
def hash
|
124
|
-
[id, message, user, created_at, updated_at, mentioned_users].hash
|
144
|
+
[id, message, has_replies, user, created_at, updated_at, mentioned_users, locales].hash
|
125
145
|
end
|
126
146
|
|
127
147
|
# Builds the object from hash
|
@@ -0,0 +1,229 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class CommentsListParameters
|
5
|
+
# Specify the branch to use
|
6
|
+
attr_accessor :branch
|
7
|
+
|
8
|
+
# Search query for comment messages
|
9
|
+
attr_accessor :query
|
10
|
+
|
11
|
+
# Search comments by their assigned locales
|
12
|
+
attr_accessor :locale_ids
|
13
|
+
|
14
|
+
# Specify filters to find comments by
|
15
|
+
attr_accessor :filters
|
16
|
+
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
18
|
+
def self.attribute_map
|
19
|
+
{
|
20
|
+
:'branch' => :'branch',
|
21
|
+
:'query' => :'query',
|
22
|
+
:'locale_ids' => :'locale_ids',
|
23
|
+
:'filters' => :'filters'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.openapi_types
|
29
|
+
{
|
30
|
+
:'branch' => :'String',
|
31
|
+
:'query' => :'String',
|
32
|
+
:'locale_ids' => :'Array<String>',
|
33
|
+
:'filters' => :'Array<String>'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
# Initializes the object
|
44
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
45
|
+
def initialize(attributes = {})
|
46
|
+
if (!attributes.is_a?(Hash))
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::CommentsListParameters` initialize method"
|
48
|
+
end
|
49
|
+
|
50
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::CommentsListParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
h[k.to_sym] = v
|
56
|
+
}
|
57
|
+
|
58
|
+
if attributes.key?(:'branch')
|
59
|
+
self.branch = attributes[:'branch']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.key?(:'query')
|
63
|
+
self.query = attributes[:'query']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'locale_ids')
|
67
|
+
if (value = attributes[:'locale_ids']).is_a?(Array)
|
68
|
+
self.locale_ids = value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'filters')
|
73
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
74
|
+
self.filters = value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properties with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
branch == o.branch &&
|
98
|
+
query == o.query &&
|
99
|
+
locale_ids == o.locale_ids &&
|
100
|
+
filters == o.filters
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Integer] Hash code
|
111
|
+
def hash
|
112
|
+
[branch, query, locale_ids, filters].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def self.build_from_hash(attributes)
|
119
|
+
new.build_from_hash(attributes)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
self.class.openapi_types.each_pair do |key, type|
|
128
|
+
if type =~ /\AArray<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
133
|
+
end
|
134
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
135
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
136
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
137
|
+
end
|
138
|
+
|
139
|
+
self
|
140
|
+
end
|
141
|
+
|
142
|
+
# Deserializes the data based on type
|
143
|
+
# @param string type Data type
|
144
|
+
# @param string value Value to be deserialized
|
145
|
+
# @return [Object] Deserialized data
|
146
|
+
def _deserialize(type, value)
|
147
|
+
case type.to_sym
|
148
|
+
when :DateTime
|
149
|
+
DateTime.parse(value)
|
150
|
+
when :Date
|
151
|
+
Date.parse(value)
|
152
|
+
when :String
|
153
|
+
value.to_s
|
154
|
+
when :Integer
|
155
|
+
value.to_i
|
156
|
+
when :Float
|
157
|
+
value.to_f
|
158
|
+
when :Boolean
|
159
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
160
|
+
true
|
161
|
+
else
|
162
|
+
false
|
163
|
+
end
|
164
|
+
when :Object
|
165
|
+
# generic object (usually a Hash), return directly
|
166
|
+
value
|
167
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
168
|
+
inner_type = Regexp.last_match[:inner_type]
|
169
|
+
value.map { |v| _deserialize(inner_type, v) }
|
170
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
171
|
+
k_type = Regexp.last_match[:k_type]
|
172
|
+
v_type = Regexp.last_match[:v_type]
|
173
|
+
{}.tap do |hash|
|
174
|
+
value.each do |k, v|
|
175
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
else # model
|
179
|
+
Phrase.const_get(type).build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
@@ -0,0 +1,217 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class RepliesListParameters
|
5
|
+
# Specify the branch to use
|
6
|
+
attr_accessor :branch
|
7
|
+
|
8
|
+
# Search query for comment messages
|
9
|
+
attr_accessor :query
|
10
|
+
|
11
|
+
# Specify filters to find comments by
|
12
|
+
attr_accessor :filters
|
13
|
+
|
14
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
15
|
+
def self.attribute_map
|
16
|
+
{
|
17
|
+
:'branch' => :'branch',
|
18
|
+
:'query' => :'query',
|
19
|
+
:'filters' => :'filters'
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Attribute type mapping.
|
24
|
+
def self.openapi_types
|
25
|
+
{
|
26
|
+
:'branch' => :'String',
|
27
|
+
:'query' => :'String',
|
28
|
+
:'filters' => :'Array<String>'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of attributes with nullable: true
|
33
|
+
def self.openapi_nullable
|
34
|
+
Set.new([
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
if (!attributes.is_a?(Hash))
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::RepliesListParameters` initialize method"
|
43
|
+
end
|
44
|
+
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::RepliesListParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
|
+
end
|
50
|
+
h[k.to_sym] = v
|
51
|
+
}
|
52
|
+
|
53
|
+
if attributes.key?(:'branch')
|
54
|
+
self.branch = attributes[:'branch']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.key?(:'query')
|
58
|
+
self.query = attributes[:'query']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.key?(:'filters')
|
62
|
+
if (value = attributes[:'filters']).is_a?(Array)
|
63
|
+
self.filters = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
69
|
+
# @return Array for valid properties with the reasons
|
70
|
+
def list_invalid_properties
|
71
|
+
invalid_properties = Array.new
|
72
|
+
invalid_properties
|
73
|
+
end
|
74
|
+
|
75
|
+
# Check to see if the all the properties in the model are valid
|
76
|
+
# @return true if the model is valid
|
77
|
+
def valid?
|
78
|
+
true
|
79
|
+
end
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] Object to be compared
|
83
|
+
def ==(o)
|
84
|
+
return true if self.equal?(o)
|
85
|
+
self.class == o.class &&
|
86
|
+
branch == o.branch &&
|
87
|
+
query == o.query &&
|
88
|
+
filters == o.filters
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Integer] Hash code
|
99
|
+
def hash
|
100
|
+
[branch, query, filters].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def self.build_from_hash(attributes)
|
107
|
+
new.build_from_hash(attributes)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Builds the object from hash
|
111
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
112
|
+
# @return [Object] Returns the model itself
|
113
|
+
def build_from_hash(attributes)
|
114
|
+
return nil unless attributes.is_a?(Hash)
|
115
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if type =~ /\AArray<(.*)>/i
|
117
|
+
# check to ensure the input is an array given that the attribute
|
118
|
+
# is documented as an array but the input is not
|
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
|
+
end
|
122
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
123
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
124
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
125
|
+
end
|
126
|
+
|
127
|
+
self
|
128
|
+
end
|
129
|
+
|
130
|
+
# Deserializes the data based on type
|
131
|
+
# @param string type Data type
|
132
|
+
# @param string value Value to be deserialized
|
133
|
+
# @return [Object] Deserialized data
|
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 =~ /\A(true|t|yes|y|1)\z/i
|
148
|
+
true
|
149
|
+
else
|
150
|
+
false
|
151
|
+
end
|
152
|
+
when :Object
|
153
|
+
# generic object (usually a Hash), return directly
|
154
|
+
value
|
155
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
+
inner_type = Regexp.last_match[:inner_type]
|
157
|
+
value.map { |v| _deserialize(inner_type, v) }
|
158
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
+
k_type = Regexp.last_match[:k_type]
|
160
|
+
v_type = Regexp.last_match[:v_type]
|
161
|
+
{}.tap do |hash|
|
162
|
+
value.each do |k, v|
|
163
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
+
end
|
165
|
+
end
|
166
|
+
else # model
|
167
|
+
Phrase.const_get(type).build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
@@ -36,6 +36,7 @@ require 'phrase/models/comment_create_parameters'
|
|
36
36
|
require 'phrase/models/comment_mark_read_parameters'
|
37
37
|
require 'phrase/models/comment_reaction'
|
38
38
|
require 'phrase/models/comment_update_parameters'
|
39
|
+
require 'phrase/models/comments_list_parameters'
|
39
40
|
require 'phrase/models/current_user'
|
40
41
|
require 'phrase/models/distribution'
|
41
42
|
require 'phrase/models/distribution_create_parameters'
|
@@ -144,6 +145,7 @@ require 'phrase/models/release'
|
|
144
145
|
require 'phrase/models/release_create_parameters'
|
145
146
|
require 'phrase/models/release_preview'
|
146
147
|
require 'phrase/models/release_update_parameters'
|
148
|
+
require 'phrase/models/replies_list_parameters'
|
147
149
|
require 'phrase/models/screenshot'
|
148
150
|
require 'phrase/models/screenshot_create_parameters'
|
149
151
|
require 'phrase/models/screenshot_marker'
|
@@ -220,6 +222,7 @@ require 'phrase/api/bitbucket_sync_api'
|
|
220
222
|
require 'phrase/api/blacklisted_keys_api'
|
221
223
|
require 'phrase/api/branches_api'
|
222
224
|
require 'phrase/api/comment_reactions_api'
|
225
|
+
require 'phrase/api/comment_replies_api'
|
223
226
|
require 'phrase/api/comments_api'
|
224
227
|
require 'phrase/api/distributions_api'
|
225
228
|
require 'phrase/api/documents_api'
|
@@ -29,6 +29,7 @@ describe 'CommentReactionsApi' do
|
|
29
29
|
# @param [Hash] opts the optional parameters
|
30
30
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
31
31
|
# @option opts [String] :branch specify the branch to use
|
32
|
+
# @option opts [String] :emoji specify the emoji for the reaction
|
32
33
|
# @return [CommentReaction]
|
33
34
|
describe 'reaction_create test' do
|
34
35
|
it 'should work' do
|
@@ -0,0 +1,129 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
# Unit tests for Phrase::CommentRepliesApi
|
5
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
6
|
+
# Please update as you see appropriate
|
7
|
+
describe 'CommentRepliesApi' do
|
8
|
+
before do
|
9
|
+
# run before each test
|
10
|
+
@api_instance = Phrase::CommentRepliesApi.new
|
11
|
+
end
|
12
|
+
|
13
|
+
after do
|
14
|
+
# run after each test
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'test an instance of CommentRepliesApi' do
|
18
|
+
it 'should create an instance of CommentRepliesApi' do
|
19
|
+
expect(@api_instance).to be_instance_of(Phrase::CommentRepliesApi)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# unit tests for replies_list
|
24
|
+
# List replies
|
25
|
+
# List all replies for a comment.
|
26
|
+
# @param project_id Project ID
|
27
|
+
# @param key_id Translation Key ID
|
28
|
+
# @param comment_id Comment ID
|
29
|
+
# @param replies_list_parameters
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
32
|
+
# @option opts [Integer] :page Page number
|
33
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
34
|
+
# @option opts [String] :branch specify the branch to use
|
35
|
+
# @option opts [String] :query Search query for comment messages
|
36
|
+
# @option opts [Array<String>] :filters Specify the filter for the comments
|
37
|
+
# @return [Array<Comment>]
|
38
|
+
describe 'replies_list test' do
|
39
|
+
it 'should work' do
|
40
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# unit tests for reply_create
|
45
|
+
# Create a reply
|
46
|
+
# Create a new reply for a comment.
|
47
|
+
# @param project_id Project ID
|
48
|
+
# @param key_id Translation Key ID
|
49
|
+
# @param comment_id Comment ID
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
52
|
+
# @option opts [String] :branch specify the branch to use
|
53
|
+
# @option opts [String] :message specify the message for the comment
|
54
|
+
# @return [Comment]
|
55
|
+
describe 'reply_create test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for reply_delete
|
62
|
+
# Delete a reply
|
63
|
+
# Delete an existing reply.
|
64
|
+
# @param project_id Project ID
|
65
|
+
# @param key_id Translation Key ID
|
66
|
+
# @param comment_id Comment ID
|
67
|
+
# @param id ID
|
68
|
+
# @param [Hash] opts the optional parameters
|
69
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
70
|
+
# @option opts [String] :branch specify the branch to use
|
71
|
+
# @return [nil]
|
72
|
+
describe 'reply_delete test' do
|
73
|
+
it 'should work' do
|
74
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# unit tests for reply_mark_as_read
|
79
|
+
# Mark a reply as read
|
80
|
+
# Mark a reply as read.
|
81
|
+
# @param project_id Project ID
|
82
|
+
# @param key_id Translation Key ID
|
83
|
+
# @param comment_id Comment ID
|
84
|
+
# @param id ID
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
87
|
+
# @option opts [String] :branch specify the branch to use
|
88
|
+
# @return [nil]
|
89
|
+
describe 'reply_mark_as_read test' do
|
90
|
+
it 'should work' do
|
91
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# unit tests for reply_mark_as_unread
|
96
|
+
# Mark a reply as unread
|
97
|
+
# Mark a reply as unread.
|
98
|
+
# @param project_id Project ID
|
99
|
+
# @param key_id Translation Key ID
|
100
|
+
# @param comment_id Comment ID
|
101
|
+
# @param id ID
|
102
|
+
# @param [Hash] opts the optional parameters
|
103
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
104
|
+
# @option opts [String] :branch specify the branch to use
|
105
|
+
# @return [nil]
|
106
|
+
describe 'reply_mark_as_unread test' do
|
107
|
+
it 'should work' do
|
108
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# unit tests for reply_show
|
113
|
+
# Get a single reply
|
114
|
+
# Get details on a single reply.
|
115
|
+
# @param project_id Project ID
|
116
|
+
# @param key_id Translation Key ID
|
117
|
+
# @param comment_id Comment ID
|
118
|
+
# @param id ID
|
119
|
+
# @param [Hash] opts the optional parameters
|
120
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
121
|
+
# @option opts [String] :branch specify the branch to use
|
122
|
+
# @return [Comment]
|
123
|
+
describe 'reply_show test' do
|
124
|
+
it 'should work' do
|
125
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|