phrase 4.22.0 → 4.24.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.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +8 -6
  4. data/docs/AccountDetails.md +1 -1
  5. data/docs/AuthorizationsApi.md +1 -1
  6. data/docs/Automation.md +6 -0
  7. data/docs/AutomationsApi.md +1 -1
  8. data/docs/AutomationsCreateParameters.md +5 -1
  9. data/docs/AutomationsCreateParameters1.md +5 -1
  10. data/docs/BlacklistedKeysApi.md +1 -1
  11. data/docs/Branch.md +2 -0
  12. data/docs/BranchCreateParameters.md +3 -1
  13. data/docs/BranchMergeParameters.md +1 -1
  14. data/docs/BranchSyncParameters.md +1 -1
  15. data/docs/BranchesApi.md +10 -10
  16. data/docs/CommentsApi.md +7 -7
  17. data/docs/Distribution.md +4 -4
  18. data/docs/{DistributionPreview.md → DistributionDetails.md} +9 -3
  19. data/docs/DistributionsApi.md +9 -9
  20. data/docs/DocumentDelete422Response.md +19 -0
  21. data/docs/{CustomMetadataPropertyCreate422ResponseErrorsInner.md → DocumentDelete422ResponseErrorsInner.md} +2 -2
  22. data/docs/DocumentsApi.md +4 -2
  23. data/docs/FigmaAttachmentsApi.md +1 -1
  24. data/docs/GlossariesApi.md +1 -1
  25. data/docs/Glossary.md +2 -0
  26. data/docs/GlossaryTerm.md +2 -0
  27. data/docs/GlossaryTermGlossary.md +19 -0
  28. data/docs/GlossaryTermTranslationsApi.md +1 -1
  29. data/docs/GlossaryTermsApi.md +1 -1
  30. data/docs/IcuSkeletonParameters.md +3 -1
  31. data/docs/Invitation.md +2 -2
  32. data/docs/InvitationsApi.md +1 -1
  33. data/docs/Job.md +5 -1
  34. data/docs/JobDetails.md +8 -2
  35. data/docs/JobTemplate.md +2 -0
  36. data/docs/JobTemplateDetails.md +2 -0
  37. data/docs/JobTemplatesApi.md +1 -1
  38. data/docs/JobsApi.md +15 -9
  39. data/docs/KeyCreateParameters.md +6 -2
  40. data/docs/KeyUpdateParameters.md +6 -2
  41. data/docs/KeysApi.md +1 -1
  42. data/docs/LocaleDownloadCreateParameters.md +4 -2
  43. data/docs/LocalesApi.md +12 -6
  44. data/docs/MembersApi.md +1 -1
  45. data/docs/NotificationsApi.md +3 -1
  46. data/docs/OrdersApi.md +4 -2
  47. data/docs/OrganizationJobTemplate.md +4 -0
  48. data/docs/OrganizationJobTemplateDetails.md +4 -0
  49. data/docs/OrganizationJobTemplatesApi.md +1 -1
  50. data/docs/ProjectCreateParameters.md +17 -1
  51. data/docs/ProjectDetails.md +7 -1
  52. data/docs/ProjectUpdateParameters.md +17 -3
  53. data/docs/ProjectsApi.md +10 -8
  54. data/docs/Release.md +2 -0
  55. data/docs/ReleasesApi.md +1 -1
  56. data/docs/RepoSync.md +2 -0
  57. data/docs/ScreenshotMarker.md +2 -2
  58. data/docs/ScreenshotMarkerPresentation.md +23 -0
  59. data/docs/ScreenshotMarkersApi.md +1 -1
  60. data/docs/ScreenshotUpdateParameters.md +1 -1
  61. data/docs/ScreenshotsApi.md +1 -1
  62. data/docs/SearchInAccountParameters.md +3 -1
  63. data/docs/StyleGuidesApi.md +1 -1
  64. data/docs/StyleguideCreateParameters.md +3 -3
  65. data/docs/StyleguideUpdateParameters.md +3 -3
  66. data/docs/Tag.md +2 -0
  67. data/docs/TagWithStats.md +2 -0
  68. data/docs/TagsApi.md +5 -3
  69. data/docs/TranslationCreateParameters.md +5 -1
  70. data/docs/TranslationOrder.md +2 -2
  71. data/docs/TranslationUpdateParameters.md +3 -1
  72. data/docs/TranslationsApi.md +4 -0
  73. data/docs/UploadBatch.md +4 -2
  74. data/docs/UploadSummary.md +1 -1
  75. data/docs/UploadsApi.md +3 -1
  76. data/docs/VariablesApi.md +1 -1
  77. data/docs/WebhooksApi.md +7 -6
  78. data/lib/phrase/api/authorizations_api.rb +2 -0
  79. data/lib/phrase/api/automations_api.rb +2 -0
  80. data/lib/phrase/api/blacklisted_keys_api.rb +2 -0
  81. data/lib/phrase/api/branches_api.rb +20 -14
  82. data/lib/phrase/api/comments_api.rb +18 -4
  83. data/lib/phrase/api/distributions_api.rb +14 -12
  84. data/lib/phrase/api/documents_api.rb +5 -0
  85. data/lib/phrase/api/figma_attachments_api.rb +2 -0
  86. data/lib/phrase/api/glossaries_api.rb +2 -0
  87. data/lib/phrase/api/glossary_term_translations_api.rb +2 -0
  88. data/lib/phrase/api/glossary_terms_api.rb +2 -0
  89. data/lib/phrase/api/invitations_api.rb +2 -0
  90. data/lib/phrase/api/job_templates_api.rb +2 -0
  91. data/lib/phrase/api/jobs_api.rb +18 -6
  92. data/lib/phrase/api/keys_api.rb +2 -0
  93. data/lib/phrase/api/locales_api.rb +15 -4
  94. data/lib/phrase/api/members_api.rb +2 -0
  95. data/lib/phrase/api/notifications_api.rb +3 -0
  96. data/lib/phrase/api/orders_api.rb +5 -0
  97. data/lib/phrase/api/organization_job_templates_api.rb +2 -0
  98. data/lib/phrase/api/projects_api.rb +23 -10
  99. data/lib/phrase/api/releases_api.rb +2 -0
  100. data/lib/phrase/api/screenshot_markers_api.rb +2 -0
  101. data/lib/phrase/api/screenshots_api.rb +2 -0
  102. data/lib/phrase/api/style_guides_api.rb +2 -0
  103. data/lib/phrase/api/tags_api.rb +7 -2
  104. data/lib/phrase/api/translations_api.rb +6 -0
  105. data/lib/phrase/api/uploads_api.rb +3 -0
  106. data/lib/phrase/api/variables_api.rb +2 -0
  107. data/lib/phrase/api/webhooks_api.rb +9 -5
  108. data/lib/phrase/models/account_details.rb +1 -0
  109. data/lib/phrase/models/authorization_create_parameters.rb +22 -0
  110. data/lib/phrase/models/authorization_update_parameters.rb +22 -0
  111. data/lib/phrase/models/automation.rb +34 -1
  112. data/lib/phrase/models/automations_create_parameters.rb +24 -4
  113. data/lib/phrase/models/automations_create_parameters1.rb +24 -4
  114. data/lib/phrase/models/branch.rb +46 -1
  115. data/lib/phrase/models/branch_create_parameters.rb +14 -4
  116. data/lib/phrase/models/branch_merge_parameters.rb +35 -1
  117. data/lib/phrase/models/branch_sync_parameters.rb +35 -1
  118. data/lib/phrase/models/distribution.rb +17 -20
  119. data/lib/phrase/models/{distribution_preview.rb → distribution_details.rb} +46 -7
  120. data/lib/phrase/models/{custom_metadata_property_create422_response.rb → document_delete422_response.rb} +4 -4
  121. data/lib/phrase/models/{custom_metadata_property_create422_response_errors_inner.rb → document_delete422_response_errors_inner.rb} +3 -3
  122. data/lib/phrase/models/glossary.rb +12 -1
  123. data/lib/phrase/models/glossary_term.rb +10 -1
  124. data/lib/phrase/models/glossary_term_glossary.rb +206 -0
  125. data/lib/phrase/models/icu_skeleton_parameters.rb +12 -2
  126. data/lib/phrase/models/invitation.rb +9 -8
  127. data/lib/phrase/models/job.rb +26 -4
  128. data/lib/phrase/models/job_details.rb +37 -4
  129. data/lib/phrase/models/job_template.rb +11 -1
  130. data/lib/phrase/models/job_template_details.rb +11 -1
  131. data/lib/phrase/models/key_create_parameters.rb +26 -4
  132. data/lib/phrase/models/key_update_parameters.rb +26 -4
  133. data/lib/phrase/models/locale_download_create_parameters.rb +13 -3
  134. data/lib/phrase/models/organization_job_template.rb +22 -1
  135. data/lib/phrase/models/organization_job_template_details.rb +22 -1
  136. data/lib/phrase/models/project_create_parameters.rb +115 -1
  137. data/lib/phrase/models/project_details.rb +31 -4
  138. data/lib/phrase/models/project_update_parameters.rb +75 -5
  139. data/lib/phrase/models/release.rb +10 -1
  140. data/lib/phrase/models/repo_sync.rb +12 -1
  141. data/lib/phrase/models/screenshot_marker.rb +2 -1
  142. data/lib/phrase/models/screenshot_marker_presentation.rb +224 -0
  143. data/lib/phrase/models/search_in_account_parameters.rb +16 -4
  144. data/lib/phrase/models/styleguide_create_parameters.rb +61 -3
  145. data/lib/phrase/models/styleguide_update_parameters.rb +61 -3
  146. data/lib/phrase/models/tag.rb +11 -1
  147. data/lib/phrase/models/tag_with_stats.rb +11 -1
  148. data/lib/phrase/models/translation_create_parameters.rb +24 -4
  149. data/lib/phrase/models/translation_order.rb +8 -7
  150. data/lib/phrase/models/translation_update_parameters.rb +14 -4
  151. data/lib/phrase/models/upload_batch.rb +24 -14
  152. data/lib/phrase/models/upload_summary.rb +1 -1
  153. data/lib/phrase/version.rb +1 -1
  154. data/lib/phrase.rb +5 -3
  155. data/spec/api/branches_api_spec.rb +7 -7
  156. data/spec/api/comments_api_spec.rb +2 -2
  157. data/spec/api/distributions_api_spec.rb +4 -4
  158. data/spec/api/documents_api_spec.rb +1 -0
  159. data/spec/api/jobs_api_spec.rb +4 -2
  160. data/spec/api/notifications_api_spec.rb +1 -0
  161. data/spec/api/orders_api_spec.rb +1 -0
  162. data/spec/api/projects_api_spec.rb +6 -5
  163. data/spec/api/tags_api_spec.rb +2 -1
  164. data/spec/api/translations_api_spec.rb +2 -0
  165. data/spec/api/webhooks_api_spec.rb +2 -2
  166. data/spec/models/authorization_create_parameters_spec.rb +4 -0
  167. data/spec/models/authorization_update_parameters_spec.rb +4 -0
  168. data/spec/models/automation_spec.rb +18 -0
  169. data/spec/models/automations_create_parameters1_spec.rb +12 -0
  170. data/spec/models/automations_create_parameters_spec.rb +12 -0
  171. data/spec/models/branch_create_parameters_spec.rb +6 -0
  172. data/spec/models/branch_merge_parameters_spec.rb +4 -0
  173. data/spec/models/branch_spec.rb +10 -0
  174. data/spec/models/branch_sync_parameters_spec.rb +4 -0
  175. data/spec/models/{distribution_preview_spec.rb → distribution_details_spec.rb} +24 -6
  176. data/spec/models/distribution_spec.rb +3 -3
  177. data/spec/models/{custom_metadata_property_create422_response_errors_inner_spec.rb → document_delete422_response_errors_inner_spec.rb} +6 -6
  178. data/spec/models/{custom_metadata_property_create422_response_spec.rb → document_delete422_response_spec.rb} +6 -6
  179. data/spec/models/glossary_spec.rb +6 -0
  180. data/spec/models/glossary_term_glossary_spec.rb +35 -0
  181. data/spec/models/glossary_term_spec.rb +6 -0
  182. data/spec/models/icu_skeleton_parameters_spec.rb +6 -0
  183. data/spec/models/invitation_spec.rb +1 -1
  184. data/spec/models/job_details_spec.rb +18 -0
  185. data/spec/models/job_spec.rb +12 -0
  186. data/spec/models/job_template_details_spec.rb +6 -0
  187. data/spec/models/job_template_spec.rb +6 -0
  188. data/spec/models/key_create_parameters_spec.rb +12 -0
  189. data/spec/models/key_update_parameters_spec.rb +12 -0
  190. data/spec/models/locale_download_create_parameters_spec.rb +6 -0
  191. data/spec/models/organization_job_template_details_spec.rb +12 -0
  192. data/spec/models/organization_job_template_spec.rb +12 -0
  193. data/spec/models/project_create_parameters_spec.rb +52 -0
  194. data/spec/models/project_details_spec.rb +18 -0
  195. data/spec/models/project_update_parameters_spec.rb +42 -0
  196. data/spec/models/release_spec.rb +6 -0
  197. data/spec/models/repo_sync_spec.rb +6 -0
  198. data/spec/models/screenshot_marker_presentation_spec.rb +47 -0
  199. data/spec/models/search_in_account_parameters_spec.rb +6 -0
  200. data/spec/models/styleguide_create_parameters_spec.rb +12 -0
  201. data/spec/models/styleguide_update_parameters_spec.rb +12 -0
  202. data/spec/models/tag_spec.rb +6 -0
  203. data/spec/models/tag_with_stats_spec.rb +6 -0
  204. data/spec/models/translation_create_parameters_spec.rb +12 -0
  205. data/spec/models/translation_order_spec.rb +1 -1
  206. data/spec/models/translation_update_parameters_spec.rb +6 -0
  207. data/spec/models/upload_batch_spec.rb +8 -2
  208. metadata +262 -254
  209. data/docs/CustomMetadataPropertyCreate422Response.md +0 -19
