phrase 2.8.3 → 2.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +15 -12
  4. data/docs/BitbucketSyncApi.md +2 -2
  5. data/docs/BranchesApi.md +3 -3
  6. data/docs/GitHubSyncApi.md +2 -2
  7. data/docs/GitLabSyncApi.md +2 -2
  8. data/docs/JobCommentsApi.md +6 -6
  9. data/docs/JobLocale.md +3 -1
  10. data/docs/JobLocaleUpdateParameters.md +5 -1
  11. data/docs/JobLocalesCreateParameters.md +6 -2
  12. data/docs/JobTemplateDetails.md +35 -0
  13. data/docs/JobTemplateDetails1.md +21 -0
  14. data/docs/JobTemplateLocaleUpdateParameters.md +6 -2
  15. data/docs/{JobTemplateLocale.md → JobTemplateLocales.md} +6 -4
  16. data/docs/JobTemplateLocalesApi.md +8 -8
  17. data/docs/JobTemplateLocalesCreateParameters.md +5 -1
  18. data/docs/JobTemplatesApi.md +41 -41
  19. data/docs/KeysSearchParameters.md +1 -1
  20. data/docs/LocaleTeamPreview.md +21 -0
  21. data/docs/{JobTemplateUserPreview.md → LocaleUserPreview.md} +2 -2
  22. data/docs/LocalesApi.md +8 -4
  23. data/docs/NotificationGroupDetail.md +1 -1
  24. data/docs/NotificationGroupsApi.md +4 -4
  25. data/docs/NotificationsApi.md +4 -4
  26. data/docs/Project.md +2 -0
  27. data/docs/ProjectCreateParameters.md +5 -1
  28. data/docs/ProjectDetails.md +2 -0
  29. data/docs/ProjectUpdateParameters.md +5 -1
  30. data/docs/SearchApi.md +1 -1
  31. data/docs/TranslationsApi.md +23 -19
  32. data/docs/TranslationsExcludeParameters.md +1 -1
  33. data/docs/TranslationsIncludeParameters.md +1 -1
  34. data/docs/TranslationsReviewParameters.md +1 -1
  35. data/docs/TranslationsSearchParameters.md +1 -1
  36. data/docs/TranslationsUnverifyParameters.md +1 -1
  37. data/docs/TranslationsVerifyParameters.md +1 -1
  38. data/docs/UploadsApi.md +3 -3
  39. data/lib/phrase/api/bitbucket_sync_api.rb +4 -4
  40. data/lib/phrase/api/branches_api.rb +6 -6
  41. data/lib/phrase/api/git_hub_sync_api.rb +4 -4
  42. data/lib/phrase/api/git_lab_sync_api.rb +4 -4
  43. data/lib/phrase/api/job_comments_api.rb +9 -9
  44. data/lib/phrase/api/job_template_locales_api.rb +12 -12
  45. data/lib/phrase/api/job_templates_api.rb +72 -72
  46. data/lib/phrase/api/locales_api.rb +10 -4
  47. data/lib/phrase/api/notification_groups_api.rb +6 -6
  48. data/lib/phrase/api/notifications_api.rb +6 -6
  49. data/lib/phrase/api/search_api.rb +2 -2
  50. data/lib/phrase/api/translations_api.rb +20 -14
  51. data/lib/phrase/api/uploads_api.rb +2 -2
  52. data/lib/phrase/models/job_locale.rb +13 -2
  53. data/lib/phrase/models/job_locale_update_parameters.rb +28 -4
  54. data/lib/phrase/models/job_locales_create_parameters.rb +33 -4
  55. data/lib/phrase/models/job_template_details.rb +285 -0
  56. data/lib/phrase/models/job_template_details1.rb +214 -0
  57. data/lib/phrase/models/job_template_locale_update_parameters.rb +28 -9
  58. data/lib/phrase/models/{job_template_locale.rb → job_template_locales.rb} +18 -7
  59. data/lib/phrase/models/job_template_locales_create_parameters.rb +28 -4
  60. data/lib/phrase/models/keys_search_parameters.rb +1 -1
  61. data/lib/phrase/models/locale_team_preview.rb +212 -0
  62. data/lib/phrase/models/{job_template_user_preview.rb → locale_user_preview.rb} +3 -3
  63. data/lib/phrase/models/notification_group_detail.rb +1 -1
  64. data/lib/phrase/models/project.rb +10 -1
  65. data/lib/phrase/models/project_create_parameters.rb +22 -2
  66. data/lib/phrase/models/project_details.rb +10 -1
  67. data/lib/phrase/models/project_update_parameters.rb +22 -2
  68. data/lib/phrase/models/translations_exclude_parameters.rb +1 -1
  69. data/lib/phrase/models/translations_include_parameters.rb +1 -1
  70. data/lib/phrase/models/translations_review_parameters.rb +1 -1
  71. data/lib/phrase/models/translations_search_parameters.rb +1 -1
  72. data/lib/phrase/models/translations_unverify_parameters.rb +1 -1
  73. data/lib/phrase/models/translations_verify_parameters.rb +1 -1
  74. data/lib/phrase/version.rb +1 -1
  75. data/lib/phrase.rb +5 -2
  76. data/spec/api/bitbucket_sync_api_spec.rb +2 -2
  77. data/spec/api/branches_api_spec.rb +3 -3
  78. data/spec/api/git_hub_sync_api_spec.rb +2 -2
  79. data/spec/api/git_lab_sync_api_spec.rb +2 -2
  80. data/spec/api/job_comments_api_spec.rb +3 -3
  81. data/spec/api/job_template_locales_api_spec.rb +4 -4
  82. data/spec/api/job_templates_api_spec.rb +17 -17
  83. data/spec/api/locales_api_spec.rb +4 -2
  84. data/spec/api/notification_groups_api_spec.rb +2 -2
  85. data/spec/api/notifications_api_spec.rb +2 -2
  86. data/spec/api/search_api_spec.rb +1 -1
  87. data/spec/api/translations_api_spec.rb +9 -7
  88. data/spec/api/uploads_api_spec.rb +1 -1
  89. data/spec/models/job_locale_spec.rb +6 -0
  90. data/spec/models/job_locale_update_parameters_spec.rb +12 -0
  91. data/spec/models/job_locales_create_parameters_spec.rb +12 -0
  92. data/spec/models/job_template_details1_spec.rb +41 -0
  93. data/spec/models/job_template_details_spec.rb +83 -0
  94. data/spec/models/job_template_locale_update_parameters_spec.rb +12 -0
  95. data/spec/models/job_template_locales_create_parameters_spec.rb +12 -0
  96. data/spec/models/{job_template_locale_spec.rb → job_template_locales_spec.rb} +12 -6
  97. data/spec/models/locale_team_preview_spec.rb +41 -0
  98. data/spec/models/{job_template_user_preview_spec.rb → locale_user_preview_spec.rb} +6 -6
  99. data/spec/models/project_create_parameters_spec.rb +12 -0
  100. data/spec/models/project_details_spec.rb +6 -0
  101. data/spec/models/project_spec.rb +6 -0
  102. data/spec/models/project_update_parameters_spec.rb +12 -0
  103. metadata +237 -225
