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.
- 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,495 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Weblate
|
|
16
|
+
class CategoriesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Category API.
|
|
23
|
+
# @param category [Category]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Category]
|
|
26
|
+
def categories_create(category, opts = {})
|
|
27
|
+
data, _status_code, _headers = categories_create_with_http_info(category, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Category API.
|
|
32
|
+
# @param category [Category]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Category, Integer, Hash)>] Category data, response status code and response headers
|
|
35
|
+
def categories_create_with_http_info(category, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_create ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'category' is set
|
|
40
|
+
if @api_client.config.client_side_validation && category.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'category' when calling CategoriesApi.categories_create"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/categories/'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
|
|
49
|
+
# header parameters
|
|
50
|
+
header_params = opts[:header_params] || {}
|
|
51
|
+
# HTTP header 'Accept' (if needed)
|
|
52
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
53
|
+
# HTTP header 'Content-Type'
|
|
54
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
55
|
+
if !content_type.nil?
|
|
56
|
+
header_params['Content-Type'] = content_type
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(category)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'Category'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"CategoriesApi.categories_create",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Category API.
|
|
89
|
+
# @param id [String]
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [nil]
|
|
92
|
+
def categories_destroy(id, opts = {})
|
|
93
|
+
categories_destroy_with_http_info(id, opts)
|
|
94
|
+
nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Category API.
|
|
98
|
+
# @param id [String]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
101
|
+
def categories_destroy_with_http_info(id, opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_destroy ...'
|
|
104
|
+
end
|
|
105
|
+
# verify the required parameter 'id' is set
|
|
106
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
107
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CategoriesApi.categories_destroy"
|
|
108
|
+
end
|
|
109
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
110
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
111
|
+
fail ArgumentError, "invalid value for 'id' when calling CategoriesApi.categories_destroy, must conform to the pattern #{pattern}."
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = opts[:query_params] || {}
|
|
119
|
+
|
|
120
|
+
# header parameters
|
|
121
|
+
header_params = opts[:header_params] || {}
|
|
122
|
+
|
|
123
|
+
# form parameters
|
|
124
|
+
form_params = opts[:form_params] || {}
|
|
125
|
+
|
|
126
|
+
# http body (model)
|
|
127
|
+
post_body = opts[:debug_body]
|
|
128
|
+
|
|
129
|
+
# return_type
|
|
130
|
+
return_type = opts[:debug_return_type]
|
|
131
|
+
|
|
132
|
+
# auth_names
|
|
133
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
134
|
+
|
|
135
|
+
new_options = opts.merge(
|
|
136
|
+
:operation => :"CategoriesApi.categories_destroy",
|
|
137
|
+
:header_params => header_params,
|
|
138
|
+
:query_params => query_params,
|
|
139
|
+
:form_params => form_params,
|
|
140
|
+
:body => post_body,
|
|
141
|
+
:auth_names => auth_names,
|
|
142
|
+
:return_type => return_type
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
146
|
+
if @api_client.config.debugging
|
|
147
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
148
|
+
end
|
|
149
|
+
return data, status_code, headers
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Category API.
|
|
153
|
+
# @param [Hash] opts the optional parameters
|
|
154
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
155
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
156
|
+
# @return [PaginatedCategoryList]
|
|
157
|
+
def categories_list(opts = {})
|
|
158
|
+
data, _status_code, _headers = categories_list_with_http_info(opts)
|
|
159
|
+
data
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Category API.
|
|
163
|
+
# @param [Hash] opts the optional parameters
|
|
164
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
165
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
166
|
+
# @return [Array<(PaginatedCategoryList, Integer, Hash)>] PaginatedCategoryList data, response status code and response headers
|
|
167
|
+
def categories_list_with_http_info(opts = {})
|
|
168
|
+
if @api_client.config.debugging
|
|
169
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_list ...'
|
|
170
|
+
end
|
|
171
|
+
# resource path
|
|
172
|
+
local_var_path = '/categories/'
|
|
173
|
+
|
|
174
|
+
# query parameters
|
|
175
|
+
query_params = opts[:query_params] || {}
|
|
176
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
177
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
178
|
+
|
|
179
|
+
# header parameters
|
|
180
|
+
header_params = opts[:header_params] || {}
|
|
181
|
+
# HTTP header 'Accept' (if needed)
|
|
182
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
183
|
+
|
|
184
|
+
# form parameters
|
|
185
|
+
form_params = opts[:form_params] || {}
|
|
186
|
+
|
|
187
|
+
# http body (model)
|
|
188
|
+
post_body = opts[:debug_body]
|
|
189
|
+
|
|
190
|
+
# return_type
|
|
191
|
+
return_type = opts[:debug_return_type] || 'PaginatedCategoryList'
|
|
192
|
+
|
|
193
|
+
# auth_names
|
|
194
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
195
|
+
|
|
196
|
+
new_options = opts.merge(
|
|
197
|
+
:operation => :"CategoriesApi.categories_list",
|
|
198
|
+
:header_params => header_params,
|
|
199
|
+
:query_params => query_params,
|
|
200
|
+
:form_params => form_params,
|
|
201
|
+
:body => post_body,
|
|
202
|
+
:auth_names => auth_names,
|
|
203
|
+
:return_type => return_type
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
207
|
+
if @api_client.config.debugging
|
|
208
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
209
|
+
end
|
|
210
|
+
return data, status_code, headers
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Category API.
|
|
214
|
+
# @param id [String]
|
|
215
|
+
# @param [Hash] opts the optional parameters
|
|
216
|
+
# @option opts [PatchedCategory] :patched_category
|
|
217
|
+
# @return [Category]
|
|
218
|
+
def categories_partial_update(id, opts = {})
|
|
219
|
+
data, _status_code, _headers = categories_partial_update_with_http_info(id, opts)
|
|
220
|
+
data
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Category API.
|
|
224
|
+
# @param id [String]
|
|
225
|
+
# @param [Hash] opts the optional parameters
|
|
226
|
+
# @option opts [PatchedCategory] :patched_category
|
|
227
|
+
# @return [Array<(Category, Integer, Hash)>] Category data, response status code and response headers
|
|
228
|
+
def categories_partial_update_with_http_info(id, opts = {})
|
|
229
|
+
if @api_client.config.debugging
|
|
230
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_partial_update ...'
|
|
231
|
+
end
|
|
232
|
+
# verify the required parameter 'id' is set
|
|
233
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
234
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CategoriesApi.categories_partial_update"
|
|
235
|
+
end
|
|
236
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
237
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
238
|
+
fail ArgumentError, "invalid value for 'id' when calling CategoriesApi.categories_partial_update, must conform to the pattern #{pattern}."
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# resource path
|
|
242
|
+
local_var_path = '/categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
243
|
+
|
|
244
|
+
# query parameters
|
|
245
|
+
query_params = opts[:query_params] || {}
|
|
246
|
+
|
|
247
|
+
# header parameters
|
|
248
|
+
header_params = opts[:header_params] || {}
|
|
249
|
+
# HTTP header 'Accept' (if needed)
|
|
250
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
251
|
+
# HTTP header 'Content-Type'
|
|
252
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
253
|
+
if !content_type.nil?
|
|
254
|
+
header_params['Content-Type'] = content_type
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# form parameters
|
|
258
|
+
form_params = opts[:form_params] || {}
|
|
259
|
+
|
|
260
|
+
# http body (model)
|
|
261
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'patched_category'])
|
|
262
|
+
|
|
263
|
+
# return_type
|
|
264
|
+
return_type = opts[:debug_return_type] || 'Category'
|
|
265
|
+
|
|
266
|
+
# auth_names
|
|
267
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
268
|
+
|
|
269
|
+
new_options = opts.merge(
|
|
270
|
+
:operation => :"CategoriesApi.categories_partial_update",
|
|
271
|
+
:header_params => header_params,
|
|
272
|
+
:query_params => query_params,
|
|
273
|
+
:form_params => form_params,
|
|
274
|
+
:body => post_body,
|
|
275
|
+
:auth_names => auth_names,
|
|
276
|
+
:return_type => return_type
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
280
|
+
if @api_client.config.debugging
|
|
281
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
282
|
+
end
|
|
283
|
+
return data, status_code, headers
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Category API.
|
|
287
|
+
# @param id [String]
|
|
288
|
+
# @param [Hash] opts the optional parameters
|
|
289
|
+
# @return [Category]
|
|
290
|
+
def categories_retrieve(id, opts = {})
|
|
291
|
+
data, _status_code, _headers = categories_retrieve_with_http_info(id, opts)
|
|
292
|
+
data
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Category API.
|
|
296
|
+
# @param id [String]
|
|
297
|
+
# @param [Hash] opts the optional parameters
|
|
298
|
+
# @return [Array<(Category, Integer, Hash)>] Category data, response status code and response headers
|
|
299
|
+
def categories_retrieve_with_http_info(id, opts = {})
|
|
300
|
+
if @api_client.config.debugging
|
|
301
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_retrieve ...'
|
|
302
|
+
end
|
|
303
|
+
# verify the required parameter 'id' is set
|
|
304
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
305
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CategoriesApi.categories_retrieve"
|
|
306
|
+
end
|
|
307
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
308
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
309
|
+
fail ArgumentError, "invalid value for 'id' when calling CategoriesApi.categories_retrieve, must conform to the pattern #{pattern}."
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# resource path
|
|
313
|
+
local_var_path = '/categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
314
|
+
|
|
315
|
+
# query parameters
|
|
316
|
+
query_params = opts[:query_params] || {}
|
|
317
|
+
|
|
318
|
+
# header parameters
|
|
319
|
+
header_params = opts[:header_params] || {}
|
|
320
|
+
# HTTP header 'Accept' (if needed)
|
|
321
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
322
|
+
|
|
323
|
+
# form parameters
|
|
324
|
+
form_params = opts[:form_params] || {}
|
|
325
|
+
|
|
326
|
+
# http body (model)
|
|
327
|
+
post_body = opts[:debug_body]
|
|
328
|
+
|
|
329
|
+
# return_type
|
|
330
|
+
return_type = opts[:debug_return_type] || 'Category'
|
|
331
|
+
|
|
332
|
+
# auth_names
|
|
333
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
334
|
+
|
|
335
|
+
new_options = opts.merge(
|
|
336
|
+
:operation => :"CategoriesApi.categories_retrieve",
|
|
337
|
+
:header_params => header_params,
|
|
338
|
+
:query_params => query_params,
|
|
339
|
+
:form_params => form_params,
|
|
340
|
+
:body => post_body,
|
|
341
|
+
:auth_names => auth_names,
|
|
342
|
+
:return_type => return_type
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
346
|
+
if @api_client.config.debugging
|
|
347
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
348
|
+
end
|
|
349
|
+
return data, status_code, headers
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Category API.
|
|
353
|
+
# @param id [String]
|
|
354
|
+
# @param [Hash] opts the optional parameters
|
|
355
|
+
# @return [Category]
|
|
356
|
+
def categories_statistics_retrieve(id, opts = {})
|
|
357
|
+
data, _status_code, _headers = categories_statistics_retrieve_with_http_info(id, opts)
|
|
358
|
+
data
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Category API.
|
|
362
|
+
# @param id [String]
|
|
363
|
+
# @param [Hash] opts the optional parameters
|
|
364
|
+
# @return [Array<(Category, Integer, Hash)>] Category data, response status code and response headers
|
|
365
|
+
def categories_statistics_retrieve_with_http_info(id, opts = {})
|
|
366
|
+
if @api_client.config.debugging
|
|
367
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_statistics_retrieve ...'
|
|
368
|
+
end
|
|
369
|
+
# verify the required parameter 'id' is set
|
|
370
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
371
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CategoriesApi.categories_statistics_retrieve"
|
|
372
|
+
end
|
|
373
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
374
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
375
|
+
fail ArgumentError, "invalid value for 'id' when calling CategoriesApi.categories_statistics_retrieve, must conform to the pattern #{pattern}."
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# resource path
|
|
379
|
+
local_var_path = '/categories/{id}/statistics/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
380
|
+
|
|
381
|
+
# query parameters
|
|
382
|
+
query_params = opts[:query_params] || {}
|
|
383
|
+
|
|
384
|
+
# header parameters
|
|
385
|
+
header_params = opts[:header_params] || {}
|
|
386
|
+
# HTTP header 'Accept' (if needed)
|
|
387
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
388
|
+
|
|
389
|
+
# form parameters
|
|
390
|
+
form_params = opts[:form_params] || {}
|
|
391
|
+
|
|
392
|
+
# http body (model)
|
|
393
|
+
post_body = opts[:debug_body]
|
|
394
|
+
|
|
395
|
+
# return_type
|
|
396
|
+
return_type = opts[:debug_return_type] || 'Category'
|
|
397
|
+
|
|
398
|
+
# auth_names
|
|
399
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
400
|
+
|
|
401
|
+
new_options = opts.merge(
|
|
402
|
+
:operation => :"CategoriesApi.categories_statistics_retrieve",
|
|
403
|
+
:header_params => header_params,
|
|
404
|
+
:query_params => query_params,
|
|
405
|
+
:form_params => form_params,
|
|
406
|
+
:body => post_body,
|
|
407
|
+
:auth_names => auth_names,
|
|
408
|
+
:return_type => return_type
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
412
|
+
if @api_client.config.debugging
|
|
413
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_statistics_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
414
|
+
end
|
|
415
|
+
return data, status_code, headers
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# Category API.
|
|
419
|
+
# @param id [String]
|
|
420
|
+
# @param category [Category]
|
|
421
|
+
# @param [Hash] opts the optional parameters
|
|
422
|
+
# @return [Category]
|
|
423
|
+
def categories_update(id, category, opts = {})
|
|
424
|
+
data, _status_code, _headers = categories_update_with_http_info(id, category, opts)
|
|
425
|
+
data
|
|
426
|
+
end
|
|
427
|
+
|
|
428
|
+
# Category API.
|
|
429
|
+
# @param id [String]
|
|
430
|
+
# @param category [Category]
|
|
431
|
+
# @param [Hash] opts the optional parameters
|
|
432
|
+
# @return [Array<(Category, Integer, Hash)>] Category data, response status code and response headers
|
|
433
|
+
def categories_update_with_http_info(id, category, opts = {})
|
|
434
|
+
if @api_client.config.debugging
|
|
435
|
+
@api_client.config.logger.debug 'Calling API: CategoriesApi.categories_update ...'
|
|
436
|
+
end
|
|
437
|
+
# verify the required parameter 'id' is set
|
|
438
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
439
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CategoriesApi.categories_update"
|
|
440
|
+
end
|
|
441
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
442
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
443
|
+
fail ArgumentError, "invalid value for 'id' when calling CategoriesApi.categories_update, must conform to the pattern #{pattern}."
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
# verify the required parameter 'category' is set
|
|
447
|
+
if @api_client.config.client_side_validation && category.nil?
|
|
448
|
+
fail ArgumentError, "Missing the required parameter 'category' when calling CategoriesApi.categories_update"
|
|
449
|
+
end
|
|
450
|
+
# resource path
|
|
451
|
+
local_var_path = '/categories/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
452
|
+
|
|
453
|
+
# query parameters
|
|
454
|
+
query_params = opts[:query_params] || {}
|
|
455
|
+
|
|
456
|
+
# header parameters
|
|
457
|
+
header_params = opts[:header_params] || {}
|
|
458
|
+
# HTTP header 'Accept' (if needed)
|
|
459
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
460
|
+
# HTTP header 'Content-Type'
|
|
461
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
462
|
+
if !content_type.nil?
|
|
463
|
+
header_params['Content-Type'] = content_type
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
# form parameters
|
|
467
|
+
form_params = opts[:form_params] || {}
|
|
468
|
+
|
|
469
|
+
# http body (model)
|
|
470
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(category)
|
|
471
|
+
|
|
472
|
+
# return_type
|
|
473
|
+
return_type = opts[:debug_return_type] || 'Category'
|
|
474
|
+
|
|
475
|
+
# auth_names
|
|
476
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
477
|
+
|
|
478
|
+
new_options = opts.merge(
|
|
479
|
+
:operation => :"CategoriesApi.categories_update",
|
|
480
|
+
:header_params => header_params,
|
|
481
|
+
:query_params => query_params,
|
|
482
|
+
:form_params => form_params,
|
|
483
|
+
:body => post_body,
|
|
484
|
+
:auth_names => auth_names,
|
|
485
|
+
:return_type => return_type
|
|
486
|
+
)
|
|
487
|
+
|
|
488
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
489
|
+
if @api_client.config.debugging
|
|
490
|
+
@api_client.config.logger.debug "API called: CategoriesApi#categories_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
491
|
+
end
|
|
492
|
+
return data, status_code, headers
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
end
|
|
@@ -0,0 +1,165 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Weblate
|
|
16
|
+
class ChangesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Changes API.
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @option opts [Array<Integer>] :action * `0` - Resource updated * `1` - Translation completed * `2` - Translation changed * `5` - Translation added * `3` - Comment added * `4` - Suggestion added * `6` - Automatically translated * `7` - Suggestion accepted * `8` - Translation reverted * `9` - Translation uploaded * `13` - Source string added * `14` - Component locked * `15` - Component unlocked * `17` - Changes committed * `18` - Changes pushed * `19` - Repository reset * `20` - Repository merged * `21` - Repository rebased * `22` - Repository merge failed * `23` - Repository rebase failed * `28` - Repository push failed * `24` - Parsing failed * `25` - Translation removed * `26` - Suggestion removed * `27` - Translation replaced * `29` - Suggestion removed during cleanup * `30` - Source string changed * `31` - String added * `32` - Bulk status changed * `33` - Visibility changed * `34` - User added * `35` - User removed * `36` - Translation approved * `37` - Marked for edit * `38` - Component removed * `39` - Project removed * `41` - Project renamed * `42` - Component renamed * `43` - Moved component * `45` - Contributor joined * `46` - Announcement posted * `47` - Alert triggered * `48` - Language added * `49` - Language requested * `50` - Project created * `51` - Component created * `52` - User invited * `53` - Repository notification received * `54` - Translation replaced file by upload * `55` - License changed * `56` - Contributor agreement changed * `57` - Screenshot added * `58` - Screenshot uploaded * `59` - String updated in the repository * `60` - Add-on installed * `61` - Add-on configuration changed * `62` - Add-on uninstalled * `63` - String removed * `64` - Comment removed * `65` - Comment resolved * `66` - Explanation updated * `67` - Category removed * `68` - Category renamed * `69` - Category moved * `70` - Saving string failed * `71` - String added in the repository * `72` - String updated in the upload * `73` - String added in the upload * `74` - Translation updated by source upload * `75` - Component translation completed
|
|
25
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
26
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
27
|
+
# @option opts [Time] :timestamp_after
|
|
28
|
+
# @option opts [Time] :timestamp_before
|
|
29
|
+
# @option opts [String] :user
|
|
30
|
+
# @return [PaginatedChangeList]
|
|
31
|
+
def changes_list(opts = {})
|
|
32
|
+
data, _status_code, _headers = changes_list_with_http_info(opts)
|
|
33
|
+
data
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Changes API.
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [Array<Integer>] :action * `0` - Resource updated * `1` - Translation completed * `2` - Translation changed * `5` - Translation added * `3` - Comment added * `4` - Suggestion added * `6` - Automatically translated * `7` - Suggestion accepted * `8` - Translation reverted * `9` - Translation uploaded * `13` - Source string added * `14` - Component locked * `15` - Component unlocked * `17` - Changes committed * `18` - Changes pushed * `19` - Repository reset * `20` - Repository merged * `21` - Repository rebased * `22` - Repository merge failed * `23` - Repository rebase failed * `28` - Repository push failed * `24` - Parsing failed * `25` - Translation removed * `26` - Suggestion removed * `27` - Translation replaced * `29` - Suggestion removed during cleanup * `30` - Source string changed * `31` - String added * `32` - Bulk status changed * `33` - Visibility changed * `34` - User added * `35` - User removed * `36` - Translation approved * `37` - Marked for edit * `38` - Component removed * `39` - Project removed * `41` - Project renamed * `42` - Component renamed * `43` - Moved component * `45` - Contributor joined * `46` - Announcement posted * `47` - Alert triggered * `48` - Language added * `49` - Language requested * `50` - Project created * `51` - Component created * `52` - User invited * `53` - Repository notification received * `54` - Translation replaced file by upload * `55` - License changed * `56` - Contributor agreement changed * `57` - Screenshot added * `58` - Screenshot uploaded * `59` - String updated in the repository * `60` - Add-on installed * `61` - Add-on configuration changed * `62` - Add-on uninstalled * `63` - String removed * `64` - Comment removed * `65` - Comment resolved * `66` - Explanation updated * `67` - Category removed * `68` - Category renamed * `69` - Category moved * `70` - Saving string failed * `71` - String added in the repository * `72` - String updated in the upload * `73` - String added in the upload * `74` - Translation updated by source upload * `75` - Component translation completed
|
|
39
|
+
# @option opts [Integer] :page A page number within the paginated result set.
|
|
40
|
+
# @option opts [Integer] :page_size Number of results to return per page.
|
|
41
|
+
# @option opts [Time] :timestamp_after
|
|
42
|
+
# @option opts [Time] :timestamp_before
|
|
43
|
+
# @option opts [String] :user
|
|
44
|
+
# @return [Array<(PaginatedChangeList, Integer, Hash)>] PaginatedChangeList data, response status code and response headers
|
|
45
|
+
def changes_list_with_http_info(opts = {})
|
|
46
|
+
if @api_client.config.debugging
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: ChangesApi.changes_list ...'
|
|
48
|
+
end
|
|
49
|
+
allowable_values = [0, 1, 13, 14, 15, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 4, 41, 42, 43, 45, 46, 47, 48, 49, 5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 7, 70, 71, 72, 73, 74, 75, 8, 9]
|
|
50
|
+
if @api_client.config.client_side_validation && opts[:'action'] && !opts[:'action'].all? { |item| allowable_values.include?(item) }
|
|
51
|
+
fail ArgumentError, "invalid value for \"action\", must include one of #{allowable_values}"
|
|
52
|
+
end
|
|
53
|
+
# resource path
|
|
54
|
+
local_var_path = '/changes/'
|
|
55
|
+
|
|
56
|
+
# query parameters
|
|
57
|
+
query_params = opts[:query_params] || {}
|
|
58
|
+
query_params[:'action'] = @api_client.build_collection_param(opts[:'action'], :multi) if !opts[:'action'].nil?
|
|
59
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
60
|
+
query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
61
|
+
query_params[:'timestamp_after'] = opts[:'timestamp_after'] if !opts[:'timestamp_after'].nil?
|
|
62
|
+
query_params[:'timestamp_before'] = opts[:'timestamp_before'] if !opts[:'timestamp_before'].nil?
|
|
63
|
+
query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?
|
|
64
|
+
|
|
65
|
+
# header parameters
|
|
66
|
+
header_params = opts[:header_params] || {}
|
|
67
|
+
# HTTP header 'Accept' (if needed)
|
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
69
|
+
|
|
70
|
+
# form parameters
|
|
71
|
+
form_params = opts[:form_params] || {}
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:debug_body]
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:debug_return_type] || 'PaginatedChangeList'
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:operation => :"ChangesApi.changes_list",
|
|
84
|
+
:header_params => header_params,
|
|
85
|
+
:query_params => query_params,
|
|
86
|
+
:form_params => form_params,
|
|
87
|
+
:body => post_body,
|
|
88
|
+
:auth_names => auth_names,
|
|
89
|
+
:return_type => return_type
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
93
|
+
if @api_client.config.debugging
|
|
94
|
+
@api_client.config.logger.debug "API called: ChangesApi#changes_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
95
|
+
end
|
|
96
|
+
return data, status_code, headers
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Changes API.
|
|
100
|
+
# @param id [String]
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @return [Change]
|
|
103
|
+
def changes_retrieve(id, opts = {})
|
|
104
|
+
data, _status_code, _headers = changes_retrieve_with_http_info(id, opts)
|
|
105
|
+
data
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Changes API.
|
|
109
|
+
# @param id [String]
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @return [Array<(Change, Integer, Hash)>] Change data, response status code and response headers
|
|
112
|
+
def changes_retrieve_with_http_info(id, opts = {})
|
|
113
|
+
if @api_client.config.debugging
|
|
114
|
+
@api_client.config.logger.debug 'Calling API: ChangesApi.changes_retrieve ...'
|
|
115
|
+
end
|
|
116
|
+
# verify the required parameter 'id' is set
|
|
117
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
118
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ChangesApi.changes_retrieve"
|
|
119
|
+
end
|
|
120
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
121
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
122
|
+
fail ArgumentError, "invalid value for 'id' when calling ChangesApi.changes_retrieve, must conform to the pattern #{pattern}."
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# resource path
|
|
126
|
+
local_var_path = '/changes/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
127
|
+
|
|
128
|
+
# query parameters
|
|
129
|
+
query_params = opts[:query_params] || {}
|
|
130
|
+
|
|
131
|
+
# header parameters
|
|
132
|
+
header_params = opts[:header_params] || {}
|
|
133
|
+
# HTTP header 'Accept' (if needed)
|
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
135
|
+
|
|
136
|
+
# form parameters
|
|
137
|
+
form_params = opts[:form_params] || {}
|
|
138
|
+
|
|
139
|
+
# http body (model)
|
|
140
|
+
post_body = opts[:debug_body]
|
|
141
|
+
|
|
142
|
+
# return_type
|
|
143
|
+
return_type = opts[:debug_return_type] || 'Change'
|
|
144
|
+
|
|
145
|
+
# auth_names
|
|
146
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
147
|
+
|
|
148
|
+
new_options = opts.merge(
|
|
149
|
+
:operation => :"ChangesApi.changes_retrieve",
|
|
150
|
+
:header_params => header_params,
|
|
151
|
+
:query_params => query_params,
|
|
152
|
+
:form_params => form_params,
|
|
153
|
+
:body => post_body,
|
|
154
|
+
:auth_names => auth_names,
|
|
155
|
+
:return_type => return_type
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
159
|
+
if @api_client.config.debugging
|
|
160
|
+
@api_client.config.logger.debug "API called: ChangesApi#changes_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
161
|
+
end
|
|
162
|
+
return data, status_code, headers
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|