@@ -2,7 +2,7 @@ require 'date'
2
2
 
3
3
  module Phrase
4
4
  class ProjectUpdateParameters
5
- # Required if the requesting user is a member of multiple accounts. Account ID to specify the actual account the project should be created in.
5
+ # (Optional) ID of an account the requesting user belongs to. Used only to disambiguate the request context; the project itself cannot be moved between accounts through this endpoint.
6
6
  attr_accessor :account_id
7
7
 
8
8
  # (Optional) Name of the project
@@ -77,6 +77,27 @@ module Phrase
77
77
  # (Optional) List of placeholder styles enabled for the project.
78
78
  attr_accessor :placeholder_styles
79
79
 
80
+ # (Optional) Enable autocomplete-job behavior so that newly created keys and locales are automatically added to in-progress jobs.
81
+ attr_accessor :autocomplete_job_enabled
82
+
83
+ # (Optional) When enabled, translations are locked once a job moves into review.
84
+ attr_accessor :job_locking_enabled
85
+
86
+ # (Optional) Enable Smart Suggest for the project.
87
+ attr_accessor :smart_suggest_enabled
88
+
89
+ # (Optional) Allow Smart Suggest to source suggestions from the project glossary.
90
+ attr_accessor :smart_suggest_use_glossary
91
+
92
+ # (Optional) Allow Smart Suggest to source suggestions from machine translation.
93
+ attr_accessor :smart_suggest_use_machine_translation
94
+
95
+ # (Optional) Collation used when sorting translation keys alphabetically.
96
+ attr_accessor :translation_keys_sort_collation
97
+
98
+ # (Optional) CLDR plural-rule version used by the project.
99
+ attr_accessor :cldr_version
100
+
80
101
  class EnumAttributeValidator