@@ -161,7 +161,7 @@ module Phrase
161
161
  return response, status_code, headers
162
162
  end
163
163
 
164
- # Revoke exclusion of a translation in export
164
+ # Include a translation
165
165
  # Remove exclude from export flag from an existing translation.
166
166
  # @param project_id [String] Project ID
167
167
  # @param id [String] ID
@@ -174,7 +174,7 @@ module Phrase
174
174
  data
175
175
  end
176
176
 
177
- # Revoke exclusion of a translation in export
177
+ # Include a translation
178
178
  # Remove exclude from export flag from an existing translation.
179
179
  # @param project_id [String] Project ID
180
180
  # @param id [String] ID
@@ -737,7 +737,7 @@ module Phrase
737
737
  # @option opts [String] :branch specify the branch to use
738
738
  # @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
739
739
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
740
- # @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
740
+ # @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> <i>Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).</i><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
741
741
  # @return [Array<Translation>]
742
742
  def translations_by_locale(project_id, locale_id, opts = {})
743
743
  data, _status_code, _headers = translations_by_locale_with_http_info(project_id, locale_id, opts)
@@ -755,7 +755,7 @@ module Phrase
755
755
  # @option opts [String] :branch specify the branch to use
756
756
  # @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
757
757
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
758
- # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
758
+ # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; &lt;i&gt;Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).&lt;/i&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
759
759
  # @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
