weblate 0.1.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 (311) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/COPYING +674 -0
  4. data/Gemfile +8 -0
  5. data/README.md +334 -0
  6. data/Rakefile +49 -0
  7. data/bin/console +11 -0
  8. data/bin/setup +8 -0
  9. data/bin/smoketest +14 -0
  10. data/bin/smoketest~ +0 -0
  11. data/docs/ActionEnum.md +15 -0
  12. data/docs/Addon.md +28 -0
  13. data/docs/AddonsApi.md +366 -0
  14. data/docs/AutoComponentList.md +20 -0
  15. data/docs/BasicUser.md +22 -0
  16. data/docs/BlankEnum.md +15 -0
  17. data/docs/CategoriesApi.md +520 -0
  18. data/docs/Category.md +30 -0
  19. data/docs/Change.md +42 -0
  20. data/docs/ChangesApi.md +163 -0
  21. data/docs/ColorEnum.md +15 -0
  22. data/docs/Component.md +146 -0
  23. data/docs/ComponentLanguageCodeStyle.md +49 -0
  24. data/docs/ComponentList.md +30 -0
  25. data/docs/ComponentListsApi.md +667 -0
  26. data/docs/ComponentsApi.md +1653 -0
  27. data/docs/ConflictsEnum.md +15 -0
  28. data/docs/DirectionEnum.md +15 -0
  29. data/docs/FileFormatEnum.md +15 -0
  30. data/docs/FrequencyEnum.md +15 -0
  31. data/docs/FuzzyEnum.md +15 -0
  32. data/docs/Group.md +40 -0
  33. data/docs/GroupsApi.md +1257 -0
  34. data/docs/Language.md +36 -0
  35. data/docs/LanguageCodeStyleEnum.md +15 -0
  36. data/docs/LanguagePlural.md +26 -0
  37. data/docs/LanguageSelectionEnum.md +15 -0
  38. data/docs/LanguagesApi.md +520 -0
  39. data/docs/LicenseEnum.md +15 -0
  40. data/docs/LockRequest.md +18 -0
  41. data/docs/Memory.md +34 -0
  42. data/docs/MemoryApi.md +448 -0
  43. data/docs/MergeStyleEnum.md +15 -0
  44. data/docs/MethodEnum.md +15 -0
  45. data/docs/Metrics.md +42 -0
  46. data/docs/MetricsApi.md +81 -0
  47. data/docs/NewLangEnum.md +15 -0
  48. data/docs/Notification.md +28 -0
  49. data/docs/NotificationEnum.md +15 -0
  50. data/docs/OperationEnum.md +15 -0
  51. data/docs/PaginatedAddonList.md +24 -0
  52. data/docs/PaginatedBasicUserList.md +24 -0
  53. data/docs/PaginatedCategoryList.md +24 -0
  54. data/docs/PaginatedChangeList.md +24 -0
  55. data/docs/PaginatedComponentList.md +24 -0
  56. data/docs/PaginatedComponentListList.md +24 -0
  57. data/docs/PaginatedGroupList.md +24 -0
  58. data/docs/PaginatedLanguageList.md +24 -0
  59. data/docs/PaginatedMemoryList.md +24 -0
  60. data/docs/PaginatedNotificationList.md +24 -0
  61. data/docs/PaginatedProjectList.md +24 -0
  62. data/docs/PaginatedRoleList.md +24 -0
  63. data/docs/PaginatedScreenshotList.md +24 -0
  64. data/docs/PaginatedTranslationList.md +24 -0
  65. data/docs/PaginatedUnitList.md +24 -0
  66. data/docs/PatchedAddon.md +28 -0
  67. data/docs/PatchedBasicUser.md +22 -0
  68. data/docs/PatchedCategory.md +30 -0
  69. data/docs/PatchedComponent.md +146 -0
  70. data/docs/PatchedComponentList.md +30 -0
  71. data/docs/PatchedGroup.md +40 -0
  72. data/docs/PatchedLanguage.md +36 -0
  73. data/docs/PatchedMemory.md +34 -0
  74. data/docs/PatchedNotification.md +28 -0
  75. data/docs/PatchedProject.md +58 -0
  76. data/docs/PatchedRole.md +24 -0
  77. data/docs/PatchedScreenshot.md +30 -0
  78. data/docs/PatchedUnitWrite.md +26 -0
  79. data/docs/PriorityEnum.md +15 -0
  80. data/docs/Project.md +58 -0
  81. data/docs/ProjectSelectionEnum.md +15 -0
  82. data/docs/ProjectsApi.md +1392 -0
  83. data/docs/RepoRequest.md +18 -0
  84. data/docs/Role.md +24 -0
  85. data/docs/RolesApi.md +448 -0
  86. data/docs/ScopeEnum.md +15 -0
  87. data/docs/Screenshot.md +30 -0
  88. data/docs/ScreenshotFile.md +18 -0
  89. data/docs/ScreenshotsApi.md +815 -0
  90. data/docs/SearchApi.md +75 -0
  91. data/docs/SourceEnum.md +15 -0
  92. data/docs/StateEnum.md +15 -0
  93. data/docs/TasksApi.md +145 -0
  94. data/docs/TextDirection.md +49 -0
  95. data/docs/Translation.md +80 -0
  96. data/docs/TranslationsApi.md +1028 -0
  97. data/docs/Unit.md +76 -0
  98. data/docs/UnitFlatLabels.md +24 -0
  99. data/docs/UnitLabels.md +24 -0
  100. data/docs/UnitWrite.md +26 -0
  101. data/docs/UnitsApi.md +376 -0
  102. data/docs/UploadRequest.md +28 -0
  103. data/docs/UploadRequestConflicts.md +49 -0
  104. data/docs/UploadRequestFuzzy.md +49 -0
  105. data/docs/UsersApi.md +1130 -0
  106. data/docs/VcsEnum.md +15 -0
  107. data/git_push.sh +57 -0
  108. data/lib/weblate/api/addons_api.rb +353 -0
  109. data/lib/weblate/api/categories_api.rb +495 -0
  110. data/lib/weblate/api/changes_api.rb +165 -0
  111. data/lib/weblate/api/component_lists_api.rb +642 -0
  112. data/lib/weblate/api/components_api.rb +1775 -0
  113. data/lib/weblate/api/groups_api.rb +1261 -0
  114. data/lib/weblate/api/languages_api.rb +495 -0
  115. data/lib/weblate/api/memory_api.rb +429 -0
  116. data/lib/weblate/api/metrics_api.rb +84 -0
  117. data/lib/weblate/api/projects_api.rb +1331 -0
  118. data/lib/weblate/api/roles_api.rb +429 -0
  119. data/lib/weblate/api/screenshots_api.rb +803 -0
  120. data/lib/weblate/api/search_api.rb +75 -0
  121. data/lib/weblate/api/tasks_api.rb +146 -0
  122. data/lib/weblate/api/translations_api.rb +1232 -0
  123. data/lib/weblate/api/units_api.rb +363 -0
  124. data/lib/weblate/api/users_api.rb +1104 -0
  125. data/lib/weblate/api_client.rb +437 -0
  126. data/lib/weblate/api_error.rb +58 -0
  127. data/lib/weblate/configuration.rb +392 -0
  128. data/lib/weblate/models/action_enum.rb +108 -0
  129. data/lib/weblate/models/addon.rb +314 -0
  130. data/lib/weblate/models/auto_component_list.rb +263 -0
  131. data/lib/weblate/models/basic_user.rb +292 -0
  132. data/lib/weblate/models/blank_enum.rb +39 -0
  133. data/lib/weblate/models/category.rb +361 -0
  134. data/lib/weblate/models/change.rb +408 -0
  135. data/lib/weblate/models/color_enum.rb +54 -0
  136. data/lib/weblate/models/component.rb +1377 -0
  137. data/lib/weblate/models/component_language_code_style.rb +106 -0
  138. data/lib/weblate/models/component_list.rb +366 -0
  139. data/lib/weblate/models/conflicts_enum.rb +41 -0
  140. data/lib/weblate/models/direction_enum.rb +40 -0
  141. data/lib/weblate/models/file_format_enum.rb +101 -0
  142. data/lib/weblate/models/frequency_enum.rb +43 -0
  143. data/lib/weblate/models/fuzzy_enum.rb +40 -0
  144. data/lib/weblate/models/group.rb +421 -0
  145. data/lib/weblate/models/language.rb +417 -0
  146. data/lib/weblate/models/language_code_style_enum.rb +51 -0
  147. data/lib/weblate/models/language_plural.rb +314 -0
  148. data/lib/weblate/models/language_selection_enum.rb +40 -0
  149. data/lib/weblate/models/license_enum.rb +677 -0
  150. data/lib/weblate/models/lock_request.rb +221 -0
  151. data/lib/weblate/models/memory.rb +329 -0
  152. data/lib/weblate/models/merge_style_enum.rb +41 -0
  153. data/lib/weblate/models/method_enum.rb +45 -0
  154. data/lib/weblate/models/metrics.rb +415 -0
  155. data/lib/weblate/models/new_lang_enum.rb +42 -0
  156. data/lib/weblate/models/notification.rb +323 -0
  157. data/lib/weblate/models/notification_enum.rb +60 -0
  158. data/lib/weblate/models/operation_enum.rb +43 -0
  159. data/lib/weblate/models/paginated_addon_list.rb +259 -0
  160. data/lib/weblate/models/paginated_basic_user_list.rb +259 -0
  161. data/lib/weblate/models/paginated_category_list.rb +259 -0
  162. data/lib/weblate/models/paginated_change_list.rb +259 -0
  163. data/lib/weblate/models/paginated_component_list.rb +259 -0
  164. data/lib/weblate/models/paginated_component_list_list.rb +259 -0
  165. data/lib/weblate/models/paginated_group_list.rb +259 -0
  166. data/lib/weblate/models/paginated_language_list.rb +259 -0
  167. data/lib/weblate/models/paginated_memory_list.rb +259 -0
  168. data/lib/weblate/models/paginated_notification_list.rb +259 -0
  169. data/lib/weblate/models/paginated_project_list.rb +259 -0
  170. data/lib/weblate/models/paginated_role_list.rb +259 -0
  171. data/lib/weblate/models/paginated_screenshot_list.rb +259 -0
  172. data/lib/weblate/models/paginated_translation_list.rb +259 -0
  173. data/lib/weblate/models/paginated_unit_list.rb +259 -0
  174. data/lib/weblate/models/patched_addon.rb +279 -0
  175. data/lib/weblate/models/patched_basic_user.rb +271 -0
  176. data/lib/weblate/models/patched_category.rb +319 -0
  177. data/lib/weblate/models/patched_component.rb +1242 -0
  178. data/lib/weblate/models/patched_component_list.rb +324 -0
  179. data/lib/weblate/models/patched_group.rb +365 -0
  180. data/lib/weblate/models/patched_language.rb +375 -0
  181. data/lib/weblate/models/patched_memory.rb +287 -0
  182. data/lib/weblate/models/patched_notification.rb +281 -0
  183. data/lib/weblate/models/patched_project.rb +472 -0
  184. data/lib/weblate/models/patched_role.rb +262 -0
  185. data/lib/weblate/models/patched_screenshot.rb +309 -0
  186. data/lib/weblate/models/patched_unit_write.rb +279 -0
  187. data/lib/weblate/models/priority_enum.rb +43 -0
  188. data/lib/weblate/models/project.rb +563 -0
  189. data/lib/weblate/models/project_selection_enum.rb +43 -0
  190. data/lib/weblate/models/repo_request.rb +243 -0
  191. data/lib/weblate/models/role.rb +290 -0
  192. data/lib/weblate/models/scope_enum.rb +43 -0
  193. data/lib/weblate/models/screenshot.rb +351 -0
  194. data/lib/weblate/models/screenshot_file.rb +221 -0
  195. data/lib/weblate/models/source_enum.rb +45 -0
  196. data/lib/weblate/models/state_enum.rb +43 -0
  197. data/lib/weblate/models/text_direction.rb +105 -0
  198. data/lib/weblate/models/translation.rb +760 -0
  199. data/lib/weblate/models/unit.rb +757 -0
  200. data/lib/weblate/models/unit_flat_labels.rb +315 -0
  201. data/lib/weblate/models/unit_labels.rb +315 -0
  202. data/lib/weblate/models/unit_write.rb +293 -0
  203. data/lib/weblate/models/upload_request.rb +307 -0
  204. data/lib/weblate/models/upload_request_conflicts.rb +105 -0
  205. data/lib/weblate/models/upload_request_fuzzy.rb +105 -0
  206. data/lib/weblate/models/vcs_enum.rb +46 -0
  207. data/lib/weblate/version.rb +15 -0
  208. data/lib/weblate.rb +135 -0
  209. data/manifest.scm +6 -0
  210. data/schema.patched.yaml +10113 -0
  211. data/schema.yaml +10116 -0
  212. data/sig/weblate.rbs +4 -0
  213. data/spec/api/addons_api_spec.rb +88 -0
  214. data/spec/api/categories_api_spec.rb +115 -0
  215. data/spec/api/changes_api_spec.rb +62 -0
  216. data/spec/api/component_lists_api_spec.rb +139 -0
  217. data/spec/api/components_api_spec.rb +307 -0
  218. data/spec/api/groups_api_spec.rb +236 -0
  219. data/spec/api/languages_api_spec.rb +115 -0
  220. data/spec/api/memory_api_spec.rb +104 -0
  221. data/spec/api/metrics_api_spec.rb +46 -0
  222. data/spec/api/projects_api_spec.rb +251 -0
  223. data/spec/api/roles_api_spec.rb +104 -0
  224. data/spec/api/screenshots_api_spec.rb +163 -0
  225. data/spec/api/search_api_spec.rb +45 -0
  226. data/spec/api/tasks_api_spec.rb +55 -0
  227. data/spec/api/translations_api_spec.rb +218 -0
  228. data/spec/api/units_api_spec.rb +93 -0
  229. data/spec/api/users_api_spec.rb +218 -0
  230. data/spec/models/action_enum_spec.rb +30 -0
  231. data/spec/models/addon_spec.rb +66 -0
  232. data/spec/models/auto_component_list_spec.rb +42 -0
  233. data/spec/models/basic_user_spec.rb +48 -0
  234. data/spec/models/blank_enum_spec.rb +30 -0
  235. data/spec/models/category_spec.rb +72 -0
  236. data/spec/models/change_spec.rb +108 -0
  237. data/spec/models/color_enum_spec.rb +30 -0
  238. data/spec/models/component_language_code_style_spec.rb +32 -0
  239. data/spec/models/component_list_spec.rb +72 -0
  240. data/spec/models/component_spec.rb +420 -0
  241. data/spec/models/conflicts_enum_spec.rb +30 -0
  242. data/spec/models/direction_enum_spec.rb +30 -0
  243. data/spec/models/file_format_enum_spec.rb +30 -0
  244. data/spec/models/frequency_enum_spec.rb +30 -0
  245. data/spec/models/fuzzy_enum_spec.rb +30 -0
  246. data/spec/models/group_spec.rb +102 -0
  247. data/spec/models/language_code_style_enum_spec.rb +30 -0
  248. data/spec/models/language_plural_spec.rb +60 -0
  249. data/spec/models/language_selection_enum_spec.rb +30 -0
  250. data/spec/models/language_spec.rb +90 -0
  251. data/spec/models/license_enum_spec.rb +30 -0
  252. data/spec/models/lock_request_spec.rb +36 -0
  253. data/spec/models/memory_spec.rb +84 -0
  254. data/spec/models/merge_style_enum_spec.rb +30 -0
  255. data/spec/models/method_enum_spec.rb +30 -0
  256. data/spec/models/metrics_spec.rb +108 -0
  257. data/spec/models/new_lang_enum_spec.rb +30 -0
  258. data/spec/models/notification_enum_spec.rb +30 -0
  259. data/spec/models/notification_spec.rb +66 -0
  260. data/spec/models/operation_enum_spec.rb +30 -0
  261. data/spec/models/paginated_addon_list_spec.rb +54 -0
  262. data/spec/models/paginated_basic_user_list_spec.rb +54 -0
  263. data/spec/models/paginated_category_list_spec.rb +54 -0
  264. data/spec/models/paginated_change_list_spec.rb +54 -0
  265. data/spec/models/paginated_component_list_list_spec.rb +54 -0
  266. data/spec/models/paginated_component_list_spec.rb +54 -0
  267. data/spec/models/paginated_group_list_spec.rb +54 -0
  268. data/spec/models/paginated_language_list_spec.rb +54 -0
  269. data/spec/models/paginated_memory_list_spec.rb +54 -0
  270. data/spec/models/paginated_notification_list_spec.rb +54 -0
  271. data/spec/models/paginated_project_list_spec.rb +54 -0
  272. data/spec/models/paginated_role_list_spec.rb +54 -0
  273. data/spec/models/paginated_screenshot_list_spec.rb +54 -0
  274. data/spec/models/paginated_translation_list_spec.rb +54 -0
  275. data/spec/models/paginated_unit_list_spec.rb +54 -0
  276. data/spec/models/patched_addon_spec.rb +66 -0
  277. data/spec/models/patched_basic_user_spec.rb +48 -0
  278. data/spec/models/patched_category_spec.rb +72 -0
  279. data/spec/models/patched_component_list_spec.rb +72 -0
  280. data/spec/models/patched_component_spec.rb +420 -0
  281. data/spec/models/patched_group_spec.rb +102 -0
  282. data/spec/models/patched_language_spec.rb +90 -0
  283. data/spec/models/patched_memory_spec.rb +84 -0
  284. data/spec/models/patched_notification_spec.rb +66 -0
  285. data/spec/models/patched_project_spec.rb +156 -0
  286. data/spec/models/patched_role_spec.rb +54 -0
  287. data/spec/models/patched_screenshot_spec.rb +72 -0
  288. data/spec/models/patched_unit_write_spec.rb +60 -0
  289. data/spec/models/priority_enum_spec.rb +30 -0
  290. data/spec/models/project_selection_enum_spec.rb +30 -0
  291. data/spec/models/project_spec.rb +156 -0
  292. data/spec/models/repo_request_spec.rb +36 -0
  293. data/spec/models/role_spec.rb +54 -0
  294. data/spec/models/scope_enum_spec.rb +30 -0
  295. data/spec/models/screenshot_file_spec.rb +36 -0
  296. data/spec/models/screenshot_spec.rb +72 -0
  297. data/spec/models/source_enum_spec.rb +30 -0
  298. data/spec/models/state_enum_spec.rb +30 -0
  299. data/spec/models/text_direction_spec.rb +32 -0
  300. data/spec/models/translation_spec.rb +222 -0
  301. data/spec/models/unit_flat_labels_spec.rb +54 -0
  302. data/spec/models/unit_labels_spec.rb +54 -0
  303. data/spec/models/unit_spec.rb +210 -0
  304. data/spec/models/unit_write_spec.rb +60 -0
  305. data/spec/models/upload_request_conflicts_spec.rb +32 -0
  306. data/spec/models/upload_request_fuzzy_spec.rb +32 -0
  307. data/spec/models/upload_request_spec.rb +66 -0
  308. data/spec/models/vcs_enum_spec.rb +30 -0
  309. data/spec/spec_helper.rb +111 -0
  310. data/weblate.gemspec +47 -0
  311. metadata +526 -0