81
102
  attr_reader :datatype
82
103
  attr_reader :allowable_values
@@ -126,7 +147,14 @@ module Phrase
126
147
  :'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory',
127
148
  :'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations',
128
149
  :'default_encoding' => :'default_encoding',
129
- :'placeholder_styles' => :'placeholder_styles'
150
+ :'placeholder_styles' => :'placeholder_styles',
151
+ :'autocomplete_job_enabled' => :'autocomplete_job_enabled',
152
+ :'job_locking_enabled' => :'job_locking_enabled',
153
+ :'smart_suggest_enabled' => :'smart_suggest_enabled',
154
+ :'smart_suggest_use_glossary' => :'smart_suggest_use_glossary',
155
+ :'smart_suggest_use_machine_translation' => :'smart_suggest_use_machine_translation',
156
+ :'translation_keys_sort_collation' => :'translation_keys_sort_collation',
157
+ :'cldr_version' => :'cldr_version'
130
158
  }
131
159
  end
132
160
 
@@ -157,7 +185,14 @@ module Phrase
157
185
  :'autotranslate_use_translation_memory' => :'Boolean',
158
186
  :'autotranslate_overwrite_unverified_translations' => :'Boolean',
159
187
  :'default_encoding' => :'String',
160
- :'placeholder_styles' => :'Array<String>'
188
+ :'placeholder_styles' => :'Array<String>',
189
+ :'autocomplete_job_enabled' => :'Boolean',
190
+ :'job_locking_enabled' => :'Boolean',
191
+ :'smart_suggest_enabled' => :'Boolean',
192
+ :'smart_suggest_use_glossary' => :'Boolean',
193
+ :'smart_suggest_use_machine_translation' => :'Boolean',
194
+ :'translation_keys_sort_collation' => :'String',
195
+ :'cldr_version' => :'String'
161
196
  }
