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,1242 @@
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 PatchedComponent
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::PatchedComponent` 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::PatchedComponent`. 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
+ end
379
+
380
+ if attributes.key?(:'slug')
381
+ self.slug = attributes[:'slug']
382
+ end
383
+
384
+ if attributes.key?(:'id')
385
+ self.id = attributes[:'id']
386
+ end
387
+
388
+ if attributes.key?(:'source_language')
389
+ self.source_language = attributes[:'source_language']
390
+ end
391
+
392
+ if attributes.key?(:'project')
393
+ self.project = attributes[:'project']
394
+ end
395
+
396
+ if attributes.key?(:'vcs')
397
+ self.vcs = attributes[:'vcs']
398
+ end
399
+
400
+ if attributes.key?(:'repo')
401
+ self.repo = attributes[:'repo']
402
+ end
403
+
404
+ if attributes.key?(:'git_export')
405
+ self.git_export = attributes[:'git_export']
406
+ end
407
+
408
+ if attributes.key?(:'branch')
409
+ self.branch = attributes[:'branch']
410
+ end
411
+
412
+ if attributes.key?(:'push_branch')
413
+ self.push_branch = attributes[:'push_branch']
414
+ end
415
+
416
+ if attributes.key?(:'filemask')
417
+ self.filemask = attributes[:'filemask']
418
+ end
419
+
420
+ if attributes.key?(:'screenshot_filemask')
421
+ self.screenshot_filemask = attributes[:'screenshot_filemask']
422
+ end
423
+
424
+ if attributes.key?(:'template')
425
+ self.template = attributes[:'template']
426
+ end
427
+
428
+ if attributes.key?(:'edit_template')
429
+ self.edit_template = attributes[:'edit_template']
430
+ end
431
+
432
+ if attributes.key?(:'intermediate')
433
+ self.intermediate = attributes[:'intermediate']
434
+ end
435
+
436
+ if attributes.key?(:'new_base')
437
+ self.new_base = attributes[:'new_base']
438
+ end
439
+
440
+ if attributes.key?(:'file_format')
441
+ self.file_format = attributes[:'file_format']
442
+ end
443
+
444
+ if attributes.key?(:'license')
445
+ self.license = attributes[:'license']
446
+ end
447
+
448
+ if attributes.key?(:'license_url')
449
+ self.license_url = attributes[:'license_url']
450
+ end
451
+
452
+ if attributes.key?(:'agreement')
453
+ self.agreement = attributes[:'agreement']
454
+ end
455
+
456
+ if attributes.key?(:'web_url')
457
+ self.web_url = attributes[:'web_url']
458
+ end
459
+
460
+ if attributes.key?(:'url')
461
+ self.url = attributes[:'url']
462
+ end
463
+
464
+ if attributes.key?(:'repository_url')
465
+ self.repository_url = attributes[:'repository_url']
466
+ end
467
+
468
+ if attributes.key?(:'translations_url')
469
+ self.translations_url = attributes[:'translations_url']
470
+ end
471
+
472
+ if attributes.key?(:'statistics_url')
473
+ self.statistics_url = attributes[:'statistics_url']
474
+ end
475
+
476
+ if attributes.key?(:'lock_url')
477
+ self.lock_url = attributes[:'lock_url']
478
+ end
479
+
480
+ if attributes.key?(:'links_url')
481
+ self.links_url = attributes[:'links_url']
482
+ end
483
+
484
+ if attributes.key?(:'changes_list_url')
485
+ self.changes_list_url = attributes[:'changes_list_url']
486
+ end
487
+
488
+ if attributes.key?(:'task_url')
489
+ self.task_url = attributes[:'task_url']
490
+ end
491
+
492
+ if attributes.key?(:'credits_url')
493
+ self.credits_url = attributes[:'credits_url']
494
+ end
495
+
496
+ if attributes.key?(:'new_lang')
497
+ self.new_lang = attributes[:'new_lang']
498
+ end
499
+
500
+ if attributes.key?(:'language_code_style')
501
+ self.language_code_style = attributes[:'language_code_style']
502
+ end
503
+
504
+ if attributes.key?(:'push')
505
+ self.push = attributes[:'push']
506
+ end
507
+
508
+ if attributes.key?(:'check_flags')
509
+ self.check_flags = attributes[:'check_flags']
510
+ end
511
+
512
+ if attributes.key?(:'priority')
513
+ self.priority = attributes[:'priority']
514
+ end
515
+
516
+ if attributes.key?(:'enforced_checks')
517
+ self.enforced_checks = attributes[:'enforced_checks']
518
+ end
519
+
520
+ if attributes.key?(:'restricted')
521
+ self.restricted = attributes[:'restricted']
522
+ end
523
+
524
+ if attributes.key?(:'repoweb')
525
+ self.repoweb = attributes[:'repoweb']
526
+ end
527
+
528
+ if attributes.key?(:'report_source_bugs')
529
+ self.report_source_bugs = attributes[:'report_source_bugs']
530
+ end
531
+
532
+ if attributes.key?(:'merge_style')
533
+ self.merge_style = attributes[:'merge_style']
534
+ end
535
+
536
+ if attributes.key?(:'commit_message')
537
+ self.commit_message = attributes[:'commit_message']
538
+ end
539
+
540
+ if attributes.key?(:'add_message')
541
+ self.add_message = attributes[:'add_message']
542
+ end
543
+
544
+ if attributes.key?(:'delete_message')
545
+ self.delete_message = attributes[:'delete_message']
546
+ end
547
+
548
+ if attributes.key?(:'merge_message')
549
+ self.merge_message = attributes[:'merge_message']
550
+ end
551
+
552
+ if attributes.key?(:'addon_message')
553
+ self.addon_message = attributes[:'addon_message']
554
+ end
555
+
556
+ if attributes.key?(:'pull_message')
557
+ self.pull_message = attributes[:'pull_message']
558
+ end
559
+
560
+ if attributes.key?(:'allow_translation_propagation')
561
+ self.allow_translation_propagation = attributes[:'allow_translation_propagation']
562
+ end
563
+
564
+ if attributes.key?(:'manage_units')
565
+ self.manage_units = attributes[:'manage_units']
566
+ end
567
+
568
+ if attributes.key?(:'enable_suggestions')
569
+ self.enable_suggestions = attributes[:'enable_suggestions']
570
+ end
571
+
572
+ if attributes.key?(:'suggestion_voting')
573
+ self.suggestion_voting = attributes[:'suggestion_voting']
574
+ end
575
+
576
+ if attributes.key?(:'suggestion_autoaccept')
577
+ self.suggestion_autoaccept = attributes[:'suggestion_autoaccept']
578
+ end
579
+
580
+ if attributes.key?(:'push_on_commit')
581
+ self.push_on_commit = attributes[:'push_on_commit']
582
+ end
583
+
584
+ if attributes.key?(:'commit_pending_age')
585
+ self.commit_pending_age = attributes[:'commit_pending_age']
586
+ end
587
+
588
+ if attributes.key?(:'auto_lock_error')
589
+ self.auto_lock_error = attributes[:'auto_lock_error']
590
+ end
591
+
592
+ if attributes.key?(:'language_regex')
593
+ self.language_regex = attributes[:'language_regex']
594
+ end
595
+
596
+ if attributes.key?(:'key_filter')
597
+ self.key_filter = attributes[:'key_filter']
598
+ end
599
+
600
+ if attributes.key?(:'variant_regex')
601
+ self.variant_regex = attributes[:'variant_regex']
602
+ end
603
+
604
+ if attributes.key?(:'zipfile')
605
+ self.zipfile = attributes[:'zipfile']
606
+ end
607
+
608
+ if attributes.key?(:'docfile')
609
+ self.docfile = attributes[:'docfile']
610
+ end
611
+
612
+ if attributes.key?(:'addons')
613
+ if (value = attributes[:'addons']).is_a?(Array)
614
+ self.addons = value
615
+ end
616
+ end
617
+
618
+ if attributes.key?(:'is_glossary')
619
+ self.is_glossary = attributes[:'is_glossary']
620
+ end
621
+
622
+ if attributes.key?(:'glossary_color')
623
+ self.glossary_color = attributes[:'glossary_color']
624
+ end
625
+
626
+ if attributes.key?(:'disable_autoshare')
627
+ self.disable_autoshare = attributes[:'disable_autoshare']
628
+ end
629
+
630
+ if attributes.key?(:'category')
631
+ self.category = attributes[:'category']
632
+ end
633
+
634
+ if attributes.key?(:'linked_component')
635
+ self.linked_component = attributes[:'linked_component']
636
+ end
637
+ end
638
+
639
+ # Show invalid properties with the reasons. Usually used together with valid?
640
+ # @return Array for valid properties with the reasons
641
+ def list_invalid_properties
642
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
643
+ invalid_properties = Array.new
644
+ if !@name.nil? && @name.to_s.length > 100
645
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
646
+ end
647
+
648
+ if !@slug.nil? && @slug.to_s.length > 100
649
+ invalid_properties.push('invalid value for "slug", the character length must be smaller than or equal to 100.')
650
+ end
651
+
652
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
653
+ if !@slug.nil? && @slug !~ pattern
654
+ invalid_properties.push("invalid value for \"slug\", must conform to the pattern #{pattern}.")
655
+ end
656
+
657
+ if !@repo.nil? && @repo.to_s.length > 300
658
+ invalid_properties.push('invalid value for "repo", the character length must be smaller than or equal to 300.')
659
+ end
660
+
661
+ if !@git_export.nil? && @git_export.to_s.length > 220
662
+ invalid_properties.push('invalid value for "git_export", the character length must be smaller than or equal to 220.')
663
+ end
664
+
665
+ if !@branch.nil? && @branch.to_s.length > 200
666
+ invalid_properties.push('invalid value for "branch", the character length must be smaller than or equal to 200.')
667
+ end
668
+
669
+ if !@push_branch.nil? && @push_branch.to_s.length > 200
670
+ invalid_properties.push('invalid value for "push_branch", the character length must be smaller than or equal to 200.')
671
+ end
672
+
673
+ if !@filemask.nil? && @filemask.to_s.length > 400
674
+ invalid_properties.push('invalid value for "filemask", the character length must be smaller than or equal to 400.')
675
+ end
676
+
677
+ if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400
678
+ invalid_properties.push('invalid value for "screenshot_filemask", the character length must be smaller than or equal to 400.')
679
+ end
680
+
681
+ if !@template.nil? && @template.to_s.length > 400
682
+ invalid_properties.push('invalid value for "template", the character length must be smaller than or equal to 400.')
683
+ end
684
+
685
+ if !@intermediate.nil? && @intermediate.to_s.length > 400
686
+ invalid_properties.push('invalid value for "intermediate", the character length must be smaller than or equal to 400.')
687
+ end
688
+
689
+ if !@new_base.nil? && @new_base.to_s.length > 400
690
+ invalid_properties.push('invalid value for "new_base", the character length must be smaller than or equal to 400.')
691
+ end
692
+
693
+ if !@push.nil? && @push.to_s.length > 300
694
+ invalid_properties.push('invalid value for "push", the character length must be smaller than or equal to 300.')
695
+ end
696
+
697
+ if !@repoweb.nil? && @repoweb.to_s.length > 200
698
+ invalid_properties.push('invalid value for "repoweb", the character length must be smaller than or equal to 200.')
699
+ end
700
+
701
+ if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190
702
+ invalid_properties.push('invalid value for "report_source_bugs", the character length must be smaller than or equal to 190.')
703
+ end
704
+
705
+ if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767
706
+ invalid_properties.push('invalid value for "suggestion_autoaccept", must be smaller than or equal to 32767.')
707
+ end
708
+
709
+ if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0
710
+ invalid_properties.push('invalid value for "suggestion_autoaccept", must be greater than or equal to 0.')
711
+ end
712
+
713
+ if !@commit_pending_age.nil? && @commit_pending_age > 2160
714
+ invalid_properties.push('invalid value for "commit_pending_age", must be smaller than or equal to 2160.')
715
+ end
716
+
717
+ if !@commit_pending_age.nil? && @commit_pending_age < -32768
718
+ invalid_properties.push('invalid value for "commit_pending_age", must be greater than or equal to -32768.')
719
+ end
720
+
721
+ if !@language_regex.nil? && @language_regex.to_s.length > 500
722
+ invalid_properties.push('invalid value for "language_regex", the character length must be smaller than or equal to 500.')
723
+ end
724
+
725
+ if !@key_filter.nil? && @key_filter.to_s.length > 500
726
+ invalid_properties.push('invalid value for "key_filter", the character length must be smaller than or equal to 500.')
727
+ end
728
+
729
+ if !@variant_regex.nil? && @variant_regex.to_s.length > 190
730
+ invalid_properties.push('invalid value for "variant_regex", the character length must be smaller than or equal to 190.')
731
+ end
732
+
733
+ invalid_properties
734
+ end
735
+
736
+ # Check to see if the all the properties in the model are valid
737
+ # @return true if the model is valid
738
+ def valid?
739
+ warn '[DEPRECATED] the `valid?` method is obsolete'
740
+ return false if !@name.nil? && @name.to_s.length > 100
741
+ return false if !@slug.nil? && @slug.to_s.length > 100
742
+ return false if !@slug.nil? && @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
743
+ return false if !@repo.nil? && @repo.to_s.length > 300
744
+ return false if !@git_export.nil? && @git_export.to_s.length > 220
745
+ return false if !@branch.nil? && @branch.to_s.length > 200
746
+ return false if !@push_branch.nil? && @push_branch.to_s.length > 200
747
+ return false if !@filemask.nil? && @filemask.to_s.length > 400
748
+ return false if !@screenshot_filemask.nil? && @screenshot_filemask.to_s.length > 400
749
+ return false if !@template.nil? && @template.to_s.length > 400
750
+ return false if !@intermediate.nil? && @intermediate.to_s.length > 400
751
+ return false if !@new_base.nil? && @new_base.to_s.length > 400
752
+ return false if !@push.nil? && @push.to_s.length > 300
753
+ return false if !@repoweb.nil? && @repoweb.to_s.length > 200
754
+ return false if !@report_source_bugs.nil? && @report_source_bugs.to_s.length > 190
755
+ return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept > 32767
756
+ return false if !@suggestion_autoaccept.nil? && @suggestion_autoaccept < 0
757
+ return false if !@commit_pending_age.nil? && @commit_pending_age > 2160
758
+ return false if !@commit_pending_age.nil? && @commit_pending_age < -32768
759
+ return false if !@language_regex.nil? && @language_regex.to_s.length > 500
760
+ return false if !@key_filter.nil? && @key_filter.to_s.length > 500
761
+ return false if !@variant_regex.nil? && @variant_regex.to_s.length > 190
762
+ true
763
+ end
764
+
765
+ # Custom attribute writer method with validation
766
+ # @param [Object] name Value to be assigned
767
+ def name=(name)
768
+ if name.nil?
769
+ fail ArgumentError, 'name cannot be nil'
770
+ end
771
+
772
+ if name.to_s.length > 100
773
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
774
+ end
775
+
776
+ @name = name
777
+ end
778
+
779
+ # Custom attribute writer method with validation
780
+ # @param [Object] slug Value to be assigned
781
+ def slug=(slug)
782
+ if slug.nil?
783
+ fail ArgumentError, 'slug cannot be nil'
784
+ end
785
+
786
+ if slug.to_s.length > 100
787
+ fail ArgumentError, 'invalid value for "slug", the character length must be smaller than or equal to 100.'
788
+ end
789
+
790
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
791
+ if slug !~ pattern
792
+ fail ArgumentError, "invalid value for \"slug\", must conform to the pattern #{pattern}."
793
+ end
794
+
795
+ @slug = slug
796
+ end
797
+
798
+ # Custom attribute writer method with validation
799
+ # @param [Object] repo Value to be assigned
800
+ def repo=(repo)
801
+ if repo.nil?
802
+ fail ArgumentError, 'repo cannot be nil'
803
+ end
804
+
805
+ if repo.to_s.length > 300
806
+ fail ArgumentError, 'invalid value for "repo", the character length must be smaller than or equal to 300.'
807
+ end
808
+
809
+ @repo = repo
810
+ end
811
+
812
+ # Custom attribute writer method with validation
813
+ # @param [Object] git_export Value to be assigned
814
+ def git_export=(git_export)
815
+ if git_export.nil?
816
+ fail ArgumentError, 'git_export cannot be nil'
817
+ end
818
+
819
+ if git_export.to_s.length > 220
820
+ fail ArgumentError, 'invalid value for "git_export", the character length must be smaller than or equal to 220.'
821
+ end
822
+
823
+ @git_export = git_export
824
+ end
825
+
826
+ # Custom attribute writer method with validation
827
+ # @param [Object] branch Value to be assigned
828
+ def branch=(branch)
829
+ if branch.nil?
830
+ fail ArgumentError, 'branch cannot be nil'
831
+ end
832
+
833
+ if branch.to_s.length > 200
834
+ fail ArgumentError, 'invalid value for "branch", the character length must be smaller than or equal to 200.'
835
+ end
836
+
837
+ @branch = branch
838
+ end
839
+
840
+ # Custom attribute writer method with validation
841
+ # @param [Object] push_branch Value to be assigned
842
+ def push_branch=(push_branch)
843
+ if push_branch.nil?
844
+ fail ArgumentError, 'push_branch cannot be nil'
845
+ end
846
+
847
+ if push_branch.to_s.length > 200
848
+ fail ArgumentError, 'invalid value for "push_branch", the character length must be smaller than or equal to 200.'
849
+ end
850
+
851
+ @push_branch = push_branch
852
+ end
853
+
854
+ # Custom attribute writer method with validation
855
+ # @param [Object] filemask Value to be assigned
856
+ def filemask=(filemask)
857
+ if filemask.nil?
858
+ fail ArgumentError, 'filemask cannot be nil'
859
+ end
860
+
861
+ if filemask.to_s.length > 400
862
+ fail ArgumentError, 'invalid value for "filemask", the character length must be smaller than or equal to 400.'
863
+ end
864
+
865
+ @filemask = filemask
866
+ end
867
+
868
+ # Custom attribute writer method with validation
869
+ # @param [Object] screenshot_filemask Value to be assigned
870
+ def screenshot_filemask=(screenshot_filemask)
871
+ if screenshot_filemask.nil?
872
+ fail ArgumentError, 'screenshot_filemask cannot be nil'
873
+ end
874
+
875
+ if screenshot_filemask.to_s.length > 400
876
+ fail ArgumentError, 'invalid value for "screenshot_filemask", the character length must be smaller than or equal to 400.'
877
+ end
878
+
879
+ @screenshot_filemask = screenshot_filemask
880
+ end
881
+
882
+ # Custom attribute writer method with validation
883
+ # @param [Object] template Value to be assigned
884
+ def template=(template)
885
+ if template.nil?
886
+ fail ArgumentError, 'template cannot be nil'
887
+ end
888
+
889
+ if template.to_s.length > 400
890
+ fail ArgumentError, 'invalid value for "template", the character length must be smaller than or equal to 400.'
891
+ end
892
+
893
+ @template = template
894
+ end
895
+
896
+ # Custom attribute writer method with validation
897
+ # @param [Object] intermediate Value to be assigned
898
+ def intermediate=(intermediate)
899
+ if intermediate.nil?
900
+ fail ArgumentError, 'intermediate cannot be nil'
901
+ end
902
+
903
+ if intermediate.to_s.length > 400
904
+ fail ArgumentError, 'invalid value for "intermediate", the character length must be smaller than or equal to 400.'
905
+ end
906
+
907
+ @intermediate = intermediate
908
+ end
909
+
910
+ # Custom attribute writer method with validation
911
+ # @param [Object] new_base Value to be assigned
912
+ def new_base=(new_base)
913
+ if new_base.nil?
914
+ fail ArgumentError, 'new_base cannot be nil'
915
+ end
916
+
917
+ if new_base.to_s.length > 400
918
+ fail ArgumentError, 'invalid value for "new_base", the character length must be smaller than or equal to 400.'
919
+ end
920
+
921
+ @new_base = new_base
922
+ end
923
+
924
+ # Custom attribute writer method with validation
925
+ # @param [Object] push Value to be assigned
926
+ def push=(push)
927
+ if push.nil?
928
+ fail ArgumentError, 'push cannot be nil'
929
+ end
930
+
931
+ if push.to_s.length > 300
932
+ fail ArgumentError, 'invalid value for "push", the character length must be smaller than or equal to 300.'
933
+ end
934
+
935
+ @push = push
936
+ end
937
+
938
+ # Custom attribute writer method with validation
939
+ # @param [Object] repoweb Value to be assigned
940
+ def repoweb=(repoweb)
941
+ if repoweb.nil?
942
+ fail ArgumentError, 'repoweb cannot be nil'
943
+ end
944
+
945
+ if repoweb.to_s.length > 200
946
+ fail ArgumentError, 'invalid value for "repoweb", the character length must be smaller than or equal to 200.'
947
+ end
948
+
949
+ @repoweb = repoweb
950
+ end
951
+
952
+ # Custom attribute writer method with validation
953
+ # @param [Object] report_source_bugs Value to be assigned
954
+ def report_source_bugs=(report_source_bugs)
955
+ if report_source_bugs.nil?
956
+ fail ArgumentError, 'report_source_bugs cannot be nil'
957
+ end
958
+
959
+ if report_source_bugs.to_s.length > 190
960
+ fail ArgumentError, 'invalid value for "report_source_bugs", the character length must be smaller than or equal to 190.'
961
+ end
962
+
963
+ @report_source_bugs = report_source_bugs
964
+ end
965
+
966
+ # Custom attribute writer method with validation
967
+ # @param [Object] suggestion_autoaccept Value to be assigned
968
+ def suggestion_autoaccept=(suggestion_autoaccept)
969
+ if suggestion_autoaccept.nil?
970
+ fail ArgumentError, 'suggestion_autoaccept cannot be nil'
971
+ end
972
+
973
+ if suggestion_autoaccept > 32767
974
+ fail ArgumentError, 'invalid value for "suggestion_autoaccept", must be smaller than or equal to 32767.'
975
+ end
976
+
977
+ if suggestion_autoaccept < 0
978
+ fail ArgumentError, 'invalid value for "suggestion_autoaccept", must be greater than or equal to 0.'
979
+ end
980
+
981
+ @suggestion_autoaccept = suggestion_autoaccept
982
+ end
983
+
984
+ # Custom attribute writer method with validation
985
+ # @param [Object] commit_pending_age Value to be assigned
986
+ def commit_pending_age=(commit_pending_age)
987
+ if commit_pending_age.nil?
988
+ fail ArgumentError, 'commit_pending_age cannot be nil'
989
+ end
990
+
991
+ if commit_pending_age > 2160
992
+ fail ArgumentError, 'invalid value for "commit_pending_age", must be smaller than or equal to 2160.'
993
+ end
994
+
995
+ if commit_pending_age < -32768
996
+ fail ArgumentError, 'invalid value for "commit_pending_age", must be greater than or equal to -32768.'
997
+ end
998
+
999
+ @commit_pending_age = commit_pending_age
1000
+ end
1001
+
1002
+ # Custom attribute writer method with validation
1003
+ # @param [Object] language_regex Value to be assigned
1004
+ def language_regex=(language_regex)
1005
+ if language_regex.nil?
1006
+ fail ArgumentError, 'language_regex cannot be nil'
1007
+ end
1008
+
1009
+ if language_regex.to_s.length > 500
1010
+ fail ArgumentError, 'invalid value for "language_regex", the character length must be smaller than or equal to 500.'
1011
+ end
1012
+
1013
+ @language_regex = language_regex
1014
+ end
1015
+
1016
+ # Custom attribute writer method with validation
1017
+ # @param [Object] key_filter Value to be assigned
1018
+ def key_filter=(key_filter)
1019
+ if key_filter.nil?
1020
+ fail ArgumentError, 'key_filter cannot be nil'
1021
+ end
1022
+
1023
+ if key_filter.to_s.length > 500
1024
+ fail ArgumentError, 'invalid value for "key_filter", the character length must be smaller than or equal to 500.'
1025
+ end
1026
+
1027
+ @key_filter = key_filter
1028
+ end
1029
+
1030
+ # Custom attribute writer method with validation
1031
+ # @param [Object] variant_regex Value to be assigned
1032
+ def variant_regex=(variant_regex)
1033
+ if variant_regex.nil?
1034
+ fail ArgumentError, 'variant_regex cannot be nil'
1035
+ end
1036
+
1037
+ if variant_regex.to_s.length > 190
1038
+ fail ArgumentError, 'invalid value for "variant_regex", the character length must be smaller than or equal to 190.'
1039
+ end
1040
+
1041
+ @variant_regex = variant_regex
1042
+ end
1043
+
1044
+ # Checks equality by comparing each attribute.
1045
+ # @param [Object] Object to be compared
1046
+ def ==(o)
1047
+ return true if self.equal?(o)
1048
+ self.class == o.class &&
1049
+ name == o.name &&
1050
+ slug == o.slug &&
1051
+ id == o.id &&
1052
+ source_language == o.source_language &&
1053
+ project == o.project &&
1054
+ vcs == o.vcs &&
1055
+ repo == o.repo &&
1056
+ git_export == o.git_export &&
1057
+ branch == o.branch &&
1058
+ push_branch == o.push_branch &&
1059
+ filemask == o.filemask &&
1060
+ screenshot_filemask == o.screenshot_filemask &&
1061
+ template == o.template &&
1062
+ edit_template == o.edit_template &&
1063
+ intermediate == o.intermediate &&
1064
+ new_base == o.new_base &&
1065
+ file_format == o.file_format &&
1066
+ license == o.license &&
1067
+ license_url == o.license_url &&
1068
+ agreement == o.agreement &&
1069
+ web_url == o.web_url &&
1070
+ url == o.url &&
1071
+ repository_url == o.repository_url &&
1072
+ translations_url == o.translations_url &&
1073
+ statistics_url == o.statistics_url &&
1074
+ lock_url == o.lock_url &&
1075
+ links_url == o.links_url &&
1076
+ changes_list_url == o.changes_list_url &&
1077
+ task_url == o.task_url &&
1078
+ credits_url == o.credits_url &&
1079
+ new_lang == o.new_lang &&
1080
+ language_code_style == o.language_code_style &&
1081
+ push == o.push &&
1082
+ check_flags == o.check_flags &&
1083
+ priority == o.priority &&
1084
+ enforced_checks == o.enforced_checks &&
1085
+ restricted == o.restricted &&
1086
+ repoweb == o.repoweb &&
1087
+ report_source_bugs == o.report_source_bugs &&
1088
+ merge_style == o.merge_style &&
1089
+ commit_message == o.commit_message &&
1090
+ add_message == o.add_message &&
1091
+ delete_message == o.delete_message &&
1092
+ merge_message == o.merge_message &&
1093
+ addon_message == o.addon_message &&
1094
+ pull_message == o.pull_message &&
1095
+ allow_translation_propagation == o.allow_translation_propagation &&
1096
+ manage_units == o.manage_units &&
1097
+ enable_suggestions == o.enable_suggestions &&
1098
+ suggestion_voting == o.suggestion_voting &&
1099
+ suggestion_autoaccept == o.suggestion_autoaccept &&
1100
+ push_on_commit == o.push_on_commit &&
1101
+ commit_pending_age == o.commit_pending_age &&
1102
+ auto_lock_error == o.auto_lock_error &&
1103
+ language_regex == o.language_regex &&
1104
+ key_filter == o.key_filter &&
1105
+ variant_regex == o.variant_regex &&
1106
+ zipfile == o.zipfile &&
1107
+ docfile == o.docfile &&
1108
+ addons == o.addons &&
1109
+ is_glossary == o.is_glossary &&
1110
+ glossary_color == o.glossary_color &&
1111
+ disable_autoshare == o.disable_autoshare &&
1112
+ category == o.category &&
1113
+ linked_component == o.linked_component
1114
+ end
1115
+
1116
+ # @see the `==` method
1117
+ # @param [Object] Object to be compared
1118
+ def eql?(o)
1119
+ self == o
1120
+ end
1121
+
1122
+ # Calculates hash code according to all attributes.
1123
+ # @return [Integer] Hash code
1124
+ def hash
1125
+ [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
1126
+ end
1127
+
1128
+ # Builds the object from hash
1129
+ # @param [Hash] attributes Model attributes in the form of hash
1130
+ # @return [Object] Returns the model itself
1131
+ def self.build_from_hash(attributes)
1132
+ return nil unless attributes.is_a?(Hash)
1133
+ attributes = attributes.transform_keys(&:to_sym)
1134
+ transformed_hash = {}
1135
+ openapi_types.each_pair do |key, type|
1136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
1137
+ transformed_hash["#{key}"] = nil
1138
+ elsif type =~ /\AArray<(.*)>/i
1139
+ # check to ensure the input is an array given that the attribute
1140
+ # is documented as an array but the input is not
1141
+ if attributes[attribute_map[key]].is_a?(Array)
1142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
1143
+ end
1144
+ elsif !attributes[attribute_map[key]].nil?
1145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
1146
+ end
1147
+ end
1148
+ new(transformed_hash)
1149
+ end
1150
+
1151
+ # Deserializes the data based on type
1152
+ # @param string type Data type
1153
+ # @param string value Value to be deserialized
1154
+ # @return [Object] Deserialized data
1155
+ def self._deserialize(type, value)
1156
+ case type.to_sym
1157
+ when :Time
1158
+ Time.parse(value)
1159
+ when :Date
1160
+ Date.parse(value)
1161
+ when :String
1162
+ value.to_s
1163
+ when :Integer
1164
+ value.to_i
1165
+ when :Float
1166
+ value.to_f
1167
+ when :Boolean
1168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
1169
+ true
1170
+ else
1171
+ false
1172
+ end
1173
+ when :Object
1174
+ # generic object (usually a Hash), return directly
1175
+ value
1176
+ when /\AArray<(?<inner_type>.+)>\z/
1177
+ inner_type = Regexp.last_match[:inner_type]
1178
+ value.map { |v| _deserialize(inner_type, v) }
1179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
1180
+ k_type = Regexp.last_match[:k_type]
1181
+ v_type = Regexp.last_match[:v_type]
1182
+ {}.tap do |hash|
1183
+ value.each do |k, v|
1184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
1185
+ end
1186
+ end
1187
+ else # model
1188
+ # models (e.g. Pet) or oneOf
1189
+ klass = Weblate.const_get(type)
1190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
1191
+ end
1192
+ end
1193
+
1194
+ # Returns the string representation of the object
1195
+ # @return [String] String presentation of the object
1196
+ def to_s
1197
+ to_hash.to_s
1198
+ end
1199
+
1200
+ # to_body is an alias to to_hash (backward compatibility)
1201
+ # @return [Hash] Returns the object in the form of hash
1202
+ def to_body
1203
+ to_hash
1204
+ end
1205
+
1206
+ # Returns the object in the form of hash
1207
+ # @return [Hash] Returns the object in the form of hash
1208
+ def to_hash
1209
+ hash = {}
1210
+ self.class.attribute_map.each_pair do |attr, param|
1211
+ value = self.send(attr)
1212
+ if value.nil?
1213
+ is_nullable = self.class.openapi_nullable.include?(attr)
1214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
1215
+ end
1216
+
1217
+ hash[param] = _to_hash(value)
1218
+ end
1219
+ hash
1220
+ end
1221
+
1222
+ # Outputs non-array value in the form of hash
1223
+ # For object, use to_hash. Otherwise, just return the value
1224
+ # @param [Object] value Any valid value
1225
+ # @return [Hash] Returns the value in the form of hash
1226
+ def _to_hash(value)
1227
+ if value.is_a?(Array)
1228
+ value.compact.map { |v| _to_hash(v) }
1229
+ elsif value.is_a?(Hash)
1230
+ {}.tap do |hash|
1231
+ value.each { |k, v| hash[k] = _to_hash(v) }
1232
+ end
1233
+ elsif value.respond_to? :to_hash
1234
+ value.to_hash
1235
+ else
1236
+ value
1237
+ end
1238
+ end
1239
+
1240
+ end
1241
+
1242
+ end