phrase 4.28.0 → 4.29.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 +10 -0
- data/README.md +6 -3
- data/docs/JobTemplateCreateParameters.md +3 -1
- data/docs/JobTemplateUpdateParameters.md +3 -1
- data/docs/KeyCreateParameters.md +1 -1
- data/docs/KeyUpdateParameters.md +1 -1
- data/docs/MembersApi.md +70 -0
- data/docs/OrganizationJobTemplateCreateParameters.md +3 -1
- data/docs/OrganizationJobTemplateUpdateParameters.md +3 -1
- data/docs/ProjectCreateParameters.md +1 -1
- data/docs/ProjectMember.md +27 -0
- data/docs/ProjectUpdateParameters.md +1 -1
- data/docs/ScreenshotUpdateParameters.md +1 -1
- data/docs/SupportedLanguagesApi.md +62 -0
- data/lib/phrase/api/members_api.rb +78 -0
- data/lib/phrase/api/supported_languages_api.rb +67 -0
- data/lib/phrase/models/job_template_create_parameters.rb +14 -4
- data/lib/phrase/models/job_template_update_parameters.rb +14 -4
- data/lib/phrase/models/organization_job_template_create_parameters.rb +14 -4
- data/lib/phrase/models/organization_job_template_update_parameters.rb +14 -4
- data/lib/phrase/models/project_member.rb +241 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +2 -0
- data/spec/api/members_api_spec.rb +17 -0
- data/spec/api/supported_languages_api_spec.rb +34 -0
- data/spec/models/job_template_create_parameters_spec.rb +6 -0
- data/spec/models/job_template_update_parameters_spec.rb +6 -0
- data/spec/models/organization_job_template_create_parameters_spec.rb +6 -0
- data/spec/models/organization_job_template_update_parameters_spec.rb +6 -0
- data/spec/models/project_member_spec.rb +59 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1357e5ef12102b342d5e7b95a38345d883618fc2e74f63f3e091c1a7d7a09a5b
|
|
4
|
+
data.tar.gz: 3ecdd44e410a3b1bd6c26df0c29430e7c9d78e09173e212c884d3dab5f911407
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '09290e886bcedcebdcad1b1647bacb04b16ba73a7b2aa716fb2b2d36555f5cbb431fcbd91568cd468ce00585095366d2d661e776260983099ff61f87608a0bf7'
|
|
7
|
+
data.tar.gz: 93c4f33ea2fe9e50f20f35d7cb821b0b851d3989067ace5ddeb4c644b630a564a416ffbd82afc63ec523a859aa79f3f7be2702c9ac5ed5adae9604c6570d35dc
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.29.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.28.0...ruby-v4.29.0) (2026-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **API:** Add /languages documentation ([#1279](https://github.com/phrase/strings-openapi/issues/1279)) ([e273b56](https://github.com/phrase/strings-openapi/commit/e273b5697172726ae7256450648f56489cd36b8f))
|
|
9
|
+
* **API:** add owner_id parameter to job template create and update endpoints #STRINGS-3477 ([#1287](https://github.com/phrase/strings-openapi/issues/1287)) ([8dd71f9](https://github.com/phrase/strings-openapi/commit/8dd71f958b69d4a59d8c646f9b69d8154312dce6))
|
|
10
|
+
* **API:** add X-Rate-Limit-Reason header to 429 responses STRINGS-3504 ([#1288](https://github.com/phrase/strings-openapi/issues/1288)) ([a109a3d](https://github.com/phrase/strings-openapi/commit/a109a3d2a3cf464b327fc2fc594742433291d578))
|
|
11
|
+
* **API:** document GET /projects/{project_id}/members list endpoint STRINGS-3471 ([#1276](https://github.com/phrase/strings-openapi/issues/1276)) ([fbf8448](https://github.com/phrase/strings-openapi/commit/fbf844851b3fa67604c55fe8b16166006a89b74f))
|
|
12
|
+
|
|
3
13
|
## [4.28.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.27.0...ruby-v4.28.0) (2026-09-17)
|
|
4
14
|
|
|
5
15
|
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Phrase Strings is a translation management platform for software projects. You c
|
|
|
7
7
|
## This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
8
8
|
|
|
9
9
|
- API version: 2.0.0
|
|
10
|
-
- Package version: 4.
|
|
10
|
+
- Package version: 4.29.0
|
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
12
12
|
For more information, please visit [https://developers.phrase.com/api/](https://developers.phrase.com/api/)
|
|
13
13
|
|
|
@@ -56,10 +56,10 @@ gem build phrase.gemspec
|
|
|
56
56
|
Then install the gem locally:
|
|
57
57
|
|
|
58
58
|
```shell
|
|
59
|
-
gem install ./phrase-4.
|
|
59
|
+
gem install ./phrase-4.29.0.gem
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
(for development, run `gem install --dev ./phrase-4.
|
|
62
|
+
(for development, run `gem install --dev ./phrase-4.29.0.gem` to install the development dependencies)
|
|
63
63
|
|
|
64
64
|
## Getting Started
|
|
65
65
|
|
|
@@ -297,6 +297,7 @@ Class | Method | HTTP request | Description
|
|
|
297
297
|
*Phrase::MembersApi* | [**member_show**](docs/MembersApi.md#member_show) | **GET** /accounts/{account_id}/members/{id} | Get single member
|
|
298
298
|
*Phrase::MembersApi* | [**member_update**](docs/MembersApi.md#member_update) | **PATCH** /accounts/{account_id}/members/{id} | Update a member
|
|
299
299
|
*Phrase::MembersApi* | [**member_update_settings**](docs/MembersApi.md#member_update_settings) | **PATCH** /projects/{project_id}/members/{id} | Update a member's project settings
|
|
300
|
+
*Phrase::MembersApi* | [**members_by_project**](docs/MembersApi.md#members_by_project) | **GET** /projects/{project_id}/members | List project members
|
|
300
301
|
*Phrase::MembersApi* | [**members_list**](docs/MembersApi.md#members_list) | **GET** /accounts/{account_id}/members | List members
|
|
301
302
|
*Phrase::NotificationGroupsApi* | [**notification_groups_list**](docs/NotificationGroupsApi.md#notification_groups_list) | **GET** /notification_groups | List notification groups
|
|
302
303
|
*Phrase::NotificationGroupsApi* | [**notification_groups_mark_all_as_read**](docs/NotificationGroupsApi.md#notification_groups_mark_all_as_read) | **PATCH** /notification_groups/mark_all_as_read | Mark all notification groups as read
|
|
@@ -374,6 +375,7 @@ Class | Method | HTTP request | Description
|
|
|
374
375
|
*Phrase::StyleGuidesApi* | [**styleguide_show**](docs/StyleGuidesApi.md#styleguide_show) | **GET** /projects/{project_id}/styleguides/{id} | Get a single style guide
|
|
375
376
|
*Phrase::StyleGuidesApi* | [**styleguide_update**](docs/StyleGuidesApi.md#styleguide_update) | **PATCH** /projects/{project_id}/styleguides/{id} | Update a style guide
|
|
376
377
|
*Phrase::StyleGuidesApi* | [**styleguides_list**](docs/StyleGuidesApi.md#styleguides_list) | **GET** /projects/{project_id}/styleguides | List style guides
|
|
378
|
+
*Phrase::SupportedLanguagesApi* | [**languages_list**](docs/SupportedLanguagesApi.md#languages_list) | **GET** /languages | List supported languages
|
|
377
379
|
*Phrase::TagsApi* | [**tag_create**](docs/TagsApi.md#tag_create) | **POST** /projects/{project_id}/tags | Create a tag
|
|
378
380
|
*Phrase::TagsApi* | [**tag_delete**](docs/TagsApi.md#tag_delete) | **DELETE** /projects/{project_id}/tags/{name} | Delete a tag
|
|
379
381
|
*Phrase::TagsApi* | [**tag_show**](docs/TagsApi.md#tag_show) | **GET** /projects/{project_id}/tags/{name} | Get a single tag
|
|
@@ -586,6 +588,7 @@ Class | Method | HTTP request | Description
|
|
|
586
588
|
- [Phrase::ProjectCreateParameters](docs/ProjectCreateParameters.md)
|
|
587
589
|
- [Phrase::ProjectDetails](docs/ProjectDetails.md)
|
|
588
590
|
- [Phrase::ProjectLocales](docs/ProjectLocales.md)
|
|
591
|
+
- [Phrase::ProjectMember](docs/ProjectMember.md)
|
|
589
592
|
- [Phrase::ProjectReport](docs/ProjectReport.md)
|
|
590
593
|
- [Phrase::ProjectShort](docs/ProjectShort.md)
|
|
591
594
|
- [Phrase::ProjectUpdateParameters](docs/ProjectUpdateParameters.md)
|
|
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**briefing** | **String** | Briefing for the translators | [optional]
|
|
10
10
|
**autotranslate** | **Boolean** | Automatically translate the job using machine translation. | [optional]
|
|
11
11
|
**source_locale_id** | **String** | The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used. | [optional]
|
|
12
|
+
**owner_id** | **String** | Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as owner at job-creation time. | [optional]
|
|
12
13
|
|
|
13
14
|
## Code Sample
|
|
14
15
|
|
|
@@ -19,7 +20,8 @@ instance = Phrase::JobTemplateCreateParameters.new(branch: my-feature-branch,
|
|
|
19
20
|
name: template,
|
|
20
21
|
briefing: text,
|
|
21
22
|
autotranslate: true,
|
|
22
|
-
source_locale_id: abcd1234cdef1234abcd1234cdef1234
|
|
23
|
+
source_locale_id: abcd1234cdef1234abcd1234cdef1234,
|
|
24
|
+
owner_id: null)
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
|
|
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
|
|
9
9
|
**briefing** | **String** | Briefing for the translators | [optional]
|
|
10
10
|
**autotranslate** | **Boolean** | Automatically translate the job using machine translation. | [optional]
|
|
11
11
|
**source_locale_id** | **String** | The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used. | [optional]
|
|
12
|
+
**owner_id** | **String** | Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. Pass an empty string to clear a previously set owner; when blank, jobs created from this template will default to assigning the job creator as owner. | [optional]
|
|
12
13
|
|
|
13
14
|
## Code Sample
|
|
14
15
|
|
|
@@ -19,7 +20,8 @@ instance = Phrase::JobTemplateUpdateParameters.new(branch: my-feature-branch,
|
|
|
19
20
|
name: template,
|
|
20
21
|
briefing: text,
|
|
21
22
|
autotranslate: true,
|
|
22
|
-
source_locale_id: abcd1234cdef1234abcd1234cdef1234
|
|
23
|
+
source_locale_id: abcd1234cdef1234abcd1234cdef1234,
|
|
24
|
+
owner_id: null)
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
|
data/docs/KeyCreateParameters.md
CHANGED
|
@@ -40,7 +40,7 @@ instance = Phrase::KeyCreateParameters.new(branch: my-feature-branch,
|
|
|
40
40
|
data_type: number,
|
|
41
41
|
tags: awesome-feature,needs-proofreading,
|
|
42
42
|
max_characters_allowed: 140,
|
|
43
|
-
screenshot: [B@
|
|
43
|
+
screenshot: [B@1b75f094,
|
|
44
44
|
remove_screenshot: null,
|
|
45
45
|
unformatted: null,
|
|
46
46
|
default_translation_content: Default translation content,
|
data/docs/KeyUpdateParameters.md
CHANGED
|
@@ -38,7 +38,7 @@ instance = Phrase::KeyUpdateParameters.new(branch: my-feature-branch,
|
|
|
38
38
|
data_type: number,
|
|
39
39
|
tags: awesome-feature,needs-proofreading,
|
|
40
40
|
max_characters_allowed: 140,
|
|
41
|
-
screenshot: [B@
|
|
41
|
+
screenshot: [B@39f9b4fc,
|
|
42
42
|
remove_screenshot: null,
|
|
43
43
|
unformatted: null,
|
|
44
44
|
xml_space_preserve: null,
|
data/docs/MembersApi.md
CHANGED
|
@@ -8,6 +8,7 @@ Method | HTTP request | Description
|
|
|
8
8
|
[**member_show**](MembersApi.md#member_show) | **GET** /accounts/{account_id}/members/{id} | Get single member
|
|
9
9
|
[**member_update**](MembersApi.md#member_update) | **PATCH** /accounts/{account_id}/members/{id} | Update a member
|
|
10
10
|
[**member_update_settings**](MembersApi.md#member_update_settings) | **PATCH** /projects/{project_id}/members/{id} | Update a member's project settings
|
|
11
|
+
[**members_by_project**](MembersApi.md#members_by_project) | **GET** /projects/{project_id}/members | List project members
|
|
11
12
|
[**members_list**](MembersApi.md#members_list) | **GET** /accounts/{account_id}/members | List members
|
|
12
13
|
|
|
13
14
|
|
|
@@ -267,6 +268,75 @@ Response<([**MemberProjectDetail**](MemberProjectDetail.md))>
|
|
|
267
268
|
- **Accept**: application/json
|
|
268
269
|
|
|
269
270
|
|
|
271
|
+
## members_by_project
|
|
272
|
+
|
|
273
|
+
> Array<ProjectMember> members_by_project(project_id, opts)
|
|
274
|
+
|
|
275
|
+
List project members
|
|
276
|
+
|
|
277
|
+
Get all members active in the project. Access token scope must include `read`.
|
|
278
|
+
|
|
279
|
+
### Example
|
|
280
|
+
|
|
281
|
+
```ruby
|
|
282
|
+
# load the gem
|
|
283
|
+
require 'phrase'
|
|
284
|
+
# setup authorization
|
|
285
|
+
Phrase.configure do |config|
|
|
286
|
+
# Configure HTTP basic authorization: Basic
|
|
287
|
+
config.username = 'YOUR USERNAME'
|
|
288
|
+
config.password = 'YOUR PASSWORD'
|
|
289
|
+
|
|
290
|
+
# Configure API key authorization: Token
|
|
291
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
292
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
api_instance = Phrase::MembersApi.new
|
|
296
|
+
project_id = 'project_id_example' # String | Project ID
|
|
297
|
+
opts = {
|
|
298
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
299
|
+
q: 'jane*', # String | Specify a query to search for members by name or email (including wildcards).
|
|
300
|
+
job_id: 'abcd1234cdef1234abcd1234cdef1234', # String | Filter members to those assigned to the job identified by this id.
|
|
301
|
+
page: 1, # Integer | Page number
|
|
302
|
+
per_page: 25 # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
begin
|
|
306
|
+
#List project members
|
|
307
|
+
result = api_instance.members_by_project(project_id, opts)
|
|
308
|
+
pp result
|
|
309
|
+
rescue Phrase::ApiError => e
|
|
310
|
+
puts "Exception when calling MembersApi->members_by_project: #{e}"
|
|
311
|
+
end
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Parameters
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
Name | Type | Description | Notes
|
|
318
|
+
------------- | ------------- | ------------- | -------------
|
|
319
|
+
**project_id** | **String**| Project ID |
|
|
320
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
321
|
+
**q** | **String**| Specify a query to search for members by name or email (including wildcards). | [optional]
|
|
322
|
+
**job_id** | **String**| Filter members to those assigned to the job identified by this id. | [optional]
|
|
323
|
+
**page** | **Integer**| Page number | [optional]
|
|
324
|
+
**per_page** | **Integer**| Limit on the number of objects to be returned, between 1 and 100. 25 by default | [optional]
|
|
325
|
+
|
|
326
|
+
### Return type
|
|
327
|
+
|
|
328
|
+
Response<([**Array<ProjectMember>**](ProjectMember.md))>
|
|
329
|
+
|
|
330
|
+
### Authorization
|
|
331
|
+
|
|
332
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
333
|
+
|
|
334
|
+
### HTTP request headers
|
|
335
|
+
|
|
336
|
+
- **Content-Type**: Not defined
|
|
337
|
+
- **Accept**: application/json
|
|
338
|
+
|
|
339
|
+
|
|
270
340
|
## members_list
|
|
271
341
|
|
|
272
342
|
> Array<Member> members_list(account_id, opts)
|
|
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**name** | **String** | Job template name |
|
|
8
8
|
**briefing** | **String** | Briefing for the translators | [optional]
|
|
9
9
|
**autotranslate** | **Boolean** | Automatically translate the job using machine translation. | [optional]
|
|
10
|
+
**owner_id** | **String** | Code of the account member to set as the job template owner. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as its owner at job-creation time. | [optional]
|
|
10
11
|
|
|
11
12
|
## Code Sample
|
|
12
13
|
|
|
@@ -15,7 +16,8 @@ require 'Phrase'
|
|
|
15
16
|
|
|
16
17
|
instance = Phrase::OrganizationJobTemplateCreateParameters.new(name: template,
|
|
17
18
|
briefing: text,
|
|
18
|
-
autotranslate: true
|
|
19
|
+
autotranslate: true,
|
|
20
|
+
owner_id: null)
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
|
|
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
|
|
|
7
7
|
**name** | **String** | Job template name |
|
|
8
8
|
**briefing** | **String** | Briefing for the translators | [optional]
|
|
9
9
|
**autotranslate** | **Boolean** | Automatically translate the job using machine translation. | [optional]
|
|
10
|
+
**owner_id** | **String** | Code of the account member to set as the job template owner. Pass an empty string to clear a previously set owner; when blank, the owner is set to null and jobs created from this template will default to assigning the job creator as owner. | [optional]
|
|
10
11
|
|
|
11
12
|
## Code Sample
|
|
12
13
|
|
|
@@ -15,7 +16,8 @@ require 'Phrase'
|
|
|
15
16
|
|
|
16
17
|
instance = Phrase::OrganizationJobTemplateUpdateParameters.new(name: template,
|
|
17
18
|
briefing: text,
|
|
18
|
-
autotranslate: true
|
|
19
|
+
autotranslate: true,
|
|
20
|
+
owner_id: null)
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
|
|
@@ -52,7 +52,7 @@ instance = Phrase::ProjectCreateParameters.new(name: My Android Project,
|
|
|
52
52
|
shares_translation_memory: true,
|
|
53
53
|
tm_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
54
54
|
term_base_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
55
|
-
project_image: [B@
|
|
55
|
+
project_image: [B@e25817f,
|
|
56
56
|
remove_project_image: null,
|
|
57
57
|
account_id: abcd1234,
|
|
58
58
|
point_of_contact: abcd1234,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Phrase::ProjectMember
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**id** | **String** | | [optional]
|
|
8
|
+
**username** | **String** | | [optional]
|
|
9
|
+
**name** | **String** | | [optional]
|
|
10
|
+
**position** | **String** | | [optional]
|
|
11
|
+
**created_at** | **Time** | | [optional]
|
|
12
|
+
**updated_at** | **Time** | | [optional]
|
|
13
|
+
|
|
14
|
+
## Code Sample
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'Phrase'
|
|
18
|
+
|
|
19
|
+
instance = Phrase::ProjectMember.new(id: null,
|
|
20
|
+
username: null,
|
|
21
|
+
name: null,
|
|
22
|
+
position: null,
|
|
23
|
+
created_at: null,
|
|
24
|
+
updated_at: null)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
@@ -53,7 +53,7 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
|
|
|
53
53
|
shares_translation_memory: true,
|
|
54
54
|
tm_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
55
55
|
term_base_ids: ["abcd1234cdef1234abcd1234cdef1234"],
|
|
56
|
-
project_image: [B@
|
|
56
|
+
project_image: [B@169729d9,
|
|
57
57
|
remove_project_image: false,
|
|
58
58
|
workflow: review,
|
|
59
59
|
machine_translation_enabled: true,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Phrase::SupportedLanguagesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.phrase.com/v2*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**languages_list**](SupportedLanguagesApi.md#languages_list) | **GET** /languages | List supported languages
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## languages_list
|
|
12
|
+
|
|
13
|
+
> Hash<String, String> languages_list
|
|
14
|
+
|
|
15
|
+
List supported languages
|
|
16
|
+
|
|
17
|
+
Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
# load the gem
|
|
23
|
+
require 'phrase'
|
|
24
|
+
# setup authorization
|
|
25
|
+
Phrase.configure do |config|
|
|
26
|
+
# Configure HTTP basic authorization: Basic
|
|
27
|
+
config.username = 'YOUR USERNAME'
|
|
28
|
+
config.password = 'YOUR PASSWORD'
|
|
29
|
+
|
|
30
|
+
# Configure API key authorization: Token
|
|
31
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
32
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
api_instance = Phrase::SupportedLanguagesApi.new
|
|
36
|
+
|
|
37
|
+
begin
|
|
38
|
+
#List supported languages
|
|
39
|
+
result = api_instance.languages_list
|
|
40
|
+
pp result
|
|
41
|
+
rescue Phrase::ApiError => e
|
|
42
|
+
puts "Exception when calling SupportedLanguagesApi->languages_list: #{e}"
|
|
43
|
+
end
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Parameters
|
|
47
|
+
|
|
48
|
+
This endpoint does not need any parameter.
|
|
49
|
+
|
|
50
|
+
### Return type
|
|
51
|
+
|
|
52
|
+
Response<(**Hash<String, String>**)>
|
|
53
|
+
|
|
54
|
+
### Authorization
|
|
55
|
+
|
|
56
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
57
|
+
|
|
58
|
+
### HTTP request headers
|
|
59
|
+
|
|
60
|
+
- **Content-Type**: Not defined
|
|
61
|
+
- **Accept**: application/json
|
|
62
|
+
|
|
@@ -311,6 +311,84 @@ module Phrase
|
|
|
311
311
|
return response, status_code, headers
|
|
312
312
|
end
|
|
313
313
|
|
|
314
|
+
# List project members
|
|
315
|
+
# Get all members active in the project. Access token scope must include `read`.
|
|
316
|
+
# @param project_id [String] Project ID
|
|
317
|
+
# @param [Hash] opts the optional parameters
|
|
318
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
319
|
+
# @option opts [String] :q Specify a query to search for members by name or email (including wildcards).
|
|
320
|
+
# @option opts [String] :job_id Filter members to those assigned to the job identified by this id.
|
|
321
|
+
# @option opts [Integer] :page Page number
|
|
322
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
323
|
+
# @return [Array<ProjectMember>]
|
|
324
|
+
def members_by_project(project_id, opts = {})
|
|
325
|
+
data, _status_code, _headers = members_by_project_with_http_info(project_id, opts)
|
|
326
|
+
data
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# List project members
|
|
330
|
+
# Get all members active in the project. Access token scope must include `read`.
|
|
331
|
+
# @param project_id [String] Project ID
|
|
332
|
+
# @param [Hash] opts the optional parameters
|
|
333
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
334
|
+
# @option opts [String] :q Specify a query to search for members by name or email (including wildcards).
|
|
335
|
+
# @option opts [String] :job_id Filter members to those assigned to the job identified by this id.
|
|
336
|
+
# @option opts [Integer] :page Page number
|
|
337
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
338
|
+
# @return [Array<(Response<(Array<ProjectMember>)>, Integer, Hash)>] Response<(Array<ProjectMember>)> data, response status code and response headers
|
|
339
|
+
def members_by_project_with_http_info(project_id, opts = {})
|
|
340
|
+
if @api_client.config.debugging
|
|
341
|
+
@api_client.config.logger.debug 'Calling API: MembersApi.members_by_project ...'
|
|
342
|
+
end
|
|
343
|
+
# verify the required parameter 'project_id' is set
|
|
344
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
345
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling MembersApi.members_by_project"
|
|
346
|
+
end
|
|
347
|
+
# resource path
|
|
348
|
+
local_var_path = '/projects/{project_id}/members'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
349
|
+
|
|
350
|
+
# query parameters
|
|
351
|
+
query_params = opts[:query_params] || {}
|
|
352
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
|
353
|
+
query_params[:'job_id'] = opts[:'job_id'] if !opts[:'job_id'].nil?
|
|
354
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
355
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
356
|
+
|
|
357
|
+
# header parameters
|
|
358
|
+
header_params = opts[:header_params] || {}
|
|
359
|
+
# HTTP header 'Accept' (if needed)
|
|
360
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
361
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
362
|
+
|
|
363
|
+
# form parameters
|
|
364
|
+
form_params = opts[:form_params] || {}
|
|
365
|
+
|
|
366
|
+
# http body (model)
|
|
367
|
+
post_body = opts[:body]
|
|
368
|
+
|
|
369
|
+
# return_type
|
|
370
|
+
return_type = opts[:return_type] || 'Array<ProjectMember>'
|
|
371
|
+
|
|
372
|
+
# auth_names
|
|
373
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
374
|
+
|
|
375
|
+
new_options = opts.merge(
|
|
376
|
+
:header_params => header_params,
|
|
377
|
+
:query_params => query_params,
|
|
378
|
+
:form_params => form_params,
|
|
379
|
+
:body => post_body,
|
|
380
|
+
:auth_names => auth_names,
|
|
381
|
+
:return_type => return_type
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
385
|
+
if @api_client.config.debugging
|
|
386
|
+
@api_client.config.logger.debug "API called: MembersApi#members_by_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
387
|
+
end
|
|
388
|
+
response = ::Phrase::Response.new(data, headers)
|
|
389
|
+
return response, status_code, headers
|
|
390
|
+
end
|
|
391
|
+
|
|
314
392
|
# List members
|
|
315
393
|
# Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include `team.manage`.
|
|
316
394
|
# @param account_id [String] Account ID
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class SupportedLanguagesApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# List supported languages
|
|
11
|
+
# Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
12
|
+
# @param [Hash] opts the optional parameters
|
|
13
|
+
# @return [Hash<String, String>]
|
|
14
|
+
def languages_list(opts = {})
|
|
15
|
+
data, _status_code, _headers = languages_list_with_http_info(opts)
|
|
16
|
+
data
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# List supported languages
|
|
20
|
+
# Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
21
|
+
# @param [Hash] opts the optional parameters
|
|
22
|
+
# @return [Array<(Response<(Hash<String, String>)>, Integer, Hash)>] Response<(Hash<String, String>)> data, response status code and response headers
|
|
23
|
+
def languages_list_with_http_info(opts = {})
|
|
24
|
+
if @api_client.config.debugging
|
|
25
|
+
@api_client.config.logger.debug 'Calling API: SupportedLanguagesApi.languages_list ...'
|
|
26
|
+
end
|
|
27
|
+
# resource path
|
|
28
|
+
local_var_path = '/languages'
|
|
29
|
+
|
|
30
|
+
# query parameters
|
|
31
|
+
query_params = opts[:query_params] || {}
|
|
32
|
+
|
|
33
|
+
# header parameters
|
|
34
|
+
header_params = opts[:header_params] || {}
|
|
35
|
+
# HTTP header 'Accept' (if needed)
|
|
36
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
37
|
+
|
|
38
|
+
# form parameters
|
|
39
|
+
form_params = opts[:form_params] || {}
|
|
40
|
+
|
|
41
|
+
# http body (model)
|
|
42
|
+
post_body = opts[:body]
|
|
43
|
+
|
|
44
|
+
# return_type
|
|
45
|
+
return_type = opts[:return_type] || 'Hash<String, String>'
|
|
46
|
+
|
|
47
|
+
# auth_names
|
|
48
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
49
|
+
|
|
50
|
+
new_options = opts.merge(
|
|
51
|
+
:header_params => header_params,
|
|
52
|
+
:query_params => query_params,
|
|
53
|
+
:form_params => form_params,
|
|
54
|
+
:body => post_body,
|
|
55
|
+
:auth_names => auth_names,
|
|
56
|
+
:return_type => return_type
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
60
|
+
if @api_client.config.debugging
|
|
61
|
+
@api_client.config.logger.debug "API called: SupportedLanguagesApi#languages_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
62
|
+
end
|
|
63
|
+
response = ::Phrase::Response.new(data, headers)
|
|
64
|
+
return response, status_code, headers
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -17,6 +17,9 @@ module Phrase
|
|
|
17
17
|
# The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used.
|
|
18
18
|
attr_accessor :source_locale_id
|
|
19
19
|
|
|
20
|
+
# Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as owner at job-creation time.
|
|
21
|
+
attr_accessor :owner_id
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
@@ -24,7 +27,8 @@ module Phrase
|
|
|
24
27
|
:'name' => :'name',
|
|
25
28
|
:'briefing' => :'briefing',
|
|
26
29
|
:'autotranslate' => :'autotranslate',
|
|
27
|
-
:'source_locale_id' => :'source_locale_id'
|
|
30
|
+
:'source_locale_id' => :'source_locale_id',
|
|
31
|
+
:'owner_id' => :'owner_id'
|
|
28
32
|
}
|
|
29
33
|
end
|
|
30
34
|
|
|
@@ -35,7 +39,8 @@ module Phrase
|
|
|
35
39
|
:'name' => :'String',
|
|
36
40
|
:'briefing' => :'String',
|
|
37
41
|
:'autotranslate' => :'Boolean',
|
|
38
|
-
:'source_locale_id' => :'String'
|
|
42
|
+
:'source_locale_id' => :'String',
|
|
43
|
+
:'owner_id' => :'String'
|
|
39
44
|
}
|
|
40
45
|
end
|
|
41
46
|
|
|
@@ -79,6 +84,10 @@ module Phrase
|
|
|
79
84
|
if attributes.key?(:'source_locale_id')
|
|
80
85
|
self.source_locale_id = attributes[:'source_locale_id']
|
|
81
86
|
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'owner_id')
|
|
89
|
+
self.owner_id = attributes[:'owner_id']
|
|
90
|
+
end
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -108,7 +117,8 @@ module Phrase
|
|
|
108
117
|
name == o.name &&
|
|
109
118
|
briefing == o.briefing &&
|
|
110
119
|
autotranslate == o.autotranslate &&
|
|
111
|
-
source_locale_id == o.source_locale_id
|
|
120
|
+
source_locale_id == o.source_locale_id &&
|
|
121
|
+
owner_id == o.owner_id
|
|
112
122
|
end
|
|
113
123
|
|
|
114
124
|
# @see the `==` method
|
|
@@ -120,7 +130,7 @@ module Phrase
|
|
|
120
130
|
# Calculates hash code according to all attributes.
|
|
121
131
|
# @return [Integer] Hash code
|
|
122
132
|
def hash
|
|
123
|
-
[branch, name, briefing, autotranslate, source_locale_id].hash
|
|
133
|
+
[branch, name, briefing, autotranslate, source_locale_id, owner_id].hash
|
|
124
134
|
end
|
|
125
135
|
|
|
126
136
|
# Builds the object from hash
|
|
@@ -17,6 +17,9 @@ module Phrase
|
|
|
17
17
|
# The API id of the source language. This locale will be set as source locale for the job template. If not provided, the project default locale will be used.
|
|
18
18
|
attr_accessor :source_locale_id
|
|
19
19
|
|
|
20
|
+
# Code of the account member to set as the job template owner. The referenced user must also be a member of the project; passing the code of an account member who is not a project member returns a 404. Pass an empty string to clear a previously set owner; when blank, jobs created from this template will default to assigning the job creator as owner.
|
|
21
|
+
attr_accessor :owner_id
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
@@ -24,7 +27,8 @@ module Phrase
|
|
|
24
27
|
:'name' => :'name',
|
|
25
28
|
:'briefing' => :'briefing',
|
|
26
29
|
:'autotranslate' => :'autotranslate',
|
|
27
|
-
:'source_locale_id' => :'source_locale_id'
|
|
30
|
+
:'source_locale_id' => :'source_locale_id',
|
|
31
|
+
:'owner_id' => :'owner_id'
|
|
28
32
|
}
|
|
29
33
|
end
|
|
30
34
|
|
|
@@ -35,7 +39,8 @@ module Phrase
|
|
|
35
39
|
:'name' => :'String',
|
|
36
40
|
:'briefing' => :'String',
|
|
37
41
|
:'autotranslate' => :'Boolean',
|
|
38
|
-
:'source_locale_id' => :'String'
|
|
42
|
+
:'source_locale_id' => :'String',
|
|
43
|
+
:'owner_id' => :'String'
|
|
39
44
|
}
|
|
40
45
|
end
|
|
41
46
|
|
|
@@ -79,6 +84,10 @@ module Phrase
|
|
|
79
84
|
if attributes.key?(:'source_locale_id')
|
|
80
85
|
self.source_locale_id = attributes[:'source_locale_id']
|
|
81
86
|
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'owner_id')
|
|
89
|
+
self.owner_id = attributes[:'owner_id']
|
|
90
|
+
end
|
|
82
91
|
end
|
|
83
92
|
|
|
84
93
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -108,7 +117,8 @@ module Phrase
|
|
|
108
117
|
name == o.name &&
|
|
109
118
|
briefing == o.briefing &&
|
|
110
119
|
autotranslate == o.autotranslate &&
|
|
111
|
-
source_locale_id == o.source_locale_id
|
|
120
|
+
source_locale_id == o.source_locale_id &&
|
|
121
|
+
owner_id == o.owner_id
|
|
112
122
|
end
|
|
113
123
|
|
|
114
124
|
# @see the `==` method
|
|
@@ -120,7 +130,7 @@ module Phrase
|
|
|
120
130
|
# Calculates hash code according to all attributes.
|
|
121
131
|
# @return [Integer] Hash code
|
|
122
132
|
def hash
|
|
123
|
-
[branch, name, briefing, autotranslate, source_locale_id].hash
|
|
133
|
+
[branch, name, briefing, autotranslate, source_locale_id, owner_id].hash
|
|
124
134
|
end
|
|
125
135
|
|
|
126
136
|
# Builds the object from hash
|
|
@@ -11,12 +11,16 @@ module Phrase
|
|
|
11
11
|
# Automatically translate the job using machine translation.
|
|
12
12
|
attr_accessor :autotranslate
|
|
13
13
|
|
|
14
|
+
# Code of the account member to set as the job template owner. When omitted or blank, no owner is pre-set; the user who creates a job from this template is assigned as its owner at job-creation time.
|
|
15
|
+
attr_accessor :owner_id
|
|
16
|
+
|
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
18
|
def self.attribute_map
|
|
16
19
|
{
|
|
17
20
|
:'name' => :'name',
|
|
18
21
|
:'briefing' => :'briefing',
|
|
19
|
-
:'autotranslate' => :'autotranslate'
|
|
22
|
+
:'autotranslate' => :'autotranslate',
|
|
23
|
+
:'owner_id' => :'owner_id'
|
|
20
24
|
}
|
|
21
25
|
end
|
|
22
26
|
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
|
25
29
|
{
|
|
26
30
|
:'name' => :'String',
|
|
27
31
|
:'briefing' => :'String',
|
|
28
|
-
:'autotranslate' => :'Boolean'
|
|
32
|
+
:'autotranslate' => :'Boolean',
|
|
33
|
+
:'owner_id' => :'String'
|
|
29
34
|
}
|
|
30
35
|
end
|
|
31
36
|
|
|
@@ -61,6 +66,10 @@ module Phrase
|
|
|
61
66
|
if attributes.key?(:'autotranslate')
|
|
62
67
|
self.autotranslate = attributes[:'autotranslate']
|
|
63
68
|
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'owner_id')
|
|
71
|
+
self.owner_id = attributes[:'owner_id']
|
|
72
|
+
end
|
|
64
73
|
end
|
|
65
74
|
|
|
66
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -88,7 +97,8 @@ module Phrase
|
|
|
88
97
|
self.class == o.class &&
|
|
89
98
|
name == o.name &&
|
|
90
99
|
briefing == o.briefing &&
|
|
91
|
-
autotranslate == o.autotranslate
|
|
100
|
+
autotranslate == o.autotranslate &&
|
|
101
|
+
owner_id == o.owner_id
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# @see the `==` method
|
|
@@ -100,7 +110,7 @@ module Phrase
|
|
|
100
110
|
# Calculates hash code according to all attributes.
|
|
101
111
|
# @return [Integer] Hash code
|
|
102
112
|
def hash
|
|
103
|
-
[name, briefing, autotranslate].hash
|
|
113
|
+
[name, briefing, autotranslate, owner_id].hash
|
|
104
114
|
end
|
|
105
115
|
|
|
106
116
|
# Builds the object from hash
|
|
@@ -11,12 +11,16 @@ module Phrase
|
|
|
11
11
|
# Automatically translate the job using machine translation.
|
|
12
12
|
attr_accessor :autotranslate
|
|
13
13
|
|
|
14
|
+
# Code of the account member to set as the job template owner. Pass an empty string to clear a previously set owner; when blank, the owner is set to null and jobs created from this template will default to assigning the job creator as owner.
|
|
15
|
+
attr_accessor :owner_id
|
|
16
|
+
|
|
14
17
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
18
|
def self.attribute_map
|
|
16
19
|
{
|
|
17
20
|
:'name' => :'name',
|
|
18
21
|
:'briefing' => :'briefing',
|
|
19
|
-
:'autotranslate' => :'autotranslate'
|
|
22
|
+
:'autotranslate' => :'autotranslate',
|
|
23
|
+
:'owner_id' => :'owner_id'
|
|
20
24
|
}
|
|
21
25
|
end
|
|
22
26
|
|
|
@@ -25,7 +29,8 @@ module Phrase
|
|
|
25
29
|
{
|
|
26
30
|
:'name' => :'String',
|
|
27
31
|
:'briefing' => :'String',
|
|
28
|
-
:'autotranslate' => :'Boolean'
|
|
32
|
+
:'autotranslate' => :'Boolean',
|
|
33
|
+
:'owner_id' => :'String'
|
|
29
34
|
}
|
|
30
35
|
end
|
|
31
36
|
|
|
@@ -61,6 +66,10 @@ module Phrase
|
|
|
61
66
|
if attributes.key?(:'autotranslate')
|
|
62
67
|
self.autotranslate = attributes[:'autotranslate']
|
|
63
68
|
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'owner_id')
|
|
71
|
+
self.owner_id = attributes[:'owner_id']
|
|
72
|
+
end
|
|
64
73
|
end
|
|
65
74
|
|
|
66
75
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -88,7 +97,8 @@ module Phrase
|
|
|
88
97
|
self.class == o.class &&
|
|
89
98
|
name == o.name &&
|
|
90
99
|
briefing == o.briefing &&
|
|
91
|
-
autotranslate == o.autotranslate
|
|
100
|
+
autotranslate == o.autotranslate &&
|
|
101
|
+
owner_id == o.owner_id
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# @see the `==` method
|
|
@@ -100,7 +110,7 @@ module Phrase
|
|
|
100
110
|
# Calculates hash code according to all attributes.
|
|
101
111
|
# @return [Integer] Hash code
|
|
102
112
|
def hash
|
|
103
|
-
[name, briefing, autotranslate].hash
|
|
113
|
+
[name, briefing, autotranslate, owner_id].hash
|
|
104
114
|
end
|
|
105
115
|
|
|
106
116
|
# Builds the object from hash
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class ProjectMember
|
|
5
|
+
attr_accessor :id
|
|
6
|
+
|
|
7
|
+
attr_accessor :username
|
|
8
|
+
|
|
9
|
+
attr_accessor :name
|
|
10
|
+
|
|
11
|
+
attr_accessor :position
|
|
12
|
+
|
|
13
|
+
attr_accessor :created_at
|
|
14
|
+
|
|
15
|
+
attr_accessor :updated_at
|
|
16
|
+
|
|
17
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
18
|
+
def self.attribute_map
|
|
19
|
+
{
|
|
20
|
+
:'id' => :'id',
|
|
21
|
+
:'username' => :'username',
|
|
22
|
+
:'name' => :'name',
|
|
23
|
+
:'position' => :'position',
|
|
24
|
+
:'created_at' => :'created_at',
|
|
25
|
+
:'updated_at' => :'updated_at'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Attribute type mapping.
|
|
30
|
+
def self.openapi_types
|
|
31
|
+
{
|
|
32
|
+
:'id' => :'String',
|
|
33
|
+
:'username' => :'String',
|
|
34
|
+
:'name' => :'String',
|
|
35
|
+
:'position' => :'String',
|
|
36
|
+
:'created_at' => :'DateTime',
|
|
37
|
+
:'updated_at' => :'DateTime'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# List of attributes with nullable: true
|
|
42
|
+
def self.openapi_nullable
|
|
43
|
+
Set.new([
|
|
44
|
+
])
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Initializes the object
|
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
49
|
+
def initialize(attributes = {})
|
|
50
|
+
if (!attributes.is_a?(Hash))
|
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectMember` initialize method"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::ProjectMember`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
58
|
+
end
|
|
59
|
+
h[k.to_sym] = v
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if attributes.key?(:'id')
|
|
63
|
+
self.id = attributes[:'id']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'username')
|
|
67
|
+
self.username = attributes[:'username']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'name')
|
|
71
|
+
self.name = attributes[:'name']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'position')
|
|
75
|
+
self.position = attributes[:'position']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'created_at')
|
|
79
|
+
self.created_at = attributes[:'created_at']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'updated_at')
|
|
83
|
+
self.updated_at = attributes[:'updated_at']
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
88
|
+
# @return Array for valid properties with the reasons
|
|
89
|
+
def list_invalid_properties
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
invalid_properties
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Check to see if the all the properties in the model are valid
|
|
95
|
+
# @return true if the model is valid
|
|
96
|
+
def valid?
|
|
97
|
+
true
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Checks equality by comparing each attribute.
|
|
101
|
+
# @param [Object] Object to be compared
|
|
102
|
+
def ==(o)
|
|
103
|
+
return true if self.equal?(o)
|
|
104
|
+
self.class == o.class &&
|
|
105
|
+
id == o.id &&
|
|
106
|
+
username == o.username &&
|
|
107
|
+
name == o.name &&
|
|
108
|
+
position == o.position &&
|
|
109
|
+
created_at == o.created_at &&
|
|
110
|
+
updated_at == o.updated_at
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# @see the `==` method
|
|
114
|
+
# @param [Object] Object to be compared
|
|
115
|
+
def eql?(o)
|
|
116
|
+
self == o
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Calculates hash code according to all attributes.
|
|
120
|
+
# @return [Integer] Hash code
|
|
121
|
+
def hash
|
|
122
|
+
[id, username, name, position, created_at, updated_at].hash
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Builds the object from hash
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
# @return [Object] Returns the model itself
|
|
128
|
+
def self.build_from_hash(attributes)
|
|
129
|
+
new.build_from_hash(attributes)
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Builds the object from hash
|
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
134
|
+
# @return [Object] Returns the model itself
|
|
135
|
+
def build_from_hash(attributes)
|
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
|
137
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
138
|
+
if type =~ /\AArray<(.*)>/i
|
|
139
|
+
# check to ensure the input is an array given that the attribute
|
|
140
|
+
# is documented as an array but the input is not
|
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
143
|
+
end
|
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
146
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
self
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Deserializes the data based on type
|
|
153
|
+
# @param string type Data type
|
|
154
|
+
# @param string value Value to be deserialized
|
|
155
|
+
# @return [Object] Deserialized data
|
|
156
|
+
def _deserialize(type, value)
|
|
157
|
+
case type.to_sym
|
|
158
|
+
when :DateTime
|
|
159
|
+
DateTime.parse(value)
|
|
160
|
+
when :Date
|
|
161
|
+
Date.parse(value)
|
|
162
|
+
when :Time
|
|
163
|
+
Time.parse(value)
|
|
164
|
+
when :String
|
|
165
|
+
value.to_s
|
|
166
|
+
when :Integer
|
|
167
|
+
value.to_i
|
|
168
|
+
when :Float
|
|
169
|
+
value.to_f
|
|
170
|
+
when :Boolean
|
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
172
|
+
true
|
|
173
|
+
else
|
|
174
|
+
false
|
|
175
|
+
end
|
|
176
|
+
when :Object
|
|
177
|
+
# generic object (usually a Hash), return directly
|
|
178
|
+
value
|
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
|
185
|
+
{}.tap do |hash|
|
|
186
|
+
value.each do |k, v|
|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
else # model
|
|
191
|
+
Phrase.const_get(type).build_from_hash(value)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Returns the string representation of the object
|
|
196
|
+
# @return [String] String presentation of the object
|
|
197
|
+
def to_s
|
|
198
|
+
to_hash.to_s
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
|
203
|
+
def to_body
|
|
204
|
+
to_hash
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Returns the object in the form of hash
|
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
|
209
|
+
def to_hash
|
|
210
|
+
hash = {}
|
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
212
|
+
value = self.send(attr)
|
|
213
|
+
if value.nil?
|
|
214
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
215
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
hash[param] = _to_hash(value)
|
|
219
|
+
end
|
|
220
|
+
hash
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Outputs non-array value in the form of hash
|
|
224
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
225
|
+
# @param [Object] value Any valid value
|
|
226
|
+
# @return [Hash] Returns the value in the form of hash
|
|
227
|
+
def _to_hash(value)
|
|
228
|
+
if value.is_a?(Array)
|
|
229
|
+
value.compact.map { |v| _to_hash(v) }
|
|
230
|
+
elsif value.is_a?(Hash)
|
|
231
|
+
{}.tap do |hash|
|
|
232
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
233
|
+
end
|
|
234
|
+
elsif value.respond_to? :to_hash
|
|
235
|
+
value.to_hash
|
|
236
|
+
else
|
|
237
|
+
value
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
data/lib/phrase/version.rb
CHANGED
data/lib/phrase.rb
CHANGED
|
@@ -161,6 +161,7 @@ require 'phrase/models/project'
|
|
|
161
161
|
require 'phrase/models/project_create_parameters'
|
|
162
162
|
require 'phrase/models/project_details'
|
|
163
163
|
require 'phrase/models/project_locales'
|
|
164
|
+
require 'phrase/models/project_member'
|
|
164
165
|
require 'phrase/models/project_report'
|
|
165
166
|
require 'phrase/models/project_short'
|
|
166
167
|
require 'phrase/models/project_update_parameters'
|
|
@@ -303,6 +304,7 @@ require 'phrase/api/screenshots_api'
|
|
|
303
304
|
require 'phrase/api/search_api'
|
|
304
305
|
require 'phrase/api/spaces_api'
|
|
305
306
|
require 'phrase/api/style_guides_api'
|
|
307
|
+
require 'phrase/api/supported_languages_api'
|
|
306
308
|
require 'phrase/api/tags_api'
|
|
307
309
|
require 'phrase/api/teams_api'
|
|
308
310
|
require 'phrase/api/translations_api'
|
|
@@ -78,6 +78,23 @@ describe 'MembersApi' do
|
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
# unit tests for members_by_project
|
|
82
|
+
# List project members
|
|
83
|
+
# Get all members active in the project. Access token scope must include `read`.
|
|
84
|
+
# @param project_id 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 [String] :q Specify a query to search for members by name or email (including wildcards).
|
|
88
|
+
# @option opts [String] :job_id Filter members to those assigned to the job identified by this id.
|
|
89
|
+
# @option opts [Integer] :page Page number
|
|
90
|
+
# @option opts [Integer] :per_page Limit on the number of objects to be returned, between 1 and 100. 25 by default
|
|
91
|
+
# @return [Array<ProjectMember>]
|
|
92
|
+
describe 'members_by_project test' do
|
|
93
|
+
it 'should work' do
|
|
94
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
81
98
|
# unit tests for members_list
|
|
82
99
|
# List members
|
|
83
100
|
# Get all users active in the account. It also lists resources like projects and locales the member has access to. In case nothing is shown the default access from the role is used. Access token scope must include `team.manage`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'json'
|
|
3
|
+
|
|
4
|
+
# Unit tests for Phrase::SupportedLanguagesApi
|
|
5
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
6
|
+
# Please update as you see appropriate
|
|
7
|
+
describe 'SupportedLanguagesApi' do
|
|
8
|
+
before do
|
|
9
|
+
# run before each test
|
|
10
|
+
@api_instance = Phrase::SupportedLanguagesApi.new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
after do
|
|
14
|
+
# run after each test
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe 'test an instance of SupportedLanguagesApi' do
|
|
18
|
+
it 'should create an instance of SupportedLanguagesApi' do
|
|
19
|
+
expect(@api_instance).to be_instance_of(Phrase::SupportedLanguagesApi)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# unit tests for languages_list
|
|
24
|
+
# List supported languages
|
|
25
|
+
# Returns all languages/locale codes that Phrase Strings recognizes, mapped to their human-readable display name. This endpoint does not require authentication.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [Hash<String, String>]
|
|
28
|
+
describe 'languages_list test' do
|
|
29
|
+
it 'should work' do
|
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
@@ -38,4 +38,10 @@ describe 'OrganizationJobTemplateCreateParameters' do
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
describe 'test attribute "owner_id"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
41
47
|
end
|
|
@@ -38,4 +38,10 @@ describe 'OrganizationJobTemplateUpdateParameters' do
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
describe 'test attribute "owner_id"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
41
47
|
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'json'
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
# Unit tests for Phrase::ProjectMember
|
|
6
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
7
|
+
# Please update as you see appropriate
|
|
8
|
+
describe 'ProjectMember' do
|
|
9
|
+
before do
|
|
10
|
+
# run before each test
|
|
11
|
+
@instance = Phrase::ProjectMember.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
after do
|
|
15
|
+
# run after each test
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ProjectMember' do
|
|
19
|
+
it 'should create an instance of ProjectMember' do
|
|
20
|
+
expect(@instance).to be_instance_of(Phrase::ProjectMember)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
describe 'test attribute "id"' do
|
|
24
|
+
it 'should work' do
|
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test attribute "username"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'test attribute "name"' do
|
|
36
|
+
it 'should work' do
|
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe 'test attribute "position"' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
describe 'test attribute "created_at"' do
|
|
48
|
+
it 'should work' do
|
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
describe 'test attribute "updated_at"' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: phrase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.29.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Phrase
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -271,6 +271,7 @@ files:
|
|
|
271
271
|
- docs/ProjectCreateParameters.md
|
|
272
272
|
- docs/ProjectDetails.md
|
|
273
273
|
- docs/ProjectLocales.md
|
|
274
|
+
- docs/ProjectMember.md
|
|
274
275
|
- docs/ProjectReport.md
|
|
275
276
|
- docs/ProjectShort.md
|
|
276
277
|
- docs/ProjectUpdateParameters.md
|
|
@@ -322,6 +323,7 @@ files:
|
|
|
322
323
|
- docs/StyleguidePreview.md
|
|
323
324
|
- docs/StyleguideUpdateParameters.md
|
|
324
325
|
- docs/Subscription.md
|
|
326
|
+
- docs/SupportedLanguagesApi.md
|
|
325
327
|
- docs/Tag.md
|
|
326
328
|
- docs/TagCreateParameters.md
|
|
327
329
|
- docs/TagWithStats.md
|
|
@@ -435,6 +437,7 @@ files:
|
|
|
435
437
|
- lib/phrase/api/search_api.rb
|
|
436
438
|
- lib/phrase/api/spaces_api.rb
|
|
437
439
|
- lib/phrase/api/style_guides_api.rb
|
|
440
|
+
- lib/phrase/api/supported_languages_api.rb
|
|
438
441
|
- lib/phrase/api/tags_api.rb
|
|
439
442
|
- lib/phrase/api/teams_api.rb
|
|
440
443
|
- lib/phrase/api/translations_api.rb
|
|
@@ -601,6 +604,7 @@ files:
|
|
|
601
604
|
- lib/phrase/models/project_create_parameters.rb
|
|
602
605
|
- lib/phrase/models/project_details.rb
|
|
603
606
|
- lib/phrase/models/project_locales.rb
|
|
607
|
+
- lib/phrase/models/project_member.rb
|
|
604
608
|
- lib/phrase/models/project_report.rb
|
|
605
609
|
- lib/phrase/models/project_short.rb
|
|
606
610
|
- lib/phrase/models/project_update_parameters.rb
|
|
@@ -744,6 +748,7 @@ files:
|
|
|
744
748
|
- spec/api/search_api_spec.rb
|
|
745
749
|
- spec/api/spaces_api_spec.rb
|
|
746
750
|
- spec/api/style_guides_api_spec.rb
|
|
751
|
+
- spec/api/supported_languages_api_spec.rb
|
|
747
752
|
- spec/api/tags_api_spec.rb
|
|
748
753
|
- spec/api/teams_api_spec.rb
|
|
749
754
|
- spec/api/translations_api_spec.rb
|
|
@@ -908,6 +913,7 @@ files:
|
|
|
908
913
|
- spec/models/project_create_parameters_spec.rb
|
|
909
914
|
- spec/models/project_details_spec.rb
|
|
910
915
|
- spec/models/project_locales_spec.rb
|
|
916
|
+
- spec/models/project_member_spec.rb
|
|
911
917
|
- spec/models/project_report_spec.rb
|
|
912
918
|
- spec/models/project_short_spec.rb
|
|
913
919
|
- spec/models/project_spec.rb
|
|
@@ -1034,6 +1040,7 @@ test_files:
|
|
|
1034
1040
|
- spec/api/machine_translation_api_spec.rb
|
|
1035
1041
|
- spec/api/screenshot_markers_api_spec.rb
|
|
1036
1042
|
- spec/api/comment_replies_api_spec.rb
|
|
1043
|
+
- spec/api/supported_languages_api_spec.rb
|
|
1037
1044
|
- spec/api/job_comments_api_spec.rb
|
|
1038
1045
|
- spec/api/screenshots_api_spec.rb
|
|
1039
1046
|
- spec/api/orders_api_spec.rb
|
|
@@ -1122,6 +1129,7 @@ test_files:
|
|
|
1122
1129
|
- spec/models/variable_create_parameters_spec.rb
|
|
1123
1130
|
- spec/models/space_spec.rb
|
|
1124
1131
|
- spec/models/document_delete422_response_errors_inner_spec.rb
|
|
1132
|
+
- spec/models/project_member_spec.rb
|
|
1125
1133
|
- spec/models/space_update_parameters_spec.rb
|
|
1126
1134
|
- spec/models/comment_spec.rb
|
|
1127
1135
|
- spec/models/branch_create_parameters_spec.rb
|