162
197
  end
163
198
 
@@ -283,6 +318,34 @@ module Phrase
283
318
  self.placeholder_styles = value
284
319
  end
285
320
  end
321
+
322
+ if attributes.key?(:'autocomplete_job_enabled')
323
+ self.autocomplete_job_enabled = attributes[:'autocomplete_job_enabled']
324
+ end
325
+
326
+ if attributes.key?(:'job_locking_enabled')
327
+ self.job_locking_enabled = attributes[:'job_locking_enabled']
328
+ end
329
+
330
+ if attributes.key?(:'smart_suggest_enabled')
331
+ self.smart_suggest_enabled = attributes[:'smart_suggest_enabled']
332
+ end
333
+
334
+ if attributes.key?(:'smart_suggest_use_glossary')
335
+ self.smart_suggest_use_glossary = attributes[:'smart_suggest_use_glossary']
336
+ end
337
+
338
+ if attributes.key?(:'smart_suggest_use_machine_translation')
339
+ self.smart_suggest_use_machine_translation = attributes[:'smart_suggest_use_machine_translation']
340
+ end
341
+
342
+ if attributes.key?(:'translation_keys_sort_collation')
343
+ self.translation_keys_sort_collation = attributes[:'translation_keys_sort_collation']
344
+ end
345
+
346
+ if attributes.key?(:'cldr_version')
347
+ self.cldr_version = attributes[:'cldr_version']
348
+ end
286
349
  end