760
760
  def translations_by_locale_with_http_info(project_id, locale_id, opts = {})
761
761
  if @api_client.config.debugging
@@ -816,7 +816,7 @@ module Phrase
816
816
  return response, status_code, headers
817
817
  end
818
818
 
819
- # Set exclude from export flag on translations selected by query
819
+ # Exclude translations by query
820
820
  # Exclude translations matching query from locale export.
821
821
  # @param project_id [String] Project ID
822
822
  # @param translations_exclude_parameters [TranslationsExcludeParameters]
@@ -828,7 +828,7 @@ module Phrase
828
828
  data
829
829
  end
830
830
 
831
- # Set exclude from export flag on translations selected by query
831
+ # Exclude translations by query
832
832
  # Exclude translations matching query from locale export.
833
833
  # @param project_id [String] Project ID
834
834
  # @param translations_exclude_parameters [TranslationsExcludeParameters]
@@ -890,7 +890,7 @@ module Phrase
890
890
  return response, status_code, headers
891
891
  end
892
892
 
893
- # Remove exlude from import flag from translations selected by query
893
+ # Include translations by query
894
894
  # Include translations matching query in locale export.
895
895
  # @param project_id [String] Project ID
896
896
  # @param translations_include_parameters [TranslationsIncludeParameters]
@@ -902,7 +902,7 @@ module Phrase
902
902
  data
903
903
  end
904
904
 
905
- # Remove exlude from import flag from translations selected by query
905
+ # Include translations by query
906
906
  # Include translations matching query in locale export.
907
907
  # @param project_id [String] Project ID
908
908
  # @param translations_include_parameters [TranslationsIncludeParameters]
@@ -969,12 +969,14 @@ module Phrase
969
969
  # @param project_id [String] Project ID
970
970
  # @param [Hash] opts the optional parameters
971
971
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
972
+ # @option opts [String] :if_modified_since Last modified condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional)
973
+ # @option opts [String] :if_none_match ETag condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional)
972
974
  # @option opts [Integer] :page Page number
973
975
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
974
976
  # @option opts [String] :branch specify the branch to use
975
977
  # @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
976
978
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
977
- # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
979
+ # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; &lt;i&gt;Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).&lt;/i&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
978
980
  # @return [Array<Translation>]
979
981
  def translations_list(project_id, opts = {})
980
982
  data, _status_code, _headers = translations_list_with_http_info(project_id, opts)
@@ -986,12 +988,14 @@ module Phrase
986
988
  # @param project_id [String] Project ID
987
989
  # @param [Hash] opts the optional parameters
988
990
  # @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
991
+ # @option opts [String] :if_modified_since Last modified condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional)
992
+ # @option opts [String] :if_none_match ETag condition, see &lt;a href&#x3D;\&quot;#overview--conditional-get-requests--http-caching\&quot;&gt;Conditional GET requests / HTTP Caching&lt;/a&gt; (optional)
989
993
  # @option opts [Integer] :page Page number
990
994
  # @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
991
995
  # @option opts [String] :branch specify the branch to use
992
996
  # @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
993
997
  # @option opts [String] :order Order direction. Can be one of: asc, desc.
