phrase 1.0.7 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/docs/BranchName.md +17 -0
- data/docs/Invitation.md +9 -1
- data/docs/InvitationCreateParameters.md +4 -0
- data/docs/InvitationUpdateParameters.md +4 -0
- data/docs/InvitationUpdateSettingsParameters.md +19 -0
- data/docs/InvitationsApi.md +66 -0
- data/docs/Job.md +5 -3
- data/docs/JobDetails.md +4 -2
- data/docs/JobLocale.md +3 -1
- data/docs/LocalesApi.md +2 -0
- data/docs/Member.md +7 -1
- data/docs/MemberProjectDetail.md +35 -0
- data/docs/MemberProjectDetailProjectRoles.md +19 -0
- data/docs/MemberSpaces.md +25 -0
- data/docs/MemberUpdateParameters.md +4 -0
- data/docs/MemberUpdateSettingsParameters.md +19 -0
- data/docs/MembersApi.md +66 -0
- data/docs/Webhook.md +2 -0
- data/docs/WebhookCreateParameters.md +3 -1
- data/docs/WebhookUpdateParameters.md +3 -1
- data/lib/phrase.rb +6 -0
- data/lib/phrase/api/invitations_api.rb +80 -0
- data/lib/phrase/api/locales_api.rb +3 -0
- data/lib/phrase/api/members_api.rb +80 -0
- data/lib/phrase/api_client.rb +2 -0
- data/lib/phrase/models/branch_name.rb +194 -0
- data/lib/phrase/models/invitation.rb +48 -4
- data/lib/phrase/models/invitation_create_parameters.rb +25 -1
- data/lib/phrase/models/invitation_update_parameters.rb +25 -1
- data/lib/phrase/models/invitation_update_settings_parameters.rb +207 -0
- data/lib/phrase/models/job.rb +22 -13
- data/lib/phrase/models/job_details.rb +19 -10
- data/lib/phrase/models/job_locale.rb +13 -4
- data/lib/phrase/models/member.rb +35 -4
- data/lib/phrase/models/member_project_detail.rb +285 -0
- data/lib/phrase/models/member_project_detail_project_roles.rb +203 -0
- data/lib/phrase/models/member_spaces.rb +230 -0
- data/lib/phrase/models/member_update_parameters.rb +25 -1
- data/lib/phrase/models/member_update_settings_parameters.rb +207 -0
- data/lib/phrase/models/webhook.rb +10 -1
- data/lib/phrase/models/webhook_create_parameters.rb +14 -4
- data/lib/phrase/models/webhook_update_parameters.rb +14 -4
- data/lib/phrase/version.rb +1 -1
- data/spec/api/invitations_api_spec.rb +15 -0
- data/spec/api/locales_api_spec.rb +1 -0
- data/spec/api/members_api_spec.rb +15 -0
- data/spec/models/branch_name_spec.rb +29 -0
- data/spec/models/invitation_create_parameters_spec.rb +12 -0
- data/spec/models/invitation_spec.rb +24 -0
- data/spec/models/invitation_update_parameters_spec.rb +12 -0
- data/spec/models/invitation_update_settings_parameters_spec.rb +35 -0
- data/spec/models/job_details_spec.rb +9 -3
- data/spec/models/job_locale_spec.rb +6 -0
- data/spec/models/job_spec.rb +9 -3
- data/spec/models/member_project_detail_project_roles_spec.rb +35 -0
- data/spec/models/member_project_detail_spec.rb +83 -0
- data/spec/models/member_spaces_spec.rb +53 -0
- data/spec/models/member_spec.rb +18 -0
- data/spec/models/member_update_parameters_spec.rb +12 -0
- data/spec/models/member_update_settings_parameters_spec.rb +35 -0
- data/spec/models/webhook_create_parameters_spec.rb +6 -0
- data/spec/models/webhook_spec.rb +6 -0
- data/spec/models/webhook_update_parameters_spec.rb +6 -0
- metadata +189 -165
@@ -7,6 +7,8 @@ Name | Type | Description | Notes
|
|
7
7
|
**role** | **String** | Member role, can be any of of Manager, Developer, Translator | [optional]
|
8
8
|
**project_ids** | **String** | List of project ids the user has access to. | [optional]
|
9
9
|
**locale_ids** | **String** | List of locale ids the user has access to. | [optional]
|
10
|
+
**default_locale_codes** | **Array<String>** | List of default locales for the user. | [optional]
|
11
|
+
**space_ids** | **Array<String>** | List of spaces the user is assigned to. | [optional]
|
10
12
|
**permissions** | **Hash<String, String>** | Additional permissions depending on member role. Available permissions are <code>create_upload</code> and <code>review_translations</code> | [optional]
|
11
13
|
|
12
14
|
## Code Sample
|
@@ -17,6 +19,8 @@ require 'Phrase'
|
|
17
19
|
instance = Phrase::MemberUpdateParameters.new(role: Developer,
|
18
20
|
project_ids: abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235,
|
19
21
|
locale_ids: abcd1234abcd1234abcd1234,abcd1234abcd1234abcd1235,
|
22
|
+
default_locale_codes: ["en","fi"],
|
23
|
+
space_ids: ["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"],
|
20
24
|
permissions: {"create_upload":true,"review_translations":true})
|
21
25
|
```
|
22
26
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Phrase::MemberUpdateSettingsParameters
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**project_role** | **String** | Member role, can be any of of Manager, Developer, Translator | [optional]
|
8
|
+
**locale_ids** | **Array<String>** | List of locale ids the user has access to. | [optional]
|
9
|
+
|
10
|
+
## Code Sample
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'Phrase'
|
14
|
+
|
15
|
+
instance = Phrase::MemberUpdateSettingsParameters.new(project_role: Developer,
|
16
|
+
locale_ids: ["abcd1234abcd1234abcd1234","abcd1234abcd1234abcd1235"])
|
17
|
+
```
|
18
|
+
|
19
|
+
|
data/docs/MembersApi.md
CHANGED
@@ -7,6 +7,7 @@ Method | HTTP request | Description
|
|
7
7
|
[**member_delete**](MembersApi.md#member_delete) | **DELETE** /accounts/{account_id}/members/{id} | Remove a user from the account
|
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
|
+
[**member_update_settings**](MembersApi.md#member_update_settings) | **PATCH** /projects/{project_id}/members/{id} | Update a member's project settings
|
10
11
|
[**members_list**](MembersApi.md#members_list) | **GET** /accounts/{account_id}/members | List members
|
11
12
|
|
12
13
|
|
@@ -201,6 +202,71 @@ Response<([**Member**](Member.md))>
|
|
201
202
|
- **Accept**: application/json
|
202
203
|
|
203
204
|
|
205
|
+
## member_update_settings
|
206
|
+
|
207
|
+
> MemberProjectDetail member_update_settings(project_id, id, member_update_settings_parameters, opts)
|
208
|
+
|
209
|
+
Update a member's project settings
|
210
|
+
|
211
|
+
Update user settings in the project. Access token scope must include <code>team.manage</code>.
|
212
|
+
|
213
|
+
### Example
|
214
|
+
|
215
|
+
```ruby
|
216
|
+
# load the gem
|
217
|
+
require 'phrase'
|
218
|
+
# setup authorization
|
219
|
+
Phrase.configure do |config|
|
220
|
+
# Configure HTTP basic authorization: Basic
|
221
|
+
config.username = 'YOUR USERNAME'
|
222
|
+
config.password = 'YOUR PASSWORD'
|
223
|
+
|
224
|
+
# Configure API key authorization: Token
|
225
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
226
|
+
config.api_key_prefix['Authorization'] = 'token'
|
227
|
+
end
|
228
|
+
|
229
|
+
api_instance = Phrase::MembersApi.new
|
230
|
+
project_id = 'project_id_example' # String | Project ID
|
231
|
+
id = 'id_example' # String | ID
|
232
|
+
member_update_settings_parameters = Phrase::MemberUpdateSettingsParameters.new # MemberUpdateSettingsParameters |
|
233
|
+
opts = {
|
234
|
+
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
|
235
|
+
}
|
236
|
+
|
237
|
+
begin
|
238
|
+
#Update a member's project settings
|
239
|
+
result = api_instance.member_update_settings(project_id, id, member_update_settings_parameters, opts)
|
240
|
+
pp result
|
241
|
+
rescue Phrase::ApiError => e
|
242
|
+
puts "Exception when calling MembersApi->member_update_settings: #{e}"
|
243
|
+
end
|
244
|
+
```
|
245
|
+
|
246
|
+
### Parameters
|
247
|
+
|
248
|
+
|
249
|
+
Name | Type | Description | Notes
|
250
|
+
------------- | ------------- | ------------- | -------------
|
251
|
+
**project_id** | **String**| Project ID |
|
252
|
+
**id** | **String**| ID |
|
253
|
+
**member_update_settings_parameters** | [**MemberUpdateSettingsParameters**](MemberUpdateSettingsParameters.md)| |
|
254
|
+
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
|
255
|
+
|
256
|
+
### Return type
|
257
|
+
|
258
|
+
Response<([**MemberProjectDetail**](MemberProjectDetail.md))>
|
259
|
+
|
260
|
+
### Authorization
|
261
|
+
|
262
|
+
[Basic](../README.md#Basic), [Token](../README.md#Token)
|
263
|
+
|
264
|
+
### HTTP request headers
|
265
|
+
|
266
|
+
- **Content-Type**: application/json
|
267
|
+
- **Accept**: application/json
|
268
|
+
|
269
|
+
|
204
270
|
## members_list
|
205
271
|
|
206
272
|
> Array<Member> members_list(account_id, opts)
|
data/docs/Webhook.md
CHANGED
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
|
9
9
|
**description** | **String** | | [optional]
|
10
10
|
**events** | **Array<String>** | | [optional]
|
11
11
|
**active** | **Boolean** | | [optional]
|
12
|
+
**include_branches** | **Boolean** | | [optional]
|
12
13
|
**created_at** | **DateTime** | | [optional]
|
13
14
|
**updated_at** | **DateTime** | | [optional]
|
14
15
|
|
@@ -22,6 +23,7 @@ instance = Phrase::Webhook.new(id: null,
|
|
22
23
|
description: null,
|
23
24
|
events: null,
|
24
25
|
active: null,
|
26
|
+
include_branches: null,
|
25
27
|
created_at: null,
|
26
28
|
updated_at: null)
|
27
29
|
```
|
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
|
9
9
|
**description** | **String** | Webhook description | [optional]
|
10
10
|
**events** | **String** | List of event names to trigger the webhook (separated by comma) | [optional]
|
11
11
|
**active** | **Boolean** | Whether webhook is active or inactive | [optional]
|
12
|
+
**include_branches** | **Boolean** | If enabled, webhook will also be triggered for events from branches of the project specified. | [optional]
|
12
13
|
|
13
14
|
## Code Sample
|
14
15
|
|
@@ -19,7 +20,8 @@ instance = Phrase::WebhookCreateParameters.new(callback_url: http://example.com/
|
|
19
20
|
secret: secr3t,
|
20
21
|
description: My webhook for chat notifications,
|
21
22
|
events: locales:create,translations:update,
|
22
|
-
active: null
|
23
|
+
active: null,
|
24
|
+
include_branches: null)
|
23
25
|
```
|
24
26
|
|
25
27
|
|
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
|
9
9
|
**description** | **String** | Webhook description | [optional]
|
10
10
|
**events** | **String** | List of event names to trigger the webhook (separated by comma) | [optional]
|
11
11
|
**active** | **Boolean** | Whether webhook is active or inactive | [optional]
|
12
|
+
**include_branches** | **Boolean** | If enabled, webhook will also be triggered for events from branches of the project specified. | [optional]
|
12
13
|
|
13
14
|
## Code Sample
|
14
15
|
|
@@ -19,7 +20,8 @@ instance = Phrase::WebhookUpdateParameters.new(callback_url: http://example.com/
|
|
19
20
|
secret: secr3t,
|
20
21
|
description: My webhook for chat notifications,
|
21
22
|
events: locales:create,translations:update,
|
22
|
-
active: null
|
23
|
+
active: null,
|
24
|
+
include_branches: null)
|
23
25
|
```
|
24
26
|
|
25
27
|
|
data/lib/phrase.rb
CHANGED
@@ -28,6 +28,7 @@ require 'phrase/models/blacklisted_key_update_parameters'
|
|
28
28
|
require 'phrase/models/branch'
|
29
29
|
require 'phrase/models/branch_create_parameters'
|
30
30
|
require 'phrase/models/branch_merge_parameters'
|
31
|
+
require 'phrase/models/branch_name'
|
31
32
|
require 'phrase/models/branch_update_parameters'
|
32
33
|
require 'phrase/models/comment'
|
33
34
|
require 'phrase/models/comment_create_parameters'
|
@@ -60,6 +61,7 @@ require 'phrase/models/inline_response422_errors'
|
|
60
61
|
require 'phrase/models/invitation'
|
61
62
|
require 'phrase/models/invitation_create_parameters'
|
62
63
|
require 'phrase/models/invitation_update_parameters'
|
64
|
+
require 'phrase/models/invitation_update_settings_parameters'
|
63
65
|
require 'phrase/models/job'
|
64
66
|
require 'phrase/models/job_complete_parameters'
|
65
67
|
require 'phrase/models/job_create_parameters'
|
@@ -89,7 +91,11 @@ require 'phrase/models/locale_preview'
|
|
89
91
|
require 'phrase/models/locale_statistics'
|
90
92
|
require 'phrase/models/locale_update_parameters'
|
91
93
|
require 'phrase/models/member'
|
94
|
+
require 'phrase/models/member_project_detail'
|
95
|
+
require 'phrase/models/member_project_detail_project_roles'
|
96
|
+
require 'phrase/models/member_spaces'
|
92
97
|
require 'phrase/models/member_update_parameters'
|
98
|
+
require 'phrase/models/member_update_settings_parameters'
|
93
99
|
require 'phrase/models/order_confirm_parameters'
|
94
100
|
require 'phrase/models/order_create_parameters'
|
95
101
|
require 'phrase/models/project'
|
@@ -375,6 +375,86 @@ module Phrase
|
|
375
375
|
return response, status_code, headers
|
376
376
|
end
|
377
377
|
|
378
|
+
# Update a member's invitation access
|
379
|
+
# Update member's settings in the invitations. Access token scope must include <code>team.manage</code>.
|
380
|
+
# @param project_id [String] Project ID
|
381
|
+
# @param id [String] ID
|
382
|
+
# @param invitation_update_settings_parameters [InvitationUpdateSettingsParameters]
|
383
|
+
# @param [Hash] opts the optional parameters
|
384
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
385
|
+
# @return [Invitation]
|
386
|
+
def invitation_update_settings(project_id, id, invitation_update_settings_parameters, opts = {})
|
387
|
+
data, _status_code, _headers = invitation_update_settings_with_http_info(project_id, id, invitation_update_settings_parameters, opts)
|
388
|
+
data
|
389
|
+
end
|
390
|
+
|
391
|
+
# Update a member's invitation access
|
392
|
+
# Update member's settings in the invitations. Access token scope must include <code>team.manage</code>.
|
393
|
+
# @param project_id [String] Project ID
|
394
|
+
# @param id [String] ID
|
395
|
+
# @param invitation_update_settings_parameters [InvitationUpdateSettingsParameters]
|
396
|
+
# @param [Hash] opts the optional parameters
|
397
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
398
|
+
# @return [Array<(Response<(Invitation)>, Integer, Hash)>] Response<(Invitation)> data, response status code and response headers
|
399
|
+
def invitation_update_settings_with_http_info(project_id, id, invitation_update_settings_parameters, opts = {})
|
400
|
+
if @api_client.config.debugging
|
401
|
+
@api_client.config.logger.debug 'Calling API: InvitationsApi.invitation_update_settings ...'
|
402
|
+
end
|
403
|
+
# verify the required parameter 'project_id' is set
|
404
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
405
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling InvitationsApi.invitation_update_settings"
|
406
|
+
end
|
407
|
+
# verify the required parameter 'id' is set
|
408
|
+
if @api_client.config.client_side_validation && id.nil?
|
409
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling InvitationsApi.invitation_update_settings"
|
410
|
+
end
|
411
|
+
# verify the required parameter 'invitation_update_settings_parameters' is set
|
412
|
+
if @api_client.config.client_side_validation && invitation_update_settings_parameters.nil?
|
413
|
+
fail ArgumentError, "Missing the required parameter 'invitation_update_settings_parameters' when calling InvitationsApi.invitation_update_settings"
|
414
|
+
end
|
415
|
+
# resource path
|
416
|
+
local_var_path = '/projects/{project_id}/invitations/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
417
|
+
|
418
|
+
# query parameters
|
419
|
+
query_params = opts[:query_params] || {}
|
420
|
+
|
421
|
+
# header parameters
|
422
|
+
header_params = opts[:header_params] || {}
|
423
|
+
# HTTP header 'Accept' (if needed)
|
424
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
425
|
+
# HTTP header 'Content-Type'
|
426
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
427
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
428
|
+
|
429
|
+
# form parameters
|
430
|
+
form_params = opts[:form_params] || {}
|
431
|
+
|
432
|
+
# http body (model)
|
433
|
+
post_body = opts[:body] || @api_client.object_to_http_body(invitation_update_settings_parameters)
|
434
|
+
|
435
|
+
# return_type
|
436
|
+
return_type = opts[:return_type] || 'Invitation'
|
437
|
+
|
438
|
+
# auth_names
|
439
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
440
|
+
|
441
|
+
new_options = opts.merge(
|
442
|
+
:header_params => header_params,
|
443
|
+
:query_params => query_params,
|
444
|
+
:form_params => form_params,
|
445
|
+
:body => post_body,
|
446
|
+
:auth_names => auth_names,
|
447
|
+
:return_type => return_type
|
448
|
+
)
|
449
|
+
|
450
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
451
|
+
if @api_client.config.debugging
|
452
|
+
@api_client.config.logger.debug "API called: InvitationsApi#invitation_update_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
453
|
+
end
|
454
|
+
response = ::Phrase::Response.new(data, headers)
|
455
|
+
return response, status_code, headers
|
456
|
+
end
|
457
|
+
|
378
458
|
# List invitations
|
379
459
|
# List invitations for an account. It will also list the accessible resources like projects and locales the invited user has access to. In case nothing is shown the default access from the role is used. Access token scope must include <code>team.manage</code>.
|
380
460
|
# @param account_id [String] Account ID
|
@@ -165,6 +165,7 @@ module Phrase
|
|
165
165
|
# @option opts [String] :tags Limit results to keys tagged with a list of comma separated tag names.
|
166
166
|
# @option opts [String] :tag Limit download to tagged keys. This parameter is deprecated. Please use the \"tags\" parameter instead
|
167
167
|
# @option opts [Boolean] :include_empty_translations Indicates whether keys without translations should be included in the output as well.
|
168
|
+
# @option opts [Boolean] :exclude_empty_zero_forms Indicates whether zero forms should be included when empty in pluralized keys.
|
168
169
|
# @option opts [Boolean] :include_translated_keys Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys.
|
169
170
|
# @option opts [Boolean] :keep_notranslate_tags Indicates whether [NOTRANSLATE] tags should be kept.
|
170
171
|
# @option opts [Boolean] :convert_emoji This option is obsolete. Projects that were created on or after Nov 29th 2019 or that did not contain emoji by then will not require this flag any longer since emoji are now supported natively.
|
@@ -191,6 +192,7 @@ module Phrase
|
|
191
192
|
# @option opts [String] :tags Limit results to keys tagged with a list of comma separated tag names.
|
192
193
|
# @option opts [String] :tag Limit download to tagged keys. This parameter is deprecated. Please use the \"tags\" parameter instead
|
193
194
|
# @option opts [Boolean] :include_empty_translations Indicates whether keys without translations should be included in the output as well.
|
195
|
+
# @option opts [Boolean] :exclude_empty_zero_forms Indicates whether zero forms should be included when empty in pluralized keys.
|
194
196
|
# @option opts [Boolean] :include_translated_keys Include translated keys in the locale file. Use in combination with include_empty_translations to obtain only untranslated keys.
|
195
197
|
# @option opts [Boolean] :keep_notranslate_tags Indicates whether [NOTRANSLATE] tags should be kept.
|
196
198
|
# @option opts [Boolean] :convert_emoji This option is obsolete. Projects that were created on or after Nov 29th 2019 or that did not contain emoji by then will not require this flag any longer since emoji are now supported natively.
|
@@ -223,6 +225,7 @@ module Phrase
|
|
223
225
|
query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil?
|
224
226
|
query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil?
|
225
227
|
query_params[:'include_empty_translations'] = opts[:'include_empty_translations'] if !opts[:'include_empty_translations'].nil?
|
228
|
+
query_params[:'exclude_empty_zero_forms'] = opts[:'exclude_empty_zero_forms'] if !opts[:'exclude_empty_zero_forms'].nil?
|
226
229
|
query_params[:'include_translated_keys'] = opts[:'include_translated_keys'] if !opts[:'include_translated_keys'].nil?
|
227
230
|
query_params[:'keep_notranslate_tags'] = opts[:'keep_notranslate_tags'] if !opts[:'keep_notranslate_tags'].nil?
|
228
231
|
query_params[:'convert_emoji'] = opts[:'convert_emoji'] if !opts[:'convert_emoji'].nil?
|
@@ -229,6 +229,86 @@ module Phrase
|
|
229
229
|
return response, status_code, headers
|
230
230
|
end
|
231
231
|
|
232
|
+
# Update a member's project settings
|
233
|
+
# Update user settings in the project. Access token scope must include <code>team.manage</code>.
|
234
|
+
# @param project_id [String] Project ID
|
235
|
+
# @param id [String] ID
|
236
|
+
# @param member_update_settings_parameters [MemberUpdateSettingsParameters]
|
237
|
+
# @param [Hash] opts the optional parameters
|
238
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
239
|
+
# @return [MemberProjectDetail]
|
240
|
+
def member_update_settings(project_id, id, member_update_settings_parameters, opts = {})
|
241
|
+
data, _status_code, _headers = member_update_settings_with_http_info(project_id, id, member_update_settings_parameters, opts)
|
242
|
+
data
|
243
|
+
end
|
244
|
+
|
245
|
+
# Update a member's project settings
|
246
|
+
# Update user settings in the project. Access token scope must include <code>team.manage</code>.
|
247
|
+
# @param project_id [String] Project ID
|
248
|
+
# @param id [String] ID
|
249
|
+
# @param member_update_settings_parameters [MemberUpdateSettingsParameters]
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
252
|
+
# @return [Array<(Response<(MemberProjectDetail)>, Integer, Hash)>] Response<(MemberProjectDetail)> data, response status code and response headers
|
253
|
+
def member_update_settings_with_http_info(project_id, id, member_update_settings_parameters, opts = {})
|
254
|
+
if @api_client.config.debugging
|
255
|
+
@api_client.config.logger.debug 'Calling API: MembersApi.member_update_settings ...'
|
256
|
+
end
|
257
|
+
# verify the required parameter 'project_id' is set
|
258
|
+
if @api_client.config.client_side_validation && project_id.nil?
|
259
|
+
fail ArgumentError, "Missing the required parameter 'project_id' when calling MembersApi.member_update_settings"
|
260
|
+
end
|
261
|
+
# verify the required parameter 'id' is set
|
262
|
+
if @api_client.config.client_side_validation && id.nil?
|
263
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling MembersApi.member_update_settings"
|
264
|
+
end
|
265
|
+
# verify the required parameter 'member_update_settings_parameters' is set
|
266
|
+
if @api_client.config.client_side_validation && member_update_settings_parameters.nil?
|
267
|
+
fail ArgumentError, "Missing the required parameter 'member_update_settings_parameters' when calling MembersApi.member_update_settings"
|
268
|
+
end
|
269
|
+
# resource path
|
270
|
+
local_var_path = '/projects/{project_id}/members/{id}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
271
|
+
|
272
|
+
# query parameters
|
273
|
+
query_params = opts[:query_params] || {}
|
274
|
+
|
275
|
+
# header parameters
|
276
|
+
header_params = opts[:header_params] || {}
|
277
|
+
# HTTP header 'Accept' (if needed)
|
278
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
279
|
+
# HTTP header 'Content-Type'
|
280
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
281
|
+
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
282
|
+
|
283
|
+
# form parameters
|
284
|
+
form_params = opts[:form_params] || {}
|
285
|
+
|
286
|
+
# http body (model)
|
287
|
+
post_body = opts[:body] || @api_client.object_to_http_body(member_update_settings_parameters)
|
288
|
+
|
289
|
+
# return_type
|
290
|
+
return_type = opts[:return_type] || 'MemberProjectDetail'
|
291
|
+
|
292
|
+
# auth_names
|
293
|
+
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
294
|
+
|
295
|
+
new_options = opts.merge(
|
296
|
+
:header_params => header_params,
|
297
|
+
:query_params => query_params,
|
298
|
+
:form_params => form_params,
|
299
|
+
:body => post_body,
|
300
|
+
:auth_names => auth_names,
|
301
|
+
:return_type => return_type
|
302
|
+
)
|
303
|
+
|
304
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
305
|
+
if @api_client.config.debugging
|
306
|
+
@api_client.config.logger.debug "API called: MembersApi#member_update_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
307
|
+
end
|
308
|
+
response = ::Phrase::Response.new(data, headers)
|
309
|
+
return response, status_code, headers
|
310
|
+
end
|
311
|
+
|
232
312
|
# List members
|
233
313
|
# 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 <code>team.manage</code>.
|
234
314
|
# @param account_id [String] Account ID
|
data/lib/phrase/api_client.rb
CHANGED
@@ -131,6 +131,8 @@ module Phrase
|
|
131
131
|
when ::File, ::Tempfile, ::Array, nil
|
132
132
|
# let typhoeus handle File, Tempfile, Array and nil parameters
|
133
133
|
data[key] = value
|
134
|
+
when ::Hash
|
135
|
+
data[key] = build_request_body(header_params, value, body)
|
134
136
|
else
|
135
137
|
data[key] = value.to_s
|
136
138
|
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
require 'date'
|
2
|
+
|
3
|
+
module Phrase
|
4
|
+
class BranchName
|
5
|
+
attr_accessor :name
|
6
|
+
|
7
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
8
|
+
def self.attribute_map
|
9
|
+
{
|
10
|
+
:'name' => :'name'
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
# Attribute type mapping.
|
15
|
+
def self.openapi_types
|
16
|
+
{
|
17
|
+
:'name' => :'String'
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
# List of attributes with nullable: true
|
22
|
+
def self.openapi_nullable
|
23
|
+
Set.new([
|
24
|
+
])
|
25
|
+
end
|
26
|
+
|
27
|
+
# Initializes the object
|
28
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
29
|
+
def initialize(attributes = {})
|
30
|
+
if (!attributes.is_a?(Hash))
|
31
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::BranchName` initialize method"
|
32
|
+
end
|
33
|
+
|
34
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
35
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
36
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
37
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::BranchName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
38
|
+
end
|
39
|
+
h[k.to_sym] = v
|
40
|
+
}
|
41
|
+
|
42
|
+
if attributes.key?(:'name')
|
43
|
+
self.name = attributes[:'name']
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
48
|
+
# @return Array for valid properties with the reasons
|
49
|
+
def list_invalid_properties
|
50
|
+
invalid_properties = Array.new
|
51
|
+
invalid_properties
|
52
|
+
end
|
53
|
+
|
54
|
+
# Check to see if the all the properties in the model are valid
|
55
|
+
# @return true if the model is valid
|
56
|
+
def valid?
|
57
|
+
true
|
58
|
+
end
|
59
|
+
|
60
|
+
# Checks equality by comparing each attribute.
|
61
|
+
# @param [Object] Object to be compared
|
62
|
+
def ==(o)
|
63
|
+
return true if self.equal?(o)
|
64
|
+
self.class == o.class &&
|
65
|
+
name == o.name
|
66
|
+
end
|
67
|
+
|
68
|
+
# @see the `==` method
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def eql?(o)
|
71
|
+
self == o
|
72
|
+
end
|
73
|
+
|
74
|
+
# Calculates hash code according to all attributes.
|
75
|
+
# @return [Integer] Hash code
|
76
|
+
def hash
|
77
|
+
[name].hash
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def self.build_from_hash(attributes)
|
84
|
+
new.build_from_hash(attributes)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Builds the object from hash
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
# @return [Object] Returns the model itself
|
90
|
+
def build_from_hash(attributes)
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
92
|
+
self.class.openapi_types.each_pair do |key, type|
|
93
|
+
if type =~ /\AArray<(.*)>/i
|
94
|
+
# check to ensure the input is an array given that the attribute
|
95
|
+
# is documented as an array but the input is not
|
96
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
97
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
98
|
+
end
|
99
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
100
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
101
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
102
|
+
end
|
103
|
+
|
104
|
+
self
|
105
|
+
end
|
106
|
+
|
107
|
+
# Deserializes the data based on type
|
108
|
+
# @param string type Data type
|
109
|
+
# @param string value Value to be deserialized
|
110
|
+
# @return [Object] Deserialized data
|
111
|
+
def _deserialize(type, value)
|
112
|
+
case type.to_sym
|
113
|
+
when :DateTime
|
114
|
+
DateTime.parse(value)
|
115
|
+
when :Date
|
116
|
+
Date.parse(value)
|
117
|
+
when :String
|
118
|
+
value.to_s
|
119
|
+
when :Integer
|
120
|
+
value.to_i
|
121
|
+
when :Float
|
122
|
+
value.to_f
|
123
|
+
when :Boolean
|
124
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
125
|
+
true
|
126
|
+
else
|
127
|
+
false
|
128
|
+
end
|
129
|
+
when :Object
|
130
|
+
# generic object (usually a Hash), return directly
|
131
|
+
value
|
132
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
133
|
+
inner_type = Regexp.last_match[:inner_type]
|
134
|
+
value.map { |v| _deserialize(inner_type, v) }
|
135
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
136
|
+
k_type = Regexp.last_match[:k_type]
|
137
|
+
v_type = Regexp.last_match[:v_type]
|
138
|
+
{}.tap do |hash|
|
139
|
+
value.each do |k, v|
|
140
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
else # model
|
144
|
+
Phrase.const_get(type).build_from_hash(value)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the string representation of the object
|
149
|
+
# @return [String] String presentation of the object
|
150
|
+
def to_s
|
151
|
+
to_hash.to_s
|
152
|
+
end
|
153
|
+
|
154
|
+
# to_body is an alias to to_hash (backward compatibility)
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_body
|
157
|
+
to_hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the object in the form of hash
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_hash
|
163
|
+
hash = {}
|
164
|
+
self.class.attribute_map.each_pair do |attr, param|
|
165
|
+
value = self.send(attr)
|
166
|
+
if value.nil?
|
167
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
168
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
169
|
+
end
|
170
|
+
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
# For object, use to_hash. Otherwise, just return the value
|
178
|
+
# @param [Object] value Any valid value
|
179
|
+
# @return [Hash] Returns the value in the form of hash
|
180
|
+
def _to_hash(value)
|
181
|
+
if value.is_a?(Array)
|
182
|
+
value.compact.map { |v| _to_hash(v) }
|
183
|
+
elsif value.is_a?(Hash)
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
186
|
+
end
|
187
|
+
elsif value.respond_to? :to_hash
|
188
|
+
value.to_hash
|
189
|
+
else
|
190
|
+
value
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|