287
350
 
288
351
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -339,7 +402,14 @@ module Phrase
339
402
  autotranslate_use_translation_memory == o.autotranslate_use_translation_memory &&
340
403
  autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations &&
341
404
  default_encoding == o.default_encoding &&
342
- placeholder_styles == o.placeholder_styles
405
+ placeholder_styles == o.placeholder_styles &&
406
+ autocomplete_job_enabled == o.autocomplete_job_enabled &&
407
+ job_locking_enabled == o.job_locking_enabled &&
408
+ smart_suggest_enabled == o.smart_suggest_enabled &&
409
+ smart_suggest_use_glossary == o.smart_suggest_use_glossary &&
410
+ smart_suggest_use_machine_translation == o.smart_suggest_use_machine_translation &&
411
+ translation_keys_sort_collation == o.translation_keys_sort_collation &&
412
+ cldr_version == o.cldr_version
343
413
  end
344
414
 
345
415
  # @see the `==` method
@@ -351,7 +421,7 @@ module Phrase
351
421
  # Calculates hash code according to all attributes.
352
422
  # @return [Integer] Hash code
353
423
  def hash
354
- [account_id, name, point_of_contact, main_format, media, shares_translation_memory, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, default_encoding, placeholder_styles].hash
424
+ [account_id, name, point_of_contact, main_format, media, shares_translation_memory, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, enable_icu_message_format, zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, default_encoding, placeholder_styles, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, cldr_version].hash
355
425
  end
356
426
 
357
427
  # Builds the object from hash
@@ -20,6 +20,8 @@ module Phrase
20
20
 
21
21
  attr_accessor :tags
22
22
 
23
+ attr_accessor :state
24
+
23
25
  attr_accessor :project
24
26
 
25
27
  attr_accessor :created_at
@@ -38,6 +40,7 @@ module Phrase
38
40
  :'environments' => :'environments',
