phrase 4.35.0 → 4.37.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 +14 -0
- data/README.md +8 -3
- data/docs/Note.md +25 -0
- data/docs/ProjectDetails.md +3 -1
- data/docs/ProjectNoteUpdateParameters.md +19 -0
- data/docs/ProjectNotesApi.md +203 -0
- data/docs/RepoSyncEvent.md +3 -1
- data/lib/phrase/api/project_notes_api.rb +223 -0
- data/lib/phrase/models/note.rb +225 -0
- data/lib/phrase/models/project_details.rb +13 -4
- data/lib/phrase/models/project_note_update_parameters.rb +202 -0
- data/lib/phrase/models/repo_sync_event.rb +12 -2
- data/lib/phrase/version.rb +1 -1
- data/lib/phrase.rb +3 -0
- data/spec/api/project_notes_api_spec.rb +66 -0
- data/spec/models/note_spec.rb +47 -0
- data/spec/models/project_details_spec.rb +6 -0
- data/spec/models/project_note_update_parameters_spec.rb +29 -0
- data/spec/models/repo_sync_event_spec.rb +6 -0
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e168b205e58e6688d53c8031fc78ceccaee85fb0935b374ae2ce272df00b2df7
|
|
4
|
+
data.tar.gz: ee9392b885ec71a5c61e35542fe1c3310faa92dd46842e30cf2b474f09bd74fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 478768bc1e448fe8ff95075d7df97015a8c43919d39402c4644f21afd8652429b06cfbf6589ccb2ebe5f05615994c04fefc428241c83fc51a97cf87dc53bbe20
|
|
7
|
+
data.tar.gz: 38a15d5f6f8659fb2b743090d28439b6d5f9dca08e1b5fac364c5e6ff259acedf497cf3ded8f415a036f9b51311363a90a2e583d650e656e090396f267356b33
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.37.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.36.0...ruby-v4.37.0) (2026-11-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **API:** add automatic field to repo sync event responses, deprecate auto_import #STRINGS-4942 ([#1393](https://github.com/phrase/strings-openapi/issues/1393)) ([f63d8e9](https://github.com/phrase/strings-openapi/commit/f63d8e9e6ecb37878007c0e1ef5c079337ab4134))
|
|
9
|
+
|
|
10
|
+
## [4.36.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.35.0...ruby-v4.36.0) (2026-11-24)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **API:** add project note endpoints and note field to project details ([#1382](https://github.com/phrase/strings-openapi/issues/1382)) ([d8a7dce](https://github.com/phrase/strings-openapi/commit/d8a7dce5ba70d133f457a58512b6234228a8d989))
|
|
16
|
+
|
|
3
17
|
## [4.35.0](https://github.com/phrase/strings-openapi/compare/ruby-v4.34.0...ruby-v4.35.0) (2026-11-23)
|
|
4
18
|
|
|
5
19
|
|
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.37.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.37.0.gem
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
(for development, run `gem install --dev ./phrase-4.
|
|
62
|
+
(for development, run `gem install --dev ./phrase-4.37.0.gem` to install the development dependencies)
|
|
63
63
|
|
|
64
64
|
## Getting Started
|
|
65
65
|
|
|
@@ -323,6 +323,9 @@ Class | Method | HTTP request | Description
|
|
|
323
323
|
*Phrase::PreTranslationsApi* | [**pre_translation_create**](docs/PreTranslationsApi.md#pre_translation_create) | **POST** /projects/{project_id}/pre_translations | Create a pre-translation job
|
|
324
324
|
*Phrase::PreTranslationsApi* | [**pre_translation_show**](docs/PreTranslationsApi.md#pre_translation_show) | **GET** /projects/{project_id}/pre_translations/{id} | Get a single pre-translation job
|
|
325
325
|
*Phrase::PreTranslationsApi* | [**pre_translations_list**](docs/PreTranslationsApi.md#pre_translations_list) | **GET** /projects/{project_id}/pre_translations | List pre-translation jobs
|
|
326
|
+
*Phrase::ProjectNotesApi* | [**project_note_destroy**](docs/ProjectNotesApi.md#project_note_destroy) | **DELETE** /projects/{project_id}/note | Delete a project note
|
|
327
|
+
*Phrase::ProjectNotesApi* | [**project_note_show**](docs/ProjectNotesApi.md#project_note_show) | **GET** /projects/{project_id}/note | Get a project note
|
|
328
|
+
*Phrase::ProjectNotesApi* | [**project_note_update**](docs/ProjectNotesApi.md#project_note_update) | **PATCH** /projects/{project_id}/note | Create or update a project note
|
|
326
329
|
*Phrase::ProjectsApi* | [**project_create**](docs/ProjectsApi.md#project_create) | **POST** /projects | Create a project
|
|
327
330
|
*Phrase::ProjectsApi* | [**project_delete**](docs/ProjectsApi.md#project_delete) | **DELETE** /projects/{id} | Delete a project
|
|
328
331
|
*Phrase::ProjectsApi* | [**project_show**](docs/ProjectsApi.md#project_show) | **GET** /projects/{id} | Get a single project
|
|
@@ -572,6 +575,7 @@ Class | Method | HTTP request | Description
|
|
|
572
575
|
- [Phrase::MemberSpacesInner](docs/MemberSpacesInner.md)
|
|
573
576
|
- [Phrase::MemberUpdateParameters](docs/MemberUpdateParameters.md)
|
|
574
577
|
- [Phrase::MemberUpdateSettingsParameters](docs/MemberUpdateSettingsParameters.md)
|
|
578
|
+
- [Phrase::Note](docs/Note.md)
|
|
575
579
|
- [Phrase::Notification](docs/Notification.md)
|
|
576
580
|
- [Phrase::NotificationGroup](docs/NotificationGroup.md)
|
|
577
581
|
- [Phrase::NotificationGroupDetail](docs/NotificationGroupDetail.md)
|
|
@@ -590,6 +594,7 @@ Class | Method | HTTP request | Description
|
|
|
590
594
|
- [Phrase::ProjectDetails](docs/ProjectDetails.md)
|
|
591
595
|
- [Phrase::ProjectLocales](docs/ProjectLocales.md)
|
|
592
596
|
- [Phrase::ProjectMember](docs/ProjectMember.md)
|
|
597
|
+
- [Phrase::ProjectNoteUpdateParameters](docs/ProjectNoteUpdateParameters.md)
|
|
593
598
|
- [Phrase::ProjectReport](docs/ProjectReport.md)
|
|
594
599
|
- [Phrase::ProjectShort](docs/ProjectShort.md)
|
|
595
600
|
- [Phrase::ProjectUpdateParameters](docs/ProjectUpdateParameters.md)
|
data/docs/Note.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Phrase::Note
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**id** | **String** | Unique code identifying the note. | [optional]
|
|
8
|
+
**body** | **String** | Markdown-formatted content of the note (max 65,535 characters). | [optional]
|
|
9
|
+
**created_at** | **Time** | | [optional]
|
|
10
|
+
**updated_at** | **Time** | | [optional]
|
|
11
|
+
|
|
12
|
+
## Code Sample
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'phrase'
|
|
16
|
+
|
|
17
|
+
instance = Phrase::Note.new(id: 'abcd1234efgh5678',
|
|
18
|
+
body: '## Project context
|
|
19
|
+
|
|
20
|
+
This project contains all marketing strings.',
|
|
21
|
+
created_at: nil,
|
|
22
|
+
updated_at: nil)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
data/docs/ProjectDetails.md
CHANGED
|
@@ -38,6 +38,7 @@ Name | Type | Description | Notes
|
|
|
38
38
|
**job_locking_enabled** | **Boolean** | | [optional]
|
|
39
39
|
**placeholder_styles** | **Array<String>** | | [optional]
|
|
40
40
|
**branch** | [**Branch**](Branch.md) | | [optional]
|
|
41
|
+
**note** | [**Note**](Note.md) | | [optional]
|
|
41
42
|
|
|
42
43
|
## Code Sample
|
|
43
44
|
|
|
@@ -77,7 +78,8 @@ instance = Phrase::ProjectDetails.new(id: nil,
|
|
|
77
78
|
translation_keys_sort_collation: 'unicode_ci',
|
|
78
79
|
job_locking_enabled: false,
|
|
79
80
|
placeholder_styles: ["rails_i18n","java_properties"],
|
|
80
|
-
branch: nil
|
|
81
|
+
branch: nil,
|
|
82
|
+
note: nil)
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Phrase::ProjectNoteUpdateParameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
Name | Type | Description | Notes
|
|
6
|
+
------------ | ------------- | ------------- | -------------
|
|
7
|
+
**body** | **String** | Markdown content for the project note (max 65,535 characters). |
|
|
8
|
+
|
|
9
|
+
## Code Sample
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'phrase'
|
|
13
|
+
|
|
14
|
+
instance = Phrase::ProjectNoteUpdateParameters.new(body: '## Project context
|
|
15
|
+
|
|
16
|
+
This project contains all marketing strings.')
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Phrase::ProjectNotesApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.phrase.com/v2*
|
|
4
|
+
|
|
5
|
+
Method | HTTP request | Description
|
|
6
|
+
------------- | ------------- | -------------
|
|
7
|
+
[**project_note_destroy**](ProjectNotesApi.md#project_note_destroy) | **DELETE** /projects/{project_id}/note | Delete a project note
|
|
8
|
+
[**project_note_show**](ProjectNotesApi.md#project_note_show) | **GET** /projects/{project_id}/note | Get a project note
|
|
9
|
+
[**project_note_update**](ProjectNotesApi.md#project_note_update) | **PATCH** /projects/{project_id}/note | Create or update a project note
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## project_note_destroy
|
|
14
|
+
|
|
15
|
+
> project_note_destroy(project_id, opts)
|
|
16
|
+
|
|
17
|
+
Delete a project note
|
|
18
|
+
|
|
19
|
+
Deletes the note associated with a project. This operation is idempotent — it succeeds silently even when no note exists. The note is resolved against the main project — branch projects delete the main project's note. Requires manage permissions on the project and the `write` OAuth scope.
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
# load the gem
|
|
25
|
+
require 'phrase'
|
|
26
|
+
# setup authorization
|
|
27
|
+
Phrase.configure do |config|
|
|
28
|
+
# Configure HTTP basic authorization: Basic
|
|
29
|
+
config.username = 'YOUR USERNAME'
|
|
30
|
+
config.password = 'YOUR PASSWORD'
|
|
31
|
+
|
|
32
|
+
# Configure API key authorization: Token
|
|
33
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
34
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
api_instance = Phrase::ProjectNotesApi.new
|
|
38
|
+
project_id = 'project_id_example' # String | Project ID
|
|
39
|
+
opts = {
|
|
40
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
41
|
+
branch: 'my-feature-branch' # String | Branch to use
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
begin
|
|
45
|
+
#Delete a project note
|
|
46
|
+
api_instance.project_note_destroy(project_id, opts)
|
|
47
|
+
rescue Phrase::ApiError => e
|
|
48
|
+
puts "Exception when calling ProjectNotesApi->project_note_destroy: #{e}"
|
|
49
|
+
end
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Parameters
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Name | Type | Description | Notes
|
|
56
|
+
------------- | ------------- | ------------- | -------------
|
|
57
|
+
**project_id** | **String**| Project ID |
|
|
58
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
59
|
+
**branch** | **String**| Branch to use | [optional]
|
|
60
|
+
|
|
61
|
+
### Return type
|
|
62
|
+
|
|
63
|
+
Response<(nil (empty response body))>
|
|
64
|
+
|
|
65
|
+
### Authorization
|
|
66
|
+
|
|
67
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
68
|
+
|
|
69
|
+
### HTTP request headers
|
|
70
|
+
|
|
71
|
+
- **Content-Type**: Not defined
|
|
72
|
+
- **Accept**: Not defined
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
## project_note_show
|
|
76
|
+
|
|
77
|
+
> Note project_note_show(project_id, opts)
|
|
78
|
+
|
|
79
|
+
Get a project note
|
|
80
|
+
|
|
81
|
+
Returns the Markdown-formatted note attached to a project. The note is resolved against the main project — branch projects return the main project's note. Returns 404 when no note has been created yet. Requires the `read` OAuth scope.
|
|
82
|
+
|
|
83
|
+
### Example
|
|
84
|
+
|
|
85
|
+
```ruby
|
|
86
|
+
# load the gem
|
|
87
|
+
require 'phrase'
|
|
88
|
+
# setup authorization
|
|
89
|
+
Phrase.configure do |config|
|
|
90
|
+
# Configure HTTP basic authorization: Basic
|
|
91
|
+
config.username = 'YOUR USERNAME'
|
|
92
|
+
config.password = 'YOUR PASSWORD'
|
|
93
|
+
|
|
94
|
+
# Configure API key authorization: Token
|
|
95
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
96
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
api_instance = Phrase::ProjectNotesApi.new
|
|
100
|
+
project_id = 'project_id_example' # String | Project ID
|
|
101
|
+
opts = {
|
|
102
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
103
|
+
branch: 'my-feature-branch' # String | Branch to use
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
begin
|
|
107
|
+
#Get a project note
|
|
108
|
+
result = api_instance.project_note_show(project_id, opts)
|
|
109
|
+
pp result
|
|
110
|
+
rescue Phrase::ApiError => e
|
|
111
|
+
puts "Exception when calling ProjectNotesApi->project_note_show: #{e}"
|
|
112
|
+
end
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Parameters
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
Name | Type | Description | Notes
|
|
119
|
+
------------- | ------------- | ------------- | -------------
|
|
120
|
+
**project_id** | **String**| Project ID |
|
|
121
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
122
|
+
**branch** | **String**| Branch to use | [optional]
|
|
123
|
+
|
|
124
|
+
### Return type
|
|
125
|
+
|
|
126
|
+
Response<([**Note**](Note.md))>
|
|
127
|
+
|
|
128
|
+
### Authorization
|
|
129
|
+
|
|
130
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
131
|
+
|
|
132
|
+
### HTTP request headers
|
|
133
|
+
|
|
134
|
+
- **Content-Type**: Not defined
|
|
135
|
+
- **Accept**: application/json
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## project_note_update
|
|
139
|
+
|
|
140
|
+
> Note project_note_update(project_id, project_note_update_parameters, opts)
|
|
141
|
+
|
|
142
|
+
Create or update a project note
|
|
143
|
+
|
|
144
|
+
Creates or updates the Markdown-formatted note for a project. If a note already exists it is updated in place; otherwise a new note is created. The note is stored on the main project — branch projects write to the main project's note. `body` is required. Requires manage permissions on the project and the `write` OAuth scope.
|
|
145
|
+
|
|
146
|
+
### Example
|
|
147
|
+
|
|
148
|
+
```ruby
|
|
149
|
+
# load the gem
|
|
150
|
+
require 'phrase'
|
|
151
|
+
# setup authorization
|
|
152
|
+
Phrase.configure do |config|
|
|
153
|
+
# Configure HTTP basic authorization: Basic
|
|
154
|
+
config.username = 'YOUR USERNAME'
|
|
155
|
+
config.password = 'YOUR PASSWORD'
|
|
156
|
+
|
|
157
|
+
# Configure API key authorization: Token
|
|
158
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
|
159
|
+
config.api_key_prefix['Authorization'] = 'token'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
api_instance = Phrase::ProjectNotesApi.new
|
|
163
|
+
project_id = 'project_id_example' # String | Project ID
|
|
164
|
+
project_note_update_parameters = Phrase::ProjectNoteUpdateParameters.new({body: '## Project context
|
|
165
|
+
|
|
166
|
+
This project contains all marketing strings.'}) # ProjectNoteUpdateParameters |
|
|
167
|
+
opts = {
|
|
168
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
|
|
169
|
+
branch: 'my-feature-branch' # String | Branch to use
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
begin
|
|
173
|
+
#Create or update a project note
|
|
174
|
+
result = api_instance.project_note_update(project_id, project_note_update_parameters, opts)
|
|
175
|
+
pp result
|
|
176
|
+
rescue Phrase::ApiError => e
|
|
177
|
+
puts "Exception when calling ProjectNotesApi->project_note_update: #{e}"
|
|
178
|
+
end
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Parameters
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
Name | Type | Description | Notes
|
|
185
|
+
------------- | ------------- | ------------- | -------------
|
|
186
|
+
**project_id** | **String**| Project ID |
|
|
187
|
+
**project_note_update_parameters** | [**ProjectNoteUpdateParameters**](ProjectNoteUpdateParameters.md)| |
|
|
188
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
|
189
|
+
**branch** | **String**| Branch to use | [optional]
|
|
190
|
+
|
|
191
|
+
### Return type
|
|
192
|
+
|
|
193
|
+
Response<([**Note**](Note.md))>
|
|
194
|
+
|
|
195
|
+
### Authorization
|
|
196
|
+
|
|
197
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
|
198
|
+
|
|
199
|
+
### HTTP request headers
|
|
200
|
+
|
|
201
|
+
- **Content-Type**: application/json
|
|
202
|
+
- **Accept**: application/json
|
|
203
|
+
|
data/docs/RepoSyncEvent.md
CHANGED
|
@@ -8,8 +8,9 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**type** | **String** | | [optional]
|
|
9
9
|
**created_at** | **Time** | | [optional]
|
|
10
10
|
**status** | **String** | | [optional]
|
|
11
|
+
**automatic** | **Boolean** | When `true`, the sync was triggered automatically (for example by a Zero Touch Localization rule or an automation). When `false`, it was triggered manually. | [optional]
|
|
11
12
|
**pull_request_url** | **String** | URL of the pull request created on export | [optional]
|
|
12
|
-
**auto_import** | **Boolean** |
|
|
13
|
+
**auto_import** | **Boolean** | **Deprecated.** Use `automatic` instead. Only present on import events. Indicates whether the import was triggered automatically. | [optional]
|
|
13
14
|
**errors** | **Array<String>** | List of error messages, in case of failure | [optional]
|
|
14
15
|
**uploads** | [**Array<RepoSyncEventUploadsInner>**](RepoSyncEventUploadsInner.md) | The uploads associated with this import event, or `null` if no upload batch has been created yet. Each entry identifies a single file upload by its public code (`id`) and its current public state (`state`). Present on show responses only; absent from list responses. Possible `state` values: `initialized`, `waiting_for_preview`, `processing`, `success`, `error`. | [optional]
|
|
15
16
|
|
|
@@ -22,6 +23,7 @@ instance = Phrase::RepoSyncEvent.new(id: nil,
|
|
|
22
23
|
type: nil,
|
|
23
24
|
created_at: nil,
|
|
24
25
|
status: nil,
|
|
26
|
+
automatic: nil,
|
|
25
27
|
pull_request_url: nil,
|
|
26
28
|
auto_import: nil,
|
|
27
29
|
errors: nil,
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
require 'cgi'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class ProjectNotesApi
|
|
5
|
+
attr_accessor :api_client
|
|
6
|
+
|
|
7
|
+
def initialize(api_client = ApiClient.default)
|
|
8
|
+
@api_client = api_client
|
|
9
|
+
end
|
|
10
|
+
# Delete a project note
|
|
11
|
+
# Deletes the note associated with a project. This operation is idempotent — it succeeds silently even when no note exists. The note is resolved against the main project — branch projects delete the main project's note. Requires manage permissions on the project and the `write` OAuth scope.
|
|
12
|
+
# @param project_id [String] Project ID
|
|
13
|
+
# @param [Hash] opts the optional parameters
|
|
14
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
15
|
+
# @option opts [String] :branch Branch to use
|
|
16
|
+
# @return [nil]
|
|
17
|
+
def project_note_destroy(project_id, opts = {})
|
|
18
|
+
data, _status_code, _headers = project_note_destroy_with_http_info(project_id, opts)
|
|
19
|
+
data
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Delete a project note
|
|
23
|
+
# Deletes the note associated with a project. This operation is idempotent — it succeeds silently even when no note exists. The note is resolved against the main project — branch projects delete the main project's note. Requires manage permissions on the project and the `write` OAuth scope.
|
|
24
|
+
# @param project_id [String] Project ID
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
27
|
+
# @option opts [String] :branch Branch to use
|
|
28
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
29
|
+
def project_note_destroy_with_http_info(project_id, opts = {})
|
|
30
|
+
if @api_client.config.debugging
|
|
31
|
+
@api_client.config.logger.debug 'Calling API: ProjectNotesApi.project_note_destroy ...'
|
|
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 ProjectNotesApi.project_note_destroy"
|
|
36
|
+
end
|
|
37
|
+
# resource path
|
|
38
|
+
local_var_path = '/projects/{project_id}/note'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
39
|
+
|
|
40
|
+
# query parameters
|
|
41
|
+
query_params = opts[:query_params] || {}
|
|
42
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
|
43
|
+
|
|
44
|
+
# header parameters
|
|
45
|
+
header_params = opts[:header_params] || {}
|
|
46
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
47
|
+
|
|
48
|
+
# form parameters
|
|
49
|
+
form_params = opts[:form_params] || {}
|
|
50
|
+
|
|
51
|
+
# http body (model)
|
|
52
|
+
post_body = opts[:body]
|
|
53
|
+
|
|
54
|
+
# return_type
|
|
55
|
+
return_type = opts[:return_type]
|
|
56
|
+
|
|
57
|
+
# auth_names
|
|
58
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
59
|
+
|
|
60
|
+
new_options = opts.merge(
|
|
61
|
+
:header_params => header_params,
|
|
62
|
+
:query_params => query_params,
|
|
63
|
+
:form_params => form_params,
|
|
64
|
+
:body => post_body,
|
|
65
|
+
:auth_names => auth_names,
|
|
66
|
+
:return_type => return_type
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
70
|
+
if @api_client.config.debugging
|
|
71
|
+
@api_client.config.logger.debug "API called: ProjectNotesApi#project_note_destroy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
72
|
+
end
|
|
73
|
+
response = ::Phrase::Response.new(data, headers)
|
|
74
|
+
return response, status_code, headers
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Get a project note
|
|
78
|
+
# Returns the Markdown-formatted note attached to a project. The note is resolved against the main project — branch projects return the main project's note. Returns 404 when no note has been created yet. Requires the `read` OAuth scope.
|
|
79
|
+
# @param project_id [String] Project ID
|
|
80
|
+
# @param [Hash] opts the optional parameters
|
|
81
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
82
|
+
# @option opts [String] :branch Branch to use
|
|
83
|
+
# @return [Note]
|
|
84
|
+
def project_note_show(project_id, opts = {})
|
|
85
|
+
data, _status_code, _headers = project_note_show_with_http_info(project_id, opts)
|
|
86
|
+
data
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Get a project note
|
|
90
|
+
# Returns the Markdown-formatted note attached to a project. The note is resolved against the main project — branch projects return the main project's note. Returns 404 when no note has been created yet. Requires the `read` OAuth scope.
|
|
91
|
+
# @param project_id [String] Project ID
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
94
|
+
# @option opts [String] :branch Branch to use
|
|
95
|
+
# @return [Array<(Response<(Note)>, Integer, Hash)>] Response<(Note)> data, response status code and response headers
|
|
96
|
+
def project_note_show_with_http_info(project_id, opts = {})
|
|
97
|
+
if @api_client.config.debugging
|
|
98
|
+
@api_client.config.logger.debug 'Calling API: ProjectNotesApi.project_note_show ...'
|
|
99
|
+
end
|
|
100
|
+
# verify the required parameter 'project_id' is set
|
|
101
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
102
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectNotesApi.project_note_show"
|
|
103
|
+
end
|
|
104
|
+
# resource path
|
|
105
|
+
local_var_path = '/projects/{project_id}/note'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
106
|
+
|
|
107
|
+
# query parameters
|
|
108
|
+
query_params = opts[:query_params] || {}
|
|
109
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
|
110
|
+
|
|
111
|
+
# header parameters
|
|
112
|
+
header_params = opts[:header_params] || {}
|
|
113
|
+
# HTTP header 'Accept' (if needed)
|
|
114
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
115
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
116
|
+
|
|
117
|
+
# form parameters
|
|
118
|
+
form_params = opts[:form_params] || {}
|
|
119
|
+
|
|
120
|
+
# http body (model)
|
|
121
|
+
post_body = opts[:body]
|
|
122
|
+
|
|
123
|
+
# return_type
|
|
124
|
+
return_type = opts[:return_type] || 'Note'
|
|
125
|
+
|
|
126
|
+
# auth_names
|
|
127
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
128
|
+
|
|
129
|
+
new_options = opts.merge(
|
|
130
|
+
:header_params => header_params,
|
|
131
|
+
:query_params => query_params,
|
|
132
|
+
:form_params => form_params,
|
|
133
|
+
:body => post_body,
|
|
134
|
+
:auth_names => auth_names,
|
|
135
|
+
:return_type => return_type
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
139
|
+
if @api_client.config.debugging
|
|
140
|
+
@api_client.config.logger.debug "API called: ProjectNotesApi#project_note_show\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
141
|
+
end
|
|
142
|
+
response = ::Phrase::Response.new(data, headers)
|
|
143
|
+
return response, status_code, headers
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Create or update a project note
|
|
147
|
+
# Creates or updates the Markdown-formatted note for a project. If a note already exists it is updated in place; otherwise a new note is created. The note is stored on the main project — branch projects write to the main project's note. `body` is required. Requires manage permissions on the project and the `write` OAuth scope.
|
|
148
|
+
# @param project_id [String] Project ID
|
|
149
|
+
# @param project_note_update_parameters [ProjectNoteUpdateParameters]
|
|
150
|
+
# @param [Hash] opts the optional parameters
|
|
151
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
152
|
+
# @option opts [String] :branch Branch to use
|
|
153
|
+
# @return [Note]
|
|
154
|
+
def project_note_update(project_id, project_note_update_parameters, opts = {})
|
|
155
|
+
data, _status_code, _headers = project_note_update_with_http_info(project_id, project_note_update_parameters, opts)
|
|
156
|
+
data
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Create or update a project note
|
|
160
|
+
# Creates or updates the Markdown-formatted note for a project. If a note already exists it is updated in place; otherwise a new note is created. The note is stored on the main project — branch projects write to the main project's note. `body` is required. Requires manage permissions on the project and the `write` OAuth scope.
|
|
161
|
+
# @param project_id [String] Project ID
|
|
162
|
+
# @param project_note_update_parameters [ProjectNoteUpdateParameters]
|
|
163
|
+
# @param [Hash] opts the optional parameters
|
|
164
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
165
|
+
# @option opts [String] :branch Branch to use
|
|
166
|
+
# @return [Array<(Response<(Note)>, Integer, Hash)>] Response<(Note)> data, response status code and response headers
|
|
167
|
+
def project_note_update_with_http_info(project_id, project_note_update_parameters, opts = {})
|
|
168
|
+
if @api_client.config.debugging
|
|
169
|
+
@api_client.config.logger.debug 'Calling API: ProjectNotesApi.project_note_update ...'
|
|
170
|
+
end
|
|
171
|
+
# verify the required parameter 'project_id' is set
|
|
172
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
|
173
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectNotesApi.project_note_update"
|
|
174
|
+
end
|
|
175
|
+
# verify the required parameter 'project_note_update_parameters' is set
|
|
176
|
+
if @api_client.config.client_side_validation && project_note_update_parameters.nil?
|
|
177
|
+
fail ArgumentError, "Missing the required parameter 'project_note_update_parameters' when calling ProjectNotesApi.project_note_update"
|
|
178
|
+
end
|
|
179
|
+
# resource path
|
|
180
|
+
local_var_path = '/projects/{project_id}/note'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))
|
|
181
|
+
|
|
182
|
+
# query parameters
|
|
183
|
+
query_params = opts[:query_params] || {}
|
|
184
|
+
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
|
|
185
|
+
|
|
186
|
+
# header parameters
|
|
187
|
+
header_params = opts[:header_params] || {}
|
|
188
|
+
# HTTP header 'Accept' (if needed)
|
|
189
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
190
|
+
# HTTP header 'Content-Type'
|
|
191
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
192
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
193
|
+
|
|
194
|
+
# form parameters
|
|
195
|
+
form_params = opts[:form_params] || {}
|
|
196
|
+
|
|
197
|
+
# http body (model)
|
|
198
|
+
post_body = opts[:body] || @api_client.object_to_http_body(project_note_update_parameters)
|
|
199
|
+
|
|
200
|
+
# return_type
|
|
201
|
+
return_type = opts[:return_type] || 'Note'
|
|
202
|
+
|
|
203
|
+
# auth_names
|
|
204
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
205
|
+
|
|
206
|
+
new_options = opts.merge(
|
|
207
|
+
:header_params => header_params,
|
|
208
|
+
:query_params => query_params,
|
|
209
|
+
:form_params => form_params,
|
|
210
|
+
:body => post_body,
|
|
211
|
+
:auth_names => auth_names,
|
|
212
|
+
:return_type => return_type
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
216
|
+
if @api_client.config.debugging
|
|
217
|
+
@api_client.config.logger.debug "API called: ProjectNotesApi#project_note_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
218
|
+
end
|
|
219
|
+
response = ::Phrase::Response.new(data, headers)
|
|
220
|
+
return response, status_code, headers
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
end
|