phrase 4.34.0 → 4.35.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 +7 -0
- data/README.md +9 -3
- data/docs/RepoSync.md +7 -1
- data/docs/RepoSyncCreateParameters.md +7 -1
- data/docs/RepoSyncCreateParametersExportSchedule.md +27 -0
- data/docs/RepoSyncExportSchedule.md +23 -0
- data/docs/RepoSyncUpdateParameters.md +23 -0
- data/docs/RepoSyncUpdateParametersExportSchedule.md +27 -0
- data/docs/RepoSyncsApi.md +66 -0
- data/docs/UserShort.md +23 -0
- data/lib/phrase/api/repo_syncs_api.rb +80 -0
- data/lib/phrase/models/repo_sync.rb +58 -5
- data/lib/phrase/models/repo_sync_create_parameters.rb +35 -4
- data/lib/phrase/models/repo_sync_create_parameters_export_schedule.rb +281 -0
- data/lib/phrase/models/repo_sync_export_schedule.rb +263 -0
- data/lib/phrase/models/repo_sync_update_parameters.rb +250 -0
- data/lib/phrase/models/repo_sync_update_parameters_export_schedule.rb +276 -0
- data/lib/phrase/models/user_short.rb +223 -0
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +5 -0
- data/spec/api/repo_syncs_api_spec.rb +15 -0
- data/spec/models/repo_sync_create_parameters_export_schedule_spec.rb +63 -0
- data/spec/models/repo_sync_create_parameters_spec.rb +22 -0
- data/spec/models/repo_sync_export_schedule_spec.rb +51 -0
- data/spec/models/repo_sync_spec.rb +22 -0
- data/spec/models/repo_sync_update_parameters_export_schedule_spec.rb +63 -0
- data/spec/models/repo_sync_update_parameters_spec.rb +51 -0
- data/spec/models/user_short_spec.rb +47 -0
- metadata +288 -268
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f985d7968ce87e4689fc720f77f336c585faa52bbde7443e676b4ee4034d0622
|
|
4
|
+
data.tar.gz: 1c3963bfd4de3c7fca1a7b55c619aa27e4dfb35b0c91a24966b18359035808b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a11ceb0b3bda2c7199eb1f724471fa33c33b2ceda2507b422d308666672b11871c8d8b108da1b46e23e9c825e0abe8b61230d05fed54367ad9b9bfe345f7cab
|
|
7
|
+
data.tar.gz: c8c228153ce06274be310eb0d4cd63eb8b3b798341ef1bbc0c80d196179b8458358177199db9351d2fb2b9e607e8d994a892ffd74c74a5882c99e2b4f34de63e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.35.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.34.0...ruby-v4.35.0) (2026-11-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **API:** add owner, export_triggers, and export_schedule to repo sync responses and request bodies #STRINGS-4401 ([#1370](https://github.com/phrase/strings-openapi/issues/1370)) ([8889946](https://github.com/phrase/strings-openapi/commit/8889946d3608a53b436e8c0e7dd8b5765687e916))
|
|
9
|
+
|
|
3
10
|
## [4.34.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.33.0...ruby-v4.34.0) (2026-11-05)
|
|
4
11
|
|
|
5
12
|
|
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.35.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.35.0.gem
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
(for development, run `gem install --dev ./phrase-4.
|
|
62
|
+
(for development, run `gem install --dev ./phrase-4.35.0.gem` to install the development dependencies)
|
|
63
63
|
|
|
64
64
|
## Getting Started
|
|
65
65
|
|
|
@@ -349,6 +349,7 @@ Class | Method | HTTP request | Description
|
|
|
349
349
|
*Phrase::RepoSyncsApi* | [**repo_sync_import**](docs/RepoSyncsApi.md#repo_sync_import) | **POST** /accounts/{account_id}/repo_syncs/{id}/import | Import from code repository
|
|
350
350
|
*Phrase::RepoSyncsApi* | [**repo_sync_list**](docs/RepoSyncsApi.md#repo_sync_list) | **GET** /accounts/{account_id}/repo_syncs | Get Repo Syncs
|
|
351
351
|
*Phrase::RepoSyncsApi* | [**repo_sync_show**](docs/RepoSyncsApi.md#repo_sync_show) | **GET** /accounts/{account_id}/repo_syncs/{id} | Get a single Repo Sync
|
|
352
|
+
*Phrase::RepoSyncsApi* | [**repo_sync_update**](docs/RepoSyncsApi.md#repo_sync_update) | **PATCH** /accounts/{account_id}/repo_syncs/{id} | Update a repo sync
|
|
352
353
|
*Phrase::ReportsApi* | [**report_locales_list**](docs/ReportsApi.md#report_locales_list) | **GET** /projects/{project_id}/report/locales | List Locale Reports (word count, character count, translation statistics)
|
|
353
354
|
*Phrase::ReportsApi* | [**report_show**](docs/ReportsApi.md#report_show) | **GET** /projects/{project_id}/report | Get Project Report
|
|
354
355
|
*Phrase::ScreenshotMarkersApi* | [**screenshot_marker_create**](docs/ScreenshotMarkersApi.md#screenshot_marker_create) | **POST** /projects/{project_id}/screenshots/{screenshot_id}/markers | Create a screenshot marker
|
|
@@ -607,10 +608,14 @@ Class | Method | HTTP request | Description
|
|
|
607
608
|
- [Phrase::ReleaseUpdateParameters1](docs/ReleaseUpdateParameters1.md)
|
|
608
609
|
- [Phrase::RepoSync](docs/RepoSync.md)
|
|
609
610
|
- [Phrase::RepoSyncCreateParameters](docs/RepoSyncCreateParameters.md)
|
|
611
|
+
- [Phrase::RepoSyncCreateParametersExportSchedule](docs/RepoSyncCreateParametersExportSchedule.md)
|
|
610
612
|
- [Phrase::RepoSyncEvent](docs/RepoSyncEvent.md)
|
|
611
613
|
- [Phrase::RepoSyncEventUploadsInner](docs/RepoSyncEventUploadsInner.md)
|
|
612
614
|
- [Phrase::RepoSyncExportParameters](docs/RepoSyncExportParameters.md)
|
|
615
|
+
- [Phrase::RepoSyncExportSchedule](docs/RepoSyncExportSchedule.md)
|
|
613
616
|
- [Phrase::RepoSyncImportParameters](docs/RepoSyncImportParameters.md)
|
|
617
|
+
- [Phrase::RepoSyncUpdateParameters](docs/RepoSyncUpdateParameters.md)
|
|
618
|
+
- [Phrase::RepoSyncUpdateParametersExportSchedule](docs/RepoSyncUpdateParametersExportSchedule.md)
|
|
614
619
|
- [Phrase::Screenshot](docs/Screenshot.md)
|
|
615
620
|
- [Phrase::ScreenshotMarker](docs/ScreenshotMarker.md)
|
|
616
621
|
- [Phrase::ScreenshotMarkerCreateParameters](docs/ScreenshotMarkerCreateParameters.md)
|
|
@@ -673,6 +678,7 @@ Class | Method | HTTP request | Description
|
|
|
673
678
|
- [Phrase::UploadSummary](docs/UploadSummary.md)
|
|
674
679
|
- [Phrase::User](docs/User.md)
|
|
675
680
|
- [Phrase::UserPreview](docs/UserPreview.md)
|
|
681
|
+
- [Phrase::UserShort](docs/UserShort.md)
|
|
676
682
|
- [Phrase::Variable](docs/Variable.md)
|
|
677
683
|
- [Phrase::VariableCreateParameters](docs/VariableCreateParameters.md)
|
|
678
684
|
- [Phrase::VariableUpdateParameters](docs/VariableUpdateParameters.md)
|
data/docs/RepoSync.md
CHANGED
|
@@ -15,6 +15,9 @@ Name | Type | Description | Notes
|
|
|
15
15
|
**created_at** | **Time** | | [optional]
|
|
16
16
|
**last_import_at** | **Time** | | [optional]
|
|
17
17
|
**last_export_at** | **Time** | | [optional]
|
|
18
|
+
**owner** | [**UserShort**](UserShort.md) | | [optional]
|
|
19
|
+
**export_triggers** | **Array<String>** | Events that trigger an automatic export. Only present when the automatic export feature is enabled for the account. Possible values: `schedule` (runs on the configured schedule), `branch_merged` (runs when a branch is merged in the connected repository), `job_completed` (runs when a translation job completes in the project). | [optional]
|
|
20
|
+
**export_schedule** | [**RepoSyncExportSchedule**](RepoSyncExportSchedule.md) | | [optional]
|
|
18
21
|
|
|
19
22
|
## Code Sample
|
|
20
23
|
|
|
@@ -31,7 +34,10 @@ instance = Phrase::RepoSync.new(id: nil,
|
|
|
31
34
|
pr_branch: nil,
|
|
32
35
|
created_at: nil,
|
|
33
36
|
last_import_at: nil,
|
|
34
|
-
last_export_at: nil
|
|
37
|
+
last_export_at: nil,
|
|
38
|
+
owner: nil,
|
|
39
|
+
export_triggers: nil,
|
|
40
|
+
export_schedule: nil)
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
|
|
@@ -14,6 +14,9 @@ Name | Type | Description | Notes
|
|
|
14
14
|
**auto_import** | **Boolean** | Enable automatic import of translations triggered by pushes to the repository. | [optional]
|
|
15
15
|
**access_token** | **String** | Personal access token for the Git provider. Required when `connection_type` is `token` or `self_hosted`. Not used for `github_app`. | [optional]
|
|
16
16
|
**custom_api_endpoint** | **String** | Custom API endpoint URL for self-hosted Git instances. Required when `connection_type` is `self_hosted`. | [optional]
|
|
17
|
+
**owner_id** | **String** | Code of the user who will own this repo sync. Automated actions run as this user. Defaults to the account owner when not set. | [optional]
|
|
18
|
+
**export_triggers** | **Array<String>** | Events that should trigger an automatic export. Requires the automatic export feature to be enabled for the account; returns `422` otherwise. Accepted values: `schedule`, `branch_merged`, `job_completed`. | [optional]
|
|
19
|
+
**export_schedule** | [**RepoSyncCreateParametersExportSchedule**](RepoSyncCreateParametersExportSchedule.md) | | [optional]
|
|
17
20
|
|
|
18
21
|
## Code Sample
|
|
19
22
|
|
|
@@ -29,7 +32,10 @@ instance = Phrase::RepoSyncCreateParameters.new(project_id: 'abcd1234abcd1234abc
|
|
|
29
32
|
pr_branch: 'phrase-translations',
|
|
30
33
|
auto_import: false,
|
|
31
34
|
access_token: 'ghp_xxxxxxxxxxxxxxxxxxxx',
|
|
32
|
-
custom_api_endpoint: 'https://git.example.com/api/v4'
|
|
35
|
+
custom_api_endpoint: 'https://git.example.com/api/v4',
|
|
36
|
+
owner_id: nil,
|
|
37
|
+
export_triggers: nil,
|
|
38
|
+
export_schedule: nil)
|
|
33
39
|
```
|
|
34
40
|
|
|
35
41
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Phrase::RepoSyncCreateParametersExportSchedule
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**frequency** | **String** | | [optional]
|
|
8
|
+
**time** | **String** | Time of day for the export (HH:MM format). Used with `day`, `week`, and `month` frequencies. | [optional]
|
|
9
|
+
**time_zone** | **String** | IANA time zone name. | [optional]
|
|
10
|
+
**days_of_week** | **String** | Comma-separated day numbers (0=Sunday … 6=Saturday). Used with `week` frequency. | [optional]
|
|
11
|
+
**day_of_month** | **Integer** | Day of the month (1–31). Used with `month` frequency. | [optional]
|
|
12
|
+
**cron_schedule** | **String** | Raw cron expression. Used when `frequency` is `cron`. | [optional]
|
|
13
|
+
|
|
14
|
+
## Code Sample
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'phrase'
|
|
18
|
+
|
|
19
|
+
instance = Phrase::RepoSyncCreateParametersExportSchedule.new(frequency: nil,
|
|
20
|
+
time: '09:00',
|
|
21
|
+
time_zone: 'Europe/Berlin',
|
|
22
|
+
days_of_week: '1,3',
|
|
23
|
+
day_of_month: nil,
|
|
24
|
+
cron_schedule: '0 9 * * 1')
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Phrase::RepoSyncExportSchedule
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**frequency** | **String** | How often the export runs. `cron` means a fully custom cron expression is used (`cron_schedule` holds the raw expression). | [optional]
|
|
8
|
+
**cron_schedule** | **String** | The underlying cron expression. Derived automatically from `frequency`, `time`, and day fields when using a named frequency; provided verbatim when `frequency` is `cron`. | [optional]
|
|
9
|
+
**time_zone** | **String** | IANA time zone name used to interpret the schedule. | [optional]
|
|
10
|
+
**next_run_at** | **Time** | When the next scheduled export will run, in UTC. | [optional]
|
|
11
|
+
|
|
12
|
+
## Code Sample
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'phrase'
|
|
16
|
+
|
|
17
|
+
instance = Phrase::RepoSyncExportSchedule.new(frequency: nil,
|
|
18
|
+
cron_schedule: '0 9 * * 1',
|
|
19
|
+
time_zone: 'Europe/Berlin',
|
|
20
|
+
next_run_at: nil)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Phrase::RepoSyncUpdateParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**name** | **String** | Display name for the repo sync. | [optional]
|
|
8
|
+
**owner_id** | **String** | Code of the user to assign as owner. Requires `manage_github_sync?` permission on the project; returns `403` if not satisfied. | [optional]
|
|
9
|
+
**export_triggers** | **Array<String>** | Replaces the current set of automatic export triggers. Requires `manage_github_sync?` permission on the project and the automatic export feature to be enabled for the account. Accepted values: `schedule`, `branch_merged`, `job_completed`. | [optional]
|
|
10
|
+
**export_schedule** | [**RepoSyncUpdateParametersExportSchedule**](RepoSyncUpdateParametersExportSchedule.md) | | [optional]
|
|
11
|
+
|
|
12
|
+
## Code Sample
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'phrase'
|
|
16
|
+
|
|
17
|
+
instance = Phrase::RepoSyncUpdateParameters.new(name: nil,
|
|
18
|
+
owner_id: nil,
|
|
19
|
+
export_triggers: nil,
|
|
20
|
+
export_schedule: nil)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Phrase::RepoSyncUpdateParametersExportSchedule
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**frequency** | **String** | | [optional]
|
|
8
|
+
**time** | **String** | | [optional]
|
|
9
|
+
**time_zone** | **String** | | [optional]
|
|
10
|
+
**days_of_week** | **String** | | [optional]
|
|
11
|
+
**day_of_month** | **Integer** | | [optional]
|
|
12
|
+
**cron_schedule** | **String** | | [optional]
|
|
13
|
+
|
|
14
|
+
## Code Sample
|
|
15
|
+
|
|
16
|
+
```ruby
|
|
17
|
+
require 'phrase'
|
|
18
|
+
|
|
19
|
+
instance = Phrase::RepoSyncUpdateParametersExportSchedule.new(frequency: nil,
|
|
20
|
+
time: '09:00',
|
|
21
|
+
time_zone: 'Europe/Berlin',
|
|
22
|
+
days_of_week: '1,3',
|
|
23
|
+
day_of_month: nil,
|
|
24
|
+
cron_schedule: '0 9 * * 1')
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
|
data/docs/RepoSyncsApi.md
CHANGED
|
@@ -11,6 +11,7 @@ Method | HTTP request | Description
|
|
|
11
11
|
[**repo_sync_import**](RepoSyncsApi.md#repo_sync_import) | **POST** /accounts/{account_id}/repo_syncs/{id}/import | Import from code repository
|
|
12
12
|
[**repo_sync_list**](RepoSyncsApi.md#repo_sync_list) | **GET** /accounts/{account_id}/repo_syncs | Get Repo Syncs
|
|
13
13
|
[**repo_sync_show**](RepoSyncsApi.md#repo_sync_show) | **GET** /accounts/{account_id}/repo_syncs/{id} | Get a single Repo Sync
|
|
14
|
+
[**repo_sync_update**](RepoSyncsApi.md#repo_sync_update) | **PATCH** /accounts/{account_id}/repo_syncs/{id} | Update a repo sync
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
@@ -460,3 +461,68 @@ Response<([**RepoSync**](RepoSync.md))>
|
|
|
460
461
|
- **Content-Type**: Not defined
|
|
461
462
|
- **Accept**: application/json
|
|
462
463
|
|
|
464
|
+
|
|
465
|
+
## repo_sync_update
|
|
466
|
+
|
|
467
|
+
> RepoSync repo_sync_update(account_id, id, repo_sync_update_parameters, opts)
|
|
468
|
+
|
|
469
|
+
Update a repo sync
|
|
470
|
+
|
|
471
|
+
Update settings for an existing Repo Sync. Sending `owner_id`, `export_triggers`, or `export_schedule` requires the caller to have `manage_github_sync?` permission on the project (returns `403` otherwise). Sending `export_triggers` or `export_schedule` when the automatic export feature is not enabled for the account returns `422`.
|
|
472
|
+
|
|
473
|
+
### Example
|
|
474
|
+
|
|
475
|
+
```ruby
|
|
476
|
+
# load the gem
|
|
477
|
+
require 'phrase'
|
|
478
|
+
# setup authorization
|
|
479
|
+
Phrase.configure do |config|
|
|
480
|
+
# Configure HTTP basic authorization: Basic
|
|
481
|
+
config.username = 'YOUR USERNAME'
|
|
482
|
+
config.password = 'YOUR PASSWORD'
|
|
483
|
+
|
|
484
|
+
# Configure API key authorization: Token
|
|
485
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
486
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
api_instance = Phrase::RepoSyncsApi.new
|
|
490
|
+
account_id = 'account_id_example' # String | Account ID
|
|
491
|
+
id = 'id_example' # String | ID
|
|
492
|
+
repo_sync_update_parameters = Phrase::RepoSyncUpdateParameters.new # RepoSyncUpdateParameters |
|
|
493
|
+
opts = {
|
|
494
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
begin
|
|
498
|
+
#Update a repo sync
|
|
499
|
+
result = api_instance.repo_sync_update(account_id, id, repo_sync_update_parameters, opts)
|
|
500
|
+
pp result
|
|
501
|
+
rescue Phrase::ApiError => e
|
|
502
|
+
puts "Exception when calling RepoSyncsApi->repo_sync_update: #{e}"
|
|
503
|
+
end
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
### Parameters
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
Name | Type | Description | Notes
|
|
510
|
+
------------- | ------------- | ------------- | -------------
|
|
511
|
+
**account_id** | **String**| Account ID |
|
|
512
|
+
**id** | **String**| ID |
|
|
513
|
+
**repo_sync_update_parameters** | [**RepoSyncUpdateParameters**](RepoSyncUpdateParameters.md)| |
|
|
514
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
515
|
+
|
|
516
|
+
### Return type
|
|
517
|
+
|
|
518
|
+
Response<([**RepoSync**](RepoSync.md))>
|
|
519
|
+
|
|
520
|
+
### Authorization
|
|
521
|
+
|
|
522
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
523
|
+
|
|
524
|
+
### HTTP request headers
|
|
525
|
+
|
|
526
|
+
- **Content-Type**: application/json
|
|
527
|
+
- **Accept**: application/json
|
|
528
|
+
|
data/docs/UserShort.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Phrase::UserShort
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**id** | **String** | | [optional]
|
|
8
|
+
**username** | **String** | | [optional]
|
|
9
|
+
**name** | **String** | | [optional]
|
|
10
|
+
**gravatar_uid** | **String** | | [optional]
|
|
11
|
+
|
|
12
|
+
## Code Sample
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'phrase'
|
|
16
|
+
|
|
17
|
+
instance = Phrase::UserShort.new(id: nil,
|
|
18
|
+
username: nil,
|
|
19
|
+
name: nil,
|
|
20
|
+
gravatar_uid: nil)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
|
|
@@ -520,5 +520,85 @@ module Phrase
|
|
|
520
520
|
response = ::Phrase::Response.new(data, headers)
|
|
521
521
|
return response, status_code, headers
|
|
522
522
|
end
|
|
523
|
+
|
|
524
|
+
# Update a repo sync
|
|
525
|
+
# Update settings for an existing Repo Sync. Sending `owner_id`, `export_triggers`, or `export_schedule` requires the caller to have `manage_github_sync?` permission on the project (returns `403` otherwise). Sending `export_triggers` or `export_schedule` when the automatic export feature is not enabled for the account returns `422`.
|
|
526
|
+
# @param account_id [String] Account ID
|
|
527
|
+
# @param id [String] ID
|
|
528
|
+
# @param repo_sync_update_parameters [RepoSyncUpdateParameters]
|
|
529
|
+
# @param [Hash] opts the optional parameters
|
|
530
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
531
|
+
# @return [RepoSync]
|
|
532
|
+
def repo_sync_update(account_id, id, repo_sync_update_parameters, opts = {})
|
|
533
|
+
data, _status_code, _headers = repo_sync_update_with_http_info(account_id, id, repo_sync_update_parameters, opts)
|
|
534
|
+
data
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
# Update a repo sync
|
|
538
|
+
# Update settings for an existing Repo Sync. Sending `owner_id`, `export_triggers`, or `export_schedule` requires the caller to have `manage_github_sync?` permission on the project (returns `403` otherwise). Sending `export_triggers` or `export_schedule` when the automatic export feature is not enabled for the account returns `422`.
|
|
539
|
+
# @param account_id [String] Account ID
|
|
540
|
+
# @param id [String] ID
|
|
541
|
+
# @param repo_sync_update_parameters [RepoSyncUpdateParameters]
|
|
542
|
+
# @param [Hash] opts the optional parameters
|
|
543
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
544
|
+
# @return [Array<(Response<(RepoSync)>, Integer, Hash)>] Response<(RepoSync)> data, response status code and response headers
|
|
545
|
+
def repo_sync_update_with_http_info(account_id, id, repo_sync_update_parameters, opts = {})
|
|
546
|
+
if @api_client.config.debugging
|
|
547
|
+
@api_client.config.logger.debug 'Calling API: RepoSyncsApi.repo_sync_update ...'
|
|
548
|
+
end
|
|
549
|
+
# verify the required parameter 'account_id' is set
|
|
550
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
551
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling RepoSyncsApi.repo_sync_update"
|
|
552
|
+
end
|
|
553
|
+
# verify the required parameter 'id' is set
|
|
554
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
555
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling RepoSyncsApi.repo_sync_update"
|
|
556
|
+
end
|
|
557
|
+
# verify the required parameter 'repo_sync_update_parameters' is set
|
|
558
|
+
if @api_client.config.client_side_validation && repo_sync_update_parameters.nil?
|
|
559
|
+
fail ArgumentError, "Missing the required parameter 'repo_sync_update_parameters' when calling RepoSyncsApi.repo_sync_update"
|
|
560
|
+
end
|
|
561
|
+
# resource path
|
|
562
|
+
local_var_path = '/accounts/{account_id}/repo_syncs/{id}'.sub('{' + 'account_id' + '}', CGI.escape(account_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
563
|
+
|
|
564
|
+
# query parameters
|
|
565
|
+
query_params = opts[:query_params] || {}
|
|
566
|
+
|
|
567
|
+
# header parameters
|
|
568
|
+
header_params = opts[:header_params] || {}
|
|
569
|
+
# HTTP header 'Accept' (if needed)
|
|
570
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
571
|
+
# HTTP header 'Content-Type'
|
|
572
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
573
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
574
|
+
|
|
575
|
+
# form parameters
|
|
576
|
+
form_params = opts[:form_params] || {}
|
|
577
|
+
|
|
578
|
+
# http body (model)
|
|
579
|
+
post_body = opts[:body] || @api_client.object_to_http_body(repo_sync_update_parameters)
|
|
580
|
+
|
|
581
|
+
# return_type
|
|
582
|
+
return_type = opts[:return_type] || 'RepoSync'
|
|
583
|
+
|
|
584
|
+
# auth_names
|
|
585
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
586
|
+
|
|
587
|
+
new_options = opts.merge(
|
|
588
|
+
:header_params => header_params,
|
|
589
|
+
:query_params => query_params,
|
|
590
|
+
:form_params => form_params,
|
|
591
|
+
:body => post_body,
|
|
592
|
+
:auth_names => auth_names,
|
|
593
|
+
:return_type => return_type
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
597
|
+
if @api_client.config.debugging
|
|
598
|
+
@api_client.config.logger.debug "API called: RepoSyncsApi#repo_sync_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
599
|
+
end
|
|
600
|
+
response = ::Phrase::Response.new(data, headers)
|
|
601
|
+
return response, status_code, headers
|
|
602
|
+
end
|
|
523
603
|
end
|
|
524
604
|
end
|
|
@@ -26,6 +26,35 @@ module Phrase
|
|
|
26
26
|
|
|
27
27
|
attr_accessor :last_export_at
|
|
28
28
|
|
|
29
|
+
attr_accessor :owner
|
|
30
|
+
|
|
31
|
+
# Events that trigger an automatic export. Only present when the automatic export feature is enabled for the account. Possible values: `schedule` (runs on the configured schedule), `branch_merged` (runs when a branch is merged in the connected repository), `job_completed` (runs when a translation job completes in the project).
|
|
32
|
+
attr_accessor :export_triggers
|
|
33
|
+
|
|
34
|
+
attr_accessor :export_schedule
|
|
35
|
+
|
|
36
|
+
class EnumAttributeValidator
|
|
37
|
+
attr_reader :datatype
|
|
38
|
+
attr_reader :allowable_values
|
|
39
|
+
|
|
40
|
+
def initialize(datatype, allowable_values)
|
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
|
42
|
+
case datatype.to_s
|
|
43
|
+
when /Integer/i
|
|
44
|
+
value.to_i
|
|
45
|
+
when /Float/i
|
|
46
|
+
value.to_f
|
|
47
|
+
else
|
|
48
|
+
value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def valid?(value)
|
|
54
|
+
!value || allowable_values.include?(value)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
29
58
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
59
|
def self.attribute_map
|
|
31
60
|
{
|
|
@@ -39,7 +68,10 @@ module Phrase
|
|
|
39
68
|
:'pr_branch' => :'pr_branch',
|
|
40
69
|
:'created_at' => :'created_at',
|
|
41
70
|
:'last_import_at' => :'last_import_at',
|
|
42
|
-
:'last_export_at' => :'last_export_at'
|
|
71
|
+
:'last_export_at' => :'last_export_at',
|
|
72
|
+
:'owner' => :'owner',
|
|
73
|
+
:'export_triggers' => :'export_triggers',
|
|
74
|
+
:'export_schedule' => :'export_schedule'
|
|
43
75
|
}
|
|
44
76
|
end
|
|
45
77
|
|
|
@@ -56,7 +88,10 @@ module Phrase
|
|
|
56
88
|
:'pr_branch' => :'String',
|
|
57
89
|
:'created_at' => :'DateTime',
|
|
58
90
|
:'last_import_at' => :'DateTime',
|
|
59
|
-
:'last_export_at' => :'DateTime'
|
|
91
|
+
:'last_export_at' => :'DateTime',
|
|
92
|
+
:'owner' => :'UserShort',
|
|
93
|
+
:'export_triggers' => :'Array<String>',
|
|
94
|
+
:'export_schedule' => :'RepoSyncExportSchedule'
|
|
60
95
|
}
|
|
61
96
|
end
|
|
62
97
|
|
|
@@ -66,7 +101,8 @@ module Phrase
|
|
|
66
101
|
:'name',
|
|
67
102
|
:'pr_branch',
|
|
68
103
|
:'last_import_at',
|
|
69
|
-
:'last_export_at'
|
|
104
|
+
:'last_export_at',
|
|
105
|
+
:'export_schedule'
|
|
70
106
|
])
|
|
71
107
|
end
|
|
72
108
|
|
|
@@ -128,6 +164,20 @@ module Phrase
|
|
|
128
164
|
if attributes.key?(:'last_export_at')
|
|
129
165
|
self.last_export_at = attributes[:'last_export_at']
|
|
130
166
|
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'owner')
|
|
169
|
+
self.owner = attributes[:'owner']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'export_triggers')
|
|
173
|
+
if (value = attributes[:'export_triggers']).is_a?(Array)
|
|
174
|
+
self.export_triggers = value
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'export_schedule')
|
|
179
|
+
self.export_schedule = attributes[:'export_schedule']
|
|
180
|
+
end
|
|
131
181
|
end
|
|
132
182
|
|
|
133
183
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -173,7 +223,10 @@ module Phrase
|
|
|
173
223
|
pr_branch == o.pr_branch &&
|
|
174
224
|
created_at == o.created_at &&
|
|
175
225
|
last_import_at == o.last_import_at &&
|
|
176
|
-
last_export_at == o.last_export_at
|
|
226
|
+
last_export_at == o.last_export_at &&
|
|
227
|
+
owner == o.owner &&
|
|
228
|
+
export_triggers == o.export_triggers &&
|
|
229
|
+
export_schedule == o.export_schedule
|
|
177
230
|
end
|
|
178
231
|
|
|
179
232
|
# @see the `==` method
|
|
@@ -185,7 +238,7 @@ module Phrase
|
|
|
185
238
|
# Calculates hash code according to all attributes.
|
|
186
239
|
# @return [Integer] Hash code
|
|
187
240
|
def hash
|
|
188
|
-
[id, name, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at].hash
|
|
241
|
+
[id, name, project, provider, enabled, auto_import, repo_name, pr_branch, created_at, last_import_at, last_export_at, owner, export_triggers, export_schedule].hash
|
|
189
242
|
end
|
|
190
243
|
|
|
191
244
|
# Builds the object from hash
|
|
@@ -32,6 +32,14 @@ module Phrase
|
|
|
32
32
|
# Custom API endpoint URL for self-hosted Git instances. Required when `connection_type` is `self_hosted`.
|
|
33
33
|
attr_accessor :custom_api_endpoint
|
|
34
34
|
|
|
35
|
+
# Code of the user who will own this repo sync. Automated actions run as this user. Defaults to the account owner when not set.
|
|
36
|
+
attr_accessor :owner_id
|
|
37
|
+
|
|
38
|
+
# Events that should trigger an automatic export. Requires the automatic export feature to be enabled for the account; returns `422` otherwise. Accepted values: `schedule`, `branch_merged`, `job_completed`.
|
|
39
|
+
attr_accessor :export_triggers
|
|
40
|
+
|
|
41
|
+
attr_accessor :export_schedule
|
|
42
|
+
|
|
35
43
|
class EnumAttributeValidator
|
|
36
44
|
attr_reader :datatype
|
|
37
45
|
attr_reader :allowable_values
|
|
@@ -66,7 +74,10 @@ module Phrase
|
|
|
66
74
|
:'pr_branch' => :'pr_branch',
|
|
67
75
|
:'auto_import' => :'auto_import',
|
|
68
76
|
:'access_token' => :'access_token',
|
|
69
|
-
:'custom_api_endpoint' => :'custom_api_endpoint'
|
|
77
|
+
:'custom_api_endpoint' => :'custom_api_endpoint',
|
|
78
|
+
:'owner_id' => :'owner_id',
|
|
79
|
+
:'export_triggers' => :'export_triggers',
|
|
80
|
+
:'export_schedule' => :'export_schedule'
|
|
70
81
|
}
|
|
71
82
|
end
|
|
72
83
|
|
|
@@ -82,7 +93,10 @@ module Phrase
|
|
|
82
93
|
:'pr_branch' => :'String',
|
|
83
94
|
:'auto_import' => :'Boolean',
|
|
84
95
|
:'access_token' => :'String',
|
|
85
|
-
:'custom_api_endpoint' => :'String'
|
|
96
|
+
:'custom_api_endpoint' => :'String',
|
|
97
|
+
:'owner_id' => :'String',
|
|
98
|
+
:'export_triggers' => :'Array<String>',
|
|
99
|
+
:'export_schedule' => :'RepoSyncCreateParametersExportSchedule'
|
|
86
100
|
}
|
|
87
101
|
end
|
|
88
102
|
|
|
@@ -149,6 +163,20 @@ module Phrase
|
|
|
149
163
|
if attributes.key?(:'custom_api_endpoint')
|
|
150
164
|
self.custom_api_endpoint = attributes[:'custom_api_endpoint']
|
|
151
165
|
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'owner_id')
|
|
168
|
+
self.owner_id = attributes[:'owner_id']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'export_triggers')
|
|
172
|
+
if (value = attributes[:'export_triggers']).is_a?(Array)
|
|
173
|
+
self.export_triggers = value
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'export_schedule')
|
|
178
|
+
self.export_schedule = attributes[:'export_schedule']
|
|
179
|
+
end
|
|
152
180
|
end
|
|
153
181
|
|
|
154
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -232,7 +260,10 @@ module Phrase
|
|
|
232
260
|
pr_branch == o.pr_branch &&
|
|
233
261
|
auto_import == o.auto_import &&
|
|
234
262
|
access_token == o.access_token &&
|
|
235
|
-
custom_api_endpoint == o.custom_api_endpoint
|
|
263
|
+
custom_api_endpoint == o.custom_api_endpoint &&
|
|
264
|
+
owner_id == o.owner_id &&
|
|
265
|
+
export_triggers == o.export_triggers &&
|
|
266
|
+
export_schedule == o.export_schedule
|
|
236
267
|
end
|
|
237
268
|
|
|
238
269
|
# @see the `==` method
|
|
@@ -244,7 +275,7 @@ module Phrase
|
|
|
244
275
|
# Calculates hash code according to all attributes.
|
|
245
276
|
# @return [Integer] Hash code
|
|
246
277
|
def hash
|
|
247
|
-
[project_id, name, git_provider, connection_type, repo_name, base_branch, pr_branch, auto_import, access_token, custom_api_endpoint].hash
|
|
278
|
+
[project_id, name, git_provider, connection_type, repo_name, base_branch, pr_branch, auto_import, access_token, custom_api_endpoint, owner_id, export_triggers, export_schedule].hash
|
|
248
279
|
end
|
|
249
280
|
|
|
250
281
|
# Builds the object from hash
|