39
41
  :'locales' => :'locales',
40
42
  :'tags' => :'tags',
43
+ :'state' => :'state',
41
44
  :'project' => :'project',
42
45
  :'created_at' => :'created_at',
43
46
  :'updated_at' => :'updated_at'
@@ -56,6 +59,7 @@ module Phrase
56
59
  :'environments' => :'Array<String>',
57
60
  :'locales' => :'Array<LocalePreview>',
58
61
  :'tags' => :'Array<String>',
62
+ :'state' => :'String',
59
63
  :'project' => :'ProjectShort',
60
64
  :'created_at' => :'DateTime',
61
65
  :'updated_at' => :'DateTime'
@@ -127,6 +131,10 @@ module Phrase
127
131
  end
128
132
  end
129
133
 
134
+ if attributes.key?(:'state')
135
+ self.state = attributes[:'state']
136
+ end
137
+
130
138
  if attributes.key?(:'project')
131
139
  self.project = attributes[:'project']
132
140
  end
@@ -167,6 +175,7 @@ module Phrase
167
175
  environments == o.environments &&
168
176
  locales == o.locales &&
169
177
  tags == o.tags &&
178
+ state == o.state &&
170
179
  project == o.project &&
171
180
  created_at == o.created_at &&
172
181
  updated_at == o.updated_at
@@ -181,7 +190,7 @@ module Phrase
181
190
  # Calculates hash code according to all attributes.
182
191
  # @return [Integer] Hash code
183
192
  def hash
184
- [id, version, app_min_version, app_max_version, description, platforms, environments, locales, tags, project, created_at, updated_at].hash
193
+ [id, version, app_min_version, app_max_version, description, platforms, environments, locales, tags, state, project, created_at, updated_at].hash
185
194
  end
186
195
 
187
196
  # Builds the object from hash
@@ -14,6 +14,9 @@ module Phrase
14
14
 
15
15
  attr_accessor :repo_name
16
16
 
17
+ # Branch used as the source of exports/PRs. May be `null` when the sync is configured to push directly to `base_branch`.
18
+ attr_accessor :pr_branch
19
+
17
20
  attr_accessor :created_at
18
21
 
19
22
  attr_accessor :last_import_at
@@ -29,6 +32,7 @@ module Phrase
29
32
  :'enabled' => :'enabled',
30
33
  :'auto_import' => :'auto_import',
31
34
  :'repo_name' => :'repo_name',
35
+ :'pr_branch' => :'pr_branch',
32
36
  :'created_at' => :'created_at',
33
37
  :'last_import_at' => :'last_import_at',
34
38
  :'last_export_at' => :'last_export_at'
@@ -44,6 +48,7 @@ module Phrase
44
48
  :'enabled' => :'Boolean',
45
49
  :'auto_import' => :'Boolean',
46
50
  :'repo_name' => :'String',
51
+ :'pr_branch' => :'String',
47
52
  :'created_at' => :'DateTime',
48
53
  :'last_import_at' => :'DateTime',
49
54
  :'last_export_at' => :'DateTime'
@@ -53,6 +58,7 @@ module Phrase
53
58
  # List of attributes with nullable: true
54
59
  def self.openapi_nullable
55
60
  Set.new([
61
+ :'pr_branch',
56
62
  ])
57
63
  end
58
64
 
@@ -95,6 +101,10 @@ module Phrase
95
101
  self.repo_name = attributes[:'repo_name']
96
102
  end
97
103
 
104
+ if attributes.key?(:'pr_branch')
105
+ self.pr_branch = attributes[:'pr_branch']
106
+ end
107
+
98
108
  if attributes.key?(:'created_at')
99
109
  self.created_at = attributes[:'created_at']
100
110
  end
@@ -132,6 +142,7 @@ module Phrase
132
142
  enabled == o.enabled &&
133
143
  auto_import == o.auto_import &&
134
144
  repo_name == o.repo_name &&
145
+ pr_branch == o.pr_branch &&
135
146
  created_at == o.created_at &&
136
147
  last_import_at == o.last_import_at &&
137
148
  last_export_at == o.last_export_at
@@ -146,7 +157,7 @@ module Phrase
146
157
  # Calculates hash code according to all attributes.
147
158
  # @return [Integer] Hash code
