phrase 3.1.0 → 3.2.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 +15 -0
- data/README.md +17 -9
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LocaleReport.md +4 -4
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ReleaseCreateParameters1.md +29 -0
- data/docs/ReleaseTrigger.md +37 -0
- data/docs/ReleaseTriggersApi.md +337 -0
- data/docs/ReleaseUpdateParameters1.md +29 -0
- data/docs/RepoSyncsApi.md +30 -30
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/lib/phrase/api/release_triggers_api.rb +402 -0
- data/lib/phrase/api/repo_syncs_api.rb +54 -54
- data/lib/phrase/models/locale_report.rb +4 -4
- data/lib/phrase/models/release_create_parameters1.rb +261 -0
- data/lib/phrase/models/release_trigger.rb +293 -0
- data/lib/phrase/models/release_update_parameters1.rb +261 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +4 -0
- data/spec/api/release_triggers_api_spec.rb +98 -0
- data/spec/api/repo_syncs_api_spec.rb +6 -6
- data/spec/models/release_create_parameters1_spec.rb +65 -0
- data/spec/models/release_trigger_spec.rb +89 -0
- data/spec/models/release_update_parameters1_spec.rb +65 -0
- metadata +249 -233
|
@@ -10,23 +10,23 @@ module Phrase
|
|
|
10
10
|
# Activate a Repo Sync
|
|
11
11
|
# Activate a deactivated Repo Sync. Active syncs can be used to import and export translations, and imports to Phrase are automatically triggered by pushes to the repository, if configured.
|
|
12
12
|
# @param account_id [String] Account ID
|
|
13
|
-
# @param
|
|
13
|
+
# @param id [String] ID
|
|
14
14
|
# @param [Hash] opts the optional parameters
|
|
15
15
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
16
|
# @return [RepoSync]
|
|
17
|
-
def repo_sync_activate(account_id,
|
|
18
|
-
data, _status_code, _headers = repo_sync_activate_with_http_info(account_id,
|
|
17
|
+
def repo_sync_activate(account_id, id, opts = {})
|
|
18
|
+
data, _status_code, _headers = repo_sync_activate_with_http_info(account_id, id, opts)
|
|
19
19
|
data
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Activate a Repo Sync
|
|
23
23
|
# Activate a deactivated Repo Sync. Active syncs can be used to import and export translations, and imports to Phrase are automatically triggered by pushes to the repository, if configured.
|
|
24
24
|
# @param account_id [String] Account ID
|
|
25
|
-
# @param
|
|
25
|
+
# @param id [String] ID
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
27
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
28
|
# @return [Array<(Response<(RepoSync)>, Integer, Hash)>] Response<(RepoSync)> data, response status code and response headers
|
|
29
|
-
def repo_sync_activate_with_http_info(account_id,
|
|
29
|
+
def repo_sync_activate_with_http_info(account_id, id, opts = {})
|
|
30
30
|
if @api_client.config.debugging
|
|
31
31
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_activate ...'
|
|
32
32
|
end
|
|
@@ -34,12 +34,12 @@ module Phrase
|
|
|
34
34
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
35
35
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_activate"
|
|
36
36
|
end
|
|
37
|
-
# verify the required parameter '
|
|
38
|
-
if @api_client.config.client_side_validation &&
|
|
39
|
-
fail ArgumentError, "Missing the required parameter '
|
|
37
|
+
# verify the required parameter 'id' is set
|
|
38
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
39
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_activate"
|
|
40
40
|
end
|
|
41
41
|
# resource path
|
|
42
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
42
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}/activate'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
43
43
|
|
|
44
44
|
# query parameters
|
|
45
45
|
query_params = opts[:query_params] || {}
|
|
@@ -82,23 +82,23 @@ module Phrase
|
|
|
82
82
|
# Deactivate a Repo Sync
|
|
83
83
|
# Deactivate an active Repo Sync. Import and export can't be performed on deactivated syncs and the pushes to the repository won't trigger the import to Phrase.
|
|
84
84
|
# @param account_id [String] Account ID
|
|
85
|
-
# @param
|
|
85
|
+
# @param id [String] ID
|
|
86
86
|
# @param [Hash] opts the optional parameters
|
|
87
87
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
88
88
|
# @return [RepoSync]
|
|
89
|
-
def repo_sync_deactivate(account_id,
|
|
90
|
-
data, _status_code, _headers = repo_sync_deactivate_with_http_info(account_id,
|
|
89
|
+
def repo_sync_deactivate(account_id, id, opts = {})
|
|
90
|
+
data, _status_code, _headers = repo_sync_deactivate_with_http_info(account_id, id, opts)
|
|
91
91
|
data
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
# Deactivate a Repo Sync
|
|
95
95
|
# Deactivate an active Repo Sync. Import and export can't be performed on deactivated syncs and the pushes to the repository won't trigger the import to Phrase.
|
|
96
96
|
# @param account_id [String] Account ID
|
|
97
|
-
# @param
|
|
97
|
+
# @param id [String] ID
|
|
98
98
|
# @param [Hash] opts the optional parameters
|
|
99
99
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
100
100
|
# @return [Array<(Response<(RepoSync)>, Integer, Hash)>] Response<(RepoSync)> data, response status code and response headers
|
|
101
|
-
def repo_sync_deactivate_with_http_info(account_id,
|
|
101
|
+
def repo_sync_deactivate_with_http_info(account_id, id, opts = {})
|
|
102
102
|
if @api_client.config.debugging
|
|
103
103
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_deactivate ...'
|
|
104
104
|
end
|
|
@@ -106,12 +106,12 @@ module Phrase
|
|
|
106
106
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
107
107
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_deactivate"
|
|
108
108
|
end
|
|
109
|
-
# verify the required parameter '
|
|
110
|
-
if @api_client.config.client_side_validation &&
|
|
111
|
-
fail ArgumentError, "Missing the required parameter '
|
|
109
|
+
# verify the required parameter 'id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_deactivate"
|
|
112
112
|
end
|
|
113
113
|
# resource path
|
|
114
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
114
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}/deactivate'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
115
115
|
|
|
116
116
|
# query parameters
|
|
117
117
|
query_params = opts[:query_params] || {}
|
|
@@ -154,23 +154,23 @@ module Phrase
|
|
|
154
154
|
# Repository Syncs History
|
|
155
155
|
# Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
|
|
156
156
|
# @param account_id [String] Account ID
|
|
157
|
-
# @param
|
|
157
|
+
# @param id [String] ID
|
|
158
158
|
# @param [Hash] opts the optional parameters
|
|
159
159
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
160
160
|
# @return [Array<RepoSyncEvent>]
|
|
161
|
-
def repo_sync_events(account_id,
|
|
162
|
-
data, _status_code, _headers = repo_sync_events_with_http_info(account_id,
|
|
161
|
+
def repo_sync_events(account_id, id, opts = {})
|
|
162
|
+
data, _status_code, _headers = repo_sync_events_with_http_info(account_id, id, opts)
|
|
163
163
|
data
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
# Repository Syncs History
|
|
167
167
|
# Get the history of a single Repo Sync. The history includes all imports and exports performed by the Repo Sync.
|
|
168
168
|
# @param account_id [String] Account ID
|
|
169
|
-
# @param
|
|
169
|
+
# @param id [String] ID
|
|
170
170
|
# @param [Hash] opts the optional parameters
|
|
171
171
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
172
172
|
# @return [Array<(Response<(Array<RepoSyncEvent>)>, Integer, Hash)>] Response<(Array<RepoSyncEvent>)> data, response status code and response headers
|
|
173
|
-
def repo_sync_events_with_http_info(account_id,
|
|
173
|
+
def repo_sync_events_with_http_info(account_id, id, opts = {})
|
|
174
174
|
if @api_client.config.debugging
|
|
175
175
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_events ...'
|
|
176
176
|
end
|
|
@@ -178,12 +178,12 @@ module Phrase
|
|
|
178
178
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
179
179
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_events"
|
|
180
180
|
end
|
|
181
|
-
# verify the required parameter '
|
|
182
|
-
if @api_client.config.client_side_validation &&
|
|
183
|
-
fail ArgumentError, "Missing the required parameter '
|
|
181
|
+
# verify the required parameter 'id' is set
|
|
182
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
183
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_events"
|
|
184
184
|
end
|
|
185
185
|
# resource path
|
|
186
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
186
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}/events'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
187
187
|
|
|
188
188
|
# query parameters
|
|
189
189
|
query_params = opts[:query_params] || {}
|
|
@@ -226,23 +226,23 @@ module Phrase
|
|
|
226
226
|
# Export to code repository
|
|
227
227
|
# > Beta: this feature will change in the future. Export translations from Phrase Strings to repository provider according to the .phrase.yml file within the code repository. *Export is done asynchronously and may take several seconds depending on the project size.*
|
|
228
228
|
# @param account_id [String] Account ID
|
|
229
|
-
# @param
|
|
229
|
+
# @param id [String] ID
|
|
230
230
|
# @param [Hash] opts the optional parameters
|
|
231
231
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
232
232
|
# @return [RepoSyncExport]
|
|
233
|
-
def repo_sync_export(account_id,
|
|
234
|
-
data, _status_code, _headers = repo_sync_export_with_http_info(account_id,
|
|
233
|
+
def repo_sync_export(account_id, id, opts = {})
|
|
234
|
+
data, _status_code, _headers = repo_sync_export_with_http_info(account_id, id, opts)
|
|
235
235
|
data
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
# Export to code repository
|
|
239
239
|
# > Beta: this feature will change in the future. Export translations from Phrase Strings to repository provider according to the .phrase.yml file within the code repository. *Export is done asynchronously and may take several seconds depending on the project size.*
|
|
240
240
|
# @param account_id [String] Account ID
|
|
241
|
-
# @param
|
|
241
|
+
# @param id [String] ID
|
|
242
242
|
# @param [Hash] opts the optional parameters
|
|
243
243
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
244
244
|
# @return [Array<(Response<(RepoSyncExport)>, Integer, Hash)>] Response<(RepoSyncExport)> data, response status code and response headers
|
|
245
|
-
def repo_sync_export_with_http_info(account_id,
|
|
245
|
+
def repo_sync_export_with_http_info(account_id, id, opts = {})
|
|
246
246
|
if @api_client.config.debugging
|
|
247
247
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_export ...'
|
|
248
248
|
end
|
|
@@ -250,12 +250,12 @@ module Phrase
|
|
|
250
250
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
251
251
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_export"
|
|
252
252
|
end
|
|
253
|
-
# verify the required parameter '
|
|
254
|
-
if @api_client.config.client_side_validation &&
|
|
255
|
-
fail ArgumentError, "Missing the required parameter '
|
|
253
|
+
# verify the required parameter 'id' is set
|
|
254
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
255
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_export"
|
|
256
256
|
end
|
|
257
257
|
# resource path
|
|
258
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
258
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}/export'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
259
259
|
|
|
260
260
|
# query parameters
|
|
261
261
|
query_params = opts[:query_params] || {}
|
|
@@ -298,23 +298,23 @@ module Phrase
|
|
|
298
298
|
# Import from code repository
|
|
299
299
|
# > Beta: this feature will change in the future. Import translations from repository provider to Phrase Strings according to the .phrase.yml file within the code repository. _Import is done asynchronously and may take several seconds depending on the project size._
|
|
300
300
|
# @param account_id [String] Account ID
|
|
301
|
-
# @param
|
|
301
|
+
# @param id [String] ID
|
|
302
302
|
# @param [Hash] opts the optional parameters
|
|
303
303
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
304
304
|
# @return [RepoSyncImport]
|
|
305
|
-
def repo_sync_import(account_id,
|
|
306
|
-
data, _status_code, _headers = repo_sync_import_with_http_info(account_id,
|
|
305
|
+
def repo_sync_import(account_id, id, opts = {})
|
|
306
|
+
data, _status_code, _headers = repo_sync_import_with_http_info(account_id, id, opts)
|
|
307
307
|
data
|
|
308
308
|
end
|
|
309
309
|
|
|
310
310
|
# Import from code repository
|
|
311
311
|
# > Beta: this feature will change in the future. Import translations from repository provider to Phrase Strings according to the .phrase.yml file within the code repository. _Import is done asynchronously and may take several seconds depending on the project size._
|
|
312
312
|
# @param account_id [String] Account ID
|
|
313
|
-
# @param
|
|
313
|
+
# @param id [String] ID
|
|
314
314
|
# @param [Hash] opts the optional parameters
|
|
315
315
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
316
316
|
# @return [Array<(Response<(RepoSyncImport)>, Integer, Hash)>] Response<(RepoSyncImport)> data, response status code and response headers
|
|
317
|
-
def repo_sync_import_with_http_info(account_id,
|
|
317
|
+
def repo_sync_import_with_http_info(account_id, id, opts = {})
|
|
318
318
|
if @api_client.config.debugging
|
|
319
319
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_import ...'
|
|
320
320
|
end
|
|
@@ -322,12 +322,12 @@ module Phrase
|
|
|
322
322
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
323
323
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_import"
|
|
324
324
|
end
|
|
325
|
-
# verify the required parameter '
|
|
326
|
-
if @api_client.config.client_side_validation &&
|
|
327
|
-
fail ArgumentError, "Missing the required parameter '
|
|
325
|
+
# verify the required parameter 'id' is set
|
|
326
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
327
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_import"
|
|
328
328
|
end
|
|
329
329
|
# resource path
|
|
330
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
330
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}/import'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
331
331
|
|
|
332
332
|
# query parameters
|
|
333
333
|
query_params = opts[:query_params] || {}
|
|
@@ -436,23 +436,23 @@ module Phrase
|
|
|
436
436
|
# Get a single Repo Sync
|
|
437
437
|
# Shows a single Repo Sync setting.
|
|
438
438
|
# @param account_id [String] Account ID
|
|
439
|
-
# @param
|
|
439
|
+
# @param id [String] ID
|
|
440
440
|
# @param [Hash] opts the optional parameters
|
|
441
441
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
442
442
|
# @return [RepoSync]
|
|
443
|
-
def repo_sync_show(account_id,
|
|
444
|
-
data, _status_code, _headers = repo_sync_show_with_http_info(account_id,
|
|
443
|
+
def repo_sync_show(account_id, id, opts = {})
|
|
444
|
+
data, _status_code, _headers = repo_sync_show_with_http_info(account_id, id, opts)
|
|
445
445
|
data
|
|
446
446
|
end
|
|
447
447
|
|
|
448
448
|
# Get a single Repo Sync
|
|
449
449
|
# Shows a single Repo Sync setting.
|
|
450
450
|
# @param account_id [String] Account ID
|
|
451
|
-
# @param
|
|
451
|
+
# @param id [String] ID
|
|
452
452
|
# @param [Hash] opts the optional parameters
|
|
453
453
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
454
454
|
# @return [Array<(Response<(RepoSync)>, Integer, Hash)>] Response<(RepoSync)> data, response status code and response headers
|
|
455
|
-
def repo_sync_show_with_http_info(account_id,
|
|
455
|
+
def repo_sync_show_with_http_info(account_id, id, opts = {})
|
|
456
456
|
if @api_client.config.debugging
|
|
457
457
|
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_show ...'
|
|
458
458
|
end
|
|
@@ -460,12 +460,12 @@ module Phrase
|
|
|
460
460
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
461
461
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_show"
|
|
462
462
|
end
|
|
463
|
-
# verify the required parameter '
|
|
464
|
-
if @api_client.config.client_side_validation &&
|
|
465
|
-
fail ArgumentError, "Missing the required parameter '
|
|
463
|
+
# verify the required parameter 'id' is set
|
|
464
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
465
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_show"
|
|
466
466
|
end
|
|
467
467
|
# resource path
|
|
468
|
-
local_var_path = '/accounts/{account_id}/repo_syncs/{
|
|
468
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
469
469
|
|
|
470
470
|
# query parameters
|
|
471
471
|
query_params = opts[:query_params] || {}
|
|
@@ -54,10 +54,10 @@ module Phrase
|
|
|
54
54
|
def self.openapi_types
|
|
55
55
|
{
|
|
56
56
|
:'keys_count' => :'Integer',
|
|
57
|
-
:'translated_translations_percentage' => :'
|
|
58
|
-
:'unverified_translations_percentage' => :'
|
|
59
|
-
:'reviewed_translations_percentage' => :'
|
|
60
|
-
:'untranslated_keys_percentage' => :'
|
|
57
|
+
:'translated_translations_percentage' => :'Float',
|
|
58
|
+
:'unverified_translations_percentage' => :'Float',
|
|
59
|
+
:'reviewed_translations_percentage' => :'Float',
|
|
60
|
+
:'untranslated_keys_percentage' => :'Float',
|
|
61
61
|
:'completed_translations_count' => :'Integer',
|
|
62
62
|
:'untranslated_keys_count' => :'Integer',
|
|
63
63
|
:'unverified_translations_count' => :'Integer',
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class ReleaseCreateParameters1
|
|
5
|
+
# Cron schedule for the scheduler. Read more about the format of this field at https://en.wikipedia.org/wiki/Cron
|
|
6
|
+
attr_accessor :cron_schedule
|
|
7
|
+
|
|
8
|
+
# Time zone for the scheduler
|
|
9
|
+
attr_accessor :time_zone
|
|
10
|
+
|
|
11
|
+
# List of locale ids that will be included in the release.
|
|
12
|
+
attr_accessor :locale_ids
|
|
13
|
+
|
|
14
|
+
# Only include tagged keys in the release. For a key to be included it must be tagged with all tags provided
|
|
15
|
+
attr_accessor :tags
|
|
16
|
+
|
|
17
|
+
# Branch used for release
|
|
18
|
+
attr_accessor :branch
|
|
19
|
+
|
|
20
|
+
# The created releases will be available only for apps with version greater or equal to this value
|
|
21
|
+
attr_accessor :app_min_version
|
|
22
|
+
|
|
23
|
+
# The created releases will be available only for apps with version less or equal to this value
|
|
24
|
+
attr_accessor :app_max_version
|
|
25
|
+
|
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
27
|
+
def self.attribute_map
|
|
28
|
+
{
|
|
29
|
+
:'cron_schedule' => :'cron_schedule',
|
|
30
|
+
:'time_zone' => :'time_zone',
|
|
31
|
+
:'locale_ids' => :'locale_ids',
|
|
32
|
+
:'tags' => :'tags',
|
|
33
|
+
:'branch' => :'branch',
|
|
34
|
+
:'app_min_version' => :'app_min_version',
|
|
35
|
+
:'app_max_version' => :'app_max_version'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'cron_schedule' => :'String',
|
|
43
|
+
:'time_zone' => :'String',
|
|
44
|
+
:'locale_ids' => :'Array<String>',
|
|
45
|
+
:'tags' => :'Array<String>',
|
|
46
|
+
:'branch' => :'String',
|
|
47
|
+
:'app_min_version' => :'String',
|
|
48
|
+
:'app_max_version' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ReleaseCreateParameters1` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ReleaseCreateParameters1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'cron_schedule')
|
|
74
|
+
self.cron_schedule = attributes[:'cron_schedule']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'time_zone')
|
|
78
|
+
self.time_zone = attributes[:'time_zone']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'locale_ids')
|
|
82
|
+
if (value = attributes[:'locale_ids']).is_a?(Array)
|
|
83
|
+
self.locale_ids = value
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'tags')
|
|
88
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
|
89
|
+
self.tags = value
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'branch')
|
|
94
|
+
self.branch = attributes[:'branch']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'app_min_version')
|
|
98
|
+
self.app_min_version = attributes[:'app_min_version']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'app_max_version')
|
|
102
|
+
self.app_max_version = attributes[:'app_max_version']
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
107
|
+
# @return Array for valid properties with the reasons
|
|
108
|
+
def list_invalid_properties
|
|
109
|
+
invalid_properties = Array.new
|
|
110
|
+
invalid_properties
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Check to see if the all the properties in the model are valid
|
|
114
|
+
# @return true if the model is valid
|
|
115
|
+
def valid?
|
|
116
|
+
true
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Checks equality by comparing each attribute.
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def ==(o)
|
|
122
|
+
return true if self.equal?(o)
|
|
123
|
+
self.class == o.class &&
|
|
124
|
+
cron_schedule == o.cron_schedule &&
|
|
125
|
+
time_zone == o.time_zone &&
|
|
126
|
+
locale_ids == o.locale_ids &&
|
|
127
|
+
tags == o.tags &&
|
|
128
|
+
branch == o.branch &&
|
|
129
|
+
app_min_version == o.app_min_version &&
|
|
130
|
+
app_max_version == o.app_max_version
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# @see the `==` method
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def eql?(o)
|
|
136
|
+
self == o
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Calculates hash code according to all attributes.
|
|
140
|
+
# @return [Integer] Hash code
|
|
141
|
+
def hash
|
|
142
|
+
[cron_schedule, time_zone, locale_ids, tags, branch, app_min_version, app_max_version].hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Builds the object from hash
|
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
147
|
+
# @return [Object] Returns the model itself
|
|
148
|
+
def self.build_from_hash(attributes)
|
|
149
|
+
new.build_from_hash(attributes)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
158
|
+
if type =~ /\AArray<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
162
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
163
|
+
end
|
|
164
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
165
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
166
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
self
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Deserializes the data based on type
|
|
173
|
+
# @param string type Data type
|
|
174
|
+
# @param string value Value to be deserialized
|
|
175
|
+
# @return [Object] Deserialized data
|
|
176
|
+
def _deserialize(type, value)
|
|
177
|
+
case type.to_sym
|
|
178
|
+
when :DateTime
|
|
179
|
+
DateTime.parse(value)
|
|
180
|
+
when :Date
|
|
181
|
+
Date.parse(value)
|
|
182
|
+
when :Time
|
|
183
|
+
Time.parse(value)
|
|
184
|
+
when :String
|
|
185
|
+
value.to_s
|
|
186
|
+
when :Integer
|
|
187
|
+
value.to_i
|
|
188
|
+
when :Float
|
|
189
|
+
value.to_f
|
|
190
|
+
when :Boolean
|
|
191
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
192
|
+
true
|
|
193
|
+
else
|
|
194
|
+
false
|
|
195
|
+
end
|
|
196
|
+
when :Object
|
|
197
|
+
# generic object (usually a Hash), return directly
|
|
198
|
+
value
|
|
199
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
200
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
201
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
202
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
203
|
+
k_type = Regexp.last_match[:k_type]
|
|
204
|
+
v_type = Regexp.last_match[:v_type]
|
|
205
|
+
{}.tap do |hash|
|
|
206
|
+
value.each do |k, v|
|
|
207
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
else # model
|
|
211
|
+
Phrase.const_get(type).build_from_hash(value)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the string representation of the object
|
|
216
|
+
# @return [String] String presentation of the object
|
|
217
|
+
def to_s
|
|
218
|
+
to_hash.to_s
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_body
|
|
224
|
+
to_hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Returns the object in the form of hash
|
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
|
229
|
+
def to_hash
|
|
230
|
+
hash = {}
|
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
232
|
+
value = self.send(attr)
|
|
233
|
+
if value.nil?
|
|
234
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
235
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
hash[param] = _to_hash(value)
|
|
239
|
+
end
|
|
240
|
+
hash
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Outputs non-array value in the form of hash
|
|
244
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
245
|
+
# @param [Object] value Any valid value
|
|
246
|
+
# @return [Hash] Returns the value in the form of hash
|
|
247
|
+
def _to_hash(value)
|
|
248
|
+
if value.is_a?(Array)
|
|
249
|
+
value.compact.map { |v| _to_hash(v) }
|
|
250
|
+
elsif value.is_a?(Hash)
|
|
251
|
+
{}.tap do |hash|
|
|
252
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
253
|
+
end
|
|
254
|
+
elsif value.respond_to? :to_hash
|
|
255
|
+
value.to_hash
|
|
256
|
+
else
|
|
257
|
+
value
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
end
|