@@ -0,0 +1,1377 @@
1
+ =begin
2
+ #Weblate's REST API
3
+
4
+ # The API is accessible on the ``/api/`` URL and it is based on [Django REST framework](https://www.django-rest-framework.org/). The OpenAPI specification is available as feature preview, feedback welcome!
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Weblate
17
+ class Component
18
+ # Display name
19
+ attr_accessor :name
20
+
21
+ # Name used in URLs and filenames.
22
+ attr_accessor :slug
23
+
24
+ attr_accessor :id
25
+
26
+ attr_accessor :source_language
27
+
28
+ attr_accessor :project
29
+
30
+ # Version control system to use to access your repository containing translations. You can also choose additional integration with third party providers to submit merge requests. * `gerrit` - Gerrit * `git` - Git * `git-force-push` - Git with force push * `github` - GitHub pull request * `gitlab` - GitLab merge request * `local` - No remote repository * `mercurial` - Mercurial * `subversion` - Subversion
31
+ attr_accessor :vcs
32
+
33
+ attr_accessor :repo
34
+
35
+ # URL of repository where users can fetch changes from Weblate
36
+ attr_accessor :git_export
37
+
38
+ attr_accessor :branch
39
+
40
+ attr_accessor :push_branch
41
+
42
+ # Path of files to translate relative to repository root, use * instead of language code, for example: po/*.po or locale/*/LC_MESSAGES/django.po.
43
+ attr_accessor :filemask
44
+
45
+ # Path of screenshots relative to repository root, for example: docs/screenshots/*.png.
46
+ attr_accessor :screenshot_filemask
47
+
48
+ # Filename of translation base file, containing all strings and their source for monolingual translations.
49
+ attr_accessor :template
50
+
51
+ # Whether users will be able to edit the base file for monolingual translations.
52
+ attr_accessor :edit_template
53
+
54
+ # Filename of intermediate translation file. In most cases this is a translation file provided by developers and is used when creating actual source strings.
55
+ attr_accessor :intermediate
56
+
57
+ # Filename of file used for creating new translations. For gettext choose .pot file.
58
+ attr_accessor :new_base
59
+
60
+ attr_accessor :file_format
61
+
62
+ attr_accessor :license
63
+
64
+ attr_accessor :license_url
65
+
66
+ # User agreement which needs to be approved before a user can translate this component.
67
+ attr_accessor :agreement
68
+
69
+ attr_accessor :web_url
70
+
71
+ attr_accessor :url
72
+
73
+ attr_accessor :repository_url
74
+
75
+ attr_accessor :translations_url
76
+
77
+ attr_accessor :statistics_url
78
+
79
+ attr_accessor :lock_url
80
+
81
+ attr_accessor :links_url
82
+
83
+ attr_accessor :changes_list_url
84
+
85
+ attr_accessor :task_url
86
+
87
+ attr_accessor :credits_url
88
+
89
+ # How to handle requests for creating new translations. * `contact` - Contact maintainers * `url` - Point to translation instructions URL * `add` - Create new language file * `none` - Disable adding new translations
90
+ attr_accessor :new_lang
91
+
92
+ attr_accessor :language_code_style
93
+
94
+ attr_accessor :push
95
+
96
+ # Additional comma-separated flags to influence Weblate behavior.
97
+ attr_accessor :check_flags
98
+
99
+ # Components with higher priority are offered first to translators. * `60` - Very high * `80` - High * `100` - Medium * `120` - Low * `140` - Very low
100
+ attr_accessor :priority
101
+
102
+ attr_accessor :enforced_checks
103
+
104
+ # Restrict access to the component to only those explicitly given permission.
105
+ attr_accessor :restricted
106
+
107
+ # Link to repository browser, use {{branch}} for branch, {{filename}} and {{line}} as filename and line placeholders. You might want to strip leading directory by using {{filename|parentdir}}.
108
+ attr_accessor :repoweb
109
+
110
+ # E-mail address for reports on errors in source strings. Leave empty for no e-mails.
111
+ attr_accessor :report_source_bugs
112
+
113
+ # Define whether Weblate should merge the upstream repository or rebase changes onto it. * `merge` - Merge * `rebase` - Rebase * `merge_noff` - Merge without fast-forward
114
+ attr_accessor :merge_style
115
+
116
+ # You can use template language for various info, please consult the documentation for more details.
117
+ attr_accessor :commit_message
118
+
119
+ # You can use template language for various info, please consult the documentation for more details.
120
+ attr_accessor :add_message
121
+
122
+ # You can use template language for various info, please consult the documentation for more details.
123
+ attr_accessor :delete_message
124
+
125
+ # You can use template language for various info, please consult the documentation for more details.
126
+ attr_accessor :merge_message
127
+
128
+ # You can use template language for various info, please consult the documentation for more details.
129
+ attr_accessor :addon_message
130
+
131
+ # You can use template language for various info, please consult the documentation for more details.
132
+ attr_accessor :pull_message
133
+
134
+ # Whether translation updates in other components will cause automatic translation in this one
135
+ attr_accessor :allow_translation_propagation
136
+
137
+ # Enables adding and removing strings straight from Weblate. If your strings are extracted from the source code or managed externally you probably want to keep it disabled.
138
+ attr_accessor :manage_units
139
+
140
+ # Whether to allow translation suggestions at all.
141
+ attr_accessor :enable_suggestions
142
+
143
+ # Users can only vote for suggestions and can’t make direct translations.
144
+ attr_accessor :suggestion_voting
145
+
146
+ # Automatically accept suggestions with this number of votes, use 0 to turn it off.
147
+ attr_accessor :suggestion_autoaccept
148
+
149
+ # Whether the repository should be pushed upstream on every commit.
150
+ attr_accessor :push_on_commit
151
+
152
+ # Time in hours after which any pending changes will be committed to the VCS.
153
+ attr_accessor :commit_pending_age
154
+
155
+ # Whether the component should be locked on repository errors.
156
+ attr_accessor :auto_lock_error
157
+
158
+ # Regular expression used to filter translation files when scanning for file mask.
159
+ attr_accessor :language_regex
160
+
161
+ # Regular expression used to filter keys. This is only available for monolingual formats.
162
+ attr_accessor :key_filter
163
+
164
+ # Regular expression used to determine variants of a string.
165
+ attr_accessor :variant_regex
166
+
167
+ attr_accessor :zipfile
168
+
169
+ attr_accessor :docfile
170
+
171
+ attr_accessor :addons
172
+
173
+ attr_accessor :is_glossary
174
+
175
+ attr_accessor :glossary_color
176
+
177
+ attr_accessor :disable_autoshare
178
+
179
+ attr_accessor :category
180
+
181
+ attr_accessor :linked_component
182
+
183
+ class EnumAttributeValidator
184
+ attr_reader :datatype
185
+ attr_reader :allowable_values
186
+
187
+ def initialize(datatype, allowable_values)
188
+ @allowable_values = allowable_values.map do |value|
189
+ case datatype.to_s
190
+ when /Integer/i
191
+ value.to_i
192
+ when /Float/i
193
+ value.to_f
194
+ else
195
+ value
196
+ end
197
+ end
198
+ end
199
+
200
+ def valid?(value)
201
+ !value || allowable_values.include?(value)
202
+ end
203
+ end
204
+
205
+ # Attribute mapping from ruby-style variable name to JSON key.
206
+ def self.attribute_map
207
+ {
208
+ :'name' => :'name',
209
+ :'slug' => :'slug',
210
+ :'id' => :'id',
211
+ :'source_language' => :'source_language',
212
+ :'project' => :'project',
213
+ :'vcs' => :'vcs',
214
+ :'repo' => :'repo',
215
+ :'git_export' => :'git_export',
216
+ :'branch' => :'branch',
217
+ :'push_branch' => :'push_branch',
218
+ :'filemask' => :'filemask',
219
+ :'screenshot_filemask' => :'screenshot_filemask',
220
+ :'template' => :'template',
221
+ :'edit_template' => :'edit_template',
222
+ :'intermediate' => :'intermediate',
223
+ :'new_base' => :'new_base',
224
+ :'file_format' => :'file_format',
225
+ :'license' => :'license',
226
+ :'license_url' => :'license_url',
227
+ :'agreement' => :'agreement',
228
+ :'web_url' => :'web_url',
229
+ :'url' => :'url',
230
+ :'repository_url' => :'repository_url',
231
+ :'translations_url' => :'translations_url',
232
+ :'statistics_url' => :'statistics_url',
233
+ :'lock_url' => :'lock_url',
234
+ :'links_url' => :'links_url',
235
+ :'changes_list_url' => :'changes_list_url',
236
+ :'task_url' => :'task_url',
237
+ :'credits_url' => :'credits_url',
238
+ :'new_lang' => :'new_lang',
239
+ :'language_code_style' => :'language_code_style',
240
+ :'push' => :'push',
241
+ :'check_flags' => :'check_flags',
242
+ :'priority' => :'priority',
243
+ :'enforced_checks' => :'enforced_checks',
244
+ :'restricted' => :'restricted',
245
+ :'repoweb' => :'repoweb',
246
+ :'report_source_bugs' => :'report_source_bugs',
247
+ :'merge_style' => :'merge_style',
248
+ :'commit_message' => :'commit_message',
249
+ :'add_message' => :'add_message',
250
+ :'delete_message' => :'delete_message',
251
+ :'merge_message' => :'merge_message',
252
+ :'addon_message' => :'addon_message',
253
+ :'pull_message' => :'pull_message',
254
+ :'allow_translation_propagation' => :'allow_translation_propagation',
255
+ :'manage_units' => :'manage_units',
256
+ :'enable_suggestions' => :'enable_suggestions',
257
+ :'suggestion_voting' => :'suggestion_voting',
258
+ :'suggestion_autoaccept' => :'suggestion_autoaccept',
259
+ :'push_on_commit' => :'push_on_commit',
260
+ :'commit_pending_age' => :'commit_pending_age',
261
+ :'auto_lock_error' => :'auto_lock_error',
262
+ :'language_regex' => :'language_regex',
263
+ :'key_filter' => :'key_filter',
264
+ :'variant_regex' => :'variant_regex',
265
+ :'zipfile' => :'zipfile',
266
+ :'docfile' => :'docfile',
267
+ :'addons' => :'addons',
268
+ :'is_glossary' => :'is_glossary',
269
+ :'glossary_color' => :'glossary_color',
270
+ :'disable_autoshare' => :'disable_autoshare',
271
+ :'category' => :'category',
272
+ :'linked_component' => :'linked_component'
273
+ }
274
+ end
275
+
276
+ # Returns all the JSON keys this model knows about
277
+ def self.acceptable_attributes
278
+ attribute_map.values
279
+ end
280
+
281
+ # Attribute type mapping.
282
+ def self.openapi_types
283
+ {
284
+ :'name' => :'String',
285
+ :'slug' => :'String',
286
+ :'id' => :'Integer',
287
+ :'source_language' => :'Language',
288
+ :'project' => :'Project',
289
+ :'vcs' => :'VcsEnum',
290
+ :'repo' => :'String',
291
+ :'git_export' => :'String',
292
+ :'branch' => :'String',
293
+ :'push_branch' => :'String',
294
+ :'filemask' => :'String',
295
+ :'screenshot_filemask' => :'String',
296
+ :'template' => :'String',
297
+ :'edit_template' => :'Boolean',
298
+ :'intermediate' => :'String',
299
+ :'new_base' => :'String',
300
+ :'file_format' => :'FileFormatEnum',
301
+ :'license' => :'LicenseEnum',
302
+ :'license_url' => :'String',
303
+ :'agreement' => :'String',
304
+ :'web_url' => :'String',
305
+ :'url' => :'String',
306
+ :'repository_url' => :'String',
307
+ :'translations_url' => :'String',
308
+ :'statistics_url' => :'String',
309
+ :'lock_url' => :'String',
310
+ :'links_url' => :'String',
311
+ :'changes_list_url' => :'String',
312
+ :'task_url' => :'String',
313
+ :'credits_url' => :'String',
314
+ :'new_lang' => :'NewLangEnum',
315
+ :'language_code_style' => :'ComponentLanguageCodeStyle',
316
+ :'push' => :'String',
317
+ :'check_flags' => :'String',
318
+ :'priority' => :'PriorityEnum',
319
+ :'enforced_checks' => :'Object',
320
+ :'restricted' => :'Boolean',
321
+ :'repoweb' => :'String',
322
+ :'report_source_bugs' => :'String',
323
+ :'merge_style' => :'MergeStyleEnum',
324
+ :'commit_message' => :'String',
325
+ :'add_message' => :'String',
326
+ :'delete_message' => :'String',
327
+ :'merge_message' => :'String',
328
+ :'addon_message' => :'String',
329
+ :'pull_message' => :'String',
330
+ :'allow_translation_propagation' => :'Boolean',
331
+ :'manage_units' => :'Boolean',
332
+ :'enable_suggestions' => :'Boolean',
333
+ :'suggestion_voting' => :'Boolean',
334
+ :'suggestion_autoaccept' => :'Integer',
335
+ :'push_on_commit' => :'Boolean',
336
+ :'commit_pending_age' => :'Integer',
337
+ :'auto_lock_error' => :'Boolean',
338
+ :'language_regex' => :'String',
339
+ :'key_filter' => :'String',
340
+ :'variant_regex' => :'String',
341
+ :'zipfile' => :'String',
342
+ :'docfile' => :'String',
343
+ :'addons' => :'Array<String>',
344
+ :'is_glossary' => :'Boolean',
345
+ :'glossary_color' => :'ColorEnum',
346
+ :'disable_autoshare' => :'Boolean',
347
+ :'category' => :'String',
348
+ :'linked_component' => :'String'
349
+ }
350
+ end
351
+
352
+ # List of attributes with nullable: true
353
+ def self.openapi_nullable
354
+ Set.new([
355
+ :'task_url',
356
+ :'enforced_checks',
357
+ :'category',
358
+ ])
359
+ end
360
+
361
+ # Initializes the object
362
+ # @param [Hash] attributes Model attributes in the form of hash
363
+ def initialize(attributes = {})
364
+ if (!attributes.is_a?(Hash))
365
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Weblate::Component` initialize method"
366
+ end
367
+
368
+ # check to see if the attribute exists and convert string to symbol for hash key
369
+ attributes = attributes.each_with_object({}) { |(k, v), h|
370
+ if (!self.class.attribute_map.key?(k.to_sym))
371
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Weblate::Component`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
372
+ end
373
+ h[k.to_sym] = v
374
+ }
375
+
376
+ if attributes.key?(:'name')
377
+ self.name = attributes[:'name']
378
+ else
379
+ self.name = nil
380
+ end
381
+
382
+ if attributes.key?(:'slug')
383
+ self.slug = attributes[:'slug']
384
+ else
385
+ self.slug = nil
386
+ end
387
+
388
+ if attributes.key?(:'id')
389
+ self.id = attributes[:'id']
390
+ else
391
+ self.id = nil
392
+ end
393
+
394
+ if attributes.key?(:'source_language')
395
+ self.source_language = attributes[:'source_language']
396
+ end
397
+
398
+ if attributes.key?(:'project')
399
+ self.project = attributes[:'project']
400
+ else
401
+ self.project = nil
402
+ end
403
+
404
+ if attributes.key?(:'vcs')
405
+ self.vcs = attributes[:'vcs']
406
+ end
407
+
408
+ if attributes.key?(:'repo')
409
+ self.repo = attributes[:'repo']
410
+ else
411
+ self.repo = nil
412
+ end
413
+
414
+ if attributes.key?(:'git_export')
415
+ self.git_export = attributes[:'git_export']
416
+ end
417
+
418
+ if attributes.key?(:'branch')
419
+ self.branch = attributes[:'branch']
420
+ end
421
+
422
+ if attributes.key?(:'push_branch')
423
+ self.push_branch = attributes[:'push_branch']
424
+ end
425
+
426
+ if attributes.key?(:'filemask')
427
+ self.filemask = attributes[:'filemask']
428
+ else
429
+ self.filemask = nil
430
+ end
431
+
432
+ if attributes.key?(:'screenshot_filemask')
433
+ self.screenshot_filemask = attributes[:'screenshot_filemask']
434
+ end
435
+
436
+ if attributes.key?(:'template')
437
+ self.template = attributes[:'template']
438
+ end
439
+
440
+ if attributes.key?(:'edit_template')
441
+ self.edit_template = attributes[:'edit_template']
442
+ end
443
+
444
+ if attributes.key?(:'intermediate')
445
+ self.intermediate = attributes[:'intermediate']
446
+ end
447
+
448
+ if attributes.key?(:'new_base')
449
+ self.new_base = attributes[:'new_base']
450
+ end
451
+
452
+ if attributes.key?(:'file_format')
453
+ self.file_format = attributes[:'file_format']
454
+ else
455
+ self.file_format = nil
456
+ end
457
+
458
+ if attributes.key?(:'license')
459
+ self.license = attributes[:'license']
460
+ end
461
+
462
+ if attributes.key?(:'license_url')
463
+ self.license_url = attributes[:'license_url']
464
+ else
465
+ self.license_url = nil
466
+ end
467
+
468
+ if attributes.key?(:'agreement')
469
+ self.agreement = attributes[:'agreement']
470
+ end
471
+
472
+ if attributes.key?(:'web_url')
473
+ self.web_url = attributes[:'web_url']
474
+ else
475
+ self.web_url = nil
476
+ end
477
+
478
+ if attributes.key?(:'url')
479
+ self.url = attributes[:'url']
480
+ else
481
+ self.url = nil
482
+ end
483
+
484
+ if attributes.key?(:'repository_url')
485
+ self.repository_url = attributes[:'repository_url']
486
+ else
487
+ self.repository_url = nil
488
+ end
489
+
490
+ if attributes.key?(:'translations_url')
491
+ self.translations_url = attributes[:'translations_url']
492
+ else
493
+ self.translations_url = nil
494
+ end
495
+
496
+ if attributes.key?(:'statistics_url')
497
+ self.statistics_url = attributes[:'statistics_url']
498
+ else
499
+ self.statistics_url = nil
500
+ end
501
+
502
+ if attributes.key?(:'lock_url')
503
+ self.lock_url = attributes[:'lock_url']
504
+ else
505
+ self.lock_url = nil
506
+ end
507
+
508
+ if attributes.key?(:'links_url')
509
+ self.links_url = attributes[:'links_url']
510
+ else
511
+ self.links_url = nil
512
+ end
513
+
514
+ if attributes.key?(:'changes_list_url')
515
+ self.changes_list_url = attributes[:'changes_list_url']
516
+ else
517
+ self.changes_list_url = nil
518
+ end
519
+
520
+ if attributes.key?(:'task_url')
521
+ self.task_url = attributes[:'task_url']
522
+ else
523
+ self.task_url = nil
524
+ end
525
+
526
+ if attributes.key?(:'credits_url')
527
+ self.credits_url = attributes[:'credits_url']
528
+ else
529
+ self.credits_url = nil
530
+ end
531
+
532
+ if attributes.key?(:'new_lang')
533
+ self.new_lang = attributes[:'new_lang']
534
+ end
535
+
536
+ if attributes.key?(:'language_code_style')
537
+ self.language_code_style = attributes[:'language_code_style']
538
+ end
539
+
540
+ if attributes.key?(:'push')
541
+ self.push = attributes[:'push']
542
+ end
543
+
544
+ if attributes.key?(:'check_flags')
545
+ self.check_flags = attributes[:'check_flags']
546
+ end
547
+
548
+ if attributes.key?(:'priority')
549
+ self.priority = attributes[:'priority']
550
+ end
551
+
552
+ if attributes.key?(:'enforced_checks')
553
+ self.enforced_checks = attributes[:'enforced_checks']
554
+ end
555
+
556
+ if attributes.key?(:'restricted')
557
+ self.restricted = attributes[:'restricted']
558
+ end
559
+
560
+ if attributes.key?(:'repoweb')
561
+ self.repoweb = attributes[:'repoweb']
562
+ end
563
+
564
+ if attributes.key?(:'report_source_bugs')
565
+ self.report_source_bugs = attributes[:'report_source_bugs']
566
+ end
567
+
568
+ if attributes.key?(:'merge_style')
569
+ self.merge_style = attributes[:'merge_style']
570
+ end
571
+
572
+ if attributes.key?(:'commit_message')
573
+ self.commit_message = attributes[:'commit_message']
574
+ end
575
+
576
+ if attributes.key?(:'add_message')
577
+ self.add_message = attributes[:'add_message']
578
+ end
579
+
580
+ if attributes.key?(:'delete_message')
581
+ self.delete_message = attributes[:'delete_message']
582
+ end
583
+
584
+ if attributes.key?(:'merge_message')
585
+ self.merge_message = attributes[:'merge_message']
586
+ end
587
+
588
+ if attributes.key?(:'addon_message')
589
+ self.addon_message = attributes[:'addon_message']
590
+ end
591
+
592
+ if attributes.key?(:'pull_message')
593
+ self.pull_message = attributes[:'pull_message']
594
+ end
595
+
596
+ if attributes.key?(:'allow_translation_propagation')
597
+ self.allow_translation_propagation = attributes[:'allow_translation_propagation']
598
+ end
599
+
600
+ if attributes.key?(:'manage_units')
601
+ self.manage_units = attributes[:'manage_units']
602
+ end
603
+
604
+ if attributes.key?(:'enable_suggestions')
605
+ self.enable_suggestions = attributes[:'enable_suggestions']
606
+ end
607
+
608
+ if attributes.key?(:'suggestion_voting')
609
+ self.suggestion_voting = attributes[:'suggestion_voting']
610
+ end
611
+
612
+ if attributes.key?(:'suggestion_autoaccept')
613
+ self.suggestion_autoaccept = attributes[:'suggestion_autoaccept']
614
+ end
615
+
616
+ if attributes.key?(:'push_on_commit')
617
+ self.push_on_commit = attributes[:'push_on_commit']
618
+ end
619
+
620
+ if attributes.key?(:'commit_pending_age')
621
+ self.commit_pending_age = attributes[:'commit_pending_age']
622
+ end
623
+
624
+ if attributes.key?(:'auto_lock_error')
625
+ self.auto_lock_error = attributes[:'auto_lock_error']
626
+ end
627
+
628
+ if attributes.key?(:'language_regex')
629
+ self.language_regex = attributes[:'language_regex']
630
+ end
631
+
632
+ if attributes.key?(:'key_filter')
633
+ self.key_filter = attributes[:'key_filter']
634
+ end
635
+
636
+ if attributes.key?(:'variant_regex')
637
+ self.variant_regex = attributes[:'variant_regex']
638
+ end
639
+
640
+ if attributes.key?(:'zipfile')
641
+ self.zipfile = attributes[:'zipfile']
642
+ end
643
+
644
+ if attributes.key?(:'docfile')
645
+ self.docfile = attributes[:'docfile']
646
+ end
647
+
648
+ if attributes.key?(:'addons')
649
+ if (value = attributes[:'addons']).is_a?(Array)
650
+ self.addons = value
651
+ end
652
+ else
653
+ self.addons = nil
654
+ end
655
+
656
+ if attributes.key?(:'is_glossary')
657
+ self.is_glossary = attributes[:'is_glossary']
658
+ end
659
+
660
+ if attributes.key?(:'glossary_color')
661
+ self.glossary_color = attributes[:'glossary_color']
662
+ end
663
+
664
+ if attributes.key?(:'disable_autoshare')
665
+ self.disable_autoshare = attributes[:'disable_autoshare']
666
+ end
667
+
668
+ if attributes.key?(:'category')
669
+ self.category = attributes[:'category']
670
+ end
671
+
672
+ if attributes.key?(:'linked_component')
673
+ self.linked_component = attributes[:'linked_component']
674
+ else
675
+ self.linked_component = nil
676
+ end
677
+ end
678
+
679
+ # Show invalid properties with the reasons. Usually used together with valid?
680
+ # @return Array for valid properties with the reasons
681
+ def list_invalid_properties
682
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
683
+ invalid_properties = Array.new
684
+ if @name.nil?
685
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
686
+ end
687
+
688
+ if @name.to_s.length > 100
689
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
690
+ end
691
+
692
+ if @slug.nil?
693
+ invalid_properties.push('invalid value for "slug", slug cannot be nil.')
694
+ end
695
+
696
+ if @slug.to_s.length > 100
697
+ invalid_properties.push('invalid value for "slug", the character length must be smaller than or equal to 100.')
698
+ end
699
+
700
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
701
+ if @slug !~ pattern
702
+ invalid_properties.push("invalid value for \"slug\", must conform to the pattern #{pattern}.")
703
+ end
704
+
705
+ if @id.nil?
706
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
707
+ end
708
+
709
+ if @project.nil?
710
+ invalid_properties.push('invalid value for "project", project cannot be nil.')
711
+ end
712
+
713
+ if @repo.nil?
714
+ invalid_properties.push('invalid value for "repo", repo cannot be nil.')
715
+ end
716
+
717
+ if @repo.to_s.length > 300
718
+ invalid_properties.push('invalid value for "repo", the character length must be smaller than or equal to 300.')
719
+ end
720
+
721
+ if !@git_export.nil? && @git_export.to_s.length > 220
722
+ invalid_properties.push('invalid value for "git_export", the character length must be smaller than or equal to 220.')
723
+ end
724
+
725
+ if !@branch.nil? && @branch.to_s.length > 200
726
+ invalid_properties.push('invalid value for "branch", the character length must be smaller than or equal to 200.')
727
+ end
728
+
729
+ if !@push_branch.nil? && @push_branch.to_s.length > 200
730
+ invalid_properties.push('invalid value for "push_branch", the character length must be smaller than or equal to 200.')
731
+ end
732
+
733
+ if @filemask.nil?
734
+ invalid_properties.push('invalid value for "filemask", filemask cannot be nil.')
735
+ end
736
+
737
+ if @filemask.to_s.length > 400
738
+ invalid_properties.push('invalid value for "filemask", the character length must be smaller than or equal to 400.')
739
+ end
740
+
741
+ if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400
742
+ invalid_properties.push('invalid value for "screenshot_filemask", the character length must be smaller than or equal to 400.')
743
+ end
744
+
745
+ if !@template.nil? && @template.to_s.length > 400
746
+ invalid_properties.push('invalid value for "template", the character length must be smaller than or equal to 400.')
747
+ end
748
+
749
+ if !@intermediate.nil? && @intermediate.to_s.length > 400
750
+ invalid_properties.push('invalid value for "intermediate", the character length must be smaller than or equal to 400.')
751
+ end
752
+
753
+ if !@new_base.nil? && @new_base.to_s.length > 400
754
+ invalid_properties.push('invalid value for "new_base", the character length must be smaller than or equal to 400.')
755
+ end
756
+
757
+ if @file_format.nil?
758
+ invalid_properties.push('invalid value for "file_format", file_format cannot be nil.')
759
+ end
760
+
761
+ if @license_url.nil?
762
+ invalid_properties.push('invalid value for "license_url", license_url cannot be nil.')
763
+ end
764
+
765
+ if @web_url.nil?
766
+ invalid_properties.push('invalid value for "web_url", web_url cannot be nil.')
767
+ end
768
+
769
+ if @url.nil?
770
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
771
+ end
772
+
773
+ if @repository_url.nil?
774
+ invalid_properties.push('invalid value for "repository_url", repository_url cannot be nil.')
775
+ end
776
+
777
+ if @translations_url.nil?
778
+ invalid_properties.push('invalid value for "translations_url", translations_url cannot be nil.')
779
+ end
780
+
781
+ if @statistics_url.nil?
782
+ invalid_properties.push('invalid value for "statistics_url", statistics_url cannot be nil.')
783
+ end
784
+
785
+ if @lock_url.nil?
786
+ invalid_properties.push('invalid value for "lock_url", lock_url cannot be nil.')
787
+ end
788
+
789
+ if @links_url.nil?
790
+ invalid_properties.push('invalid value for "links_url", links_url cannot be nil.')
791
+ end
792
+
793
+ if @changes_list_url.nil?
794
+ invalid_properties.push('invalid value for "changes_list_url", changes_list_url cannot be nil.')
795
+ end
796
+
797
+ if @credits_url.nil?
798
+ invalid_properties.push('invalid value for "credits_url", credits_url cannot be nil.')
799
+ end
800
+
801
+ if !@push.nil? && @push.to_s.length > 300
802
+ invalid_properties.push('invalid value for "push", the character length must be smaller than or equal to 300.')
803
+ end
804
+
805
+ if !@repoweb.nil? && @repoweb.to_s.length > 200
806
+ invalid_properties.push('invalid value for "repoweb", the character length must be smaller than or equal to 200.')
807
+ end
808
+
809
+ if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190
810
+ invalid_properties.push('invalid value for "report_source_bugs", the character length must be smaller than or equal to 190.')
811
+ end
812
+
813
+ if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767
814
+ invalid_properties.push('invalid value for "suggestion_autoaccept", must be smaller than or equal to 32767.')
815
+ end
816
+
817
+ if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0
818
+ invalid_properties.push('invalid value for "suggestion_autoaccept", must be greater than or equal to 0.')
819
+ end
820
+
821
+ if !@commit_pending_age.nil? && @commit_pending_age > 2160
822
+ invalid_properties.push('invalid value for "commit_pending_age", must be smaller than or equal to 2160.')
823
+ end
824
+
825
+ if !@commit_pending_age.nil? && @commit_pending_age < -32768
826
+ invalid_properties.push('invalid value for "commit_pending_age", must be greater than or equal to -32768.')
827
+ end
828
+
829
+ if !@language_regex.nil? && @language_regex.to_s.length > 500
830
+ invalid_properties.push('invalid value for "language_regex", the character length must be smaller than or equal to 500.')
831
+ end
832
+
833
+ if !@key_filter.nil? && @key_filter.to_s.length > 500
834
+ invalid_properties.push('invalid value for "key_filter", the character length must be smaller than or equal to 500.')
835
+ end
836
+
837
+ if !@variant_regex.nil? && @variant_regex.to_s.length > 190
838
+ invalid_properties.push('invalid value for "variant_regex", the character length must be smaller than or equal to 190.')
839
+ end
840
+
841
+ if @addons.nil?
842
+ invalid_properties.push('invalid value for "addons", addons cannot be nil.')
843
+ end
844
+
845
+ if @linked_component.nil?
846
+ invalid_properties.push('invalid value for "linked_component", linked_component cannot be nil.')
847
+ end
848
+
849
+ invalid_properties
850
+ end
851
+
852
+ # Check to see if the all the properties in the model are valid
853
+ # @return true if the model is valid
854
+ def valid?
855
+ warn '[DEPRECATED] the `valid?` method is obsolete'
856
+ return false if @name.nil?
857
+ return false if @name.to_s.length > 100
858
+ return false if @slug.nil?
859
+ return false if @slug.to_s.length > 100
860
+ return false if @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
861
+ return false if @id.nil?
862
+ return false if @project.nil?
863
+ return false if @repo.nil?
864
+ return false if @repo.to_s.length > 300
865
+ return false if !@git_export.nil? && @git_export.to_s.length > 220
866
+ return false if !@branch.nil? && @branch.to_s.length > 200
867
+ return false if !@push_branch.nil? && @push_branch.to_s.length > 200
868
+ return false if @filemask.nil?
869
+ return false if @filemask.to_s.length > 400
870
+ return false if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400
871
+ return false if !@template.nil? && @template.to_s.length > 400
872
+ return false if !@intermediate.nil? && @intermediate.to_s.length > 400
873
+ return false if !@new_base.nil? && @new_base.to_s.length > 400
874
+ return false if @file_format.nil?
875
+ return false if @license_url.nil?
876
+ return false if @web_url.nil?
877
+ return false if @url.nil?
878
+ return false if @repository_url.nil?
879
+ return false if @translations_url.nil?
880
+ return false if @statistics_url.nil?
881
+ return false if @lock_url.nil?
882
+ return false if @links_url.nil?
883
+ return false if @changes_list_url.nil?
884
+ return false if @credits_url.nil?
885
+ return false if !@push.nil? && @push.to_s.length > 300
886
+ return false if !@repoweb.nil? && @repoweb.to_s.length > 200
887
+ return false if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190
888
+ return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767
889
+ return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0
890
+ return false if !@commit_pending_age.nil? && @commit_pending_age > 2160
891
+ return false if !@commit_pending_age.nil? && @commit_pending_age < -32768
892
+ return false if !@language_regex.nil? && @language_regex.to_s.length > 500
893
+ return false if !@key_filter.nil? && @key_filter.to_s.length > 500
894
+ return false if !@variant_regex.nil? && @variant_regex.to_s.length > 190
895
+ return false if @addons.nil?
896
+ return false if @linked_component.nil?
897
+ true
898
+ end
899
+
900
+ # Custom attribute writer method with validation
901
+ # @param [Object] name Value to be assigned
902
+ def name=(name)
903
+ if name.nil?
904
+ fail ArgumentError, 'name cannot be nil'
905
+ end
906
+
907
+ if name.to_s.length > 100
908
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
909
+ end
910
+
911
+ @name = name
912
+ end
913
+
914
+ # Custom attribute writer method with validation
915
+ # @param [Object] slug Value to be assigned
916
+ def slug=(slug)
917
+ if slug.nil?
918
+ fail ArgumentError, 'slug cannot be nil'
919
+ end
920
+
921
+ if slug.to_s.length > 100
922
+ fail ArgumentError, 'invalid value for "slug", the character length must be smaller than or equal to 100.'
923
+ end
924
+
925
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
926
+ if slug !~ pattern
927
+ fail ArgumentError, "invalid value for \"slug\", must conform to the pattern #{pattern}."
928
+ end
929
+
930
+ @slug = slug
931
+ end
932
+
933
+ # Custom attribute writer method with validation
934
+ # @param [Object] repo Value to be assigned
935
+ def repo=(repo)
936
+ if repo.nil?
937
+ fail ArgumentError, 'repo cannot be nil'
938
+ end
939
+
940
+ if repo.to_s.length > 300
941
+ fail ArgumentError, 'invalid value for "repo", the character length must be smaller than or equal to 300.'
942
+ end
943
+
944
+ @repo = repo
945
+ end
946
+
947
+ # Custom attribute writer method with validation
948
+ # @param [Object] git_export Value to be assigned
949
+ def git_export=(git_export)
950
+ if git_export.nil?
951
+ fail ArgumentError, 'git_export cannot be nil'
952
+ end
953
+
954
+ if git_export.to_s.length > 220
955
+ fail ArgumentError, 'invalid value for "git_export", the character length must be smaller than or equal to 220.'
956
+ end
957
+
958
+ @git_export = git_export
959
+ end
960
+
961
+ # Custom attribute writer method with validation
962
+ # @param [Object] branch Value to be assigned
963
+ def branch=(branch)
964
+ if branch.nil?
965
+ fail ArgumentError, 'branch cannot be nil'
966
+ end
967
+
968
+ if branch.to_s.length > 200
969
+ fail ArgumentError, 'invalid value for "branch", the character length must be smaller than or equal to 200.'
970
+ end
971
+
972
+ @branch = branch
973
+ end
974
+
975
+ # Custom attribute writer method with validation
976
+ # @param [Object] push_branch Value to be assigned
977
+ def push_branch=(push_branch)
978
+ if push_branch.nil?
979
+ fail ArgumentError, 'push_branch cannot be nil'
980
+ end
981
+
982
+ if push_branch.to_s.length > 200
983
+ fail ArgumentError, 'invalid value for "push_branch", the character length must be smaller than or equal to 200.'
984
+ end
985
+
986
+ @push_branch = push_branch
987
+ end
988
+
989
+ # Custom attribute writer method with validation
990
+ # @param [Object] filemask Value to be assigned
991
+ def filemask=(filemask)
992
+ if filemask.nil?
993
+ fail ArgumentError, 'filemask cannot be nil'
994
+ end
995
+
996
+ if filemask.to_s.length > 400
997
+ fail ArgumentError, 'invalid value for "filemask", the character length must be smaller than or equal to 400.'
998
+ end
999
+
1000
+ @filemask = filemask
1001
+ end
1002
+
1003
+ # Custom attribute writer method with validation
1004
+ # @param [Object] screenshot_filemask Value to be assigned
1005
+ def screenshot_filemask=(screenshot_filemask)
1006
+ if screenshot_filemask.nil?
1007
+ fail ArgumentError, 'screenshot_filemask cannot be nil'
1008
+ end
1009
+
1010
+ if screenshot_filemask.to_s.length > 400
1011
+ fail ArgumentError, 'invalid value for "screenshot_filemask", the character length must be smaller than or equal to 400.'
1012
+ end
1013
+
1014
+ @screenshot_filemask = screenshot_filemask
1015
+ end
1016
+
1017
+ # Custom attribute writer method with validation
1018
+ # @param [Object] template Value to be assigned
1019
+ def template=(template)
1020
+ if template.nil?
1021
+ fail ArgumentError, 'template cannot be nil'
1022
+ end
1023
+
1024
+ if template.to_s.length > 400
1025
+ fail ArgumentError, 'invalid value for "template", the character length must be smaller than or equal to 400.'
1026
+ end
1027
+
1028
+ @template = template
1029
+ end
1030
+
1031
+ # Custom attribute writer method with validation
1032
+ # @param [Object] intermediate Value to be assigned
1033
+ def intermediate=(intermediate)
1034
+ if intermediate.nil?
1035
+ fail ArgumentError, 'intermediate cannot be nil'
1036
+ end
1037
+
1038
+ if intermediate.to_s.length > 400
1039
+ fail ArgumentError, 'invalid value for "intermediate", the character length must be smaller than or equal to 400.'
1040
+ end
1041
+
1042
+ @intermediate = intermediate
1043
+ end
1044
+
1045
+ # Custom attribute writer method with validation
1046
+ # @param [Object] new_base Value to be assigned
1047
+ def new_base=(new_base)
1048
+ if new_base.nil?
1049
+ fail ArgumentError, 'new_base cannot be nil'
1050
+ end
1051
+
1052
+ if new_base.to_s.length > 400
1053
+ fail ArgumentError, 'invalid value for "new_base", the character length must be smaller than or equal to 400.'
1054
+ end
1055
+
1056
+ @new_base = new_base
1057
+ end
1058
+
1059
+ # Custom attribute writer method with validation
1060
+ # @param [Object] push Value to be assigned
1061
+ def push=(push)
1062
+ if push.nil?
1063
+ fail ArgumentError, 'push cannot be nil'
1064
+ end
1065
+
1066
+ if push.to_s.length > 300
1067
+ fail ArgumentError, 'invalid value for "push", the character length must be smaller than or equal to 300.'
1068
+ end
1069
+
1070
+ @push = push
1071
+ end
1072
+
1073
+ # Custom attribute writer method with validation
1074
+ # @param [Object] repoweb Value to be assigned
1075
+ def repoweb=(repoweb)
1076
+ if repoweb.nil?
1077
+ fail ArgumentError, 'repoweb cannot be nil'
1078
+ end
1079
+
1080
+ if repoweb.to_s.length > 200
1081
+ fail ArgumentError, 'invalid value for "repoweb", the character length must be smaller than or equal to 200.'
1082
+ end
1083
+
1084
+ @repoweb = repoweb
1085
+ end
1086
+
1087
+ # Custom attribute writer method with validation
1088
+ # @param [Object] report_source_bugs Value to be assigned
1089
+ def report_source_bugs=(report_source_bugs)
1090
+ if report_source_bugs.nil?
1091
+ fail ArgumentError, 'report_source_bugs cannot be nil'
1092
+ end
1093
+
1094
+ if report_source_bugs.to_s.length > 190
1095
+ fail ArgumentError, 'invalid value for "report_source_bugs", the character length must be smaller than or equal to 190.'
1096
+ end
1097
+
1098
+ @report_source_bugs = report_source_bugs
1099
+ end
1100
+
1101
+ # Custom attribute writer method with validation
1102
+ # @param [Object] suggestion_autoaccept Value to be assigned
1103
+ def suggestion_autoaccept=(suggestion_autoaccept)
1104
+ if suggestion_autoaccept.nil?
1105
+ fail ArgumentError, 'suggestion_autoaccept cannot be nil'
1106
+ end
1107
+
1108
+ if suggestion_autoaccept > 32767
1109
+ fail ArgumentError, 'invalid value for "suggestion_autoaccept", must be smaller than or equal to 32767.'
1110
+ end
1111
+
1112
+ if suggestion_autoaccept < 0
1113
+ fail ArgumentError, 'invalid value for "suggestion_autoaccept", must be greater than or equal to 0.'
1114
+ end
1115
+
1116
+ @suggestion_autoaccept = suggestion_autoaccept
1117
+ end
1118
+
1119
+ # Custom attribute writer method with validation
1120
+ # @param [Object] commit_pending_age Value to be assigned
1121
+ def commit_pending_age=(commit_pending_age)
1122
+ if commit_pending_age.nil?
1123
+ fail ArgumentError, 'commit_pending_age cannot be nil'
1124
+ end
1125
+
1126
+ if commit_pending_age > 2160
1127
+ fail ArgumentError, 'invalid value for "commit_pending_age", must be smaller than or equal to 2160.'
1128
+ end
1129
+
1130
+ if commit_pending_age < -32768
1131
+ fail ArgumentError, 'invalid value for "commit_pending_age", must be greater than or equal to -32768.'
1132
+ end
1133
+
1134
+ @commit_pending_age = commit_pending_age
1135
+ end
1136
+
1137
+ # Custom attribute writer method with validation
1138
+ # @param [Object] language_regex Value to be assigned
1139
+ def language_regex=(language_regex)
1140
+ if language_regex.nil?
1141
+ fail ArgumentError, 'language_regex cannot be nil'
1142
+ end
1143
+
1144
+ if language_regex.to_s.length > 500
1145
+ fail ArgumentError, 'invalid value for "language_regex", the character length must be smaller than or equal to 500.'
1146
+ end
1147
+
1148
+ @language_regex = language_regex
1149
+ end
1150
+
1151
+ # Custom attribute writer method with validation
1152
+ # @param [Object] key_filter Value to be assigned
1153
+ def key_filter=(key_filter)
1154
+ if key_filter.nil?
1155
+ fail ArgumentError, 'key_filter cannot be nil'
1156
+ end
1157
+
1158
+ if key_filter.to_s.length > 500
1159
+ fail ArgumentError, 'invalid value for "key_filter", the character length must be smaller than or equal to 500.'
1160
+ end
1161
+
1162
+ @key_filter = key_filter
1163
+ end
1164
+
1165
+ # Custom attribute writer method with validation
1166
+ # @param [Object] variant_regex Value to be assigned
1167
+ def variant_regex=(variant_regex)
1168
+ if variant_regex.nil?
1169
+ fail ArgumentError, 'variant_regex cannot be nil'
1170
+ end
1171
+
1172
+ if variant_regex.to_s.length > 190
1173
+ fail ArgumentError, 'invalid value for "variant_regex", the character length must be smaller than or equal to 190.'
1174
+ end
1175
+
1176
+ @variant_regex = variant_regex
1177
+ end
1178
+
1179
+ # Checks equality by comparing each attribute.
1180
+ # @param [Object] Object to be compared
1181
+ def ==(o)
1182
+ return true if self.equal?(o)
1183
+ self.class == o.class &&
1184
+ name == o.name &&
1185
+ slug == o.slug &&
1186
+ id == o.id &&
1187
+ source_language == o.source_language &&
1188
+ project == o.project &&
1189
+ vcs == o.vcs &&
1190
+ repo == o.repo &&
1191
+ git_export == o.git_export &&
1192
+ branch == o.branch &&
1193
+ push_branch == o.push_branch &&
1194
+ filemask == o.filemask &&
1195
+ screenshot_filemask == o.screenshot_filemask &&
1196
+ template == o.template &&
1197
+ edit_template == o.edit_template &&
1198
+ intermediate == o.intermediate &&
1199
+ new_base == o.new_base &&
1200
+ file_format == o.file_format &&
1201
+ license == o.license &&
1202
+ license_url == o.license_url &&
1203
+ agreement == o.agreement &&
1204
+ web_url == o.web_url &&
1205
+ url == o.url &&
1206
+ repository_url == o.repository_url &&
1207
+ translations_url == o.translations_url &&
1208
+ statistics_url == o.statistics_url &&
1209
+ lock_url == o.lock_url &&
1210
+ links_url == o.links_url &&
1211
+ changes_list_url == o.changes_list_url &&
1212
+ task_url == o.task_url &&
1213
+ credits_url == o.credits_url &&
1214
+ new_lang == o.new_lang &&
1215
+ language_code_style == o.language_code_style &&
1216
+ push == o.push &&
1217
+ check_flags == o.check_flags &&
1218
+ priority == o.priority &&
1219
+ enforced_checks == o.enforced_checks &&
1220
+ restricted == o.restricted &&
1221
+ repoweb == o.repoweb &&
1222
+ report_source_bugs == o.report_source_bugs &&
1223
+ merge_style == o.merge_style &&
1224
+ commit_message == o.commit_message &&
1225
+ add_message == o.add_message &&
1226
+ delete_message == o.delete_message &&
1227
+ merge_message == o.merge_message &&
1228
+ addon_message == o.addon_message &&
1229
+ pull_message == o.pull_message &&
1230
+ allow_translation_propagation == o.allow_translation_propagation &&
1231
+ manage_units == o.manage_units &&
1232
+ enable_suggestions == o.enable_suggestions &&
1233
+ suggestion_voting == o.suggestion_voting &&
1234
+ suggestion_autoaccept == o.suggestion_autoaccept &&
1235
+ push_on_commit == o.push_on_commit &&
1236
+ commit_pending_age == o.commit_pending_age &&
1237
+ auto_lock_error == o.auto_lock_error &&
1238
+ language_regex == o.language_regex &&
1239
+ key_filter == o.key_filter &&
1240
+ variant_regex == o.variant_regex &&
1241
+ zipfile == o.zipfile &&
1242
+ docfile == o.docfile &&
1243
+ addons == o.addons &&
1244
+ is_glossary == o.is_glossary &&
1245
+ glossary_color == o.glossary_color &&
1246
+ disable_autoshare == o.disable_autoshare &&
1247
+ category == o.category &&
1248
+ linked_component == o.linked_component
1249
+ end
1250
+
1251
+ # @see the `==` method
1252
+ # @param [Object] Object to be compared
1253
+ def eql?(o)
1254
+ self == o
1255
+ end
1256
+
1257
+ # Calculates hash code according to all attributes.
1258
+ # @return [Integer] Hash code
1259
+ def hash
1260
+ [name, slug, id, source_language, project, vcs, repo, git_export, branch, push_branch, filemask, screenshot_filemask, template, edit_template, intermediate, new_base, file_format, license, license_url, agreement, web_url, url, repository_url, translations_url, statistics_url, lock_url, links_url, changes_list_url, task_url, credits_url, new_lang, language_code_style, push, check_flags, priority, enforced_checks, restricted, repoweb, report_source_bugs, merge_style, commit_message, add_message, delete_message, merge_message, addon_message, pull_message, allow_translation_propagation, manage_units, enable_suggestions, suggestion_voting, suggestion_autoaccept, push_on_commit, commit_pending_age, auto_lock_error, language_regex, key_filter, variant_regex, zipfile, docfile, addons, is_glossary, glossary_color, disable_autoshare, category, linked_component].hash
1261
+ end
1262
+
1263
+ # Builds the object from hash
1264
+ # @param [Hash] attributes Model attributes in the form of hash
1265
+ # @return [Object] Returns the model itself
1266
+ def self.build_from_hash(attributes)
1267
+ return nil unless attributes.is_a?(Hash)
1268
+ attributes = attributes.transform_keys(&:to_sym)
1269
+ transformed_hash = {}
1270
+ openapi_types.each_pair do |key, type|
1271
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
1272
+ transformed_hash["#{key}"] = nil
1273
+ elsif type =~ /\AArray<(.*)>/i
1274
+ # check to ensure the input is an array given that the attribute
1275
+ # is documented as an array but the input is not
1276
+ if attributes[attribute_map[key]].is_a?(Array)
1277
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
1278
+ end
1279
+ elsif !attributes[attribute_map[key]].nil?
1280
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
1281
+ end
1282
+ end
1283
+ new(transformed_hash)
1284
+ end
1285
+
1286
+ # Deserializes the data based on type
1287
+ # @param string type Data type
1288
+ # @param string value Value to be deserialized
1289
+ # @return [Object] Deserialized data
1290
+ def self._deserialize(type, value)
1291
+ case type.to_sym
1292
+ when :Time
1293
+ Time.parse(value)
1294
+ when :Date
1295
+ Date.parse(value)
1296
+ when :String
1297
+ value.to_s
1298
+ when :Integer
1299
+ value.to_i
1300
+ when :Float
1301
+ value.to_f
1302
+ when :Boolean
1303
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1304
+ true
1305
+ else
1306
+ false
1307
+ end
1308
+ when :Object
1309
+ # generic object (usually a Hash), return directly
1310
+ value
1311
+ when /\AArray<(?<inner_type>.+)>\z/
1312
+ inner_type = Regexp.last_match[:inner_type]
1313
+ value.map { |v| _deserialize(inner_type, v) }
1314
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1315
+ k_type = Regexp.last_match[:k_type]
1316
+ v_type = Regexp.last_match[:v_type]
1317
+ {}.tap do |hash|
1318
+ value.each do |k, v|
1319
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1320
+ end
1321
+ end
1322
+ else # model
1323
+ # models (e.g. Pet) or oneOf
1324
+ klass = Weblate.const_get(type)
1325
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1326
+ end
1327
+ end
1328
+
1329
+ # Returns the string representation of the object
1330
+ # @return [String] String presentation of the object
1331
+ def to_s
1332
+ to_hash.to_s
1333
+ end
1334
+
1335
+ # to_body is an alias to to_hash (backward compatibility)
1336
+ # @return [Hash] Returns the object in the form of hash
1337
+ def to_body
1338
+ to_hash
1339
+ end
1340
+
1341
+ # Returns the object in the form of hash
1342
+ # @return [Hash] Returns the object in the form of hash
1343
+ def to_hash
1344
+ hash = {}
1345
+ self.class.attribute_map.each_pair do |attr, param|
1346
+ value = self.send(attr)
1347
+ if value.nil?
1348
+ is_nullable = self.class.openapi_nullable.include?(attr)
1349
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1350
+ end
1351
+
1352
+ hash[param] = _to_hash(value)
1353
+ end
1354
+ hash
1355
+ end
1356
+
1357
+ # Outputs non-array value in the form of hash
1358
+ # For object, use to_hash. Otherwise, just return the value
1359
+ # @param [Object] value Any valid value
1360
+ # @return [Hash] Returns the value in the form of hash
1361
+ def _to_hash(value)
1362
+ if value.is_a?(Array)
1363
+ value.compact.map { |v| _to_hash(v) }
1364
+ elsif value.is_a?(Hash)
1365
+ {}.tap do |hash|
1366
+ value.each { |k, v| hash[k] = _to_hash(v) }
1367
+ end
1368
+ elsif value.respond_to? :to_hash
1369
+ value.to_hash
1370
+ else
1371
+ value
1372
+ end
1373
+ end
1374
+
1375
+ end
1376
+
1377
+ end