994
- # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
998
+ # @option opts [String] :q Specify a query to find translations by content (including wildcards).&lt;br&gt;&lt;br&gt; &lt;i&gt;Note: Search is limited to 10000 results and may not include recently updated data (depending on the project size).&lt;/i&gt;&lt;br&gt; The following qualifiers are supported in the query:&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;code&gt;id:translation_id,...&lt;/code&gt; for queries on a comma-separated list of ids&lt;/li&gt; &lt;li&gt;&lt;code&gt;tags:XYZ&lt;/code&gt; for tags on the translation&lt;/li&gt; &lt;li&gt;&lt;code&gt;unverified:{true|false}&lt;/code&gt; for verification status&lt;/li&gt; &lt;li&gt;&lt;code&gt;excluded:{true|false}&lt;/code&gt; for exclusion status&lt;/li&gt; &lt;li&gt;&lt;code&gt;updated_at:{&gt;&#x3D;|&lt;&#x3D;}2013-02-21T00:00:00Z&lt;/code&gt; for date range queries&lt;/li&gt; &lt;/ul&gt; Find more examples &lt;a href&#x3D;\&quot;#overview--usage-examples\&quot;&gt;here&lt;/a&gt;.
995
999
  # @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
996
1000
  def translations_list_with_http_info(project_id, opts = {})
997
1001
  if @api_client.config.debugging
@@ -1018,6 +1022,8 @@ module Phrase
1018
1022
  # HTTP header 'Accept' (if needed)
1019
1023
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1020
1024
  header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
1025
+ header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?
1026
+ header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?
1021
1027
 
1022
1028
  # form parameters
1023
1029
  form_params = opts[:form_params] || {}
@@ -1202,7 +1208,7 @@ module Phrase
1202
1208
  return response, status_code, headers
1203
1209
  end
1204
1210
 
1205
- # Mark translations selected by query as unverified
1211
+ # Unverify translations by query
1206
1212
  # Mark translations matching query as unverified.
1207
1213
  # @param project_id [String] Project ID
1208
1214
  # @param translations_unverify_parameters [TranslationsUnverifyParameters]
@@ -1214,7 +1220,7 @@ module Phrase
1214
1220
  data
1215
1221
  end
1216
1222
 
1217
- # Mark translations selected by query as unverified
1223
+ # Unverify translations by query
1218
1224
  # Mark translations matching query as unverified.
1219
1225
  # @param project_id [String] Project ID
1220
1226
  # @param translations_unverify_parameters [TranslationsUnverifyParameters]
@@ -1276,7 +1282,7 @@ module Phrase
1276
1282
  return response, status_code, headers
1277
1283
  end
1278
1284
 
1279
- # Verify translations selected by query
1285
+ # Verify translations by query
1280
1286
  # Verify translations matching query.
1281
1287
  # @param project_id [String] Project ID
1282
1288
  # @param translations_verify_parameters [TranslationsVerifyParameters]
@@ -1288,7 +1294,7 @@ module Phrase
1288
1294
  data
1289
1295
  end
1290
1296
 
1291
- # Verify translations selected by query
1297
+ # Verify translations by query
1292
1298
  # Verify translations matching query.
1293
1299
  # @param project_id [String] Project ID
1294
1300
  # @param translations_verify_parameters [TranslationsVerifyParameters]
@@ -120,7 +120,7 @@ module Phrase
120
120
  return response, status_code, headers
121
121
  end
122
122
 
123
- # View upload details
123
+ # Get a single upload
124
124
  # View details and summary for a single upload.
125
125
  # @param project_id [String] Project ID
126
126
  # @param id [String] ID
@@ -133,7 +133,7 @@ module Phrase
133
133
  data
134
134
  end
135
135
 
136
- # View upload details
136
+ # Get a single upload
137
137
  # View details and summary for a single upload.
138
138
  # @param project_id [String] Project ID
139
139
  # @param id [String] ID
@@ -10,6 +10,8 @@ module Phrase
10
10
 
11
11
  attr_accessor :users
12
12
 
13
+ attr_accessor :teams
14
+
13
15
  attr_accessor :completed
14
16
 
15
17
  attr_accessor :translation_completed_at
@@ -23,6 +25,7 @@ module Phrase
23
25
  :'job' => :'job',
24
26
  :'locale' => :'locale',
25
27
  :'users' => :'users',
