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,429 @@
|
|
|
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 MemoryApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Memory API.
|
|
23
|
+
# @param memory [Memory]
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [Memory]
|
|
26
|
+
def memory_create(memory, opts = {})
|
|
27
|
+
data, _status_code, _headers = memory_create_with_http_info(memory, opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Memory API.
|
|
32
|
+
# @param memory [Memory]
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(Memory, Integer, Hash)>] Memory data, response status code and response headers
|
|
35
|
+
def memory_create_with_http_info(memory, opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_create ...'
|
|
38
|
+
end
|
|
39
|
+
# verify the required parameter 'memory' is set
|
|
40
|
+
if @api_client.config.client_side_validation && memory.nil?
|
|
41
|
+
fail ArgumentError, "Missing the required parameter 'memory' when calling MemoryApi.memory_create"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/memory/'
|
|
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(memory)
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'Memory'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"MemoryApi.memory_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: MemoryApi#memory_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Memory API.
|
|
89
|
+
# @param id [String]
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [nil]
|
|
92
|
+
def memory_destroy(id, opts = {})
|
|
93
|
+
memory_destroy_with_http_info(id, opts)
|
|
94
|
+
nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Memory 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 memory_destroy_with_http_info(id, opts = {})
|
|
102
|
+
if @api_client.config.debugging
|
|
103
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_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 MemoryApi.memory_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 MemoryApi.memory_destroy, must conform to the pattern #{pattern}."
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = '/memory/{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 => :"MemoryApi.memory_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: MemoryApi#memory_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
148
|
+
end
|
|
149
|
+
return data, status_code, headers
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Memory 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 [PaginatedMemoryList]
|
|
157
|
+
def memory_list(opts = {})
|
|
158
|
+
data, _status_code, _headers = memory_list_with_http_info(opts)
|
|
159
|
+
data
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Memory 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<(PaginatedMemoryList, Integer, Hash)>] PaginatedMemoryList data, response status code and response headers
|
|
167
|
+
def memory_list_with_http_info(opts = {})
|
|
168
|
+
if @api_client.config.debugging
|
|
169
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_list ...'
|
|
170
|
+
end
|
|
171
|
+
# resource path
|
|
172
|
+
local_var_path = '/memory/'
|
|
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] || 'PaginatedMemoryList'
|
|
192
|
+
|
|
193
|
+
# auth_names
|
|
194
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
195
|
+
|
|
196
|
+
new_options = opts.merge(
|
|
197
|
+
:operation => :"MemoryApi.memory_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: MemoryApi#memory_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
209
|
+
end
|
|
210
|
+
return data, status_code, headers
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Memory API.
|
|
214
|
+
# @param id [String]
|
|
215
|
+
# @param [Hash] opts the optional parameters
|
|
216
|
+
# @option opts [PatchedMemory] :patched_memory
|
|
217
|
+
# @return [Memory]
|
|
218
|
+
def memory_partial_update(id, opts = {})
|
|
219
|
+
data, _status_code, _headers = memory_partial_update_with_http_info(id, opts)
|
|
220
|
+
data
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Memory API.
|
|
224
|
+
# @param id [String]
|
|
225
|
+
# @param [Hash] opts the optional parameters
|
|
226
|
+
# @option opts [PatchedMemory] :patched_memory
|
|
227
|
+
# @return [Array<(Memory, Integer, Hash)>] Memory data, response status code and response headers
|
|
228
|
+
def memory_partial_update_with_http_info(id, opts = {})
|
|
229
|
+
if @api_client.config.debugging
|
|
230
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_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 MemoryApi.memory_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 MemoryApi.memory_partial_update, must conform to the pattern #{pattern}."
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# resource path
|
|
242
|
+
local_var_path = '/memory/{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_memory'])
|
|
262
|
+
|
|
263
|
+
# return_type
|
|
264
|
+
return_type = opts[:debug_return_type] || 'Memory'
|
|
265
|
+
|
|
266
|
+
# auth_names
|
|
267
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
268
|
+
|
|
269
|
+
new_options = opts.merge(
|
|
270
|
+
:operation => :"MemoryApi.memory_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: MemoryApi#memory_partial_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
282
|
+
end
|
|
283
|
+
return data, status_code, headers
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Memory API.
|
|
287
|
+
# @param id [String]
|
|
288
|
+
# @param [Hash] opts the optional parameters
|
|
289
|
+
# @return [Memory]
|
|
290
|
+
def memory_retrieve(id, opts = {})
|
|
291
|
+
data, _status_code, _headers = memory_retrieve_with_http_info(id, opts)
|
|
292
|
+
data
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# Memory API.
|
|
296
|
+
# @param id [String]
|
|
297
|
+
# @param [Hash] opts the optional parameters
|
|
298
|
+
# @return [Array<(Memory, Integer, Hash)>] Memory data, response status code and response headers
|
|
299
|
+
def memory_retrieve_with_http_info(id, opts = {})
|
|
300
|
+
if @api_client.config.debugging
|
|
301
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_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 MemoryApi.memory_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 MemoryApi.memory_retrieve, must conform to the pattern #{pattern}."
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# resource path
|
|
313
|
+
local_var_path = '/memory/{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] || 'Memory'
|
|
331
|
+
|
|
332
|
+
# auth_names
|
|
333
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
334
|
+
|
|
335
|
+
new_options = opts.merge(
|
|
336
|
+
:operation => :"MemoryApi.memory_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: MemoryApi#memory_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
348
|
+
end
|
|
349
|
+
return data, status_code, headers
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Memory API.
|
|
353
|
+
# @param id [String]
|
|
354
|
+
# @param memory [Memory]
|
|
355
|
+
# @param [Hash] opts the optional parameters
|
|
356
|
+
# @return [Memory]
|
|
357
|
+
def memory_update(id, memory, opts = {})
|
|
358
|
+
data, _status_code, _headers = memory_update_with_http_info(id, memory, opts)
|
|
359
|
+
data
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Memory API.
|
|
363
|
+
# @param id [String]
|
|
364
|
+
# @param memory [Memory]
|
|
365
|
+
# @param [Hash] opts the optional parameters
|
|
366
|
+
# @return [Array<(Memory, Integer, Hash)>] Memory data, response status code and response headers
|
|
367
|
+
def memory_update_with_http_info(id, memory, opts = {})
|
|
368
|
+
if @api_client.config.debugging
|
|
369
|
+
@api_client.config.logger.debug 'Calling API: MemoryApi.memory_update ...'
|
|
370
|
+
end
|
|
371
|
+
# verify the required parameter 'id' is set
|
|
372
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
373
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling MemoryApi.memory_update"
|
|
374
|
+
end
|
|
375
|
+
pattern = Regexp.new(/^[^\/]+$/)
|
|
376
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
377
|
+
fail ArgumentError, "invalid value for 'id' when calling MemoryApi.memory_update, must conform to the pattern #{pattern}."
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
# verify the required parameter 'memory' is set
|
|
381
|
+
if @api_client.config.client_side_validation && memory.nil?
|
|
382
|
+
fail ArgumentError, "Missing the required parameter 'memory' when calling MemoryApi.memory_update"
|
|
383
|
+
end
|
|
384
|
+
# resource path
|
|
385
|
+
local_var_path = '/memory/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
386
|
+
|
|
387
|
+
# query parameters
|
|
388
|
+
query_params = opts[:query_params] || {}
|
|
389
|
+
|
|
390
|
+
# header parameters
|
|
391
|
+
header_params = opts[:header_params] || {}
|
|
392
|
+
# HTTP header 'Accept' (if needed)
|
|
393
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
394
|
+
# HTTP header 'Content-Type'
|
|
395
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
|
|
396
|
+
if !content_type.nil?
|
|
397
|
+
header_params['Content-Type'] = content_type
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
# form parameters
|
|
401
|
+
form_params = opts[:form_params] || {}
|
|
402
|
+
|
|
403
|
+
# http body (model)
|
|
404
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(memory)
|
|
405
|
+
|
|
406
|
+
# return_type
|
|
407
|
+
return_type = opts[:debug_return_type] || 'Memory'
|
|
408
|
+
|
|
409
|
+
# auth_names
|
|
410
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
411
|
+
|
|
412
|
+
new_options = opts.merge(
|
|
413
|
+
:operation => :"MemoryApi.memory_update",
|
|
414
|
+
:header_params => header_params,
|
|
415
|
+
:query_params => query_params,
|
|
416
|
+
:form_params => form_params,
|
|
417
|
+
:body => post_body,
|
|
418
|
+
:auth_names => auth_names,
|
|
419
|
+
:return_type => return_type
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
423
|
+
if @api_client.config.debugging
|
|
424
|
+
@api_client.config.logger.debug "API called: MemoryApi#memory_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
425
|
+
end
|
|
426
|
+
return data, status_code, headers
|
|
427
|
+
end
|
|
428
|
+
end
|
|
429
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
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 MetricsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Metrics view for monitoring.
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @option opts [String] :format
|
|
25
|
+
# @return [Metrics]
|
|
26
|
+
def metrics_retrieve(opts = {})
|
|
27
|
+
data, _status_code, _headers = metrics_retrieve_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Metrics view for monitoring.
|
|
32
|
+
# @param [Hash] opts the optional parameters
|
|
33
|
+
# @option opts [String] :format
|
|
34
|
+
# @return [Array<(Metrics, Integer, Hash)>] Metrics data, response status code and response headers
|
|
35
|
+
def metrics_retrieve_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.metrics_retrieve ...'
|
|
38
|
+
end
|
|
39
|
+
allowable_values = ["json", "openmetrics"]
|
|
40
|
+
if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format'])
|
|
41
|
+
fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
|
|
42
|
+
end
|
|
43
|
+
# resource path
|
|
44
|
+
local_var_path = '/metrics/'
|
|
45
|
+
|
|
46
|
+
# query parameters
|
|
47
|
+
query_params = opts[:query_params] || {}
|
|
48
|
+
query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
|
|
49
|
+
|
|
50
|
+
# header parameters
|
|
51
|
+
header_params = opts[:header_params] || {}
|
|
52
|
+
# HTTP header 'Accept' (if needed)
|
|
53
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/openmetrics-text']) unless header_params['Accept']
|
|
54
|
+
|
|
55
|
+
# form parameters
|
|
56
|
+
form_params = opts[:form_params] || {}
|
|
57
|
+
|
|
58
|
+
# http body (model)
|
|
59
|
+
post_body = opts[:debug_body]
|
|
60
|
+
|
|
61
|
+
# return_type
|
|
62
|
+
return_type = opts[:debug_return_type] || 'Metrics'
|
|
63
|
+
|
|
64
|
+
# auth_names
|
|
65
|
+
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|
|
66
|
+
|
|
67
|
+
new_options = opts.merge(
|
|
68
|
+
:operation => :"MetricsApi.metrics_retrieve",
|
|
69
|
+
:header_params => header_params,
|
|
70
|
+
:query_params => query_params,
|
|
71
|
+
:form_params => form_params,
|
|
72
|
+
:body => post_body,
|
|
73
|
+
:auth_names => auth_names,
|
|
74
|
+
:return_type => return_type
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
78
|
+
if @api_client.config.debugging
|
|
79
|
+
@api_client.config.logger.debug "API called: MetricsApi#metrics_retrieve\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
80
|
+
end
|
|
81
|
+
return data, status_code, headers
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|