weblate 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/COPYING +674 -0
- data/Gemfile +8 -0
- data/README.md +334 -0
- data/Rakefile +49 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/bin/smoketest +14 -0
- data/bin/smoketest~ +0 -0
- data/docs/ActionEnum.md +15 -0
- data/docs/Addon.md +28 -0
- data/docs/AddonsApi.md +366 -0
- data/docs/AutoComponentList.md +20 -0
- data/docs/BasicUser.md +22 -0
- data/docs/BlankEnum.md +15 -0
- data/docs/CategoriesApi.md +520 -0
- data/docs/Category.md +30 -0
- data/docs/Change.md +42 -0
- data/docs/ChangesApi.md +163 -0
- data/docs/ColorEnum.md +15 -0
- data/docs/Component.md +146 -0
- data/docs/ComponentLanguageCodeStyle.md +49 -0
- data/docs/ComponentList.md +30 -0
- data/docs/ComponentListsApi.md +667 -0
- data/docs/ComponentsApi.md +1653 -0
- data/docs/ConflictsEnum.md +15 -0
- data/docs/DirectionEnum.md +15 -0
- data/docs/FileFormatEnum.md +15 -0
- data/docs/FrequencyEnum.md +15 -0
- data/docs/FuzzyEnum.md +15 -0
- data/docs/Group.md +40 -0
- data/docs/GroupsApi.md +1257 -0
- data/docs/Language.md +36 -0
- data/docs/LanguageCodeStyleEnum.md +15 -0
- data/docs/LanguagePlural.md +26 -0
- data/docs/LanguageSelectionEnum.md +15 -0
- data/docs/LanguagesApi.md +520 -0
- data/docs/LicenseEnum.md +15 -0
- data/docs/LockRequest.md +18 -0
- data/docs/Memory.md +34 -0
- data/docs/MemoryApi.md +448 -0
- data/docs/MergeStyleEnum.md +15 -0
- data/docs/MethodEnum.md +15 -0
- data/docs/Metrics.md +42 -0
- data/docs/MetricsApi.md +81 -0
- data/docs/NewLangEnum.md +15 -0
- data/docs/Notification.md +28 -0
- data/docs/NotificationEnum.md +15 -0
- data/docs/OperationEnum.md +15 -0
- data/docs/PaginatedAddonList.md +24 -0
- data/docs/PaginatedBasicUserList.md +24 -0
- data/docs/PaginatedCategoryList.md +24 -0
- data/docs/PaginatedChangeList.md +24 -0
- data/docs/PaginatedComponentList.md +24 -0
- data/docs/PaginatedComponentListList.md +24 -0
- data/docs/PaginatedGroupList.md +24 -0
- data/docs/PaginatedLanguageList.md +24 -0
- data/docs/PaginatedMemoryList.md +24 -0
- data/docs/PaginatedNotificationList.md +24 -0
- data/docs/PaginatedProjectList.md +24 -0
- data/docs/PaginatedRoleList.md +24 -0
- data/docs/PaginatedScreenshotList.md +24 -0
- data/docs/PaginatedTranslationList.md +24 -0
- data/docs/PaginatedUnitList.md +24 -0
- data/docs/PatchedAddon.md +28 -0
- data/docs/PatchedBasicUser.md +22 -0
- data/docs/PatchedCategory.md +30 -0
- data/docs/PatchedComponent.md +146 -0
- data/docs/PatchedComponentList.md +30 -0
- data/docs/PatchedGroup.md +40 -0
- data/docs/PatchedLanguage.md +36 -0
- data/docs/PatchedMemory.md +34 -0
- data/docs/PatchedNotification.md +28 -0
- data/docs/PatchedProject.md +58 -0
- data/docs/PatchedRole.md +24 -0
- data/docs/PatchedScreenshot.md +30 -0
- data/docs/PatchedUnitWrite.md +26 -0
- data/docs/PriorityEnum.md +15 -0
- data/docs/Project.md +58 -0
- data/docs/ProjectSelectionEnum.md +15 -0
- data/docs/ProjectsApi.md +1392 -0
- data/docs/RepoRequest.md +18 -0
- data/docs/Role.md +24 -0
- data/docs/RolesApi.md +448 -0
- data/docs/ScopeEnum.md +15 -0
- data/docs/Screenshot.md +30 -0
- data/docs/ScreenshotFile.md +18 -0
- data/docs/ScreenshotsApi.md +815 -0
- data/docs/SearchApi.md +75 -0
- data/docs/SourceEnum.md +15 -0
- data/docs/StateEnum.md +15 -0
- data/docs/TasksApi.md +145 -0
- data/docs/TextDirection.md +49 -0
- data/docs/Translation.md +80 -0
- data/docs/TranslationsApi.md +1028 -0
- data/docs/Unit.md +76 -0
- data/docs/UnitFlatLabels.md +24 -0
- data/docs/UnitLabels.md +24 -0
- data/docs/UnitWrite.md +26 -0
- data/docs/UnitsApi.md +376 -0
- data/docs/UploadRequest.md +28 -0
- data/docs/UploadRequestConflicts.md +49 -0
- data/docs/UploadRequestFuzzy.md +49 -0
- data/docs/UsersApi.md +1130 -0
- data/docs/VcsEnum.md +15 -0
- data/git_push.sh +57 -0
- data/lib/weblate/api/addons_api.rb +353 -0
- data/lib/weblate/api/categories_api.rb +495 -0
- data/lib/weblate/api/changes_api.rb +165 -0
- data/lib/weblate/api/component_lists_api.rb +642 -0
- data/lib/weblate/api/components_api.rb +1775 -0
- data/lib/weblate/api/groups_api.rb +1261 -0
- data/lib/weblate/api/languages_api.rb +495 -0
- data/lib/weblate/api/memory_api.rb +429 -0
- data/lib/weblate/api/metrics_api.rb +84 -0
- data/lib/weblate/api/projects_api.rb +1331 -0
- data/lib/weblate/api/roles_api.rb +429 -0
- data/lib/weblate/api/screenshots_api.rb +803 -0
- data/lib/weblate/api/search_api.rb +75 -0
- data/lib/weblate/api/tasks_api.rb +146 -0
- data/lib/weblate/api/translations_api.rb +1232 -0
- data/lib/weblate/api/units_api.rb +363 -0
- data/lib/weblate/api/users_api.rb +1104 -0
- data/lib/weblate/api_client.rb +437 -0
- data/lib/weblate/api_error.rb +58 -0
- data/lib/weblate/configuration.rb +392 -0
- data/lib/weblate/models/action_enum.rb +108 -0
- data/lib/weblate/models/addon.rb +314 -0
- data/lib/weblate/models/auto_component_list.rb +263 -0
- data/lib/weblate/models/basic_user.rb +292 -0
- data/lib/weblate/models/blank_enum.rb +39 -0
- data/lib/weblate/models/category.rb +361 -0
- data/lib/weblate/models/change.rb +408 -0
- data/lib/weblate/models/color_enum.rb +54 -0
- data/lib/weblate/models/component.rb +1377 -0
- data/lib/weblate/models/component_language_code_style.rb +106 -0
- data/lib/weblate/models/component_list.rb +366 -0
- data/lib/weblate/models/conflicts_enum.rb +41 -0
- data/lib/weblate/models/direction_enum.rb +40 -0
- data/lib/weblate/models/file_format_enum.rb +101 -0
- data/lib/weblate/models/frequency_enum.rb +43 -0
- data/lib/weblate/models/fuzzy_enum.rb +40 -0
- data/lib/weblate/models/group.rb +421 -0
- data/lib/weblate/models/language.rb +417 -0
- data/lib/weblate/models/language_code_style_enum.rb +51 -0
- data/lib/weblate/models/language_plural.rb +314 -0
- data/lib/weblate/models/language_selection_enum.rb +40 -0
- data/lib/weblate/models/license_enum.rb +677 -0
- data/lib/weblate/models/lock_request.rb +221 -0
- data/lib/weblate/models/memory.rb +329 -0
- data/lib/weblate/models/merge_style_enum.rb +41 -0
- data/lib/weblate/models/method_enum.rb +45 -0
- data/lib/weblate/models/metrics.rb +415 -0
- data/lib/weblate/models/new_lang_enum.rb +42 -0
- data/lib/weblate/models/notification.rb +323 -0
- data/lib/weblate/models/notification_enum.rb +60 -0
- data/lib/weblate/models/operation_enum.rb +43 -0
- data/lib/weblate/models/paginated_addon_list.rb +259 -0
- data/lib/weblate/models/paginated_basic_user_list.rb +259 -0
- data/lib/weblate/models/paginated_category_list.rb +259 -0
- data/lib/weblate/models/paginated_change_list.rb +259 -0
- data/lib/weblate/models/paginated_component_list.rb +259 -0
- data/lib/weblate/models/paginated_component_list_list.rb +259 -0
- data/lib/weblate/models/paginated_group_list.rb +259 -0
- data/lib/weblate/models/paginated_language_list.rb +259 -0
- data/lib/weblate/models/paginated_memory_list.rb +259 -0
- data/lib/weblate/models/paginated_notification_list.rb +259 -0
- data/lib/weblate/models/paginated_project_list.rb +259 -0
- data/lib/weblate/models/paginated_role_list.rb +259 -0
- data/lib/weblate/models/paginated_screenshot_list.rb +259 -0
- data/lib/weblate/models/paginated_translation_list.rb +259 -0
- data/lib/weblate/models/paginated_unit_list.rb +259 -0
- data/lib/weblate/models/patched_addon.rb +279 -0
- data/lib/weblate/models/patched_basic_user.rb +271 -0
- data/lib/weblate/models/patched_category.rb +319 -0
- data/lib/weblate/models/patched_component.rb +1242 -0
- data/lib/weblate/models/patched_component_list.rb +324 -0
- data/lib/weblate/models/patched_group.rb +365 -0
- data/lib/weblate/models/patched_language.rb +375 -0
- data/lib/weblate/models/patched_memory.rb +287 -0
- data/lib/weblate/models/patched_notification.rb +281 -0
- data/lib/weblate/models/patched_project.rb +472 -0
- data/lib/weblate/models/patched_role.rb +262 -0
- data/lib/weblate/models/patched_screenshot.rb +309 -0
- data/lib/weblate/models/patched_unit_write.rb +279 -0
- data/lib/weblate/models/priority_enum.rb +43 -0
- data/lib/weblate/models/project.rb +563 -0
- data/lib/weblate/models/project_selection_enum.rb +43 -0
- data/lib/weblate/models/repo_request.rb +243 -0
- data/lib/weblate/models/role.rb +290 -0
- data/lib/weblate/models/scope_enum.rb +43 -0
- data/lib/weblate/models/screenshot.rb +351 -0
- data/lib/weblate/models/screenshot_file.rb +221 -0
- data/lib/weblate/models/source_enum.rb +45 -0
- data/lib/weblate/models/state_enum.rb +43 -0
- data/lib/weblate/models/text_direction.rb +105 -0
- data/lib/weblate/models/translation.rb +760 -0
- data/lib/weblate/models/unit.rb +757 -0
- data/lib/weblate/models/unit_flat_labels.rb +315 -0
- data/lib/weblate/models/unit_labels.rb +315 -0
- data/lib/weblate/models/unit_write.rb +293 -0
- data/lib/weblate/models/upload_request.rb +307 -0
- data/lib/weblate/models/upload_request_conflicts.rb +105 -0
- data/lib/weblate/models/upload_request_fuzzy.rb +105 -0
- data/lib/weblate/models/vcs_enum.rb +46 -0
- data/lib/weblate/version.rb +15 -0
- data/lib/weblate.rb +135 -0
- data/manifest.scm +6 -0
- data/schema.patched.yaml +10113 -0
- data/schema.yaml +10116 -0
- data/sig/weblate.rbs +4 -0
- data/spec/api/addons_api_spec.rb +88 -0
- data/spec/api/categories_api_spec.rb +115 -0
- data/spec/api/changes_api_spec.rb +62 -0
- data/spec/api/component_lists_api_spec.rb +139 -0
- data/spec/api/components_api_spec.rb +307 -0
- data/spec/api/groups_api_spec.rb +236 -0
- data/spec/api/languages_api_spec.rb +115 -0
- data/spec/api/memory_api_spec.rb +104 -0
- data/spec/api/metrics_api_spec.rb +46 -0
- data/spec/api/projects_api_spec.rb +251 -0
- data/spec/api/roles_api_spec.rb +104 -0
- data/spec/api/screenshots_api_spec.rb +163 -0
- data/spec/api/search_api_spec.rb +45 -0
- data/spec/api/tasks_api_spec.rb +55 -0
- data/spec/api/translations_api_spec.rb +218 -0
- data/spec/api/units_api_spec.rb +93 -0
- data/spec/api/users_api_spec.rb +218 -0
- data/spec/models/action_enum_spec.rb +30 -0
- data/spec/models/addon_spec.rb +66 -0
- data/spec/models/auto_component_list_spec.rb +42 -0
- data/spec/models/basic_user_spec.rb +48 -0
- data/spec/models/blank_enum_spec.rb +30 -0
- data/spec/models/category_spec.rb +72 -0
- data/spec/models/change_spec.rb +108 -0
- data/spec/models/color_enum_spec.rb +30 -0
- data/spec/models/component_language_code_style_spec.rb +32 -0
- data/spec/models/component_list_spec.rb +72 -0
- data/spec/models/component_spec.rb +420 -0
- data/spec/models/conflicts_enum_spec.rb +30 -0
- data/spec/models/direction_enum_spec.rb +30 -0
- data/spec/models/file_format_enum_spec.rb +30 -0
- data/spec/models/frequency_enum_spec.rb +30 -0
- data/spec/models/fuzzy_enum_spec.rb +30 -0
- data/spec/models/group_spec.rb +102 -0
- data/spec/models/language_code_style_enum_spec.rb +30 -0
- data/spec/models/language_plural_spec.rb +60 -0
- data/spec/models/language_selection_enum_spec.rb +30 -0
- data/spec/models/language_spec.rb +90 -0
- data/spec/models/license_enum_spec.rb +30 -0
- data/spec/models/lock_request_spec.rb +36 -0
- data/spec/models/memory_spec.rb +84 -0
- data/spec/models/merge_style_enum_spec.rb +30 -0
- data/spec/models/method_enum_spec.rb +30 -0
- data/spec/models/metrics_spec.rb +108 -0
- data/spec/models/new_lang_enum_spec.rb +30 -0
- data/spec/models/notification_enum_spec.rb +30 -0
- data/spec/models/notification_spec.rb +66 -0
- data/spec/models/operation_enum_spec.rb +30 -0
- data/spec/models/paginated_addon_list_spec.rb +54 -0
- data/spec/models/paginated_basic_user_list_spec.rb +54 -0
- data/spec/models/paginated_category_list_spec.rb +54 -0
- data/spec/models/paginated_change_list_spec.rb +54 -0
- data/spec/models/paginated_component_list_list_spec.rb +54 -0
- data/spec/models/paginated_component_list_spec.rb +54 -0
- data/spec/models/paginated_group_list_spec.rb +54 -0
- data/spec/models/paginated_language_list_spec.rb +54 -0
- data/spec/models/paginated_memory_list_spec.rb +54 -0
- data/spec/models/paginated_notification_list_spec.rb +54 -0
- data/spec/models/paginated_project_list_spec.rb +54 -0
- data/spec/models/paginated_role_list_spec.rb +54 -0
- data/spec/models/paginated_screenshot_list_spec.rb +54 -0
- data/spec/models/paginated_translation_list_spec.rb +54 -0
- data/spec/models/paginated_unit_list_spec.rb +54 -0
- data/spec/models/patched_addon_spec.rb +66 -0
- data/spec/models/patched_basic_user_spec.rb +48 -0
- data/spec/models/patched_category_spec.rb +72 -0
- data/spec/models/patched_component_list_spec.rb +72 -0
- data/spec/models/patched_component_spec.rb +420 -0
- data/spec/models/patched_group_spec.rb +102 -0
- data/spec/models/patched_language_spec.rb +90 -0
- data/spec/models/patched_memory_spec.rb +84 -0
- data/spec/models/patched_notification_spec.rb +66 -0
- data/spec/models/patched_project_spec.rb +156 -0
- data/spec/models/patched_role_spec.rb +54 -0
- data/spec/models/patched_screenshot_spec.rb +72 -0
- data/spec/models/patched_unit_write_spec.rb +60 -0
- data/spec/models/priority_enum_spec.rb +30 -0
- data/spec/models/project_selection_enum_spec.rb +30 -0
- data/spec/models/project_spec.rb +156 -0
- data/spec/models/repo_request_spec.rb +36 -0
- data/spec/models/role_spec.rb +54 -0
- data/spec/models/scope_enum_spec.rb +30 -0
- data/spec/models/screenshot_file_spec.rb +36 -0
- data/spec/models/screenshot_spec.rb +72 -0
- data/spec/models/source_enum_spec.rb +30 -0
- data/spec/models/state_enum_spec.rb +30 -0
- data/spec/models/text_direction_spec.rb +32 -0
- data/spec/models/translation_spec.rb +222 -0
- data/spec/models/unit_flat_labels_spec.rb +54 -0
- data/spec/models/unit_labels_spec.rb +54 -0
- data/spec/models/unit_spec.rb +210 -0
- data/spec/models/unit_write_spec.rb +60 -0
- data/spec/models/upload_request_conflicts_spec.rb +32 -0
- data/spec/models/upload_request_fuzzy_spec.rb +32 -0
- data/spec/models/upload_request_spec.rb +66 -0
- data/spec/models/vcs_enum_spec.rb +30 -0
- data/spec/spec_helper.rb +111 -0
- data/weblate.gemspec +47 -0
- metadata +526 -0
@@ -0,0 +1,563 @@
|
|
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 Project
|
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
|
+
# Main website of translated project.
|
27
|
+
attr_accessor :web
|
28
|
+
|
29
|
+
attr_accessor :web_url
|
30
|
+
|
31
|
+
attr_accessor :url
|
32
|
+
|
33
|
+
attr_accessor :components_list_url
|
34
|
+
|
35
|
+
attr_accessor :repository_url
|
36
|
+
|
37
|
+
attr_accessor :statistics_url
|
38
|
+
|
39
|
+
attr_accessor :categories_url
|
40
|
+
|
41
|
+
attr_accessor :changes_list_url
|
42
|
+
|
43
|
+
attr_accessor :languages_url
|
44
|
+
|
45
|
+
attr_accessor :labels_url
|
46
|
+
|
47
|
+
attr_accessor :credits_url
|
48
|
+
|
49
|
+
# Requires dedicated reviewers to approve translations.
|
50
|
+
attr_accessor :translation_review
|
51
|
+
|
52
|
+
# Requires dedicated reviewers to approve source strings.
|
53
|
+
attr_accessor :source_review
|
54
|
+
|
55
|
+
# Lets Weblate update the \"Language-Team\" file header of your project.
|
56
|
+
attr_accessor :set_language_team
|
57
|
+
|
58
|
+
# You can use Markdown and mention users by @username.
|
59
|
+
attr_accessor :instructions
|
60
|
+
|
61
|
+
# Whether to allow updating this repository by remote hooks.
|
62
|
+
attr_accessor :enable_hooks
|
63
|
+
|
64
|
+
# Comma-separated list of language code mappings, for example: en_GB:en,en_US:en
|
65
|
+
attr_accessor :language_aliases
|
66
|
+
|
67
|
+
# Requires contributors to have two-factor authentication configured before being able to contribute.
|
68
|
+
attr_accessor :enforced_2fa
|
69
|
+
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
71
|
+
def self.attribute_map
|
72
|
+
{
|
73
|
+
:'name' => :'name',
|
74
|
+
:'slug' => :'slug',
|
75
|
+
:'id' => :'id',
|
76
|
+
:'web' => :'web',
|
77
|
+
:'web_url' => :'web_url',
|
78
|
+
:'url' => :'url',
|
79
|
+
:'components_list_url' => :'components_list_url',
|
80
|
+
:'repository_url' => :'repository_url',
|
81
|
+
:'statistics_url' => :'statistics_url',
|
82
|
+
:'categories_url' => :'categories_url',
|
83
|
+
:'changes_list_url' => :'changes_list_url',
|
84
|
+
:'languages_url' => :'languages_url',
|
85
|
+
:'labels_url' => :'labels_url',
|
86
|
+
:'credits_url' => :'credits_url',
|
87
|
+
:'translation_review' => :'translation_review',
|
88
|
+
:'source_review' => :'source_review',
|
89
|
+
:'set_language_team' => :'set_language_team',
|
90
|
+
:'instructions' => :'instructions',
|
91
|
+
:'enable_hooks' => :'enable_hooks',
|
92
|
+
:'language_aliases' => :'language_aliases',
|
93
|
+
:'enforced_2fa' => :'enforced_2fa'
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns all the JSON keys this model knows about
|
98
|
+
def self.acceptable_attributes
|
99
|
+
attribute_map.values
|
100
|
+
end
|
101
|
+
|
102
|
+
# Attribute type mapping.
|
103
|
+
def self.openapi_types
|
104
|
+
{
|
105
|
+
:'name' => :'String',
|
106
|
+
:'slug' => :'String',
|
107
|
+
:'id' => :'Integer',
|
108
|
+
:'web' => :'String',
|
109
|
+
:'web_url' => :'String',
|
110
|
+
:'url' => :'String',
|
111
|
+
:'components_list_url' => :'String',
|
112
|
+
:'repository_url' => :'String',
|
113
|
+
:'statistics_url' => :'String',
|
114
|
+
:'categories_url' => :'String',
|
115
|
+
:'changes_list_url' => :'String',
|
116
|
+
:'languages_url' => :'String',
|
117
|
+
:'labels_url' => :'String',
|
118
|
+
:'credits_url' => :'String',
|
119
|
+
:'translation_review' => :'Boolean',
|
120
|
+
:'source_review' => :'Boolean',
|
121
|
+
:'set_language_team' => :'Boolean',
|
122
|
+
:'instructions' => :'String',
|
123
|
+
:'enable_hooks' => :'Boolean',
|
124
|
+
:'language_aliases' => :'String',
|
125
|
+
:'enforced_2fa' => :'Boolean'
|
126
|
+
}
|
127
|
+
end
|
128
|
+
|
129
|
+
# List of attributes with nullable: true
|
130
|
+
def self.openapi_nullable
|
131
|
+
Set.new([
|
132
|
+
])
|
133
|
+
end
|
134
|
+
|
135
|
+
# Initializes the object
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
def initialize(attributes = {})
|
138
|
+
if (!attributes.is_a?(Hash))
|
139
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weblate::Project` initialize method"
|
140
|
+
end
|
141
|
+
|
142
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
143
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
144
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
145
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weblate::Project`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
146
|
+
end
|
147
|
+
h[k.to_sym] = v
|
148
|
+
}
|
149
|
+
|
150
|
+
if attributes.key?(:'name')
|
151
|
+
self.name = attributes[:'name']
|
152
|
+
else
|
153
|
+
self.name = nil
|
154
|
+
end
|
155
|
+
|
156
|
+
if attributes.key?(:'slug')
|
157
|
+
self.slug = attributes[:'slug']
|
158
|
+
else
|
159
|
+
self.slug = nil
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'id')
|
163
|
+
self.id = attributes[:'id']
|
164
|
+
else
|
165
|
+
self.id = nil
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'web')
|
169
|
+
self.web = attributes[:'web']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'web_url')
|
173
|
+
self.web_url = attributes[:'web_url']
|
174
|
+
else
|
175
|
+
self.web_url = nil
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'url')
|
179
|
+
self.url = attributes[:'url']
|
180
|
+
else
|
181
|
+
self.url = nil
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'components_list_url')
|
185
|
+
self.components_list_url = attributes[:'components_list_url']
|
186
|
+
else
|
187
|
+
self.components_list_url = nil
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'repository_url')
|
191
|
+
self.repository_url = attributes[:'repository_url']
|
192
|
+
else
|
193
|
+
self.repository_url = nil
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'statistics_url')
|
197
|
+
self.statistics_url = attributes[:'statistics_url']
|
198
|
+
else
|
199
|
+
self.statistics_url = nil
|
200
|
+
end
|
201
|
+
|
202
|
+
if attributes.key?(:'categories_url')
|
203
|
+
self.categories_url = attributes[:'categories_url']
|
204
|
+
else
|
205
|
+
self.categories_url = nil
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'changes_list_url')
|
209
|
+
self.changes_list_url = attributes[:'changes_list_url']
|
210
|
+
else
|
211
|
+
self.changes_list_url = nil
|
212
|
+
end
|
213
|
+
|
214
|
+
if attributes.key?(:'languages_url')
|
215
|
+
self.languages_url = attributes[:'languages_url']
|
216
|
+
else
|
217
|
+
self.languages_url = nil
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'labels_url')
|
221
|
+
self.labels_url = attributes[:'labels_url']
|
222
|
+
else
|
223
|
+
self.labels_url = nil
|
224
|
+
end
|
225
|
+
|
226
|
+
if attributes.key?(:'credits_url')
|
227
|
+
self.credits_url = attributes[:'credits_url']
|
228
|
+
else
|
229
|
+
self.credits_url = nil
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'translation_review')
|
233
|
+
self.translation_review = attributes[:'translation_review']
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'source_review')
|
237
|
+
self.source_review = attributes[:'source_review']
|
238
|
+
end
|
239
|
+
|
240
|
+
if attributes.key?(:'set_language_team')
|
241
|
+
self.set_language_team = attributes[:'set_language_team']
|
242
|
+
end
|
243
|
+
|
244
|
+
if attributes.key?(:'instructions')
|
245
|
+
self.instructions = attributes[:'instructions']
|
246
|
+
end
|
247
|
+
|
248
|
+
if attributes.key?(:'enable_hooks')
|
249
|
+
self.enable_hooks = attributes[:'enable_hooks']
|
250
|
+
end
|
251
|
+
|
252
|
+
if attributes.key?(:'language_aliases')
|
253
|
+
self.language_aliases = attributes[:'language_aliases']
|
254
|
+
end
|
255
|
+
|
256
|
+
if attributes.key?(:'enforced_2fa')
|
257
|
+
self.enforced_2fa = attributes[:'enforced_2fa']
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
262
|
+
# @return Array for valid properties with the reasons
|
263
|
+
def list_invalid_properties
|
264
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
265
|
+
invalid_properties = Array.new
|
266
|
+
if @name.nil?
|
267
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
268
|
+
end
|
269
|
+
|
270
|
+
if @name.to_s.length > 60
|
271
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 60.')
|
272
|
+
end
|
273
|
+
|
274
|
+
if @slug.nil?
|
275
|
+
invalid_properties.push('invalid value for "slug", slug cannot be nil.')
|
276
|
+
end
|
277
|
+
|
278
|
+
if @slug.to_s.length > 60
|
279
|
+
invalid_properties.push('invalid value for "slug", the character length must be smaller than or equal to 60.')
|
280
|
+
end
|
281
|
+
|
282
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
283
|
+
if @slug !~ pattern
|
284
|
+
invalid_properties.push("invalid value for \"slug\", must conform to the pattern #{pattern}.")
|
285
|
+
end
|
286
|
+
|
287
|
+
if @id.nil?
|
288
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
289
|
+
end
|
290
|
+
|
291
|
+
if !@web.nil? && @web.to_s.length > 200
|
292
|
+
invalid_properties.push('invalid value for "web", the character length must be smaller than or equal to 200.')
|
293
|
+
end
|
294
|
+
|
295
|
+
if @web_url.nil?
|
296
|
+
invalid_properties.push('invalid value for "web_url", web_url cannot be nil.')
|
297
|
+
end
|
298
|
+
|
299
|
+
if @url.nil?
|
300
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
301
|
+
end
|
302
|
+
|
303
|
+
if @components_list_url.nil?
|
304
|
+
invalid_properties.push('invalid value for "components_list_url", components_list_url cannot be nil.')
|
305
|
+
end
|
306
|
+
|
307
|
+
if @repository_url.nil?
|
308
|
+
invalid_properties.push('invalid value for "repository_url", repository_url cannot be nil.')
|
309
|
+
end
|
310
|
+
|
311
|
+
if @statistics_url.nil?
|
312
|
+
invalid_properties.push('invalid value for "statistics_url", statistics_url cannot be nil.')
|
313
|
+
end
|
314
|
+
|
315
|
+
if @categories_url.nil?
|
316
|
+
invalid_properties.push('invalid value for "categories_url", categories_url cannot be nil.')
|
317
|
+
end
|
318
|
+
|
319
|
+
if @changes_list_url.nil?
|
320
|
+
invalid_properties.push('invalid value for "changes_list_url", changes_list_url cannot be nil.')
|
321
|
+
end
|
322
|
+
|
323
|
+
if @languages_url.nil?
|
324
|
+
invalid_properties.push('invalid value for "languages_url", languages_url cannot be nil.')
|
325
|
+
end
|
326
|
+
|
327
|
+
if @labels_url.nil?
|
328
|
+
invalid_properties.push('invalid value for "labels_url", labels_url cannot be nil.')
|
329
|
+
end
|
330
|
+
|
331
|
+
if @credits_url.nil?
|
332
|
+
invalid_properties.push('invalid value for "credits_url", credits_url cannot be nil.')
|
333
|
+
end
|
334
|
+
|
335
|
+
invalid_properties
|
336
|
+
end
|
337
|
+
|
338
|
+
# Check to see if the all the properties in the model are valid
|
339
|
+
# @return true if the model is valid
|
340
|
+
def valid?
|
341
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
342
|
+
return false if @name.nil?
|
343
|
+
return false if @name.to_s.length > 60
|
344
|
+
return false if @slug.nil?
|
345
|
+
return false if @slug.to_s.length > 60
|
346
|
+
return false if @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
347
|
+
return false if @id.nil?
|
348
|
+
return false if !@web.nil? && @web.to_s.length > 200
|
349
|
+
return false if @web_url.nil?
|
350
|
+
return false if @url.nil?
|
351
|
+
return false if @components_list_url.nil?
|
352
|
+
return false if @repository_url.nil?
|
353
|
+
return false if @statistics_url.nil?
|
354
|
+
return false if @categories_url.nil?
|
355
|
+
return false if @changes_list_url.nil?
|
356
|
+
return false if @languages_url.nil?
|
357
|
+
return false if @labels_url.nil?
|
358
|
+
return false if @credits_url.nil?
|
359
|
+
true
|
360
|
+
end
|
361
|
+
|
362
|
+
# Custom attribute writer method with validation
|
363
|
+
# @param [Object] name Value to be assigned
|
364
|
+
def name=(name)
|
365
|
+
if name.nil?
|
366
|
+
fail ArgumentError, 'name cannot be nil'
|
367
|
+
end
|
368
|
+
|
369
|
+
if name.to_s.length > 60
|
370
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 60.'
|
371
|
+
end
|
372
|
+
|
373
|
+
@name = name
|
374
|
+
end
|
375
|
+
|
376
|
+
# Custom attribute writer method with validation
|
377
|
+
# @param [Object] slug Value to be assigned
|
378
|
+
def slug=(slug)
|
379
|
+
if slug.nil?
|
380
|
+
fail ArgumentError, 'slug cannot be nil'
|
381
|
+
end
|
382
|
+
|
383
|
+
if slug.to_s.length > 60
|
384
|
+
fail ArgumentError, 'invalid value for "slug", the character length must be smaller than or equal to 60.'
|
385
|
+
end
|
386
|
+
|
387
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
388
|
+
if slug !~ pattern
|
389
|
+
fail ArgumentError, "invalid value for \"slug\", must conform to the pattern #{pattern}."
|
390
|
+
end
|
391
|
+
|
392
|
+
@slug = slug
|
393
|
+
end
|
394
|
+
|
395
|
+
# Custom attribute writer method with validation
|
396
|
+
# @param [Object] web Value to be assigned
|
397
|
+
def web=(web)
|
398
|
+
if web.nil?
|
399
|
+
fail ArgumentError, 'web cannot be nil'
|
400
|
+
end
|
401
|
+
|
402
|
+
if web.to_s.length > 200
|
403
|
+
fail ArgumentError, 'invalid value for "web", the character length must be smaller than or equal to 200.'
|
404
|
+
end
|
405
|
+
|
406
|
+
@web = web
|
407
|
+
end
|
408
|
+
|
409
|
+
# Checks equality by comparing each attribute.
|
410
|
+
# @param [Object] Object to be compared
|
411
|
+
def ==(o)
|
412
|
+
return true if self.equal?(o)
|
413
|
+
self.class == o.class &&
|
414
|
+
name == o.name &&
|
415
|
+
slug == o.slug &&
|
416
|
+
id == o.id &&
|
417
|
+
web == o.web &&
|
418
|
+
web_url == o.web_url &&
|
419
|
+
url == o.url &&
|
420
|
+
components_list_url == o.components_list_url &&
|
421
|
+
repository_url == o.repository_url &&
|
422
|
+
statistics_url == o.statistics_url &&
|
423
|
+
categories_url == o.categories_url &&
|
424
|
+
changes_list_url == o.changes_list_url &&
|
425
|
+
languages_url == o.languages_url &&
|
426
|
+
labels_url == o.labels_url &&
|
427
|
+
credits_url == o.credits_url &&
|
428
|
+
translation_review == o.translation_review &&
|
429
|
+
source_review == o.source_review &&
|
430
|
+
set_language_team == o.set_language_team &&
|
431
|
+
instructions == o.instructions &&
|
432
|
+
enable_hooks == o.enable_hooks &&
|
433
|
+
language_aliases == o.language_aliases &&
|
434
|
+
enforced_2fa == o.enforced_2fa
|
435
|
+
end
|
436
|
+
|
437
|
+
# @see the `==` method
|
438
|
+
# @param [Object] Object to be compared
|
439
|
+
def eql?(o)
|
440
|
+
self == o
|
441
|
+
end
|
442
|
+
|
443
|
+
# Calculates hash code according to all attributes.
|
444
|
+
# @return [Integer] Hash code
|
445
|
+
def hash
|
446
|
+
[name, slug, id, web, web_url, url, components_list_url, repository_url, statistics_url, categories_url, changes_list_url, languages_url, labels_url, credits_url, translation_review, source_review, set_language_team, instructions, enable_hooks, language_aliases, enforced_2fa].hash
|
447
|
+
end
|
448
|
+
|
449
|
+
# Builds the object from hash
|
450
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
451
|
+
# @return [Object] Returns the model itself
|
452
|
+
def self.build_from_hash(attributes)
|
453
|
+
return nil unless attributes.is_a?(Hash)
|
454
|
+
attributes = attributes.transform_keys(&:to_sym)
|
455
|
+
transformed_hash = {}
|
456
|
+
openapi_types.each_pair do |key, type|
|
457
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
458
|
+
transformed_hash["#{key}"] = nil
|
459
|
+
elsif type =~ /\AArray<(.*)>/i
|
460
|
+
# check to ensure the input is an array given that the attribute
|
461
|
+
# is documented as an array but the input is not
|
462
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
463
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
464
|
+
end
|
465
|
+
elsif !attributes[attribute_map[key]].nil?
|
466
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
467
|
+
end
|
468
|
+
end
|
469
|
+
new(transformed_hash)
|
470
|
+
end
|
471
|
+
|
472
|
+
# Deserializes the data based on type
|
473
|
+
# @param string type Data type
|
474
|
+
# @param string value Value to be deserialized
|
475
|
+
# @return [Object] Deserialized data
|
476
|
+
def self._deserialize(type, value)
|
477
|
+
case type.to_sym
|
478
|
+
when :Time
|
479
|
+
Time.parse(value)
|
480
|
+
when :Date
|
481
|
+
Date.parse(value)
|
482
|
+
when :String
|
483
|
+
value.to_s
|
484
|
+
when :Integer
|
485
|
+
value.to_i
|
486
|
+
when :Float
|
487
|
+
value.to_f
|
488
|
+
when :Boolean
|
489
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
490
|
+
true
|
491
|
+
else
|
492
|
+
false
|
493
|
+
end
|
494
|
+
when :Object
|
495
|
+
# generic object (usually a Hash), return directly
|
496
|
+
value
|
497
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
498
|
+
inner_type = Regexp.last_match[:inner_type]
|
499
|
+
value.map { |v| _deserialize(inner_type, v) }
|
500
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
501
|
+
k_type = Regexp.last_match[:k_type]
|
502
|
+
v_type = Regexp.last_match[:v_type]
|
503
|
+
{}.tap do |hash|
|
504
|
+
value.each do |k, v|
|
505
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
506
|
+
end
|
507
|
+
end
|
508
|
+
else # model
|
509
|
+
# models (e.g. Pet) or oneOf
|
510
|
+
klass = Weblate.const_get(type)
|
511
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
512
|
+
end
|
513
|
+
end
|
514
|
+
|
515
|
+
# Returns the string representation of the object
|
516
|
+
# @return [String] String presentation of the object
|
517
|
+
def to_s
|
518
|
+
to_hash.to_s
|
519
|
+
end
|
520
|
+
|
521
|
+
# to_body is an alias to to_hash (backward compatibility)
|
522
|
+
# @return [Hash] Returns the object in the form of hash
|
523
|
+
def to_body
|
524
|
+
to_hash
|
525
|
+
end
|
526
|
+
|
527
|
+
# Returns the object in the form of hash
|
528
|
+
# @return [Hash] Returns the object in the form of hash
|
529
|
+
def to_hash
|
530
|
+
hash = {}
|
531
|
+
self.class.attribute_map.each_pair do |attr, param|
|
532
|
+
value = self.send(attr)
|
533
|
+
if value.nil?
|
534
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
535
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
536
|
+
end
|
537
|
+
|
538
|
+
hash[param] = _to_hash(value)
|
539
|
+
end
|
540
|
+
hash
|
541
|
+
end
|
542
|
+
|
543
|
+
# Outputs non-array value in the form of hash
|
544
|
+
# For object, use to_hash. Otherwise, just return the value
|
545
|
+
# @param [Object] value Any valid value
|
546
|
+
# @return [Hash] Returns the value in the form of hash
|
547
|
+
def _to_hash(value)
|
548
|
+
if value.is_a?(Array)
|
549
|
+
value.compact.map { |v| _to_hash(v) }
|
550
|
+
elsif value.is_a?(Hash)
|
551
|
+
{}.tap do |hash|
|
552
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
553
|
+
end
|
554
|
+
elsif value.respond_to? :to_hash
|
555
|
+
value.to_hash
|
556
|
+
else
|
557
|
+
value
|
558
|
+
end
|
559
|
+
end
|
560
|
+
|
561
|
+
end
|
562
|
+
|
563
|
+
end
|
@@ -0,0 +1,43 @@
|
|
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 ProjectSelectionEnum
|
18
|
+
N0 = 0.freeze
|
19
|
+
N1 = 1.freeze
|
20
|
+
N3 = 3.freeze
|
21
|
+
N4 = 4.freeze
|
22
|
+
N2 = 2.freeze
|
23
|
+
|
24
|
+
def self.all_vars
|
25
|
+
@all_vars ||= [N0, N1, N3, N4, N2].freeze
|
26
|
+
end
|
27
|
+
|
28
|
+
# Builds the enum from string
|
29
|
+
# @param [String] The enum value in the form of the string
|
30
|
+
# @return [String] The enum value
|
31
|
+
def self.build_from_hash(value)
|
32
|
+
new.build_from_hash(value)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Builds the enum from string
|
36
|
+
# @param [String] The enum value in the form of the string
|
37
|
+
# @return [String] The enum value
|
38
|
+
def build_from_hash(value)
|
39
|
+
return value if ProjectSelectionEnum.all_vars.include?(value)
|
40
|
+
raise "Invalid ENUM value #{value} for class #ProjectSelectionEnum"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|