phrase 4.24.0 → 4.25.0
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +7 -3
- data/docs/BranchComparison.md +23 -0
- data/docs/BranchComparisonChange.md +19 -0
- data/docs/BranchComparisonDiff.md +21 -0
- data/docs/BranchComparisonDiffConflictsValue.md +19 -0
- data/docs/BranchesApi.md +5 -4
- data/docs/Format.md +20 -20
- data/docs/FormatsApi.md +1 -1
- data/docs/Job.md +3 -1
- data/docs/JobDetails.md +2 -0
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/Locale.md +2 -0
- data/docs/LocaleCreateParameters.md +3 -1
- data/docs/LocaleDetails.md +2 -0
- data/docs/LocaleDownloadCreateParameters.md +4 -0
- data/docs/LocaleUpdateParameters.md +3 -1
- data/docs/LocalesApi.md +2 -2
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/RepoSync.md +2 -0
- data/docs/RepoSyncCreateParameters.md +2 -0
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/ScreenshotsApi.md +9 -9
- data/lib/phrase/api/branches_api.rb +5 -3
- data/lib/phrase/api/formats_api.rb +2 -2
- data/lib/phrase/api/locales_api.rb +2 -2
- data/lib/phrase/api/screenshots_api.rb +16 -12
- data/lib/phrase/models/branch_comparison.rb +224 -0
- data/lib/phrase/models/branch_comparison_change.rb +212 -0
- data/lib/phrase/models/branch_comparison_diff.rb +223 -0
- data/lib/phrase/models/branch_comparison_diff_conflicts_value.rb +209 -0
- data/lib/phrase/models/format.rb +60 -0
- data/lib/phrase/models/job.rb +16 -5
- data/lib/phrase/models/job_details.rb +12 -1
- data/lib/phrase/models/locale.rb +10 -1
- data/lib/phrase/models/locale_create_parameters.rb +14 -4
- data/lib/phrase/models/locale_details.rb +10 -1
- data/lib/phrase/models/locale_download_create_parameters.rb +21 -1
- data/lib/phrase/models/locale_update_parameters.rb +14 -4
- data/lib/phrase/models/repo_sync.rb +29 -1
- data/lib/phrase/models/repo_sync_create_parameters.rb +27 -1
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +4 -0
- data/spec/api/branches_api_spec.rb +1 -1
- data/spec/api/formats_api_spec.rb +1 -1
- data/spec/api/screenshots_api_spec.rb +4 -4
- data/spec/models/branch_comparison_change_spec.rb +35 -0
- data/spec/models/branch_comparison_diff_conflicts_value_spec.rb +35 -0
- data/spec/models/branch_comparison_diff_spec.rb +41 -0
- data/spec/models/branch_comparison_spec.rb +47 -0
- data/spec/models/job_details_spec.rb +6 -0
- data/spec/models/job_spec.rb +6 -0
- data/spec/models/locale_create_parameters_spec.rb +6 -0
- data/spec/models/locale_details_spec.rb +6 -0
- data/spec/models/locale_download_create_parameters_spec.rb +12 -0
- data/spec/models/locale_spec.rb +6 -0
- data/spec/models/locale_update_parameters_spec.rb +6 -0
- data/spec/models/repo_sync_create_parameters_spec.rb +6 -0
- data/spec/models/repo_sync_spec.rb +6 -0
- metadata +18 -2
data/lib/phrase/models/locale.rb
CHANGED
|
@@ -22,6 +22,8 @@ module Phrase
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :fallback_locale
|
|
24
24
|
|
|
25
|
+
attr_accessor :language_ai_profile
|
|
26
|
+
|
|
25
27
|
attr_accessor :created_at
|
|
26
28
|
|
|
27
29
|
attr_accessor :updated_at
|
|
@@ -39,6 +41,7 @@ module Phrase
|
|
|
39
41
|
:'ordinal_plural_forms' => :'ordinal_plural_forms',
|
|
40
42
|
:'source_locale' => :'source_locale',
|
|
41
43
|
:'fallback_locale' => :'fallback_locale',
|
|
44
|
+
:'language_ai_profile' => :'language_ai_profile',
|
|
42
45
|
:'created_at' => :'created_at',
|
|
43
46
|
:'updated_at' => :'updated_at'
|
|
44
47
|
}
|
|
@@ -57,6 +60,7 @@ module Phrase
|
|
|
57
60
|
:'ordinal_plural_forms' => :'Array<String>',
|
|
58
61
|
:'source_locale' => :'LocalePreview',
|
|
59
62
|
:'fallback_locale' => :'LocalePreview',
|
|
63
|
+
:'language_ai_profile' => :'String',
|
|
60
64
|
:'created_at' => :'DateTime',
|
|
61
65
|
:'updated_at' => :'DateTime'
|
|
62
66
|
}
|
|
@@ -127,6 +131,10 @@ module Phrase
|
|
|
127
131
|
self.fallback_locale = attributes[:'fallback_locale']
|
|
128
132
|
end
|
|
129
133
|
|
|
134
|
+
if attributes.key?(:'language_ai_profile')
|
|
135
|
+
self.language_ai_profile = attributes[:'language_ai_profile']
|
|
136
|
+
end
|
|
137
|
+
|
|
130
138
|
if attributes.key?(:'created_at')
|
|
131
139
|
self.created_at = attributes[:'created_at']
|
|
132
140
|
end
|
|
@@ -164,6 +172,7 @@ module Phrase
|
|
|
164
172
|
ordinal_plural_forms == o.ordinal_plural_forms &&
|
|
165
173
|
source_locale == o.source_locale &&
|
|
166
174
|
fallback_locale == o.fallback_locale &&
|
|
175
|
+
language_ai_profile == o.language_ai_profile &&
|
|
167
176
|
created_at == o.created_at &&
|
|
168
177
|
updated_at == o.updated_at
|
|
169
178
|
end
|
|
@@ -177,7 +186,7 @@ module Phrase
|
|
|
177
186
|
# Calculates hash code according to all attributes.
|
|
178
187
|
# @return [Integer] Hash code
|
|
179
188
|
def hash
|
|
180
|
-
[id, name, code, default, main, rtl, plural_forms, ordinal_plural_forms, source_locale, fallback_locale, created_at, updated_at].hash
|
|
189
|
+
[id, name, code, default, main, rtl, plural_forms, ordinal_plural_forms, source_locale, fallback_locale, language_ai_profile, created_at, updated_at].hash
|
|
181
190
|
end
|
|
182
191
|
|
|
183
192
|
# Builds the object from hash
|
|
@@ -35,6 +35,9 @@ module Phrase
|
|
|
35
35
|
# If set, translations for this locale will be fetched automatically, right after creation.
|
|
36
36
|
attr_accessor :autotranslate
|
|
37
37
|
|
|
38
|
+
# Identifier of the Language AI profile to use for this locale.
|
|
39
|
+
attr_accessor :language_ai_profile
|
|
40
|
+
|
|
38
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
42
|
def self.attribute_map
|
|
40
43
|
{
|
|
@@ -48,7 +51,8 @@ module Phrase
|
|
|
48
51
|
:'fallback_locale_id' => :'fallback_locale_id',
|
|
49
52
|
:'unverify_new_translations' => :'unverify_new_translations',
|
|
50
53
|
:'unverify_updated_translations' => :'unverify_updated_translations',
|
|
51
|
-
:'autotranslate' => :'autotranslate'
|
|
54
|
+
:'autotranslate' => :'autotranslate',
|
|
55
|
+
:'language_ai_profile' => :'language_ai_profile'
|
|
52
56
|
}
|
|
53
57
|
end
|
|
54
58
|
|
|
@@ -65,7 +69,8 @@ module Phrase
|
|
|
65
69
|
:'fallback_locale_id' => :'String',
|
|
66
70
|
:'unverify_new_translations' => :'Boolean',
|
|
67
71
|
:'unverify_updated_translations' => :'Boolean',
|
|
68
|
-
:'autotranslate' => :'Boolean'
|
|
72
|
+
:'autotranslate' => :'Boolean',
|
|
73
|
+
:'language_ai_profile' => :'String'
|
|
69
74
|
}
|
|
70
75
|
end
|
|
71
76
|
|
|
@@ -133,6 +138,10 @@ module Phrase
|
|
|
133
138
|
if attributes.key?(:'autotranslate')
|
|
134
139
|
self.autotranslate = attributes[:'autotranslate']
|
|
135
140
|
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'language_ai_profile')
|
|
143
|
+
self.language_ai_profile = attributes[:'language_ai_profile']
|
|
144
|
+
end
|
|
136
145
|
end
|
|
137
146
|
|
|
138
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -173,7 +182,8 @@ module Phrase
|
|
|
173
182
|
fallback_locale_id == o.fallback_locale_id &&
|
|
174
183
|
unverify_new_translations == o.unverify_new_translations &&
|
|
175
184
|
unverify_updated_translations == o.unverify_updated_translations &&
|
|
176
|
-
autotranslate == o.autotranslate
|
|
185
|
+
autotranslate == o.autotranslate &&
|
|
186
|
+
language_ai_profile == o.language_ai_profile
|
|
177
187
|
end
|
|
178
188
|
|
|
179
189
|
# @see the `==` method
|
|
@@ -185,7 +195,7 @@ module Phrase
|
|
|
185
195
|
# Calculates hash code according to all attributes.
|
|
186
196
|
# @return [Integer] Hash code
|
|
187
197
|
def hash
|
|
188
|
-
[branch, name, code, default, main, rtl, source_locale_id, fallback_locale_id, unverify_new_translations, unverify_updated_translations, autotranslate].hash
|
|
198
|
+
[branch, name, code, default, main, rtl, source_locale_id, fallback_locale_id, unverify_new_translations, unverify_updated_translations, autotranslate, language_ai_profile].hash
|
|
189
199
|
end
|
|
190
200
|
|
|
191
201
|
# Builds the object from hash
|
|
@@ -22,6 +22,8 @@ module Phrase
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :fallback_locale
|
|
24
24
|
|
|
25
|
+
attr_accessor :language_ai_profile
|
|
26
|
+
|
|
25
27
|
attr_accessor :created_at
|
|
26
28
|
|
|
27
29
|
attr_accessor :updated_at
|
|
@@ -41,6 +43,7 @@ module Phrase
|
|
|
41
43
|
:'ordinal_plural_forms' => :'ordinal_plural_forms',
|
|
42
44
|
:'source_locale' => :'source_locale',
|
|
43
45
|
:'fallback_locale' => :'fallback_locale',
|
|
46
|
+
:'language_ai_profile' => :'language_ai_profile',
|
|
44
47
|
:'created_at' => :'created_at',
|
|
45
48
|
:'updated_at' => :'updated_at',
|
|
46
49
|
:'statistics' => :'statistics'
|
|
@@ -60,6 +63,7 @@ module Phrase
|
|
|
60
63
|
:'ordinal_plural_forms' => :'Array<String>',
|
|
61
64
|
:'source_locale' => :'LocalePreview',
|
|
62
65
|
:'fallback_locale' => :'LocalePreview',
|
|
66
|
+
:'language_ai_profile' => :'String',
|
|
63
67
|
:'created_at' => :'DateTime',
|
|
64
68
|
:'updated_at' => :'DateTime',
|
|
65
69
|
:'statistics' => :'LocaleStatistics'
|
|
@@ -138,6 +142,10 @@ module Phrase
|
|
|
138
142
|
self.fallback_locale = attributes[:'fallback_locale']
|
|
139
143
|
end
|
|
140
144
|
|
|
145
|
+
if attributes.key?(:'language_ai_profile')
|
|
146
|
+
self.language_ai_profile = attributes[:'language_ai_profile']
|
|
147
|
+
end
|
|
148
|
+
|
|
141
149
|
if attributes.key?(:'created_at')
|
|
142
150
|
self.created_at = attributes[:'created_at']
|
|
143
151
|
end
|
|
@@ -179,6 +187,7 @@ module Phrase
|
|
|
179
187
|
ordinal_plural_forms == o.ordinal_plural_forms &&
|
|
180
188
|
source_locale == o.source_locale &&
|
|
181
189
|
fallback_locale == o.fallback_locale &&
|
|
190
|
+
language_ai_profile == o.language_ai_profile &&
|
|
182
191
|
created_at == o.created_at &&
|
|
183
192
|
updated_at == o.updated_at &&
|
|
184
193
|
statistics == o.statistics
|
|
@@ -193,7 +202,7 @@ module Phrase
|
|
|
193
202
|
# Calculates hash code according to all attributes.
|
|
194
203
|
# @return [Integer] Hash code
|
|
195
204
|
def hash
|
|
196
|
-
[id, name, code, default, main, rtl, plural_forms, ordinal_plural_forms, source_locale, fallback_locale, created_at, updated_at, statistics].hash
|
|
205
|
+
[id, name, code, default, main, rtl, plural_forms, ordinal_plural_forms, source_locale, fallback_locale, language_ai_profile, created_at, updated_at, statistics].hash
|
|
197
206
|
end
|
|
198
207
|
|
|
199
208
|
# Builds the object from hash
|
|
@@ -53,6 +53,12 @@ module Phrase
|
|
|
53
53
|
# 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.
|
|
54
54
|
attr_accessor :custom_metadata_filters
|
|
55
55
|
|
|
56
|
+
# Download all translation keys, and remove the specified prefix where possible. Warning: this may create duplicate key names if other keys share the same name after the prefix is removed.
|
|
57
|
+
attr_accessor :translation_key_prefix
|
|
58
|
+
|
|
59
|
+
# Only download translation keys containing the prefix specified by `translation_key_prefix`, and remove that prefix from the generated file. Requires `translation_key_prefix` to be set.
|
|
60
|
+
attr_accessor :filter_by_prefix
|
|
61
|
+
|
|
56
62
|
# Only include translations and keys that have been updated since the given date. The date must be in ISO 8601 format (e.g., `2023-01-01T00:00:00Z`).
|
|
57
63
|
attr_accessor :updated_since
|
|
58
64
|
|
|
@@ -76,6 +82,8 @@ module Phrase
|
|
|
76
82
|
:'fallback_for_unverified_translations' => :'fallback_for_unverified_translations',
|
|
77
83
|
:'source_locale_id' => :'source_locale_id',
|
|
78
84
|
:'custom_metadata_filters' => :'custom_metadata_filters',
|
|
85
|
+
:'translation_key_prefix' => :'translation_key_prefix',
|
|
86
|
+
:'filter_by_prefix' => :'filter_by_prefix',
|
|
79
87
|
:'updated_since' => :'updated_since'
|
|
80
88
|
}
|
|
81
89
|
end
|
|
@@ -100,6 +108,8 @@ module Phrase
|
|
|
100
108
|
:'fallback_for_unverified_translations' => :'Boolean',
|
|
101
109
|
:'source_locale_id' => :'String',
|
|
102
110
|
:'custom_metadata_filters' => :'Object',
|
|
111
|
+
:'translation_key_prefix' => :'String',
|
|
112
|
+
:'filter_by_prefix' => :'Boolean',
|
|
103
113
|
:'updated_since' => :'String'
|
|
104
114
|
}
|
|
105
115
|
end
|
|
@@ -195,6 +205,14 @@ module Phrase
|
|
|
195
205
|
self.custom_metadata_filters = attributes[:'custom_metadata_filters']
|
|
196
206
|
end
|
|
197
207
|
|
|
208
|
+
if attributes.key?(:'translation_key_prefix')
|
|
209
|
+
self.translation_key_prefix = attributes[:'translation_key_prefix']
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if attributes.key?(:'filter_by_prefix')
|
|
213
|
+
self.filter_by_prefix = attributes[:'filter_by_prefix']
|
|
214
|
+
end
|
|
215
|
+
|
|
198
216
|
if attributes.key?(:'updated_since')
|
|
199
217
|
self.updated_since = attributes[:'updated_since']
|
|
200
218
|
end
|
|
@@ -240,6 +258,8 @@ module Phrase
|
|
|
240
258
|
fallback_for_unverified_translations == o.fallback_for_unverified_translations &&
|
|
241
259
|
source_locale_id == o.source_locale_id &&
|
|
242
260
|
custom_metadata_filters == o.custom_metadata_filters &&
|
|
261
|
+
translation_key_prefix == o.translation_key_prefix &&
|
|
262
|
+
filter_by_prefix == o.filter_by_prefix &&
|
|
243
263
|
updated_since == o.updated_since
|
|
244
264
|
end
|
|
245
265
|
|
|
@@ -252,7 +272,7 @@ module Phrase
|
|
|
252
272
|
# Calculates hash code according to all attributes.
|
|
253
273
|
# @return [Integer] Hash code
|
|
254
274
|
def hash
|
|
255
|
-
[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, locale_ids, fallback_locale_id, use_locale_fallback, fallback_for_unverified_translations, source_locale_id, custom_metadata_filters, updated_since].hash
|
|
275
|
+
[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, locale_ids, fallback_locale_id, use_locale_fallback, fallback_for_unverified_translations, source_locale_id, custom_metadata_filters, translation_key_prefix, filter_by_prefix, updated_since].hash
|
|
256
276
|
end
|
|
257
277
|
|
|
258
278
|
# Builds the object from hash
|
|
@@ -35,6 +35,9 @@ module Phrase
|
|
|
35
35
|
# If set, translations for this locale will be fetched automatically, right after creation.
|
|
36
36
|
attr_accessor :autotranslate
|
|
37
37
|
|
|
38
|
+
# Identifier of the Language AI profile to use for this locale.
|
|
39
|
+
attr_accessor :language_ai_profile
|
|
40
|
+
|
|
38
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
39
42
|
def self.attribute_map
|
|
40
43
|
{
|
|
@@ -48,7 +51,8 @@ module Phrase
|
|
|
48
51
|
:'fallback_locale_id' => :'fallback_locale_id',
|
|
49
52
|
:'unverify_new_translations' => :'unverify_new_translations',
|
|
50
53
|
:'unverify_updated_translations' => :'unverify_updated_translations',
|
|
51
|
-
:'autotranslate' => :'autotranslate'
|
|
54
|
+
:'autotranslate' => :'autotranslate',
|
|
55
|
+
:'language_ai_profile' => :'language_ai_profile'
|
|
52
56
|
}
|
|
53
57
|
end
|
|
54
58
|
|
|
@@ -65,7 +69,8 @@ module Phrase
|
|
|
65
69
|
:'fallback_locale_id' => :'String',
|
|
66
70
|
:'unverify_new_translations' => :'Boolean',
|
|
67
71
|
:'unverify_updated_translations' => :'Boolean',
|
|
68
|
-
:'autotranslate' => :'Boolean'
|
|
72
|
+
:'autotranslate' => :'Boolean',
|
|
73
|
+
:'language_ai_profile' => :'String'
|
|
69
74
|
}
|
|
70
75
|
end
|
|
71
76
|
|
|
@@ -133,6 +138,10 @@ module Phrase
|
|
|
133
138
|
if attributes.key?(:'autotranslate')
|
|
134
139
|
self.autotranslate = attributes[:'autotranslate']
|
|
135
140
|
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'language_ai_profile')
|
|
143
|
+
self.language_ai_profile = attributes[:'language_ai_profile']
|
|
144
|
+
end
|
|
136
145
|
end
|
|
137
146
|
|
|
138
147
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -163,7 +172,8 @@ module Phrase
|
|
|
163
172
|
fallback_locale_id == o.fallback_locale_id &&
|
|
164
173
|
unverify_new_translations == o.unverify_new_translations &&
|
|
165
174
|
unverify_updated_translations == o.unverify_updated_translations &&
|
|
166
|
-
autotranslate == o.autotranslate
|
|
175
|
+
autotranslate == o.autotranslate &&
|
|
176
|
+
language_ai_profile == o.language_ai_profile
|
|
167
177
|
end
|
|
168
178
|
|
|
169
179
|
# @see the `==` method
|
|
@@ -175,7 +185,7 @@ module Phrase
|
|
|
175
185
|
# Calculates hash code according to all attributes.
|
|
176
186
|
# @return [Integer] Hash code
|
|
177
187
|
def hash
|
|
178
|
-
[branch, name, code, default, main, rtl, source_locale_id, fallback_locale_id, unverify_new_translations, unverify_updated_translations, autotranslate].hash
|
|
188
|
+
[branch, name, code, default, main, rtl, source_locale_id, fallback_locale_id, unverify_new_translations, unverify_updated_translations, autotranslate, language_ai_profile].hash
|
|
179
189
|
end
|
|
180
190
|
|
|
181
191
|
# Builds the object from hash
|
|
@@ -4,6 +4,9 @@ module Phrase
|
|
|
4
4
|
class RepoSync
|
|
5
5
|
attr_accessor :id
|
|
6
6
|
|
|
7
|
+
# Optional custom display name for this repo sync. When null or blank, the sync is displayed using the associated project name.
|
|
8
|
+
attr_accessor :name
|
|
9
|
+
|
|
7
10
|
attr_accessor :project
|
|
8
11
|
|
|
9
12
|
attr_accessor :provider
|
|
@@ -27,6 +30,7 @@ module Phrase
|
|
|
27
30
|
def self.attribute_map
|
|
28
31
|
{
|
|
29
32
|
:'id' => :'id',
|
|
33
|
+
:'name' => :'name',
|
|
30
34
|
:'project' => :'project',
|
|
31
35
|
:'provider' => :'provider',
|
|
32
36
|
:'enabled' => :'enabled',
|
|
@@ -43,6 +47,7 @@ module Phrase
|
|
|
43
47
|
def self.openapi_types
|
|
44
48
|
{
|
|
45
49
|
:'id' => :'String',
|
|
50
|
+
:'name' => :'String',
|
|
46
51
|
:'project' => :'ProjectShort',
|
|
47
52
|
:'provider' => :'String',
|
|
48
53
|
:'enabled' => :'Boolean',
|
|
@@ -58,7 +63,10 @@ module Phrase
|
|
|
58
63
|
# List of attributes with nullable: true
|
|
59
64
|
def self.openapi_nullable
|
|
60
65
|
Set.new([
|
|
66
|
+
:'name',
|
|
61
67
|
:'pr_branch',
|
|
68
|
+
:'last_import_at',
|
|
69
|
+
:'last_export_at'
|
|
62
70
|
])
|
|
63
71
|
end
|
|
64
72
|
|
|
@@ -81,6 +89,10 @@ module Phrase
|
|
|
81
89
|
self.id = attributes[:'id']
|
|
82
90
|
end
|
|
83
91
|
|
|
92
|
+
if attributes.key?(:'name')
|
|
93
|
+
self.name = attributes[:'name']
|
|
94
|
+
end
|
|
95
|
+
|
|
84
96
|
if attributes.key?(:'project')
|
|
85
97
|
self.project = attributes[:'project']
|
|
86
98
|
end
|
|
@@ -122,21 +134,37 @@ module Phrase
|
|
|
122
134
|
# @return Array for valid properties with the reasons
|
|
123
135
|
def list_invalid_properties
|
|
124
136
|
invalid_properties = Array.new
|
|
137
|
+
if !@name.nil? && @name.to_s.length > 100
|
|
138
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
|
139
|
+
end
|
|
140
|
+
|
|
125
141
|
invalid_properties
|
|
126
142
|
end
|
|
127
143
|
|
|
128
144
|
# Check to see if the all the properties in the model are valid
|
|
129
145
|
# @return true if the model is valid
|
|
130
146
|
def valid?
|
|
147
|
+
return false if !@name.nil? && @name.to_s.length > 100
|
|
131
148
|
true
|
|
132
149
|
end
|
|
133
150
|
|
|
151
|
+
# Custom attribute writer method with validation
|
|
152
|
+
# @param [Object] name Value to be assigned
|
|
153
|
+
def name=(name)
|
|
154
|
+
if !name.nil? && name.to_s.length > 100
|
|
155
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
@name = name
|
|
159
|
+
end
|
|
160
|
+
|
|
134
161
|
# Checks equality by comparing each attribute.
|
|
135
162
|
# @param [Object] Object to be compared
|
|
136
163
|
def ==(o)
|
|
137
164
|
return true if self.equal?(o)
|
|
138
165
|
self.class == o.class &&
|
|
139
166
|
id == o.id &&
|
|
167
|
+
name == o.name &&
|
|
140
168
|
project == o.project &&
|
|
141
169
|
provider == o.provider &&
|
|
142
170
|
enabled == o.enabled &&
|
|
@@ -157,7 +185,7 @@ module Phrase
|
|
|
157
185
|
# Calculates hash code according to all attributes.
|
|
158
186
|
# @return [Integer] Hash code
|
|
159
187
|
def hash
|
|
160
|
-
[id, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at].hash
|
|
188
|
+
[id, name, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at].hash
|
|
161
189
|
end
|
|
162
190
|
|
|
163
191
|
# Builds the object from hash
|
|
@@ -5,6 +5,9 @@ module Phrase
|
|
|
5
5
|
# ID of the project to connect the Repo Sync to.
|
|
6
6
|
attr_accessor :project_id
|
|
7
7
|
|
|
8
|
+
# Optional custom display name for this repo sync. Defaults to null; when null the project name is used as the display name.
|
|
9
|
+
attr_accessor :name
|
|
10
|
+
|
|
8
11
|
# The Git provider to use.
|
|
9
12
|
attr_accessor :git_provider
|
|
10
13
|
|
|
@@ -55,6 +58,7 @@ module Phrase
|
|
|
55
58
|
def self.attribute_map
|
|
56
59
|
{
|
|
57
60
|
:'project_id' => :'project_id',
|
|
61
|
+
:'name' => :'name',
|
|
58
62
|
:'git_provider' => :'git_provider',
|
|
59
63
|
:'connection_type' => :'connection_type',
|
|
60
64
|
:'repo_name' => :'repo_name',
|
|
@@ -70,6 +74,7 @@ module Phrase
|
|
|
70
74
|
def self.openapi_types
|
|
71
75
|
{
|
|
72
76
|
:'project_id' => :'String',
|
|
77
|
+
:'name' => :'String',
|
|
73
78
|
:'git_provider' => :'String',
|
|
74
79
|
:'connection_type' => :'String',
|
|
75
80
|
:'repo_name' => :'String',
|
|
@@ -84,6 +89,7 @@ module Phrase
|
|
|
84
89
|
# List of attributes with nullable: true
|
|
85
90
|
def self.openapi_nullable
|
|
86
91
|
Set.new([
|
|
92
|
+
:'name',
|
|
87
93
|
])
|
|
88
94
|
end
|
|
89
95
|
|
|
@@ -106,6 +112,10 @@ module Phrase
|
|
|
106
112
|
self.project_id = attributes[:'project_id']
|
|
107
113
|
end
|
|
108
114
|
|
|
115
|
+
if attributes.key?(:'name')
|
|
116
|
+
self.name = attributes[:'name']
|
|
117
|
+
end
|
|
118
|
+
|
|
109
119
|
if attributes.key?(:'git_provider')
|
|
110
120
|
self.git_provider = attributes[:'git_provider']
|
|
111
121
|
else
|
|
@@ -149,6 +159,10 @@ module Phrase
|
|
|
149
159
|
invalid_properties.push('invalid value for "project_id", project_id cannot be nil.')
|
|
150
160
|
end
|
|
151
161
|
|
|
162
|
+
if !@name.nil? && @name.to_s.length > 100
|
|
163
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
|
164
|
+
end
|
|
165
|
+
|
|
152
166
|
if @connection_type.nil?
|
|
153
167
|
invalid_properties.push('invalid value for "connection_type", connection_type cannot be nil.')
|
|
154
168
|
end
|
|
@@ -164,6 +178,7 @@ module Phrase
|
|
|
164
178
|
# @return true if the model is valid
|
|
165
179
|
def valid?
|
|
166
180
|
return false if @project_id.nil?
|
|
181
|
+
return false if !@name.nil? && @name.to_s.length > 100
|
|
167
182
|
git_provider_validator = EnumAttributeValidator.new('String', ["github", "gitlab", "bitbucket"])
|
|
168
183
|
return false unless git_provider_validator.valid?(@git_provider)
|
|
169
184
|
return false if @connection_type.nil?
|
|
@@ -173,6 +188,16 @@ module Phrase
|
|
|
173
188
|
true
|
|
174
189
|
end
|
|
175
190
|
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] name Value to be assigned
|
|
193
|
+
def name=(name)
|
|
194
|
+
if !name.nil? && name.to_s.length > 100
|
|
195
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@name = name
|
|
199
|
+
end
|
|
200
|
+
|
|
176
201
|
# Custom attribute writer method checking allowed values (enum).
|
|
177
202
|
# @param [Object] git_provider Object to be assigned
|
|
178
203
|
def git_provider=(git_provider)
|
|
@@ -199,6 +224,7 @@ module Phrase
|
|
|
199
224
|
return true if self.equal?(o)
|
|
200
225
|
self.class == o.class &&
|
|
201
226
|
project_id == o.project_id &&
|
|
227
|
+
name == o.name &&
|
|
202
228
|
git_provider == o.git_provider &&
|
|
203
229
|
connection_type == o.connection_type &&
|
|
204
230
|
repo_name == o.repo_name &&
|
|
@@ -218,7 +244,7 @@ module Phrase
|
|
|
218
244
|
# Calculates hash code according to all attributes.
|
|
219
245
|
# @return [Integer] Hash code
|
|
220
246
|
def hash
|
|
221
|
-
[project_id, git_provider, connection_type, repo_name, base_branch, pr_branch, auto_import, access_token, custom_api_endpoint].hash
|
|
247
|
+
[project_id, name, git_provider, connection_type, repo_name, base_branch, pr_branch, auto_import, access_token, custom_api_endpoint].hash
|
|
222
248
|
end
|
|
223
249
|
|
|
224
250
|
# Builds the object from hash
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
|
@@ -24,6 +24,10 @@ require 'phrase/models/blacklisted_key'
|
|
|
24
24
|
require 'phrase/models/blacklisted_key_create_parameters'
|
|
25
25
|
require 'phrase/models/blacklisted_key_update_parameters'
|
|
26
26
|
require 'phrase/models/branch'
|
|
27
|
+
require 'phrase/models/branch_comparison'
|
|
28
|
+
require 'phrase/models/branch_comparison_change'
|
|
29
|
+
require 'phrase/models/branch_comparison_diff'
|
|
30
|
+
require 'phrase/models/branch_comparison_diff_conflicts_value'
|
|
27
31
|
require 'phrase/models/branch_create_comparison_parameters'
|
|
28
32
|
require 'phrase/models/branch_create_parameters'
|
|
29
33
|
require 'phrase/models/branch_merge_parameters'
|
|
@@ -27,7 +27,7 @@ describe 'BranchesApi' do
|
|
|
27
27
|
# @param name name
|
|
28
28
|
# @param [Hash] opts the optional parameters
|
|
29
29
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
30
|
-
# @return [
|
|
30
|
+
# @return [BranchComparison]
|
|
31
31
|
describe 'branch_compare test' do
|
|
32
32
|
it 'should work' do
|
|
33
33
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
@@ -22,7 +22,7 @@ describe 'FormatsApi' do
|
|
|
22
22
|
|
|
23
23
|
# unit tests for formats_list
|
|
24
24
|
# List formats
|
|
25
|
-
#
|
|
25
|
+
# Returns all file formats that Phrase Strings supports. Use the api_name value from each format as the file_format parameter when uploading or downloading locale files. Not every format supports both directions: check the importable and exportable fields before using a format in a workflow. This endpoint does not require authentication and is not subject to rate limiting.
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
27
|
# @return [Array<Format>]
|
|
28
28
|
describe 'formats_list test' do
|
|
@@ -22,14 +22,14 @@ describe 'ScreenshotsApi' do
|
|
|
22
22
|
|
|
23
23
|
# unit tests for screenshot_create
|
|
24
24
|
# Create a screenshot
|
|
25
|
-
#
|
|
25
|
+
# Creates a screenshot in a project to provide visual context for in-context translation. Attach translation keys to regions of the uploaded image so translators can see where each string appears in your UI. This endpoint accepts a multipart/form-data request with a binary file upload, unlike most Phrase API endpoints that use JSON. Use a multipart form client or the -F flag in curl rather than a JSON body. The screenshot name must be unique within the project (case-insensitive). When name is omitted, it is derived from the uploaded filename. The account must have the Screenshots feature enabled; requests to projects on accounts without it return 403. Creating a screenshot requires a token with the write scope and manage access to the project.
|
|
26
26
|
# @param project_id Project ID
|
|
27
|
+
# @param filename Image file to upload. Accepted formats are JPEG (jpg/jpeg), GIF, and PNG. Maximum file size is 10 MB. Submitting an unsupported format or a file exceeding the size limit returns 422.
|
|
27
28
|
# @param [Hash] opts the optional parameters
|
|
28
29
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
29
30
|
# @option opts [String] :branch specify the branch to use
|
|
30
|
-
# @option opts [String] :name
|
|
31
|
-
# @option opts [String] :description
|
|
32
|
-
# @option opts [File] :filename Screenshot file
|
|
31
|
+
# @option opts [String] :name Display name for the screenshot. Must be unique within the project (case-insensitive). When omitted, the name is derived from the uploaded filename.
|
|
32
|
+
# @option opts [String] :description Optional free-text description of the screenshot.
|
|
33
33
|
# @return [Screenshot]
|
|
34
34
|
describe 'screenshot_create test' do
|
|
35
35
|
it 'should work' do
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'json'
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
# Unit tests for Phrase::BranchComparisonChange
|
|
6
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
7
|
+
# Please update as you see appropriate
|
|
8
|
+
describe 'BranchComparisonChange' do
|
|
9
|
+
before do
|
|
10
|
+
# run before each test
|
|
11
|
+
@instance = Phrase::BranchComparisonChange.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
after do
|
|
15
|
+
# run after each test
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of BranchComparisonChange' do
|
|
19
|
+
it 'should create an instance of BranchComparisonChange' do
|
|
20
|
+
expect(@instance).to be_instance_of(Phrase::BranchComparisonChange)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "from"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "to"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'json'
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
# Unit tests for Phrase::BranchComparisonDiffConflictsValue
|
|
6
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
7
|
+
# Please update as you see appropriate
|
|
8
|
+
describe 'BranchComparisonDiffConflictsValue' do
|
|
9
|
+
before do
|
|
10
|
+
# run before each test
|
|
11
|
+
@instance = Phrase::BranchComparisonDiffConflictsValue.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
after do
|
|
15
|
+
# run after each test
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of BranchComparisonDiffConflictsValue' do
|
|
19
|
+
it 'should create an instance of BranchComparisonDiffConflictsValue' do
|
|
20
|
+
expect(@instance).to be_instance_of(Phrase::BranchComparisonDiffConflictsValue)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "base"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "head"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'json'
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
# Unit tests for Phrase::BranchComparisonDiff
|
|
6
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
7
|
+
# Please update as you see appropriate
|
|
8
|
+
describe 'BranchComparisonDiff' do
|
|
9
|
+
before do
|
|
10
|
+
# run before each test
|
|
11
|
+
@instance = Phrase::BranchComparisonDiff.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
after do
|
|
15
|
+
# run after each test
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of BranchComparisonDiff' do
|
|
19
|
+
it 'should create an instance of BranchComparisonDiff' do
|
|
20
|
+
expect(@instance).to be_instance_of(Phrase::BranchComparisonDiff)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "base_changes"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "head_changes"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'test attribute "conflicts"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|