28
+ :'teams' => :'teams',
26
29
  :'completed' => :'completed',
27
30
  :'translation_completed_at' => :'translation_completed_at',
28
31
  :'review_completed_at' => :'review_completed_at'
@@ -35,7 +38,8 @@ module Phrase
35
38
  :'id' => :'String',
36
39
  :'job' => :'JobPreview',
37
40
  :'locale' => :'LocalePreview',
38
- :'users' => :'Array<UserPreview>',
41
+ :'users' => :'Array<LocaleUserPreview>',
42
+ :'teams' => :'Array<LocaleTeamPreview>',
39
43
  :'completed' => :'Boolean',
40
44
  :'translation_completed_at' => :'DateTime',
41
45
  :'review_completed_at' => :'DateTime'
@@ -81,6 +85,12 @@ module Phrase
81
85
  end
82
86
  end
83
87
 
88
+ if attributes.key?(:'teams')
89
+ if (value = attributes[:'teams']).is_a?(Array)
90
+ self.teams = value
91
+ end
92
+ end
93
+
84
94
  if attributes.key?(:'completed')
85
95
  self.completed = attributes[:'completed']
86
96
  end
@@ -116,6 +126,7 @@ module Phrase
116
126
  job == o.job &&
117
127
  locale == o.locale &&
118
128
  users == o.users &&
129
+ teams == o.teams &&
119
130
  completed == o.completed &&
120
131
  translation_completed_at == o.translation_completed_at &&
121
132
  review_completed_at == o.review_completed_at
@@ -130,7 +141,7 @@ module Phrase
130
141
  # Calculates hash code according to all attributes.
131
142
  # @return [Integer] Hash code
132
143
  def hash
133
- [id, job, locale, users, completed, translation_completed_at, review_completed_at].hash
144
+ [id, job, locale, users, teams, completed, translation_completed_at, review_completed_at].hash
134
145
  end
135
146
 
136
147
  # Builds the object from hash
@@ -14,13 +14,21 @@ module Phrase
14
14
  # Array of reviewer ids to be assigned to the job locale as reviewers
15
15
  attr_accessor :reviewer_ids
16
16
 
17
+ # Array of team ids to be assigned to the job locale as translators
18
+ attr_accessor :translator_team_ids
19
+
20
+ # Array of team ids to be assigned to the job locale as reviewers
21
+ attr_accessor :reviewer_team_ids
22
+
17
23
  # Attribute mapping from ruby-style variable name to JSON key.
18
24
  def self.attribute_map
19
25
  {
20
26
  :'branch' => :'branch',
21
27
  :'locale_id' => :'locale_id',
22
28
  :'user_ids' => :'user_ids',
23
- :'reviewer_ids' => :'reviewer_ids'
29
+ :'reviewer_ids' => :'reviewer_ids',
30
+ :'translator_team_ids' => :'translator_team_ids',
31
+ :'reviewer_team_ids' => :'reviewer_team_ids'
24
32
  }
25
33
  end
26
34
 
@@ -30,7 +38,9 @@ module Phrase
30
38
  :'branch' => :'String',
31
39
  :'locale_id' => :'String',
32
40
  :'user_ids' => :'Array<String>',
33
- :'reviewer_ids' => :'Array<String>'
41
+ :'reviewer_ids' => :'Array<String>',
42
+ :'translator_team_ids' => :'Array<String>',
43
+ :'reviewer_team_ids' => :'Array<String>'
34
44
  }
35
45
  end
36
46
 
@@ -74,6 +84,18 @@ module Phrase
74
84
  self.reviewer_ids = value
75
85
  end
76
86
  end
87
+
88
+ if attributes.key?(:'translator_team_ids')
89
+ if (value = attributes[:'translator_team_ids']).is_a?(Array)
90
+ self.translator_team_ids = value
91
+ end
92
+ end
93
+
94
+ if attributes.key?(:'reviewer_team_ids')
95
+ if (value = attributes[:'reviewer_team_ids']).is_a?(Array)
96
+ self.reviewer_team_ids = value
97
+ end
98
+ end
77
99
  end