148
159
  def hash
149
- [id, project, provider, enabled, auto_import, repo_name, created_at, last_import_at, last_export_at].hash
160
+ [id, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at].hash
150
161
  end
151
162
 
152
163
  # Builds the object from hash
@@ -6,6 +6,7 @@ module Phrase
6
6
 
7
7
  attr_accessor :presentation
8
8
 
9
+ # Marker presentation style. The default value is `default`.
9
10
  attr_accessor :presentation_type
10
11
 
11
12
  attr_accessor :created_at
@@ -30,7 +31,7 @@ module Phrase
30
31
  def self.openapi_types
31
32
  {
32
33
  :'id' => :'String',
33
- :'presentation' => :'String',
34
+ :'presentation' => :'ScreenshotMarkerPresentation',
34
35
  :'presentation_type' => :'String',
35
36
  :'created_at' => :'DateTime',
36
37
  :'updated_at' => :'DateTime',
@@ -0,0 +1,224 @@
1
+ require 'date'
2
+
3
+ module Phrase
4
+ # Coordinates and size of the marker on the screenshot, in pixels.
5
+ class ScreenshotMarkerPresentation
6
+ attr_accessor :x
7
+
8
+ attr_accessor :y
9
+
10
+ attr_accessor :w
11
+
12
+ attr_accessor :h
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ :'x' => :'x',
18
+ :'y' => :'y',
19
+ :'w' => :'w',
20
+ :'h' => :'h'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'x' => :'Integer',
28
+ :'y' => :'Integer',
29
+ :'w' => :'Integer',
30
+ :'h' => :'Integer'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ScreenshotMarkerPresentation` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ScreenshotMarkerPresentation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'x')
56
+ self.x = attributes[:'x']
57
+ end
58
+
59
+ if attributes.key?(:'y')
60
+ self.y = attributes[:'y']
61
+ end
62
+
63
+ if attributes.key?(:'w')
64
+ self.w = attributes[:'w']
65
+ end
66
+
67
+ if attributes.key?(:'h')
68
+ self.h = attributes[:'h']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ true
83
+ end
84
+
85
+ # Checks equality by comparing each attribute.
86
+ # @param [Object] Object to be compared
87
+ def ==(o)
88
+ return true if self.equal?(o)
89
+ self.class == o.class &&
90
+ x == o.x &&
91
+ y == o.y &&
92
+ w == o.w &&
93
+ h == o.h
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [x, y, w, h].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :DateTime
142
+ DateTime.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :Time
146
+ Time.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ Phrase.const_get(type).build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
@@ -14,13 +14,17 @@ module Phrase
14
14
  # Number of results per page
15
15
  attr_accessor :per_page
16
16
 
17
+ # Limit the search to the given project codes. When omitted, the search spans every project the user can access in this account.
18
+ attr_accessor :project_ids
19
+
17
20
  # Attribute mapping from ruby-style variable name to JSON key.
18
21
  def self.attribute_map
19
22
  {
20
23
  :'query' => :'query',
21
24
  :'locale_code' => :'locale_code',
22
25
  :'page' => :'page',
23
- :'per_page' => :'per_page'
26
+ :'per_page' => :'per_page',
27
+ :'project_ids' => :'project_ids'
24
28
  }
25
29
  end
26
30
 
@@ -30,7 +34,8 @@ module Phrase
30
34
  :'query' => :'String',
31
35
  :'locale_code' => :'String',
32
36
  :'page' => :'Integer',
33
- :'per_page' => :'Integer'
37
+ :'per_page' => :'Integer',
38
+ :'project_ids' => :'Array<String>'
34
39
  }
35
40
  end
36
41
 
@@ -70,6 +75,12 @@ module Phrase
70
75
  if attributes.key?(:'per_page')
71
76
  self.per_page = attributes[:'per_page']
72
77
  end
78
+
79
+ if attributes.key?(:'project_ids')
80
+ if (value = attributes[:'project_ids']).is_a?(Array)
81
+ self.project_ids = value
82
+ end
83
+ end
73
84
  end
74
85
 
75
86
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -93,7 +104,8 @@ module Phrase
93
104
  query == o.query &&
94
105
  locale_code == o.locale_code &&
95
106
  page == o.page &&
96
- per_page == o.per_page
107
+ per_page == o.per_page &&
108
+ project_ids == o.project_ids
97
109
  end
98
110
 
99
111
  # @see the `==` method
@@ -105,7 +117,7 @@ module Phrase
105
117
  # Calculates hash code according to all attributes.
106
118
  # @return [Integer] Hash code
107
119
  def hash
108
- [query, locale_code, page, per_page].hash
120
+ [query, locale_code, page, per_page, project_ids].hash
109
121
  end
110
122
 
111
123
  # Builds the object from hash
@@ -8,13 +8,13 @@ module Phrase
8
8
  # Audience description
9
9
  attr_accessor :audience
10
10
 
11
- # Can be one of: not_specified, children, teenager, young_adults, adults, old_adults.
11
+ # Target audience for the translations.
12
12
  attr_accessor :target_audience
13
13
 
14
- # Can be one of: not_specified, first_person_singular, second_person_singular, third_person_singular_masculine, third_person_singular_feminine, third_person_singular_neuter, first_person_plural, second_person_plural, third_person_plural.
14
+ # Preferred grammatical person.
15
15
  attr_accessor :grammatical_person
16
16
 
17
- # Can be one of: not_specified, popular, technical, fictional.
17
+ # Vocabulary register the translations should use.
18
18
  attr_accessor :vocabulary_type
19
19
 
20
20
  # Description of the business
@@ -41,6 +41,28 @@ module Phrase
41
41
  # Provide links to sample product pages, FAQ pages, etc. to give the translator a point of reference. You can also provide past translations. Even snippets or short paragraphs are helpful for maintaining consistency.
42
42
  attr_accessor :samples
43
43
 
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
44
66
  # Attribute mapping from ruby-style variable name to JSON key.
45
67
  def self.attribute_map
46
68
  {
@@ -168,9 +190,45 @@ module Phrase
168
190
  # @return true if the model is valid
169
191
  def valid?
170
192
  return false if @title.nil?
193
+ target_audience_validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
194
+ return false unless target_audience_validator.valid?(@target_audience)
195
+ grammatical_person_validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
196
+ return false unless grammatical_person_validator.valid?(@grammatical_person)
197
+ vocabulary_type_validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
198
+ return false unless vocabulary_type_validator.valid?(@vocabulary_type)
171
199
  true
172
200
  end
173
201
 
202
+ # Custom attribute writer method checking allowed values (enum).
203
+ # @param [Object] target_audience Object to be assigned
204
+ def target_audience=(target_audience)
205
+ validator = EnumAttributeValidator.new('String', ["not_specified", "children", "teenager", "young_adults", "adults", "old_adults"])
206
+ unless validator.valid?(target_audience)
207
+ fail ArgumentError, "invalid value for \"target_audience\", must be one of #{validator.allowable_values}."
208
+ end
209
+ @target_audience = target_audience
210
+ end
211
+
212
+ # Custom attribute writer method checking allowed values (enum).
213
+ # @param [Object] grammatical_person Object to be assigned
214
+ def grammatical_person=(grammatical_person)
215
+ validator = EnumAttributeValidator.new('String', ["not_specified", "first_person_singular", "second_person_singular", "third_person_singular_masculine", "third_person_singular_feminine", "third_person_singular_neuter", "first_person_plural", "second_person_plural", "third_person_plural"])
216
+ unless validator.valid?(grammatical_person)
217
+ fail ArgumentError, "invalid value for \"grammatical_person\", must be one of #{validator.allowable_values}."
218
+ end
219
+ @grammatical_person = grammatical_person
220
+ end
221
+
222
+ # Custom attribute writer method checking allowed values (enum).
223
+ # @param [Object] vocabulary_type Object to be assigned
224
+ def vocabulary_type=(vocabulary_type)
225
+ validator = EnumAttributeValidator.new('String', ["not_specified", "popular", "technical", "fictional"])
226
+ unless validator.valid?(vocabulary_type)
227
+ fail ArgumentError, "invalid value for \"vocabulary_type\", must be one of #{validator.allowable_values}."
228
+ end
229
+ @vocabulary_type = vocabulary_type
230
+ end
231
+
174
232
  # Checks equality by comparing each attribute.
175
233
  # @param [Object] Object to be compared
176
234
  def ==(o)