phrase 3.2.1 → 3.3.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 +8 -0
- data/README.md +10 -5
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LocaleDownload.md +29 -0
- data/docs/LocaleDownloadCreateParameters.md +43 -0
- data/docs/LocaleDownloadParams.md +29 -0
- data/docs/LocaleDownloadResult.md +17 -0
- data/docs/LocaleDownloadsApi.md +148 -0
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/RepoSyncEvent.md +3 -1
- data/docs/RepoSyncsApi.md +70 -4
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/lib/phrase/api/locale_downloads_api.rb +180 -0
- data/lib/phrase/api/repo_syncs_api.rb +84 -6
- data/lib/phrase/models/locale_download.rb +285 -0
- data/lib/phrase/models/locale_download_create_parameters.rb +332 -0
- data/lib/phrase/models/{repo_sync_import.rb → locale_download_params.rb} +65 -10
- data/lib/phrase/models/{repo_sync_export.rb → locale_download_result.rb} +11 -10
- data/lib/phrase/models/repo_sync_event.rb +10 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -2
- data/spec/api/locale_downloads_api_spec.rb +57 -0
- data/spec/api/repo_syncs_api_spec.rb +17 -2
- data/spec/models/locale_download_create_parameters_spec.rb +107 -0
- data/spec/models/locale_download_params_spec.rb +65 -0
- data/spec/models/{repo_sync_export_spec.rb → locale_download_result_spec.rb} +7 -7
- data/spec/models/locale_download_spec.rb +69 -0
- data/spec/models/repo_sync_event_spec.rb +6 -0
- metadata +258 -246
- data/docs/RepoSyncExport.md +0 -17
- data/docs/RepoSyncImport.md +0 -17
- data/spec/models/repo_sync_import_spec.rb +0 -29
@@ -0,0 +1,332 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class LocaleDownloadCreateParameters
|
5
|
+
# File format name. See the <a href=\"https://support.phrase.com/hc/en-us/sections/6111343326364\">format guide</a> for all supported file formats.
|
6
|
+
attr_accessor :file_format
|
7
|
+
|
8
|
+
# specify the branch to use
|
9
|
+
attr_accessor :branch
|
10
|
+
|
11
|
+
# Limit results to keys tagged with a list of comma separated tag names.
|
12
|
+
attr_accessor :tags
|
13
|
+
|
14
|
+
# Indicates whether keys without translations should be included in the output as well.
|
15
|
+
attr_accessor :include_empty_translations
|
16
|
+
|
17
|
+
# Indicates whether zero forms should be included when empty in pluralized keys.
|
18
|
+
attr_accessor :exclude_empty_zero_forms
|
19
|
+
|
20
|
+
# Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys.
|
21
|
+
attr_accessor :include_translated_keys
|
22
|
+
|
23
|
+
# Indicates whether [NOTRANSLATE] tags should be kept.
|
24
|
+
attr_accessor :keep_notranslate_tags
|
25
|
+
|
26
|
+
# Additional formatting and render options. See the <a href=\"https://support.phrase.com/hc/en-us/sections/6111343326364\">format guide</a> for a list of options available for each format. Specify format options like this: <code>...&format_options[foo]=bar</code>
|
27
|
+
attr_accessor :format_options
|
28
|
+
|
29
|
+
# Enforces a specific encoding on the file contents. Valid options are \"UTF-8\", \"UTF-16\" and \"ISO-8859-1\".
|
30
|
+
attr_accessor :encoding
|
31
|
+
|
32
|
+
# if set to false unverified translations are excluded
|
33
|
+
attr_accessor :include_unverified_translations
|
34
|
+
|
35
|
+
# If set to true the last reviewed version of a translation is used. This is only available if the review workflow is enabled for the project.
|
36
|
+
attr_accessor :use_last_reviewed_version
|
37
|
+
|
38
|
+
# If a key has no translation in the locale being downloaded the translation in the fallback locale will be used. Provide the ID of the locale that should be used as the fallback. Requires include_empty_translations to be set to <code>true</code>.
|
39
|
+
attr_accessor :fallback_locale_id
|
40
|
+
|
41
|
+
# Provides the source language of a corresponding job as the source language of the generated locale file. This parameter will be ignored unless used in combination with a <code>tag</code> parameter indicating a specific job.
|
42
|
+
attr_accessor :source_locale_id
|
43
|
+
|
44
|
+
# Custom metadata filters. Provide the name of the metadata field and the value to filter by. Only keys with matching metadata will be included in the download.
|
45
|
+
attr_accessor :custom_metadata_filters
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'file_format' => :'file_format',
|
51
|
+
:'branch' => :'branch',
|
52
|
+
:'tags' => :'tags',
|
53
|
+
:'include_empty_translations' => :'include_empty_translations',
|
54
|
+
:'exclude_empty_zero_forms' => :'exclude_empty_zero_forms',
|
55
|
+
:'include_translated_keys' => :'include_translated_keys',
|
56
|
+
:'keep_notranslate_tags' => :'keep_notranslate_tags',
|
57
|
+
:'format_options' => :'format_options',
|
58
|
+
:'encoding' => :'encoding',
|
59
|
+
:'include_unverified_translations' => :'include_unverified_translations',
|
60
|
+
:'use_last_reviewed_version' => :'use_last_reviewed_version',
|
61
|
+
:'fallback_locale_id' => :'fallback_locale_id',
|
62
|
+
:'source_locale_id' => :'source_locale_id',
|
63
|
+
:'custom_metadata_filters' => :'custom_metadata_filters'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Attribute type mapping.
|
68
|
+
def self.openapi_types
|
69
|
+
{
|
70
|
+
:'file_format' => :'String',
|
71
|
+
:'branch' => :'String',
|
72
|
+
:'tags' => :'String',
|
73
|
+
:'include_empty_translations' => :'Boolean',
|
74
|
+
:'exclude_empty_zero_forms' => :'Boolean',
|
75
|
+
:'include_translated_keys' => :'Boolean',
|
76
|
+
:'keep_notranslate_tags' => :'Boolean',
|
77
|
+
:'format_options' => :'Object',
|
78
|
+
:'encoding' => :'String',
|
79
|
+
:'include_unverified_translations' => :'Boolean',
|
80
|
+
:'use_last_reviewed_version' => :'Boolean',
|
81
|
+
:'fallback_locale_id' => :'String',
|
82
|
+
:'source_locale_id' => :'String',
|
83
|
+
:'custom_metadata_filters' => :'Object'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# List of attributes with nullable: true
|
88
|
+
def self.openapi_nullable
|
89
|
+
Set.new([
|
90
|
+
])
|
91
|
+
end
|
92
|
+
|
93
|
+
# Initializes the object
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
def initialize(attributes = {})
|
96
|
+
if (!attributes.is_a?(Hash))
|
97
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::LocaleDownloadCreateParameters` initialize method"
|
98
|
+
end
|
99
|
+
|
100
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
101
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
102
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
103
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::LocaleDownloadCreateParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
104
|
+
end
|
105
|
+
h[k.to_sym] = v
|
106
|
+
}
|
107
|
+
|
108
|
+
if attributes.key?(:'file_format')
|
109
|
+
self.file_format = attributes[:'file_format']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'branch')
|
113
|
+
self.branch = attributes[:'branch']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'tags')
|
117
|
+
self.tags = attributes[:'tags']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'include_empty_translations')
|
121
|
+
self.include_empty_translations = attributes[:'include_empty_translations']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'exclude_empty_zero_forms')
|
125
|
+
self.exclude_empty_zero_forms = attributes[:'exclude_empty_zero_forms']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'include_translated_keys')
|
129
|
+
self.include_translated_keys = attributes[:'include_translated_keys']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'keep_notranslate_tags')
|
133
|
+
self.keep_notranslate_tags = attributes[:'keep_notranslate_tags']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'format_options')
|
137
|
+
self.format_options = attributes[:'format_options']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'encoding')
|
141
|
+
self.encoding = attributes[:'encoding']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'include_unverified_translations')
|
145
|
+
self.include_unverified_translations = attributes[:'include_unverified_translations']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'use_last_reviewed_version')
|
149
|
+
self.use_last_reviewed_version = attributes[:'use_last_reviewed_version']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'fallback_locale_id')
|
153
|
+
self.fallback_locale_id = attributes[:'fallback_locale_id']
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'source_locale_id')
|
157
|
+
self.source_locale_id = attributes[:'source_locale_id']
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'custom_metadata_filters')
|
161
|
+
self.custom_metadata_filters = attributes[:'custom_metadata_filters']
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
166
|
+
# @return Array for valid properties with the reasons
|
167
|
+
def list_invalid_properties
|
168
|
+
invalid_properties = Array.new
|
169
|
+
if @file_format.nil?
|
170
|
+
invalid_properties.push('invalid value for "file_format", file_format cannot be nil.')
|
171
|
+
end
|
172
|
+
|
173
|
+
invalid_properties
|
174
|
+
end
|
175
|
+
|
176
|
+
# Check to see if the all the properties in the model are valid
|
177
|
+
# @return true if the model is valid
|
178
|
+
def valid?
|
179
|
+
return false if @file_format.nil?
|
180
|
+
true
|
181
|
+
end
|
182
|
+
|
183
|
+
# Checks equality by comparing each attribute.
|
184
|
+
# @param [Object] Object to be compared
|
185
|
+
def ==(o)
|
186
|
+
return true if self.equal?(o)
|
187
|
+
self.class == o.class &&
|
188
|
+
file_format == o.file_format &&
|
189
|
+
branch == o.branch &&
|
190
|
+
tags == o.tags &&
|
191
|
+
include_empty_translations == o.include_empty_translations &&
|
192
|
+
exclude_empty_zero_forms == o.exclude_empty_zero_forms &&
|
193
|
+
include_translated_keys == o.include_translated_keys &&
|
194
|
+
keep_notranslate_tags == o.keep_notranslate_tags &&
|
195
|
+
format_options == o.format_options &&
|
196
|
+
encoding == o.encoding &&
|
197
|
+
include_unverified_translations == o.include_unverified_translations &&
|
198
|
+
use_last_reviewed_version == o.use_last_reviewed_version &&
|
199
|
+
fallback_locale_id == o.fallback_locale_id &&
|
200
|
+
source_locale_id == o.source_locale_id &&
|
201
|
+
custom_metadata_filters == o.custom_metadata_filters
|
202
|
+
end
|
203
|
+
|
204
|
+
# @see the `==` method
|
205
|
+
# @param [Object] Object to be compared
|
206
|
+
def eql?(o)
|
207
|
+
self == o
|
208
|
+
end
|
209
|
+
|
210
|
+
# Calculates hash code according to all attributes.
|
211
|
+
# @return [Integer] Hash code
|
212
|
+
def hash
|
213
|
+
[file_format, branch, tags, include_empty_translations, exclude_empty_zero_forms, include_translated_keys, keep_notranslate_tags, format_options, encoding, include_unverified_translations, use_last_reviewed_version, fallback_locale_id, source_locale_id, custom_metadata_filters].hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Builds the object from hash
|
217
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
218
|
+
# @return [Object] Returns the model itself
|
219
|
+
def self.build_from_hash(attributes)
|
220
|
+
new.build_from_hash(attributes)
|
221
|
+
end
|
222
|
+
|
223
|
+
# Builds the object from hash
|
224
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
225
|
+
# @return [Object] Returns the model itself
|
226
|
+
def build_from_hash(attributes)
|
227
|
+
return nil unless attributes.is_a?(Hash)
|
228
|
+
self.class.openapi_types.each_pair do |key, type|
|
229
|
+
if type =~ /\AArray<(.*)>/i
|
230
|
+
# check to ensure the input is an array given that the attribute
|
231
|
+
# is documented as an array but the input is not
|
232
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
233
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
234
|
+
end
|
235
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
236
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
237
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
238
|
+
end
|
239
|
+
|
240
|
+
self
|
241
|
+
end
|
242
|
+
|
243
|
+
# Deserializes the data based on type
|
244
|
+
# @param string type Data type
|
245
|
+
# @param string value Value to be deserialized
|
246
|
+
# @return [Object] Deserialized data
|
247
|
+
def _deserialize(type, value)
|
248
|
+
case type.to_sym
|
249
|
+
when :DateTime
|
250
|
+
DateTime.parse(value)
|
251
|
+
when :Date
|
252
|
+
Date.parse(value)
|
253
|
+
when :Time
|
254
|
+
Time.parse(value)
|
255
|
+
when :String
|
256
|
+
value.to_s
|
257
|
+
when :Integer
|
258
|
+
value.to_i
|
259
|
+
when :Float
|
260
|
+
value.to_f
|
261
|
+
when :Boolean
|
262
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
263
|
+
true
|
264
|
+
else
|
265
|
+
false
|
266
|
+
end
|
267
|
+
when :Object
|
268
|
+
# generic object (usually a Hash), return directly
|
269
|
+
value
|
270
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
271
|
+
inner_type = Regexp.last_match[:inner_type]
|
272
|
+
value.map { |v| _deserialize(inner_type, v) }
|
273
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
274
|
+
k_type = Regexp.last_match[:k_type]
|
275
|
+
v_type = Regexp.last_match[:v_type]
|
276
|
+
{}.tap do |hash|
|
277
|
+
value.each do |k, v|
|
278
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
279
|
+
end
|
280
|
+
end
|
281
|
+
else # model
|
282
|
+
Phrase.const_get(type).build_from_hash(value)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
# Returns the string representation of the object
|
287
|
+
# @return [String] String presentation of the object
|
288
|
+
def to_s
|
289
|
+
to_hash.to_s
|
290
|
+
end
|
291
|
+
|
292
|
+
# to_body is an alias to to_hash (backward compatibility)
|
293
|
+
# @return [Hash] Returns the object in the form of hash
|
294
|
+
def to_body
|
295
|
+
to_hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the object in the form of hash
|
299
|
+
# @return [Hash] Returns the object in the form of hash
|
300
|
+
def to_hash
|
301
|
+
hash = {}
|
302
|
+
self.class.attribute_map.each_pair do |attr, param|
|
303
|
+
value = self.send(attr)
|
304
|
+
if value.nil?
|
305
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
306
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
307
|
+
end
|
308
|
+
|
309
|
+
hash[param] = _to_hash(value)
|
310
|
+
end
|
311
|
+
hash
|
312
|
+
end
|
313
|
+
|
314
|
+
# Outputs non-array value in the form of hash
|
315
|
+
# For object, use to_hash. Otherwise, just return the value
|
316
|
+
# @param [Object] value Any valid value
|
317
|
+
# @return [Hash] Returns the value in the form of hash
|
318
|
+
def _to_hash(value)
|
319
|
+
if value.is_a?(Array)
|
320
|
+
value.compact.map { |v| _to_hash(v) }
|
321
|
+
elsif value.is_a?(Hash)
|
322
|
+
{}.tap do |hash|
|
323
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
324
|
+
end
|
325
|
+
elsif value.respond_to? :to_hash
|
326
|
+
value.to_hash
|
327
|
+
else
|
328
|
+
value
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|
@@ -1,20 +1,45 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
3
|
module Phrase
|
4
|
-
|
5
|
-
|
4
|
+
# The parameters of the download request.
|
5
|
+
class LocaleDownloadParams
|
6
|
+
attr_accessor :file_format
|
7
|
+
|
8
|
+
attr_accessor :locale_id
|
9
|
+
|
10
|
+
attr_accessor :tags
|
11
|
+
|
12
|
+
attr_accessor :branch
|
13
|
+
|
14
|
+
attr_accessor :include_empty_translations
|
15
|
+
|
16
|
+
attr_accessor :include_translated_keys
|
17
|
+
|
18
|
+
attr_accessor :include_unverified_translations
|
6
19
|
|
7
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
8
21
|
def self.attribute_map
|
9
22
|
{
|
10
|
-
:'
|
23
|
+
:'file_format' => :'file_format',
|
24
|
+
:'locale_id' => :'locale_id',
|
25
|
+
:'tags' => :'tags',
|
26
|
+
:'branch' => :'branch',
|
27
|
+
:'include_empty_translations' => :'include_empty_translations',
|
28
|
+
:'include_translated_keys' => :'include_translated_keys',
|
29
|
+
:'include_unverified_translations' => :'include_unverified_translations'
|
11
30
|
}
|
12
31
|
end
|
13
32
|
|
14
33
|
# Attribute type mapping.
|
15
34
|
def self.openapi_types
|
16
35
|
{
|
17
|
-
:'
|
36
|
+
:'file_format' => :'String',
|
37
|
+
:'locale_id' => :'String',
|
38
|
+
:'tags' => :'String',
|
39
|
+
:'branch' => :'String',
|
40
|
+
:'include_empty_translations' => :'Boolean',
|
41
|
+
:'include_translated_keys' => :'Boolean',
|
42
|
+
:'include_unverified_translations' => :'Boolean'
|
18
43
|
}
|
19
44
|
end
|
20
45
|
|
@@ -28,19 +53,43 @@ module Phrase
|
|
28
53
|
# @param [Hash] attributes Model attributes in the form of hash
|
29
54
|
def initialize(attributes = {})
|
30
55
|
if (!attributes.is_a?(Hash))
|
31
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::LocaleDownloadParams` initialize method"
|
32
57
|
end
|
33
58
|
|
34
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
35
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
36
61
|
if (!self.class.attribute_map.key?(k.to_sym))
|
37
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::LocaleDownloadParams`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
38
63
|
end
|
39
64
|
h[k.to_sym] = v
|
40
65
|
}
|
41
66
|
|
42
|
-
if attributes.key?(:'
|
43
|
-
self.
|
67
|
+
if attributes.key?(:'file_format')
|
68
|
+
self.file_format = attributes[:'file_format']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'locale_id')
|
72
|
+
self.locale_id = attributes[:'locale_id']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'tags')
|
76
|
+
self.tags = attributes[:'tags']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'branch')
|
80
|
+
self.branch = attributes[:'branch']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'include_empty_translations')
|
84
|
+
self.include_empty_translations = attributes[:'include_empty_translations']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'include_translated_keys')
|
88
|
+
self.include_translated_keys = attributes[:'include_translated_keys']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.key?(:'include_unverified_translations')
|
92
|
+
self.include_unverified_translations = attributes[:'include_unverified_translations']
|
44
93
|
end
|
45
94
|
end
|
46
95
|
|
@@ -62,7 +111,13 @@ module Phrase
|
|
62
111
|
def ==(o)
|
63
112
|
return true if self.equal?(o)
|
64
113
|
self.class == o.class &&
|
65
|
-
|
114
|
+
file_format == o.file_format &&
|
115
|
+
locale_id == o.locale_id &&
|
116
|
+
tags == o.tags &&
|
117
|
+
branch == o.branch &&
|
118
|
+
include_empty_translations == o.include_empty_translations &&
|
119
|
+
include_translated_keys == o.include_translated_keys &&
|
120
|
+
include_unverified_translations == o.include_unverified_translations
|
66
121
|
end
|
67
122
|
|
68
123
|
# @see the `==` method
|
@@ -74,7 +129,7 @@ module Phrase
|
|
74
129
|
# Calculates hash code according to all attributes.
|
75
130
|
# @return [Integer] Hash code
|
76
131
|
def hash
|
77
|
-
[
|
132
|
+
[file_format, locale_id, tags, branch, include_empty_translations, include_translated_keys, include_unverified_translations].hash
|
78
133
|
end
|
79
134
|
|
80
135
|
# Builds the object from hash
|
@@ -1,20 +1,21 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
3
|
module Phrase
|
4
|
-
class
|
5
|
-
|
4
|
+
class LocaleDownloadResult
|
5
|
+
# The URL to the download file. This URL is valid for 15 minutes.
|
6
|
+
attr_accessor :url
|
6
7
|
|
7
8
|
# Attribute mapping from ruby-style variable name to JSON key.
|
8
9
|
def self.attribute_map
|
9
10
|
{
|
10
|
-
:'
|
11
|
+
:'url' => :'url'
|
11
12
|
}
|
12
13
|
end
|
13
14
|
|
14
15
|
# Attribute type mapping.
|
15
16
|
def self.openapi_types
|
16
17
|
{
|
17
|
-
:'
|
18
|
+
:'url' => :'String'
|
18
19
|
}
|
19
20
|
end
|
20
21
|
|
@@ -28,19 +29,19 @@ module Phrase
|
|
28
29
|
# @param [Hash] attributes Model attributes in the form of hash
|
29
30
|
def initialize(attributes = {})
|
30
31
|
if (!attributes.is_a?(Hash))
|
31
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::
|
32
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::LocaleDownloadResult` initialize method"
|
32
33
|
end
|
33
34
|
|
34
35
|
# check to see if the attribute exists and convert string to symbol for hash key
|
35
36
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
36
37
|
if (!self.class.attribute_map.key?(k.to_sym))
|
37
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::
|
38
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::LocaleDownloadResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
38
39
|
end
|
39
40
|
h[k.to_sym] = v
|
40
41
|
}
|
41
42
|
|
42
|
-
if attributes.key?(:'
|
43
|
-
self.
|
43
|
+
if attributes.key?(:'url')
|
44
|
+
self.url = attributes[:'url']
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
@@ -62,7 +63,7 @@ module Phrase
|
|
62
63
|
def ==(o)
|
63
64
|
return true if self.equal?(o)
|
64
65
|
self.class == o.class &&
|
65
|
-
|
66
|
+
url == o.url
|
66
67
|
end
|
67
68
|
|
68
69
|
# @see the `==` method
|
@@ -74,7 +75,7 @@ module Phrase
|
|
74
75
|
# Calculates hash code according to all attributes.
|
75
76
|
# @return [Integer] Hash code
|
76
77
|
def hash
|
77
|
-
[
|
78
|
+
[url].hash
|
78
79
|
end
|
79
80
|
|
80
81
|
# Builds the object from hash
|
@@ -2,6 +2,8 @@ require 'date'
|
|
2
2
|
|
3
3
|
module Phrase
|
4
4
|
class RepoSyncEvent
|
5
|
+
attr_accessor :id
|
6
|
+
|
5
7
|
attr_accessor :event_type
|
6
8
|
|
7
9
|
attr_accessor :created_at
|
@@ -42,6 +44,7 @@ module Phrase
|
|
42
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
43
45
|
def self.attribute_map
|
44
46
|
{
|
47
|
+
:'id' => :'id',
|
45
48
|
:'event_type' => :'event_type',
|
46
49
|
:'created_at' => :'created_at',
|
47
50
|
:'status' => :'status',
|
@@ -54,6 +57,7 @@ module Phrase
|
|
54
57
|
# Attribute type mapping.
|
55
58
|
def self.openapi_types
|
56
59
|
{
|
60
|
+
:'id' => :'String',
|
57
61
|
:'event_type' => :'String',
|
58
62
|
:'created_at' => :'DateTime',
|
59
63
|
:'status' => :'String',
|
@@ -84,6 +88,10 @@ module Phrase
|
|
84
88
|
h[k.to_sym] = v
|
85
89
|
}
|
86
90
|
|
91
|
+
if attributes.key?(:'id')
|
92
|
+
self.id = attributes[:'id']
|
93
|
+
end
|
94
|
+
|
87
95
|
if attributes.key?(:'event_type')
|
88
96
|
self.event_type = attributes[:'event_type']
|
89
97
|
end
|
@@ -153,6 +161,7 @@ module Phrase
|
|
153
161
|
def ==(o)
|
154
162
|
return true if self.equal?(o)
|
155
163
|
self.class == o.class &&
|
164
|
+
id == o.id &&
|
156
165
|
event_type == o.event_type &&
|
157
166
|
created_at == o.created_at &&
|
158
167
|
status == o.status &&
|
@@ -170,7 +179,7 @@ module Phrase
|
|
170
179
|
# Calculates hash code according to all attributes.
|
171
180
|
# @return [Integer] Hash code
|
172
181
|
def hash
|
173
|
-
[event_type, created_at, status, pull_request_url, auto_import, errors].hash
|
182
|
+
[id, event_type, created_at, status, pull_request_url, auto_import, errors].hash
|
174
183
|
end
|
175
184
|
|
176
185
|
# Builds the object from hash
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
@@ -117,6 +117,10 @@ require 'phrase/models/keys_untag_parameters'
|
|
117
117
|
require 'phrase/models/locale'
|
118
118
|
require 'phrase/models/locale_create_parameters'
|
119
119
|
require 'phrase/models/locale_details'
|
120
|
+
require 'phrase/models/locale_download'
|
121
|
+
require 'phrase/models/locale_download_create_parameters'
|
122
|
+
require 'phrase/models/locale_download_params'
|
123
|
+
require 'phrase/models/locale_download_result'
|
120
124
|
require 'phrase/models/locale_preview'
|
121
125
|
require 'phrase/models/locale_preview1'
|
122
126
|
require 'phrase/models/locale_report'
|
@@ -165,8 +169,6 @@ require 'phrase/models/replies_list_parameters'
|
|
165
169
|
require 'phrase/models/repo_sync'
|
166
170
|
require 'phrase/models/repo_sync_event'
|
167
171
|
require 'phrase/models/repo_sync_event_errors_inner'
|
168
|
-
require 'phrase/models/repo_sync_export'
|
169
|
-
require 'phrase/models/repo_sync_import'
|
170
172
|
require 'phrase/models/screenshot'
|
171
173
|
require 'phrase/models/screenshot_marker'
|
172
174
|
require 'phrase/models/screenshot_marker_create_parameters'
|
@@ -259,6 +261,7 @@ require 'phrase/api/jobs_api'
|
|
259
261
|
require 'phrase/api/keys_api'
|
260
262
|
require 'phrase/api/keys_figma_attachments_api'
|
261
263
|
require 'phrase/api/linked_keys_api'
|
264
|
+
require 'phrase/api/locale_downloads_api'
|
262
265
|
require 'phrase/api/locales_api'
|
263
266
|
require 'phrase/api/members_api'
|
264
267
|
require 'phrase/api/notification_groups_api'
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
# Unit tests for Phrase::LocaleDownloadsApi
|
5
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
6
|
+
# Please update as you see appropriate
|
7
|
+
describe 'LocaleDownloadsApi' do
|
8
|
+
before do
|
9
|
+
# run before each test
|
10
|
+
@api_instance = Phrase::LocaleDownloadsApi.new
|
11
|
+
end
|
12
|
+
|
13
|
+
after do
|
14
|
+
# run after each test
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'test an instance of LocaleDownloadsApi' do
|
18
|
+
it 'should create an instance of LocaleDownloadsApi' do
|
19
|
+
expect(@api_instance).to be_instance_of(Phrase::LocaleDownloadsApi)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# unit tests for locale_download_create
|
24
|
+
# Initiate async download of a locale
|
25
|
+
# Prepare a locale for download in a specific file format.
|
26
|
+
# @param project_id Project ID
|
27
|
+
# @param locale_id Locale ID
|
28
|
+
# @param locale_download_create_parameters
|
29
|
+
# @param [Hash] opts the optional parameters
|
30
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
31
|
+
# @option opts [String] :if_modified_since Last modified condition, see <a href=\"#overview--conditional-get-requests--http-caching\">Conditional GET requests / HTTP Caching</a> (optional)
|
32
|
+
# @option opts [String] :if_none_match ETag condition, see <a href=\"#overview--conditional-get-requests--http-caching\">Conditional GET requests / HTTP Caching</a> (optional)
|
33
|
+
# @return [LocaleDownload]
|
34
|
+
describe 'locale_download_create test' do
|
35
|
+
it 'should work' do
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# unit tests for locale_download_show
|
41
|
+
# Show status of an async locale download
|
42
|
+
# Show status of already started async locale download. If the download is finished, the download link will be returned.
|
43
|
+
# @param project_id Project ID
|
44
|
+
# @param locale_id Locale ID
|
45
|
+
# @param id ID
|
46
|
+
# @param [Hash] opts the optional parameters
|
47
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
48
|
+
# @option opts [String] :if_modified_since Last modified condition, see <a href=\"#overview--conditional-get-requests--http-caching\">Conditional GET requests / HTTP Caching</a> (optional)
|
49
|
+
# @option opts [String] :if_none_match ETag condition, see <a href=\"#overview--conditional-get-requests--http-caching\">Conditional GET requests / HTTP Caching</a> (optional)
|
50
|
+
# @return [LocaleDownload]
|
51
|
+
describe 'locale_download_show test' do
|
52
|
+
it 'should work' do
|
53
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|