78
100
 
79
101
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -97,7 +119,9 @@ module Phrase
97
119
  branch == o.branch &&
98
120
  locale_id == o.locale_id &&
99
121
  user_ids == o.user_ids &&
100
- reviewer_ids == o.reviewer_ids
122
+ reviewer_ids == o.reviewer_ids &&
123
+ translator_team_ids == o.translator_team_ids &&
124
+ reviewer_team_ids == o.reviewer_team_ids
101
125
  end
102
126
 
103
127
  # @see the `==` method
@@ -109,7 +133,7 @@ module Phrase
109
133
  # Calculates hash code according to all attributes.
110
134
  # @return [Integer] Hash code
111
135
  def hash
112
- [branch, locale_id, user_ids, reviewer_ids].hash
136
+ [branch, locale_id, user_ids, reviewer_ids, translator_team_ids, reviewer_team_ids].hash
113
137
  end
114
138
 
115
139
  # Builds the object from hash
@@ -14,13 +14,21 @@ module Phrase
14
14
  # Array of reviewer ids to be assigned to the job locale as reviewers
15
15
  attr_accessor :reviewer_ids
16
16
 
17
+ # Array of team ids to be assigned to the job locale as translators
18
+ attr_accessor :translator_team_ids
19
+
20
+ # Array of team ids to be assigned to the job locale as reviewers
21
+ attr_accessor :reviewer_team_ids
22
+
17
23
  # Attribute mapping from ruby-style variable name to JSON key.
18
24
  def self.attribute_map
19
25
  {
20
26
  :'branch' => :'branch',
21
27
  :'locale_id' => :'locale_id',
22
28
  :'user_ids' => :'user_ids',
23
- :'reviewer_ids' => :'reviewer_ids'
29
+ :'reviewer_ids' => :'reviewer_ids',
30
+ :'translator_team_ids' => :'translator_team_ids',
31
+ :'reviewer_team_ids' => :'reviewer_team_ids'
24
32
  }
25
33
  end
26
34
 
@@ -30,7 +38,9 @@ module Phrase
30
38
  :'branch' => :'String',
31
39
  :'locale_id' => :'String',
32
40
  :'user_ids' => :'Array<String>',
33
- :'reviewer_ids' => :'Array<String>'
41
+ :'reviewer_ids' => :'Array<String>',
42
+ :'translator_team_ids' => :'Array<String>',
43
+ :'reviewer_team_ids' => :'Array<String>'
34
44
  }
35
45
  end
36
46
 
@@ -74,18 +84,35 @@ module Phrase
74
84
  self.reviewer_ids = value
75
85
  end
76
86
  end
87
+
88
+ if attributes.key?(:'translator_team_ids')
89
+ if (value = attributes[:'translator_team_ids']).is_a?(Array)
90
+ self.translator_team_ids = value
91
+ end
92
+ end
93
+
94
+ if attributes.key?(:'reviewer_team_ids')
95
+ if (value = attributes[:'reviewer_team_ids']).is_a?(Array)
96
+ self.reviewer_team_ids = value
97
+ end
98
+ end
77
99
  end
78
100
 
79
101
  # Show invalid properties with the reasons. Usually used together with valid?
80
102
  # @return Array for valid properties with the reasons
81
103
  def list_invalid_properties
82
104
  invalid_properties = Array.new
105
+ if @locale_id.nil?
106
+ invalid_properties.push('invalid value for "locale_id", locale_id cannot be nil.')
107
+ end
108
+
83
109
  invalid_properties
84
110
  end
85
111
 
86
112
  # Check to see if the all the properties in the model are valid
87
113
  # @return true if the model is valid
88
114
  def valid?
115
+ return false if @locale_id.nil?
89
116
  true
90
117
  end
91
118
 
@@ -97,7 +124,9 @@ module Phrase
97
124
  branch == o.branch &&
98
125
  locale_id == o.locale_id &&
99
126
  user_ids == o.user_ids &&
