phrase 4.25.0 → 4.27.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 +4 -4
- data/CHANGELOG.md +29 -0
- data/README.md +26 -4
- data/docs/AutomationEvent.md +33 -0
- data/docs/AutomationEventProject.md +19 -0
- data/docs/AutomationEventsApi.md +168 -0
- data/docs/AutomationsCreateParameters.md +1 -1
- data/docs/AutomationsCreateParameters1.md +1 -1
- data/docs/CheckIssue.md +33 -0
- data/docs/ChecksApi.md +146 -0
- data/docs/DocumentsApi.md +4 -4
- data/docs/ICUApi.md +1 -1
- data/docs/IcuSkeletonError.md +17 -0
- data/docs/IcuSkeletonParameters.md +11 -11
- data/docs/JobCreateParameters.md +1 -1
- data/docs/JobsApi.md +2 -2
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyFormatAnnotationsApi.md +74 -0
- data/docs/KeyFormatAnnotationsList200ResponseInner.md +19 -0
- data/docs/KeyLinksBatchDestroyParameters.md +6 -4
- data/docs/KeyLinksCreateParameters.md +2 -2
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/LinkedKeysApi.md +14 -13
- data/docs/Locale.md +6 -0
- data/docs/LocaleCreateParameters.md +2 -0
- data/docs/LocaleDetails.md +6 -0
- data/docs/LocaleUpdateParameters.md +2 -0
- data/docs/MachineTranslationApi.md +263 -0
- data/docs/MachineTranslationLocaleProviderMapping.md +21 -0
- data/docs/MachineTranslationLocaleProviderMappingsCreateParameters.md +21 -0
- data/docs/MachineTranslationSettings.md +23 -0
- data/docs/MachineTranslationSettingsUpdateParameters.md +17 -0
- data/docs/PreTranslation.md +29 -0
- data/docs/PreTranslationCreateParameters.md +19 -0
- data/docs/PreTranslationsApi.md +210 -0
- data/docs/ProjectCreateParameters.md +8 -2
- data/docs/ProjectDetails.md +3 -1
- data/docs/ProjectUpdateParameters.md +8 -2
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/ScreenshotsApi.md +2 -2
- data/docs/Upload.md +3 -1
- data/docs/UploadsApi.md +4 -4
- data/lib/phrase/api/automation_events_api.rb +215 -0
- data/lib/phrase/api/checks_api.rb +174 -0
- data/lib/phrase/api/documents_api.rb +6 -6
- data/lib/phrase/api/icu_api.rb +2 -6
- data/lib/phrase/api/key_format_annotations_api.rb +85 -0
- data/lib/phrase/api/linked_keys_api.rb +19 -23
- data/lib/phrase/api/machine_translation_api.rb +302 -0
- data/lib/phrase/api/pre_translations_api.rb +240 -0
- data/lib/phrase/api/screenshots_api.rb +4 -4
- data/lib/phrase/api/uploads_api.rb +6 -6
- data/lib/phrase/models/automation_event.rb +325 -0
- data/lib/phrase/models/automation_event_project.rb +208 -0
- data/lib/phrase/models/automations_create_parameters.rb +1 -1
- data/lib/phrase/models/automations_create_parameters1.rb +1 -1
- data/lib/phrase/models/check_issue.rb +319 -0
- data/lib/phrase/models/{key_links_index400_response.rb → icu_skeleton_error.rb} +11 -10
- data/lib/phrase/models/icu_skeleton_parameters.rb +6 -6
- data/lib/phrase/models/job_create_parameters.rb +1 -1
- data/lib/phrase/models/key_format_annotations_list200_response_inner.rb +207 -0
- data/lib/phrase/models/key_links_batch_destroy_parameters.rb +52 -6
- data/lib/phrase/models/key_links_create_parameters.rb +1 -1
- data/lib/phrase/models/locale.rb +31 -1
- data/lib/phrase/models/locale_create_parameters.rb +11 -1
- data/lib/phrase/models/locale_details.rb +31 -1
- data/lib/phrase/models/locale_update_parameters.rb +11 -1
- data/lib/phrase/models/machine_translation_locale_provider_mapping.rb +217 -0
- data/lib/phrase/models/machine_translation_locale_provider_mappings_create_parameters.rb +232 -0
- data/lib/phrase/models/machine_translation_settings.rb +230 -0
- data/lib/phrase/models/machine_translation_settings_update_parameters.rb +198 -0
- data/lib/phrase/models/pre_translation.rb +301 -0
- data/lib/phrase/models/pre_translation_create_parameters.rb +241 -0
- data/lib/phrase/models/project_create_parameters.rb +35 -1
- data/lib/phrase/models/project_details.rb +10 -1
- data/lib/phrase/models/project_update_parameters.rb +35 -1
- data/lib/phrase/models/upload.rb +13 -1
- data/lib/phrase/response.rb +2 -2
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +16 -1
- data/phrase.gemspec +1 -1
- data/spec/api/automation_events_api_spec.rb +67 -0
- data/spec/api/checks_api_spec.rb +56 -0
- data/spec/api/documents_api_spec.rb +3 -3
- data/spec/api/icu_api_spec.rb +1 -1
- data/spec/api/key_format_annotations_api_spec.rb +38 -0
- data/spec/api/linked_keys_api_spec.rb +7 -7
- data/spec/api/machine_translation_api_spec.rb +79 -0
- data/spec/api/pre_translations_api_spec.rb +70 -0
- data/spec/api/screenshots_api_spec.rb +2 -2
- data/spec/models/automation_event_project_spec.rb +35 -0
- data/spec/models/automation_event_spec.rb +85 -0
- data/spec/models/check_issue_spec.rb +85 -0
- data/spec/models/{key_links_index400_response_spec.rb → icu_skeleton_error_spec.rb} +7 -7
- data/spec/models/key_format_annotations_list200_response_inner_spec.rb +35 -0
- data/spec/models/key_links_batch_destroy_parameters_spec.rb +10 -0
- data/spec/models/locale_create_parameters_spec.rb +6 -0
- data/spec/models/locale_details_spec.rb +18 -0
- data/spec/models/locale_spec.rb +18 -0
- data/spec/models/locale_update_parameters_spec.rb +6 -0
- data/spec/models/machine_translation_locale_provider_mapping_spec.rb +41 -0
- data/spec/models/machine_translation_locale_provider_mappings_create_parameters_spec.rb +41 -0
- data/spec/models/machine_translation_settings_spec.rb +47 -0
- data/spec/models/machine_translation_settings_update_parameters_spec.rb +29 -0
- data/spec/models/pre_translation_create_parameters_spec.rb +39 -0
- data/spec/models/pre_translation_spec.rb +73 -0
- data/spec/models/project_create_parameters_spec.rb +18 -0
- data/spec/models/project_details_spec.rb +6 -0
- data/spec/models/project_update_parameters_spec.rb +18 -0
- data/spec/models/upload_spec.rb +6 -0
- data/spec/response_spec.rb +53 -0
- metadata +313 -251
- data/docs/KeyLinksIndex400Response.md +0 -17
|
@@ -10,6 +10,8 @@ Name | Type | Description | Notes
|
|
|
10
10
|
**main_format** | **String** | (Optional) Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see [Format Guide](https://support.phrase.com/hc/en-us/sections/6111343326364) or our [Formats API Endpoint](#formats). | [optional]
|
|
11
11
|
**media** | **String** | (Optional) Main technology stack used in the project. It affects for example the suggested placeholder style. Predefined values include: `Ruby`, `JavaScript`, `AngularJS`, `React`, `iOS`, `Android`, `Python`, `PHP`, `Java`, `Go`, `Windows Phone`, `Rails`, `Node.js`, `.NET`, `Django`, `Symfony`, `Yii Framework`, `Zend Framework`, `Apple App Store Description`, `Google Play Description`, but it can also take any other value. | [optional]
|
|
12
12
|
**shares_translation_memory** | **Boolean** | (Optional) Indicates whether the project should share the account's translation memory | [optional]
|
|
13
|
+
**tm_ids** | **Array<String>** | List of TMS translation memory IDs, used to provide reference translations for the AI translation agent. | [optional]
|
|
14
|
+
**term_base_ids** | **Array<String>** | List of TMS term base IDs, used to ensure consistent terminology for the AI translation agent. | [optional]
|
|
13
15
|
**project_image** | **File** | (Optional) Image to identify the project | [optional]
|
|
14
16
|
**remove_project_image** | **Boolean** | (Optional) Indicates whether the project image should be deleted. | [optional]
|
|
15
17
|
**workflow** | **String** | (Optional) Review Workflow. \"simple\" / \"review\". [Read more](https://support.phrase.com/hc/en-us/articles/5784094755484) | [optional]
|
|
@@ -27,6 +29,7 @@ Name | Type | Description | Notes
|
|
|
27
29
|
**autotranslate_use_machine_translation** | **Boolean** | (Optional) Requires autotranslate_enabled to be true | [optional]
|
|
28
30
|
**autotranslate_use_translation_memory** | **Boolean** | (Optional) Requires autotranslate_enabled to be true | [optional]
|
|
29
31
|
**autotranslate_overwrite_unverified_translations** | **Boolean** | (Optional) Requires autotranslate_enabled to be true | [optional]
|
|
32
|
+
**fallback_for_unverified_translations** | **Boolean** | (Optional) When enabled, the fallback locale's translation is used on export for unverified translations in addition to empty ones. Requires a fallback locale to be configured on the locale. | [optional]
|
|
30
33
|
**default_encoding** | **String** | (Optional) Sets the default encoding for Uploads. If you leave it empty, we will try to guess it automatically for you when you Upload a file. You can still override this value by setting the [`file_encoding`](/en/api/strings/uploads/upload-a-new-file) parameter for Uploads. | [optional]
|
|
31
34
|
**placeholder_styles** | **Array<String>** | (Optional) List of placeholder styles enabled for the project. | [optional]
|
|
32
35
|
**autocomplete_job_enabled** | **Boolean** | (Optional) Enable autocomplete-job behavior so that newly created keys and locales are automatically added to in-progress jobs. | [optional]
|
|
@@ -48,7 +51,9 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
|
|
|
48
51
|
main_format: yml,
|
|
49
52
|
media: Python,
|
|
50
53
|
shares_translation_memory: true,
|
|
51
|
-
|
|
54
|
+
tm_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
55
|
+
term_base_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
56
|
+
project_image: [B@71fcff54,
|
|
52
57
|
remove_project_image: false,
|
|
53
58
|
workflow: review,
|
|
54
59
|
machine_translation_enabled: true,
|
|
@@ -65,8 +70,9 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
|
|
|
65
70
|
autotranslate_use_machine_translation: true,
|
|
66
71
|
autotranslate_use_translation_memory: true,
|
|
67
72
|
autotranslate_overwrite_unverified_translations: true,
|
|
73
|
+
fallback_for_unverified_translations: false,
|
|
68
74
|
default_encoding: UTF-8,
|
|
69
|
-
placeholder_styles: ["
|
|
75
|
+
placeholder_styles: ["rails_i18n","java_properties"],
|
|
70
76
|
autocomplete_job_enabled: false,
|
|
71
77
|
job_locking_enabled: false,
|
|
72
78
|
smart_suggest_enabled: true,
|
data/docs/ScreenshotsApi.md
CHANGED
|
@@ -87,7 +87,7 @@ Response<([**Screenshot**](Screenshot.md))>
|
|
|
87
87
|
|
|
88
88
|
Delete a screenshot
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
Permanently removes a screenshot and all its associated markers from the project. Use this when you need to fully remove a screenshot that is no longer relevant — for example, after a UI redesign renders the captured screen obsolete. This is a hard delete: the screenshot record and every key-to-region marker linked to it are destroyed together and cannot be recovered.
|
|
91
91
|
|
|
92
92
|
### Example
|
|
93
93
|
|
|
@@ -151,7 +151,7 @@ Response<(nil (empty response body))>
|
|
|
151
151
|
|
|
152
152
|
Get a single screenshot
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Returns a single screenshot belonging to the specified project. Use this to retrieve the screenshot's name, description, hosted image URL, and marker count after uploading, or before creating, updating, or inspecting its markers. The response is a synchronous, idempotent read — repeated calls return the same record without side effects. The Attachable Screenshots feature must be enabled on the account.
|
|
155
155
|
|
|
156
156
|
### Example
|
|
157
157
|
|
data/docs/Upload.md
CHANGED
|
@@ -7,7 +7,8 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**id** | **String** | | [optional]
|
|
8
8
|
**filename** | **String** | | [optional]
|
|
9
9
|
**format** | **String** | | [optional]
|
|
10
|
-
**state** | **String** | | [optional]
|
|
10
|
+
**state** | **String** | Processing state of the upload: `initialized`, `processing`, `success`, or `error`. `error` means processing failed — for example the file could not be parsed, or a provided `file_format` didn't match the file's actual content. Poll this field until it leaves `initialized`/`processing` to get the final outcome. | [optional]
|
|
11
|
+
**error_message** | **String** | A user-facing message explaining why the upload failed, or `null` if the upload did not fail. This message is intended for display only. Its wording may change at any time and it should not be parsed or relied upon programmatically. | [optional]
|
|
11
12
|
**tag** | **String** | Unique tag of the upload | [optional]
|
|
12
13
|
**tags** | **Array<String>** | List of tags that were assigned to the uploaded keys | [optional]
|
|
13
14
|
**url** | **String** | The URL to the upload in Phrase Strings app. | [optional]
|
|
@@ -25,6 +26,7 @@ instance = Phrase::Upload.new(id: null,
|
|
|
25
26
|
filename: null,
|
|
26
27
|
format: null,
|
|
27
28
|
state: null,
|
|
29
|
+
error_message: null,
|
|
28
30
|
tag: null,
|
|
29
31
|
tags: null,
|
|
30
32
|
url: null,
|
data/docs/UploadsApi.md
CHANGED
|
@@ -16,7 +16,7 @@ Method | HTTP request | Description
|
|
|
16
16
|
|
|
17
17
|
Upload a new file
|
|
18
18
|
|
|
19
|
-
Upload a new language file. Creates necessary resources in your project. Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
19
|
+
Upload a new language file. Creates necessary resources in your project. The upload is processed asynchronously: this endpoint returns `201 Created` once the file has been accepted and enqueued, not once processing has finished. Poll `GET /projects/{project_id}/uploads/{id}` and check the `state` field — `error` means processing failed (for example, an unparseable file or a `file_format` that doesn't match the file's actual content). Note: be aware of [upload limits](https://support.phrase.com/hc/en-us/articles/8548271212188-Phrase-Strings-Limits#file-size-upload-limits-0-0).
|
|
20
20
|
|
|
21
21
|
### Example
|
|
22
22
|
|
|
@@ -37,7 +37,7 @@ end
|
|
|
37
37
|
api_instance = Phrase::UploadsApi.new
|
|
38
38
|
project_id = 'project_id_example' # String | Project ID
|
|
39
39
|
file = File.new('/path/to/some/file') # File | File to be imported
|
|
40
|
-
file_format = 'file_format_example' # String | File format.
|
|
40
|
+
file_format = 'file_format_example' # String | File format of the uploaded file, given as a format's `api_name`. See our [Formats API Endpoint](/en/api/strings/formats/list-formats) for the full list of supported formats. Optional. When omitted, Phrase tries to auto-detect the format from the file's content. This is not always possible for JSON files, since several JSON-based formats (e.g. `json`, `simple_json`, `nested_json`) share the same structure.
|
|
41
41
|
locale_id = 'locale_id_example' # String | Locale of the file's content. Can be the name or id of the locale. Preferred is id.
|
|
42
42
|
opts = {
|
|
43
43
|
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
@@ -79,7 +79,7 @@ Name | Type | Description | Notes
|
|
|
79
79
|
------------- | ------------- | ------------- | -------------
|
|
80
80
|
**project_id** | **String**| Project ID |
|
|
81
81
|
**file** | **File**| File to be imported |
|
|
82
|
-
**file_format** | **String**| File format.
|
|
82
|
+
**file_format** | **String**| File format of the uploaded file, given as a format's `api_name`. See our [Formats API Endpoint](/en/api/strings/formats/list-formats) for the full list of supported formats. Optional. When omitted, Phrase tries to auto-detect the format from the file's content. This is not always possible for JSON files, since several JSON-based formats (e.g. `json`, `simple_json`, `nested_json`) share the same structure. |
|
|
83
83
|
**locale_id** | **String**| Locale of the file's content. Can be the name or id of the locale. Preferred is id. |
|
|
84
84
|
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
85
85
|
**branch** | **String**| specify the branch to use | [optional]
|
|
@@ -123,7 +123,7 @@ Response<([**Upload**](Upload.md))>
|
|
|
123
123
|
|
|
124
124
|
Get a single upload
|
|
125
125
|
|
|
126
|
-
View details and summary for a single upload.
|
|
126
|
+
View details and summary for a single upload. Use this endpoint to poll for the outcome of an upload created via `POST /projects/{project_id}/uploads` — check the `state` field.
|
|
127
127
|
|
|
128
128
|
### Example
|
|
129
129
|
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class AutomationEventsApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# List automation events for an account
|
|
11
|
+
# Returns the run history across all automations in the account, newest-first. Use `automation_id` to narrow results to a single automation. Use `project_id` or `project_ids` to narrow by project. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
|
|
12
|
+
# @param account_id [String] Account ID
|
|
13
|
+
# @param [Hash] opts the optional parameters
|
|
14
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
15
|
+
# @option opts [Integer] :page Page number
|
|
16
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
17
|
+
# @option opts [String] :automation_id Filter events to a single automation by its ID.
|
|
18
|
+
# @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
|
|
19
|
+
# @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
|
|
20
|
+
# @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
|
|
21
|
+
# @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
|
|
22
|
+
# @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
23
|
+
# @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
24
|
+
# @return [Array<AutomationEvent>]
|
|
25
|
+
def account_automation_events_list(account_id, opts = {})
|
|
26
|
+
data, _status_code, _headers = account_automation_events_list_with_http_info(account_id, opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# List automation events for an account
|
|
31
|
+
# Returns the run history across all automations in the account, newest-first. Use `automation_id` to narrow results to a single automation. Use `project_id` or `project_ids` to narrow by project. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
|
|
32
|
+
# @param account_id [String] Account ID
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
35
|
+
# @option opts [Integer] :page Page number
|
|
36
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
37
|
+
# @option opts [String] :automation_id Filter events to a single automation by its ID.
|
|
38
|
+
# @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
|
|
39
|
+
# @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
|
|
40
|
+
# @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
|
|
41
|
+
# @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
|
|
42
|
+
# @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
43
|
+
# @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
44
|
+
# @return [Array<(Response<(Array<AutomationEvent>)>, Integer, Hash)>] Response<(Array<AutomationEvent>)> data, response status code and response headers
|
|
45
|
+
def account_automation_events_list_with_http_info(account_id, opts = {})
|
|
46
|
+
if @api_client.config.debugging
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: AutomationEventsApi.account_automation_events_list ...'
|
|
48
|
+
end
|
|
49
|
+
# verify the required parameter 'account_id' is set
|
|
50
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationEventsApi.account_automation_events_list"
|
|
52
|
+
end
|
|
53
|
+
allowable_values = ["success", "failure", "in_progress"]
|
|
54
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
|
55
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
|
56
|
+
end
|
|
57
|
+
allowable_values = ["manual", "schedule", "upload", "upload_batch"]
|
|
58
|
+
if @api_client.config.client_side_validation && opts[:'triggered_by'] && !allowable_values.include?(opts[:'triggered_by'])
|
|
59
|
+
fail ArgumentError, "invalid value for \"triggered_by\", must be one of #{allowable_values}"
|
|
60
|
+
end
|
|
61
|
+
# resource path
|
|
62
|
+
local_var_path = '/accounts/{account_id}/automation_events'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s))
|
|
63
|
+
|
|
64
|
+
# query parameters
|
|
65
|
+
query_params = opts[:query_params] || {}
|
|
66
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
67
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
68
|
+
query_params[:'automation_id'] = opts[:'automation_id'] if !opts[:'automation_id'].nil?
|
|
69
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
70
|
+
query_params[:'triggered_by'] = opts[:'triggered_by'] if !opts[:'triggered_by'].nil?
|
|
71
|
+
query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
|
|
72
|
+
query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
|
|
73
|
+
query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
|
|
74
|
+
query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
|
75
|
+
|
|
76
|
+
# header parameters
|
|
77
|
+
header_params = opts[:header_params] || {}
|
|
78
|
+
# HTTP header 'Accept' (if needed)
|
|
79
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
80
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
81
|
+
|
|
82
|
+
# form parameters
|
|
83
|
+
form_params = opts[:form_params] || {}
|
|
84
|
+
|
|
85
|
+
# http body (model)
|
|
86
|
+
post_body = opts[:body]
|
|
87
|
+
|
|
88
|
+
# return_type
|
|
89
|
+
return_type = opts[:return_type] || 'Array<AutomationEvent>'
|
|
90
|
+
|
|
91
|
+
# auth_names
|
|
92
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
93
|
+
|
|
94
|
+
new_options = opts.merge(
|
|
95
|
+
:header_params => header_params,
|
|
96
|
+
:query_params => query_params,
|
|
97
|
+
:form_params => form_params,
|
|
98
|
+
:body => post_body,
|
|
99
|
+
:auth_names => auth_names,
|
|
100
|
+
:return_type => return_type
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
104
|
+
if @api_client.config.debugging
|
|
105
|
+
@api_client.config.logger.debug "API called: AutomationEventsApi#account_automation_events_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
106
|
+
end
|
|
107
|
+
response = ::Phrase::Response.new(data, headers)
|
|
108
|
+
return response, status_code, headers
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# List events for an automation
|
|
112
|
+
# Returns the run history for a specific automation, newest-first. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
|
|
113
|
+
# @param account_id [String] Account ID
|
|
114
|
+
# @param id [String] ID
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
117
|
+
# @option opts [Integer] :page Page number
|
|
118
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
119
|
+
# @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
|
|
120
|
+
# @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
|
|
121
|
+
# @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
|
|
122
|
+
# @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
|
|
123
|
+
# @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
124
|
+
# @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
125
|
+
# @return [Array<AutomationEvent>]
|
|
126
|
+
def automation_events_list(account_id, id, opts = {})
|
|
127
|
+
data, _status_code, _headers = automation_events_list_with_http_info(account_id, id, opts)
|
|
128
|
+
data
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# List events for an automation
|
|
132
|
+
# Returns the run history for a specific automation, newest-first. For feature availability, see [Jobs (Strings)](https://support.phrase.com/hc/en-us/articles/5784100517788-Jobs-Strings).
|
|
133
|
+
# @param account_id [String] Account ID
|
|
134
|
+
# @param id [String] ID
|
|
135
|
+
# @param [Hash] opts the optional parameters
|
|
136
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
137
|
+
# @option opts [Integer] :page Page number
|
|
138
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
139
|
+
# @option opts [String] :state Filter events by outcome state. Unrecognized values are ignored.
|
|
140
|
+
# @option opts [String] :triggered_by Filter events by what triggered the automation run. Unrecognized values are ignored.
|
|
141
|
+
# @option opts [String] :project_id Filter events by project ID. Accepts a single ID or a comma-separated list of IDs.
|
|
142
|
+
# @option opts [Array<String>] :project_ids Filter events by one or more project IDs.
|
|
143
|
+
# @option opts [String] :created_after Return only events created after this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
144
|
+
# @option opts [String] :created_before Return only events created before this ISO 8601 timestamp. Returns 400 if the value is not a valid date-time.
|
|
145
|
+
# @return [Array<(Response<(Array<AutomationEvent>)>, Integer, Hash)>] Response<(Array<AutomationEvent>)> data, response status code and response headers
|
|
146
|
+
def automation_events_list_with_http_info(account_id, id, opts = {})
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug 'Calling API: AutomationEventsApi.automation_events_list ...'
|
|
149
|
+
end
|
|
150
|
+
# verify the required parameter 'account_id' is set
|
|
151
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
152
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AutomationEventsApi.automation_events_list"
|
|
153
|
+
end
|
|
154
|
+
# verify the required parameter 'id' is set
|
|
155
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
156
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling AutomationEventsApi.automation_events_list"
|
|
157
|
+
end
|
|
158
|
+
allowable_values = ["success", "failure", "in_progress"]
|
|
159
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
|
160
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
|
161
|
+
end
|
|
162
|
+
allowable_values = ["manual", "schedule", "upload", "upload_batch"]
|
|
163
|
+
if @api_client.config.client_side_validation && opts[:'triggered_by'] && !allowable_values.include?(opts[:'triggered_by'])
|
|
164
|
+
fail ArgumentError, "invalid value for \"triggered_by\", must be one of #{allowable_values}"
|
|
165
|
+
end
|
|
166
|
+
# resource path
|
|
167
|
+
local_var_path = '/accounts/{account_id}/automations/{automation_id}/events'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
168
|
+
|
|
169
|
+
# query parameters
|
|
170
|
+
query_params = opts[:query_params] || {}
|
|
171
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
172
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
173
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
174
|
+
query_params[:'triggered_by'] = opts[:'triggered_by'] if !opts[:'triggered_by'].nil?
|
|
175
|
+
query_params[:'project_id'] = opts[:'project_id'] if !opts[:'project_id'].nil?
|
|
176
|
+
query_params[:'project_ids'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
|
|
177
|
+
query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
|
|
178
|
+
query_params[:'created_before'] = opts[:'created_before'] if !opts[:'created_before'].nil?
|
|
179
|
+
|
|
180
|
+
# header parameters
|
|
181
|
+
header_params = opts[:header_params] || {}
|
|
182
|
+
# HTTP header 'Accept' (if needed)
|
|
183
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
184
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
185
|
+
|
|
186
|
+
# form parameters
|
|
187
|
+
form_params = opts[:form_params] || {}
|
|
188
|
+
|
|
189
|
+
# http body (model)
|
|
190
|
+
post_body = opts[:body]
|
|
191
|
+
|
|
192
|
+
# return_type
|
|
193
|
+
return_type = opts[:return_type] || 'Array<AutomationEvent>'
|
|
194
|
+
|
|
195
|
+
# auth_names
|
|
196
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
197
|
+
|
|
198
|
+
new_options = opts.merge(
|
|
199
|
+
:header_params => header_params,
|
|
200
|
+
:query_params => query_params,
|
|
201
|
+
:form_params => form_params,
|
|
202
|
+
:body => post_body,
|
|
203
|
+
:auth_names => auth_names,
|
|
204
|
+
:return_type => return_type
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
208
|
+
if @api_client.config.debugging
|
|
209
|
+
@api_client.config.logger.debug "API called: AutomationEventsApi#automation_events_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
210
|
+
end
|
|
211
|
+
response = ::Phrase::Response.new(data, headers)
|
|
212
|
+
return response, status_code, headers
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class ChecksApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# Dismiss a check issue
|
|
11
|
+
# **Note:** The Checks API is still in development and might change in subsequent releases. Mark a check issue as dismissed so it no longer appears on the list of active check issues.
|
|
12
|
+
# @param project_id [String] Project ID
|
|
13
|
+
# @param id [String] Check Issue ID
|
|
14
|
+
# @param [Hash] opts the optional parameters
|
|
15
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
|
+
# @return [CheckIssue]
|
|
17
|
+
def check_issue_dismiss(project_id, id, opts = {})
|
|
18
|
+
data, _status_code, _headers = check_issue_dismiss_with_http_info(project_id, id, opts)
|
|
19
|
+
data
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Dismiss a check issue
|
|
23
|
+
# **Note:** The Checks API is still in development and might change in subsequent releases. Mark a check issue as dismissed so it no longer appears on the list of active check issues.
|
|
24
|
+
# @param project_id [String] Project ID
|
|
25
|
+
# @param id [String] Check Issue ID
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
|
+
# @return [Array<(Response<(CheckIssue)>, Integer, Hash)>] Response<(CheckIssue)> data, response status code and response headers
|
|
29
|
+
def check_issue_dismiss_with_http_info(project_id, id, opts = {})
|
|
30
|
+
if @api_client.config.debugging
|
|
31
|
+
@api_client.config.logger.debug 'Calling API: ChecksApi.check_issue_dismiss ...'
|
|
32
|
+
end
|
|
33
|
+
# verify the required parameter 'project_id' is set
|
|
34
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
35
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ChecksApi.check_issue_dismiss"
|
|
36
|
+
end
|
|
37
|
+
# verify the required parameter 'id' is set
|
|
38
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
39
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ChecksApi.check_issue_dismiss"
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/projects/{project_id}/checks/issues/{id}/dismiss'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
43
|
+
|
|
44
|
+
# query parameters
|
|
45
|
+
query_params = opts[:query_params] || {}
|
|
46
|
+
|
|
47
|
+
# header parameters
|
|
48
|
+
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
51
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
52
|
+
|
|
53
|
+
# form parameters
|
|
54
|
+
form_params = opts[:form_params] || {}
|
|
55
|
+
|
|
56
|
+
# http body (model)
|
|
57
|
+
post_body = opts[:body]
|
|
58
|
+
|
|
59
|
+
# return_type
|
|
60
|
+
return_type = opts[:return_type] || 'CheckIssue'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:header_params => header_params,
|
|
67
|
+
:query_params => query_params,
|
|
68
|
+
:form_params => form_params,
|
|
69
|
+
:body => post_body,
|
|
70
|
+
:auth_names => auth_names,
|
|
71
|
+
:return_type => return_type
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
75
|
+
if @api_client.config.debugging
|
|
76
|
+
@api_client.config.logger.debug "API called: ChecksApi#check_issue_dismiss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
77
|
+
end
|
|
78
|
+
response = ::Phrase::Response.new(data, headers)
|
|
79
|
+
return response, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List check issues
|
|
83
|
+
# **Note:** The Checks API is still in development and might change in subsequent releases. List check issues for the given project. Results can be filtered by locale, check name, and state.
|
|
84
|
+
# @param project_id [String] Project ID
|
|
85
|
+
# @param [Hash] opts the optional parameters
|
|
86
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
87
|
+
# @option opts [Integer] :page Page number
|
|
88
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
89
|
+
# @option opts [String] :state Filter by state of the check issue. Can be one of: `active`, `solved`, `dismissed`, `all`. Defaults to `active`. (default to 'active')
|
|
90
|
+
# @option opts [Array<String>] :locale_ids Filter by one or more locale IDs.
|
|
91
|
+
# @option opts [Array<String>] :check_names Filter by one or more check names. Valid values are: - `translation_content_length` — the translation exceeds the maximum character limit configured for the key. - `translation_placeholder_usage` — the translation is missing placeholders present in the source, or contains unexpected ones. - `translation_glossary_usage` — the translation does not follow the glossary term translations.
|
|
92
|
+
# @option opts [String] :created_since Return only check issues created on or after this ISO 8601 datetime. Returns 400 if the value is not a valid date-time.
|
|
93
|
+
# @return [Array<CheckIssue>]
|
|
94
|
+
def check_issues_list(project_id, opts = {})
|
|
95
|
+
data, _status_code, _headers = check_issues_list_with_http_info(project_id, opts)
|
|
96
|
+
data
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# List check issues
|
|
100
|
+
# **Note:** The Checks API is still in development and might change in subsequent releases. List check issues for the given project. Results can be filtered by locale, check name, and state.
|
|
101
|
+
# @param project_id [String] Project ID
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
104
|
+
# @option opts [Integer] :page Page number
|
|
105
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
106
|
+
# @option opts [String] :state Filter by state of the check issue. Can be one of: `active`, `solved`, `dismissed`, `all`. Defaults to `active`.
|
|
107
|
+
# @option opts [Array<String>] :locale_ids Filter by one or more locale IDs.
|
|
108
|
+
# @option opts [Array<String>] :check_names Filter by one or more check names. Valid values are: - `translation_content_length` — the translation exceeds the maximum character limit configured for the key. - `translation_placeholder_usage` — the translation is missing placeholders present in the source, or contains unexpected ones. - `translation_glossary_usage` — the translation does not follow the glossary term translations.
|
|
109
|
+
# @option opts [String] :created_since Return only check issues created on or after this ISO 8601 datetime. Returns 400 if the value is not a valid date-time.
|
|
110
|
+
# @return [Array<(Response<(Array<CheckIssue>)>, Integer, Hash)>] Response<(Array<CheckIssue>)> data, response status code and response headers
|
|
111
|
+
def check_issues_list_with_http_info(project_id, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: ChecksApi.check_issues_list ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'project_id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ChecksApi.check_issues_list"
|
|
118
|
+
end
|
|
119
|
+
allowable_values = ["active", "solved", "dismissed", "all"]
|
|
120
|
+
if @api_client.config.client_side_validation && opts[:'state'] && !allowable_values.include?(opts[:'state'])
|
|
121
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{allowable_values}"
|
|
122
|
+
end
|
|
123
|
+
allowable_values = ["translation_content_length", "translation_placeholder_usage", "translation_glossary_usage"]
|
|
124
|
+
if @api_client.config.client_side_validation && opts[:'check_names'] && !opts[:'check_names'].all? { |item| allowable_values.include?(item) }
|
|
125
|
+
fail ArgumentError, "invalid value for \"check_names\", must include one of #{allowable_values}"
|
|
126
|
+
end
|
|
127
|
+
# resource path
|
|
128
|
+
local_var_path = '/projects/{project_id}/checks/issues'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
129
|
+
|
|
130
|
+
# query parameters
|
|
131
|
+
query_params = opts[:query_params] || {}
|
|
132
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
133
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
134
|
+
query_params[:'state'] = opts[:'state'] if !opts[:'state'].nil?
|
|
135
|
+
query_params[:'locale_ids'] = @api_client.build_collection_param(opts[:'locale_ids'], :multi) if !opts[:'locale_ids'].nil?
|
|
136
|
+
query_params[:'check_names'] = @api_client.build_collection_param(opts[:'check_names'], :multi) if !opts[:'check_names'].nil?
|
|
137
|
+
query_params[:'created_since'] = opts[:'created_since'] if !opts[:'created_since'].nil?
|
|
138
|
+
|
|
139
|
+
# header parameters
|
|
140
|
+
header_params = opts[:header_params] || {}
|
|
141
|
+
# HTTP header 'Accept' (if needed)
|
|
142
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
143
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
144
|
+
|
|
145
|
+
# form parameters
|
|
146
|
+
form_params = opts[:form_params] || {}
|
|
147
|
+
|
|
148
|
+
# http body (model)
|
|
149
|
+
post_body = opts[:body]
|
|
150
|
+
|
|
151
|
+
# return_type
|
|
152
|
+
return_type = opts[:return_type] || 'Array<CheckIssue>'
|
|
153
|
+
|
|
154
|
+
# auth_names
|
|
155
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
156
|
+
|
|
157
|
+
new_options = opts.merge(
|
|
158
|
+
:header_params => header_params,
|
|
159
|
+
:query_params => query_params,
|
|
160
|
+
:form_params => form_params,
|
|
161
|
+
:body => post_body,
|
|
162
|
+
:auth_names => auth_names,
|
|
163
|
+
:return_type => return_type
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
167
|
+
if @api_client.config.debugging
|
|
168
|
+
@api_client.config.logger.debug "API called: ChecksApi#check_issues_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
169
|
+
end
|
|
170
|
+
response = ::Phrase::Response.new(data, headers)
|
|
171
|
+
return response, status_code, headers
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -8,7 +8,7 @@ module Phrase
|
|
|
8
8
|
@api_client = api_client
|
|
9
9
|
end
|
|
10
10
|
# Delete document
|
|
11
|
-
#
|
|
11
|
+
# Permanently deletes a document and all of its associated translation segments from the project. Use this when you want to remove a document that is no longer needed; the deletion cannot be reversed and all associated segments will be lost.
|
|
12
12
|
# @param project_id [String] Project ID
|
|
13
13
|
# @param id [String] ID
|
|
14
14
|
# @param [Hash] opts the optional parameters
|
|
@@ -20,7 +20,7 @@ module Phrase
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Delete document
|
|
23
|
-
#
|
|
23
|
+
# Permanently deletes a document and all of its associated translation segments from the project. Use this when you want to remove a document that is no longer needed; the deletion cannot be reversed and all associated segments will be lost.
|
|
24
24
|
# @param project_id [String] Project ID
|
|
25
25
|
# @param id [String] ID
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -80,13 +80,13 @@ module Phrase
|
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
# List documents
|
|
83
|
-
#
|
|
83
|
+
# Returns all documents in a project that the authenticated user has read access to. A Document is a source file — an HTML or DOCX file — that has been uploaded to Phrase Strings and whose content is segmented into translation keys for localization. Use this endpoint to enumerate documents before downloading, previewing, or triggering translation workflows for individual files. The q parameter performs a prefix match on the document name (case-insensitive). For example, passing q=invoice returns documents whose names begin with \"invoice\" but not documents containing \"invoice\" elsewhere in the name.
|
|
84
84
|
# @param project_id [String] Project ID
|
|
85
85
|
# @param [Hash] opts the optional parameters
|
|
86
86
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
87
87
|
# @option opts [Integer] :page Page number
|
|
88
88
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
89
|
-
# @option opts [String] :q
|
|
89
|
+
# @option opts [String] :q Filter documents by name prefix. Returns documents whose name starts with the given value (case-insensitive).
|
|
90
90
|
# @return [Array<Document>]
|
|
91
91
|
def documents_list(project_id, opts = {})
|
|
92
92
|
data, _status_code, _headers = documents_list_with_http_info(project_id, opts)
|
|
@@ -94,13 +94,13 @@ module Phrase
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# List documents
|
|
97
|
-
#
|
|
97
|
+
# Returns all documents in a project that the authenticated user has read access to. A Document is a source file — an HTML or DOCX file — that has been uploaded to Phrase Strings and whose content is segmented into translation keys for localization. Use this endpoint to enumerate documents before downloading, previewing, or triggering translation workflows for individual files. The q parameter performs a prefix match on the document name (case-insensitive). For example, passing q=invoice returns documents whose names begin with \"invoice\" but not documents containing \"invoice\" elsewhere in the name.
|
|
98
98
|
# @param project_id [String] Project ID
|
|
99
99
|
# @param [Hash] opts the optional parameters
|
|
100
100
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
101
101
|
# @option opts [Integer] :page Page number
|
|
102
102
|
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
103
|
-
# @option opts [String] :q
|
|
103
|
+
# @option opts [String] :q Filter documents by name prefix. Returns documents whose name starts with the given value (case-insensitive).
|
|
104
104
|
# @return [Array<(Response<(Array<Document>)>, Integer, Hash)>] Response<(Array<Document>)> data, response status code and response headers
|
|
105
105
|
def documents_list_with_http_info(project_id, opts = {})
|
|
106
106
|
if @api_client.config.debugging
|
data/lib/phrase/api/icu_api.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Phrase
|
|
|
8
8
|
@api_client = api_client
|
|
9
9
|
end
|
|
10
10
|
# Build ICU skeletons
|
|
11
|
-
#
|
|
11
|
+
# Generates ICU (International Components for Unicode) message format skeletons for a given source string across one or more locales. An ICU skeleton strips the literal text from a pluralized or select message while preserving its structural rules — argument names, plural categories, select cases, and ordinal forms — adjusted to the pluralization rules of each requested locale. Use this endpoint to normalize translation templates before importing them into locale files, or to validate that a source string carries the plural forms required by a target language. Either `content` or `id` must be provided — supplying both or neither returns 400. When `id` is used and the referenced translation does not exist, the endpoint returns 404. When the source string is not valid ICU message format syntax, the endpoint returns 422 with an `error` field describing the parse failure.
|
|
12
12
|
# @param icu_skeleton_parameters [IcuSkeletonParameters]
|
|
13
13
|
# @param [Hash] opts the optional parameters
|
|
14
14
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
@@ -19,7 +19,7 @@ module Phrase
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
# Build ICU skeletons
|
|
22
|
-
#
|
|
22
|
+
# Generates ICU (International Components for Unicode) message format skeletons for a given source string across one or more locales. An ICU skeleton strips the literal text from a pluralized or select message while preserving its structural rules — argument names, plural categories, select cases, and ordinal forms — adjusted to the pluralization rules of each requested locale. Use this endpoint to normalize translation templates before importing them into locale files, or to validate that a source string carries the plural forms required by a target language. Either `content` or `id` must be provided — supplying both or neither returns 400. When `id` is used and the referenced translation does not exist, the endpoint returns 404. When the source string is not valid ICU message format syntax, the endpoint returns 422 with an `error` field describing the parse failure.
|
|
23
23
|
# @param icu_skeleton_parameters [IcuSkeletonParameters]
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
25
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
@@ -28,10 +28,6 @@ module Phrase
|
|
|
28
28
|
if @api_client.config.debugging
|
|
29
29
|
@api_client.config.logger.debug 'Calling API: ICUApi.icu_skeleton ...'
|
|
30
30
|
end
|
|
31
|
-
# verify the required parameter 'icu_skeleton_parameters' is set
|
|
32
|
-
if @api_client.config.client_side_validation && icu_skeleton_parameters.nil?
|
|
33
|
-
fail ArgumentError, "Missing the required parameter 'icu_skeleton_parameters' when calling ICUApi.icu_skeleton"
|
|
34
|
-
end
|
|
35
31
|
# resource path
|
|
36
32
|
local_var_path = '/icu/skeleton'
|
|
37
33
|
|