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,760 @@
|
|
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 Translation
|
18
|
+
attr_accessor :language
|
19
|
+
|
20
|
+
attr_accessor :component
|
21
|
+
|
22
|
+
attr_accessor :language_code
|
23
|
+
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
attr_accessor :filename
|
27
|
+
|
28
|
+
attr_accessor :revision
|
29
|
+
|
30
|
+
attr_accessor :web_url
|
31
|
+
|
32
|
+
attr_accessor :share_url
|
33
|
+
|
34
|
+
attr_accessor :translate_url
|
35
|
+
|
36
|
+
attr_accessor :url
|
37
|
+
|
38
|
+
attr_accessor :is_template
|
39
|
+
|
40
|
+
attr_accessor :is_source
|
41
|
+
|
42
|
+
attr_accessor :total
|
43
|
+
|
44
|
+
attr_accessor :total_words
|
45
|
+
|
46
|
+
attr_accessor :translated
|
47
|
+
|
48
|
+
attr_accessor :translated_words
|
49
|
+
|
50
|
+
attr_accessor :translated_percent
|
51
|
+
|
52
|
+
attr_accessor :fuzzy
|
53
|
+
|
54
|
+
attr_accessor :fuzzy_words
|
55
|
+
|
56
|
+
attr_accessor :fuzzy_percent
|
57
|
+
|
58
|
+
attr_accessor :failing_checks
|
59
|
+
|
60
|
+
attr_accessor :failing_checks_words
|
61
|
+
|
62
|
+
attr_accessor :failing_checks_percent
|
63
|
+
|
64
|
+
attr_accessor :have_suggestion
|
65
|
+
|
66
|
+
attr_accessor :have_comment
|
67
|
+
|
68
|
+
attr_accessor :last_change
|
69
|
+
|
70
|
+
attr_accessor :last_author
|
71
|
+
|
72
|
+
attr_accessor :repository_url
|
73
|
+
|
74
|
+
attr_accessor :file_url
|
75
|
+
|
76
|
+
attr_accessor :statistics_url
|
77
|
+
|
78
|
+
attr_accessor :changes_list_url
|
79
|
+
|
80
|
+
attr_accessor :units_list_url
|
81
|
+
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'language' => :'language',
|
86
|
+
:'component' => :'component',
|
87
|
+
:'language_code' => :'language_code',
|
88
|
+
:'id' => :'id',
|
89
|
+
:'filename' => :'filename',
|
90
|
+
:'revision' => :'revision',
|
91
|
+
:'web_url' => :'web_url',
|
92
|
+
:'share_url' => :'share_url',
|
93
|
+
:'translate_url' => :'translate_url',
|
94
|
+
:'url' => :'url',
|
95
|
+
:'is_template' => :'is_template',
|
96
|
+
:'is_source' => :'is_source',
|
97
|
+
:'total' => :'total',
|
98
|
+
:'total_words' => :'total_words',
|
99
|
+
:'translated' => :'translated',
|
100
|
+
:'translated_words' => :'translated_words',
|
101
|
+
:'translated_percent' => :'translated_percent',
|
102
|
+
:'fuzzy' => :'fuzzy',
|
103
|
+
:'fuzzy_words' => :'fuzzy_words',
|
104
|
+
:'fuzzy_percent' => :'fuzzy_percent',
|
105
|
+
:'failing_checks' => :'failing_checks',
|
106
|
+
:'failing_checks_words' => :'failing_checks_words',
|
107
|
+
:'failing_checks_percent' => :'failing_checks_percent',
|
108
|
+
:'have_suggestion' => :'have_suggestion',
|
109
|
+
:'have_comment' => :'have_comment',
|
110
|
+
:'last_change' => :'last_change',
|
111
|
+
:'last_author' => :'last_author',
|
112
|
+
:'repository_url' => :'repository_url',
|
113
|
+
:'file_url' => :'file_url',
|
114
|
+
:'statistics_url' => :'statistics_url',
|
115
|
+
:'changes_list_url' => :'changes_list_url',
|
116
|
+
:'units_list_url' => :'units_list_url'
|
117
|
+
}
|
118
|
+
end
|
119
|
+
|
120
|
+
# Returns all the JSON keys this model knows about
|
121
|
+
def self.acceptable_attributes
|
122
|
+
attribute_map.values
|
123
|
+
end
|
124
|
+
|
125
|
+
# Attribute type mapping.
|
126
|
+
def self.openapi_types
|
127
|
+
{
|
128
|
+
:'language' => :'Language',
|
129
|
+
:'component' => :'Component',
|
130
|
+
:'language_code' => :'String',
|
131
|
+
:'id' => :'Integer',
|
132
|
+
:'filename' => :'String',
|
133
|
+
:'revision' => :'String',
|
134
|
+
:'web_url' => :'String',
|
135
|
+
:'share_url' => :'String',
|
136
|
+
:'translate_url' => :'String',
|
137
|
+
:'url' => :'String',
|
138
|
+
:'is_template' => :'Boolean',
|
139
|
+
:'is_source' => :'Boolean',
|
140
|
+
:'total' => :'Integer',
|
141
|
+
:'total_words' => :'Integer',
|
142
|
+
:'translated' => :'Integer',
|
143
|
+
:'translated_words' => :'Integer',
|
144
|
+
:'translated_percent' => :'Float',
|
145
|
+
:'fuzzy' => :'Integer',
|
146
|
+
:'fuzzy_words' => :'Integer',
|
147
|
+
:'fuzzy_percent' => :'Float',
|
148
|
+
:'failing_checks' => :'Integer',
|
149
|
+
:'failing_checks_words' => :'Integer',
|
150
|
+
:'failing_checks_percent' => :'Float',
|
151
|
+
:'have_suggestion' => :'Integer',
|
152
|
+
:'have_comment' => :'Integer',
|
153
|
+
:'last_change' => :'Time',
|
154
|
+
:'last_author' => :'String',
|
155
|
+
:'repository_url' => :'String',
|
156
|
+
:'file_url' => :'String',
|
157
|
+
:'statistics_url' => :'String',
|
158
|
+
:'changes_list_url' => :'String',
|
159
|
+
:'units_list_url' => :'String'
|
160
|
+
}
|
161
|
+
end
|
162
|
+
|
163
|
+
# List of attributes with nullable: true
|
164
|
+
def self.openapi_nullable
|
165
|
+
Set.new([
|
166
|
+
])
|
167
|
+
end
|
168
|
+
|
169
|
+
# Initializes the object
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
171
|
+
def initialize(attributes = {})
|
172
|
+
if (!attributes.is_a?(Hash))
|
173
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Weblate::Translation` initialize method"
|
174
|
+
end
|
175
|
+
|
176
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
177
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
178
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
179
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Weblate::Translation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
180
|
+
end
|
181
|
+
h[k.to_sym] = v
|
182
|
+
}
|
183
|
+
|
184
|
+
if attributes.key?(:'language')
|
185
|
+
self.language = attributes[:'language']
|
186
|
+
else
|
187
|
+
self.language = nil
|
188
|
+
end
|
189
|
+
|
190
|
+
if attributes.key?(:'component')
|
191
|
+
self.component = attributes[:'component']
|
192
|
+
else
|
193
|
+
self.component = nil
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'language_code')
|
197
|
+
self.language_code = attributes[:'language_code']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'id')
|
201
|
+
self.id = attributes[:'id']
|
202
|
+
else
|
203
|
+
self.id = nil
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'filename')
|
207
|
+
self.filename = attributes[:'filename']
|
208
|
+
else
|
209
|
+
self.filename = nil
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'revision')
|
213
|
+
self.revision = attributes[:'revision']
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'web_url')
|
217
|
+
self.web_url = attributes[:'web_url']
|
218
|
+
else
|
219
|
+
self.web_url = nil
|
220
|
+
end
|
221
|
+
|
222
|
+
if attributes.key?(:'share_url')
|
223
|
+
self.share_url = attributes[:'share_url']
|
224
|
+
else
|
225
|
+
self.share_url = nil
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'translate_url')
|
229
|
+
self.translate_url = attributes[:'translate_url']
|
230
|
+
else
|
231
|
+
self.translate_url = nil
|
232
|
+
end
|
233
|
+
|
234
|
+
if attributes.key?(:'url')
|
235
|
+
self.url = attributes[:'url']
|
236
|
+
else
|
237
|
+
self.url = nil
|
238
|
+
end
|
239
|
+
|
240
|
+
if attributes.key?(:'is_template')
|
241
|
+
self.is_template = attributes[:'is_template']
|
242
|
+
else
|
243
|
+
self.is_template = nil
|
244
|
+
end
|
245
|
+
|
246
|
+
if attributes.key?(:'is_source')
|
247
|
+
self.is_source = attributes[:'is_source']
|
248
|
+
else
|
249
|
+
self.is_source = nil
|
250
|
+
end
|
251
|
+
|
252
|
+
if attributes.key?(:'total')
|
253
|
+
self.total = attributes[:'total']
|
254
|
+
else
|
255
|
+
self.total = nil
|
256
|
+
end
|
257
|
+
|
258
|
+
if attributes.key?(:'total_words')
|
259
|
+
self.total_words = attributes[:'total_words']
|
260
|
+
else
|
261
|
+
self.total_words = nil
|
262
|
+
end
|
263
|
+
|
264
|
+
if attributes.key?(:'translated')
|
265
|
+
self.translated = attributes[:'translated']
|
266
|
+
else
|
267
|
+
self.translated = nil
|
268
|
+
end
|
269
|
+
|
270
|
+
if attributes.key?(:'translated_words')
|
271
|
+
self.translated_words = attributes[:'translated_words']
|
272
|
+
else
|
273
|
+
self.translated_words = nil
|
274
|
+
end
|
275
|
+
|
276
|
+
if attributes.key?(:'translated_percent')
|
277
|
+
self.translated_percent = attributes[:'translated_percent']
|
278
|
+
else
|
279
|
+
self.translated_percent = nil
|
280
|
+
end
|
281
|
+
|
282
|
+
if attributes.key?(:'fuzzy')
|
283
|
+
self.fuzzy = attributes[:'fuzzy']
|
284
|
+
else
|
285
|
+
self.fuzzy = nil
|
286
|
+
end
|
287
|
+
|
288
|
+
if attributes.key?(:'fuzzy_words')
|
289
|
+
self.fuzzy_words = attributes[:'fuzzy_words']
|
290
|
+
else
|
291
|
+
self.fuzzy_words = nil
|
292
|
+
end
|
293
|
+
|
294
|
+
if attributes.key?(:'fuzzy_percent')
|
295
|
+
self.fuzzy_percent = attributes[:'fuzzy_percent']
|
296
|
+
else
|
297
|
+
self.fuzzy_percent = nil
|
298
|
+
end
|
299
|
+
|
300
|
+
if attributes.key?(:'failing_checks')
|
301
|
+
self.failing_checks = attributes[:'failing_checks']
|
302
|
+
else
|
303
|
+
self.failing_checks = nil
|
304
|
+
end
|
305
|
+
|
306
|
+
if attributes.key?(:'failing_checks_words')
|
307
|
+
self.failing_checks_words = attributes[:'failing_checks_words']
|
308
|
+
else
|
309
|
+
self.failing_checks_words = nil
|
310
|
+
end
|
311
|
+
|
312
|
+
if attributes.key?(:'failing_checks_percent')
|
313
|
+
self.failing_checks_percent = attributes[:'failing_checks_percent']
|
314
|
+
else
|
315
|
+
self.failing_checks_percent = nil
|
316
|
+
end
|
317
|
+
|
318
|
+
if attributes.key?(:'have_suggestion')
|
319
|
+
self.have_suggestion = attributes[:'have_suggestion']
|
320
|
+
else
|
321
|
+
self.have_suggestion = nil
|
322
|
+
end
|
323
|
+
|
324
|
+
if attributes.key?(:'have_comment')
|
325
|
+
self.have_comment = attributes[:'have_comment']
|
326
|
+
else
|
327
|
+
self.have_comment = nil
|
328
|
+
end
|
329
|
+
|
330
|
+
if attributes.key?(:'last_change')
|
331
|
+
self.last_change = attributes[:'last_change']
|
332
|
+
else
|
333
|
+
self.last_change = nil
|
334
|
+
end
|
335
|
+
|
336
|
+
if attributes.key?(:'last_author')
|
337
|
+
self.last_author = attributes[:'last_author']
|
338
|
+
else
|
339
|
+
self.last_author = nil
|
340
|
+
end
|
341
|
+
|
342
|
+
if attributes.key?(:'repository_url')
|
343
|
+
self.repository_url = attributes[:'repository_url']
|
344
|
+
else
|
345
|
+
self.repository_url = nil
|
346
|
+
end
|
347
|
+
|
348
|
+
if attributes.key?(:'file_url')
|
349
|
+
self.file_url = attributes[:'file_url']
|
350
|
+
else
|
351
|
+
self.file_url = nil
|
352
|
+
end
|
353
|
+
|
354
|
+
if attributes.key?(:'statistics_url')
|
355
|
+
self.statistics_url = attributes[:'statistics_url']
|
356
|
+
else
|
357
|
+
self.statistics_url = nil
|
358
|
+
end
|
359
|
+
|
360
|
+
if attributes.key?(:'changes_list_url')
|
361
|
+
self.changes_list_url = attributes[:'changes_list_url']
|
362
|
+
else
|
363
|
+
self.changes_list_url = nil
|
364
|
+
end
|
365
|
+
|
366
|
+
if attributes.key?(:'units_list_url')
|
367
|
+
self.units_list_url = attributes[:'units_list_url']
|
368
|
+
else
|
369
|
+
self.units_list_url = nil
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
374
|
+
# @return Array for valid properties with the reasons
|
375
|
+
def list_invalid_properties
|
376
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
377
|
+
invalid_properties = Array.new
|
378
|
+
if @language.nil?
|
379
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
380
|
+
end
|
381
|
+
|
382
|
+
if @component.nil?
|
383
|
+
invalid_properties.push('invalid value for "component", component cannot be nil.')
|
384
|
+
end
|
385
|
+
|
386
|
+
if !@language_code.nil? && @language_code.to_s.length > 50
|
387
|
+
invalid_properties.push('invalid value for "language_code", the character length must be smaller than or equal to 50.')
|
388
|
+
end
|
389
|
+
|
390
|
+
if @id.nil?
|
391
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
392
|
+
end
|
393
|
+
|
394
|
+
if @filename.nil?
|
395
|
+
invalid_properties.push('invalid value for "filename", filename cannot be nil.')
|
396
|
+
end
|
397
|
+
|
398
|
+
if @filename.to_s.length > 400
|
399
|
+
invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 400.')
|
400
|
+
end
|
401
|
+
|
402
|
+
if !@revision.nil? && @revision.to_s.length > 200
|
403
|
+
invalid_properties.push('invalid value for "revision", the character length must be smaller than or equal to 200.')
|
404
|
+
end
|
405
|
+
|
406
|
+
if @web_url.nil?
|
407
|
+
invalid_properties.push('invalid value for "web_url", web_url cannot be nil.')
|
408
|
+
end
|
409
|
+
|
410
|
+
if @share_url.nil?
|
411
|
+
invalid_properties.push('invalid value for "share_url", share_url cannot be nil.')
|
412
|
+
end
|
413
|
+
|
414
|
+
if @translate_url.nil?
|
415
|
+
invalid_properties.push('invalid value for "translate_url", translate_url cannot be nil.')
|
416
|
+
end
|
417
|
+
|
418
|
+
if @url.nil?
|
419
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
420
|
+
end
|
421
|
+
|
422
|
+
if @is_template.nil?
|
423
|
+
invalid_properties.push('invalid value for "is_template", is_template cannot be nil.')
|
424
|
+
end
|
425
|
+
|
426
|
+
if @is_source.nil?
|
427
|
+
invalid_properties.push('invalid value for "is_source", is_source cannot be nil.')
|
428
|
+
end
|
429
|
+
|
430
|
+
if @total.nil?
|
431
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
432
|
+
end
|
433
|
+
|
434
|
+
if @total_words.nil?
|
435
|
+
invalid_properties.push('invalid value for "total_words", total_words cannot be nil.')
|
436
|
+
end
|
437
|
+
|
438
|
+
if @translated.nil?
|
439
|
+
invalid_properties.push('invalid value for "translated", translated cannot be nil.')
|
440
|
+
end
|
441
|
+
|
442
|
+
if @translated_words.nil?
|
443
|
+
invalid_properties.push('invalid value for "translated_words", translated_words cannot be nil.')
|
444
|
+
end
|
445
|
+
|
446
|
+
if @translated_percent.nil?
|
447
|
+
invalid_properties.push('invalid value for "translated_percent", translated_percent cannot be nil.')
|
448
|
+
end
|
449
|
+
|
450
|
+
if @fuzzy.nil?
|
451
|
+
invalid_properties.push('invalid value for "fuzzy", fuzzy cannot be nil.')
|
452
|
+
end
|
453
|
+
|
454
|
+
if @fuzzy_words.nil?
|
455
|
+
invalid_properties.push('invalid value for "fuzzy_words", fuzzy_words cannot be nil.')
|
456
|
+
end
|
457
|
+
|
458
|
+
if @fuzzy_percent.nil?
|
459
|
+
invalid_properties.push('invalid value for "fuzzy_percent", fuzzy_percent cannot be nil.')
|
460
|
+
end
|
461
|
+
|
462
|
+
if @failing_checks.nil?
|
463
|
+
invalid_properties.push('invalid value for "failing_checks", failing_checks cannot be nil.')
|
464
|
+
end
|
465
|
+
|
466
|
+
if @failing_checks_words.nil?
|
467
|
+
invalid_properties.push('invalid value for "failing_checks_words", failing_checks_words cannot be nil.')
|
468
|
+
end
|
469
|
+
|
470
|
+
if @failing_checks_percent.nil?
|
471
|
+
invalid_properties.push('invalid value for "failing_checks_percent", failing_checks_percent cannot be nil.')
|
472
|
+
end
|
473
|
+
|
474
|
+
if @have_suggestion.nil?
|
475
|
+
invalid_properties.push('invalid value for "have_suggestion", have_suggestion cannot be nil.')
|
476
|
+
end
|
477
|
+
|
478
|
+
if @have_comment.nil?
|
479
|
+
invalid_properties.push('invalid value for "have_comment", have_comment cannot be nil.')
|
480
|
+
end
|
481
|
+
|
482
|
+
if @last_change.nil?
|
483
|
+
invalid_properties.push('invalid value for "last_change", last_change cannot be nil.')
|
484
|
+
end
|
485
|
+
|
486
|
+
if @last_author.nil?
|
487
|
+
invalid_properties.push('invalid value for "last_author", last_author cannot be nil.')
|
488
|
+
end
|
489
|
+
|
490
|
+
if @repository_url.nil?
|
491
|
+
invalid_properties.push('invalid value for "repository_url", repository_url cannot be nil.')
|
492
|
+
end
|
493
|
+
|
494
|
+
if @file_url.nil?
|
495
|
+
invalid_properties.push('invalid value for "file_url", file_url cannot be nil.')
|
496
|
+
end
|
497
|
+
|
498
|
+
if @statistics_url.nil?
|
499
|
+
invalid_properties.push('invalid value for "statistics_url", statistics_url cannot be nil.')
|
500
|
+
end
|
501
|
+
|
502
|
+
if @changes_list_url.nil?
|
503
|
+
invalid_properties.push('invalid value for "changes_list_url", changes_list_url cannot be nil.')
|
504
|
+
end
|
505
|
+
|
506
|
+
if @units_list_url.nil?
|
507
|
+
invalid_properties.push('invalid value for "units_list_url", units_list_url cannot be nil.')
|
508
|
+
end
|
509
|
+
|
510
|
+
invalid_properties
|
511
|
+
end
|
512
|
+
|
513
|
+
# Check to see if the all the properties in the model are valid
|
514
|
+
# @return true if the model is valid
|
515
|
+
def valid?
|
516
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
517
|
+
return false if @language.nil?
|
518
|
+
return false if @component.nil?
|
519
|
+
return false if !@language_code.nil? && @language_code.to_s.length > 50
|
520
|
+
return false if @id.nil?
|
521
|
+
return false if @filename.nil?
|
522
|
+
return false if @filename.to_s.length > 400
|
523
|
+
return false if !@revision.nil? && @revision.to_s.length > 200
|
524
|
+
return false if @web_url.nil?
|
525
|
+
return false if @share_url.nil?
|
526
|
+
return false if @translate_url.nil?
|
527
|
+
return false if @url.nil?
|
528
|
+
return false if @is_template.nil?
|
529
|
+
return false if @is_source.nil?
|
530
|
+
return false if @total.nil?
|
531
|
+
return false if @total_words.nil?
|
532
|
+
return false if @translated.nil?
|
533
|
+
return false if @translated_words.nil?
|
534
|
+
return false if @translated_percent.nil?
|
535
|
+
return false if @fuzzy.nil?
|
536
|
+
return false if @fuzzy_words.nil?
|
537
|
+
return false if @fuzzy_percent.nil?
|
538
|
+
return false if @failing_checks.nil?
|
539
|
+
return false if @failing_checks_words.nil?
|
540
|
+
return false if @failing_checks_percent.nil?
|
541
|
+
return false if @have_suggestion.nil?
|
542
|
+
return false if @have_comment.nil?
|
543
|
+
return false if @last_change.nil?
|
544
|
+
return false if @last_author.nil?
|
545
|
+
return false if @repository_url.nil?
|
546
|
+
return false if @file_url.nil?
|
547
|
+
return false if @statistics_url.nil?
|
548
|
+
return false if @changes_list_url.nil?
|
549
|
+
return false if @units_list_url.nil?
|
550
|
+
true
|
551
|
+
end
|
552
|
+
|
553
|
+
# Custom attribute writer method with validation
|
554
|
+
# @param [Object] language_code Value to be assigned
|
555
|
+
def language_code=(language_code)
|
556
|
+
if language_code.nil?
|
557
|
+
fail ArgumentError, 'language_code cannot be nil'
|
558
|
+
end
|
559
|
+
|
560
|
+
if language_code.to_s.length > 50
|
561
|
+
fail ArgumentError, 'invalid value for "language_code", the character length must be smaller than or equal to 50.'
|
562
|
+
end
|
563
|
+
|
564
|
+
@language_code = language_code
|
565
|
+
end
|
566
|
+
|
567
|
+
# Custom attribute writer method with validation
|
568
|
+
# @param [Object] filename Value to be assigned
|
569
|
+
def filename=(filename)
|
570
|
+
if filename.nil?
|
571
|
+
fail ArgumentError, 'filename cannot be nil'
|
572
|
+
end
|
573
|
+
|
574
|
+
if filename.to_s.length > 400
|
575
|
+
fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 400.'
|
576
|
+
end
|
577
|
+
|
578
|
+
@filename = filename
|
579
|
+
end
|
580
|
+
|
581
|
+
# Custom attribute writer method with validation
|
582
|
+
# @param [Object] revision Value to be assigned
|
583
|
+
def revision=(revision)
|
584
|
+
if revision.nil?
|
585
|
+
fail ArgumentError, 'revision cannot be nil'
|
586
|
+
end
|
587
|
+
|
588
|
+
if revision.to_s.length > 200
|
589
|
+
fail ArgumentError, 'invalid value for "revision", the character length must be smaller than or equal to 200.'
|
590
|
+
end
|
591
|
+
|
592
|
+
@revision = revision
|
593
|
+
end
|
594
|
+
|
595
|
+
# Checks equality by comparing each attribute.
|
596
|
+
# @param [Object] Object to be compared
|
597
|
+
def ==(o)
|
598
|
+
return true if self.equal?(o)
|
599
|
+
self.class == o.class &&
|
600
|
+
language == o.language &&
|
601
|
+
component == o.component &&
|
602
|
+
language_code == o.language_code &&
|
603
|
+
id == o.id &&
|
604
|
+
filename == o.filename &&
|
605
|
+
revision == o.revision &&
|
606
|
+
web_url == o.web_url &&
|
607
|
+
share_url == o.share_url &&
|
608
|
+
translate_url == o.translate_url &&
|
609
|
+
url == o.url &&
|
610
|
+
is_template == o.is_template &&
|
611
|
+
is_source == o.is_source &&
|
612
|
+
total == o.total &&
|
613
|
+
total_words == o.total_words &&
|
614
|
+
translated == o.translated &&
|
615
|
+
translated_words == o.translated_words &&
|
616
|
+
translated_percent == o.translated_percent &&
|
617
|
+
fuzzy == o.fuzzy &&
|
618
|
+
fuzzy_words == o.fuzzy_words &&
|
619
|
+
fuzzy_percent == o.fuzzy_percent &&
|
620
|
+
failing_checks == o.failing_checks &&
|
621
|
+
failing_checks_words == o.failing_checks_words &&
|
622
|
+
failing_checks_percent == o.failing_checks_percent &&
|
623
|
+
have_suggestion == o.have_suggestion &&
|
624
|
+
have_comment == o.have_comment &&
|
625
|
+
last_change == o.last_change &&
|
626
|
+
last_author == o.last_author &&
|
627
|
+
repository_url == o.repository_url &&
|
628
|
+
file_url == o.file_url &&
|
629
|
+
statistics_url == o.statistics_url &&
|
630
|
+
changes_list_url == o.changes_list_url &&
|
631
|
+
units_list_url == o.units_list_url
|
632
|
+
end
|
633
|
+
|
634
|
+
# @see the `==` method
|
635
|
+
# @param [Object] Object to be compared
|
636
|
+
def eql?(o)
|
637
|
+
self == o
|
638
|
+
end
|
639
|
+
|
640
|
+
# Calculates hash code according to all attributes.
|
641
|
+
# @return [Integer] Hash code
|
642
|
+
def hash
|
643
|
+
[language, component, language_code, id, filename, revision, web_url, share_url, translate_url, url, is_template, is_source, total, total_words, translated, translated_words, translated_percent, fuzzy, fuzzy_words, fuzzy_percent, failing_checks, failing_checks_words, failing_checks_percent, have_suggestion, have_comment, last_change, last_author, repository_url, file_url, statistics_url, changes_list_url, units_list_url].hash
|
644
|
+
end
|
645
|
+
|
646
|
+
# Builds the object from hash
|
647
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
648
|
+
# @return [Object] Returns the model itself
|
649
|
+
def self.build_from_hash(attributes)
|
650
|
+
return nil unless attributes.is_a?(Hash)
|
651
|
+
attributes = attributes.transform_keys(&:to_sym)
|
652
|
+
transformed_hash = {}
|
653
|
+
openapi_types.each_pair do |key, type|
|
654
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
655
|
+
transformed_hash["#{key}"] = nil
|
656
|
+
elsif type =~ /\AArray<(.*)>/i
|
657
|
+
# check to ensure the input is an array given that the attribute
|
658
|
+
# is documented as an array but the input is not
|
659
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
660
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
661
|
+
end
|
662
|
+
elsif !attributes[attribute_map[key]].nil?
|
663
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
664
|
+
end
|
665
|
+
end
|
666
|
+
new(transformed_hash)
|
667
|
+
end
|
668
|
+
|
669
|
+
# Deserializes the data based on type
|
670
|
+
# @param string type Data type
|
671
|
+
# @param string value Value to be deserialized
|
672
|
+
# @return [Object] Deserialized data
|
673
|
+
def self._deserialize(type, value)
|
674
|
+
case type.to_sym
|
675
|
+
when :Time
|
676
|
+
Time.parse(value)
|
677
|
+
when :Date
|
678
|
+
Date.parse(value)
|
679
|
+
when :String
|
680
|
+
value.to_s
|
681
|
+
when :Integer
|
682
|
+
value.to_i
|
683
|
+
when :Float
|
684
|
+
value.to_f
|
685
|
+
when :Boolean
|
686
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
687
|
+
true
|
688
|
+
else
|
689
|
+
false
|
690
|
+
end
|
691
|
+
when :Object
|
692
|
+
# generic object (usually a Hash), return directly
|
693
|
+
value
|
694
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
695
|
+
inner_type = Regexp.last_match[:inner_type]
|
696
|
+
value.map { |v| _deserialize(inner_type, v) }
|
697
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
698
|
+
k_type = Regexp.last_match[:k_type]
|
699
|
+
v_type = Regexp.last_match[:v_type]
|
700
|
+
{}.tap do |hash|
|
701
|
+
value.each do |k, v|
|
702
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
703
|
+
end
|
704
|
+
end
|
705
|
+
else # model
|
706
|
+
# models (e.g. Pet) or oneOf
|
707
|
+
klass = Weblate.const_get(type)
|
708
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
709
|
+
end
|
710
|
+
end
|
711
|
+
|
712
|
+
# Returns the string representation of the object
|
713
|
+
# @return [String] String presentation of the object
|
714
|
+
def to_s
|
715
|
+
to_hash.to_s
|
716
|
+
end
|
717
|
+
|
718
|
+
# to_body is an alias to to_hash (backward compatibility)
|
719
|
+
# @return [Hash] Returns the object in the form of hash
|
720
|
+
def to_body
|
721
|
+
to_hash
|
722
|
+
end
|
723
|
+
|
724
|
+
# Returns the object in the form of hash
|
725
|
+
# @return [Hash] Returns the object in the form of hash
|
726
|
+
def to_hash
|
727
|
+
hash = {}
|
728
|
+
self.class.attribute_map.each_pair do |attr, param|
|
729
|
+
value = self.send(attr)
|
730
|
+
if value.nil?
|
731
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
732
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
733
|
+
end
|
734
|
+
|
735
|
+
hash[param] = _to_hash(value)
|
736
|
+
end
|
737
|
+
hash
|
738
|
+
end
|
739
|
+
|
740
|
+
# Outputs non-array value in the form of hash
|
741
|
+
# For object, use to_hash. Otherwise, just return the value
|
742
|
+
# @param [Object] value Any valid value
|
743
|
+
# @return [Hash] Returns the value in the form of hash
|
744
|
+
def _to_hash(value)
|
745
|
+
if value.is_a?(Array)
|
746
|
+
value.compact.map { |v| _to_hash(v) }
|
747
|
+
elsif value.is_a?(Hash)
|
748
|
+
{}.tap do |hash|
|
749
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
750
|
+
end
|
751
|
+
elsif value.respond_to? :to_hash
|
752
|
+
value.to_hash
|
753
|
+
else
|
754
|
+
value
|
755
|
+
end
|
756
|
+
end
|
757
|
+
|
758
|
+
end
|
759
|
+
|
760
|
+
end
|