100
- reviewer_ids == o.reviewer_ids
127
+ reviewer_ids == o.reviewer_ids &&
128
+ translator_team_ids == o.translator_team_ids &&
129
+ reviewer_team_ids == o.reviewer_team_ids
101
130
  end
102
131
 
103
132
  # @see the `==` method
@@ -109,7 +138,7 @@ module Phrase
109
138
  # Calculates hash code according to all attributes.
110
139
  # @return [Integer] Hash code
111
140
  def hash
112
- [branch, locale_id, user_ids, reviewer_ids].hash
141
+ [branch, locale_id, user_ids, reviewer_ids, translator_team_ids, reviewer_team_ids].hash
113
142
  end
114
143
 
115
144
  # Builds the object from hash
@@ -0,0 +1,285 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ class JobTemplateDetails
5
+ attr_accessor :id
6
+
7
+ attr_accessor :name
8
+
9
+ attr_accessor :briefing
10
+
11
+ attr_accessor :project
12
+
13
+ attr_accessor :branch
14
+
15
+ attr_accessor :created_at
16
+
17
+ attr_accessor :updated_at
18
+
19
+ attr_accessor :owner
20
+
21
+ attr_accessor :creator
22
+
23
+ attr_accessor :locales
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'id' => :'id',
29
+ :'name' => :'name',
30
+ :'briefing' => :'briefing',
31
+ :'project' => :'project',
32
+ :'branch' => :'branch',
33
+ :'created_at' => :'created_at',
34
+ :'updated_at' => :'updated_at',
35
+ :'owner' => :'owner',
36
+ :'creator' => :'creator',
37
+ :'locales' => :'locales'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'String',
45
+ :'name' => :'String',
46
+ :'briefing' => :'String',
47
+ :'project' => :'ProjectShort',
48
+ :'branch' => :'Branch',
49
+ :'created_at' => :'DateTime',
50
+ :'updated_at' => :'DateTime',
51
+ :'owner' => :'UserPreview',
52
+ :'creator' => :'UserPreview',
53
+ :'locales' => :'Array<LocalePreview>'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # List of class defined in allOf (OpenAPI v3)
64
+ def self.openapi_all_of
65
+ [
66
+ :'JobTemplate',
67
+ :'JobTemplateDetails1'
68
+ ]
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::JobTemplateDetails` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::JobTemplateDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'id')
87
+ self.id = attributes[:'id']
88
+ end
89
+
90
+ if attributes.key?(:'name')
91
+ self.name = attributes[:'name']
92
+ end
93
+
94
+ if attributes.key?(:'briefing')
95
+ self.briefing = attributes[:'briefing']
96
+ end
97
+
98
+ if attributes.key?(:'project')
99
+ self.project = attributes[:'project']
100
+ end
101
+
102
+ if attributes.key?(:'branch')
103
+ self.branch = attributes[:'branch']
104
+ end
105
+
106
+ if attributes.key?(:'created_at')
107
+ self.created_at = attributes[:'created_at']
108
+ end
109
+
110
+ if attributes.key?(:'updated_at')
111
+ self.updated_at = attributes[:'updated_at']
112
+ end
113
+
114
+ if attributes.key?(:'owner')
115
+ self.owner = attributes[:'owner']
116
+ end
117
+
118
+ if attributes.key?(:'creator')
119
+ self.creator = attributes[:'creator']
120
+ end
121
+
122
+ if attributes.key?(:'locales')
123
+ if (value = attributes[:'locales']).is_a?(Array)
124
+ self.locales = value
125
+ end
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ invalid_properties = Array.new
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ id == o.id &&
148
+ name == o.name &&
149
+ briefing == o.briefing &&
150
+ project == o.project &&
151
+ branch == o.branch &&
152
+ created_at == o.created_at &&
153
+ updated_at == o.updated_at &&
154
+ owner == o.owner &&
155
+ creator == o.creator &&
156
+ locales == o.locales
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [id, name, briefing, project, branch, created_at, updated_at, owner, creator, locales].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ new.build_from_hash(attributes)
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.openapi_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :Boolean
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ Phrase.const_get(type).build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+ end
285
+ end