phrase 1.0.1 → 1.0.2
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/README.md +50 -387
- data/docs/AccountsApi.md +2 -4
- data/docs/AuthorizationsApi.md +10 -14
- data/docs/BitbucketSyncApi.md +3 -6
- data/docs/BlacklistedKeysApi.md +10 -14
- data/docs/BranchesApi.md +12 -18
- data/docs/CommentsApi.md +13 -20
- data/docs/DistributionsApi.md +10 -14
- data/docs/FormatsApi.md +1 -2
- data/docs/GitLabSyncApi.md +7 -14
- data/docs/{GlossaryApi.md → GlossariesApi.md} +26 -30
- data/docs/GlossaryTermTranslationsApi.md +8 -10
- data/docs/GlossaryTermsApi.md +10 -14
- data/docs/InvitationsApi.md +11 -16
- data/docs/JobLocalesApi.md +12 -18
- data/docs/JobsApi.md +15 -24
- data/docs/KeysApi.md +18 -26
- data/docs/KeysSearchParameters.md +1 -1
- data/docs/KeysTagParameters.md +1 -1
- data/docs/KeysUntagParameters.md +1 -1
- data/docs/LocalesApi.md +13 -18
- data/docs/MembersApi.md +4 -8
- data/docs/OrdersApi.md +10 -14
- data/docs/ProjectCreateParameters.md +3 -1
- data/docs/ProjectsApi.md +10 -14
- data/docs/ReleasesApi.md +11 -16
- data/docs/ScreenshotMarkersApi.md +10 -14
- data/docs/ScreenshotsApi.md +10 -14
- data/docs/SpacesApi.md +13 -20
- data/docs/StyleGuidesApi.md +10 -14
- data/docs/TagsApi.md +9 -12
- data/docs/Team.md +29 -0
- data/docs/TeamCreateParameters.md +17 -0
- data/docs/TeamDetail.md +29 -0
- data/docs/TeamUpdateParameters.md +17 -0
- data/docs/TeamsApi.md +721 -0
- data/docs/TeamsProjectsCreateParameters.md +17 -0
- data/docs/TeamsSpacesCreateParameters.md +17 -0
- data/docs/TeamsUsersCreateParameters.md +17 -0
- data/docs/TranslationsApi.md +28 -44
- data/docs/TranslationsExcludeParameters.md +1 -1
- data/docs/TranslationsIncludeParameters.md +1 -1
- data/docs/TranslationsReviewParameters.md +1 -1
- data/docs/TranslationsSearchParameters.md +1 -1
- data/docs/TranslationsUnverifyParameters.md +1 -1
- data/docs/TranslationsVerifyParameters.md +1 -1
- data/docs/UploadCreateParameters.md +2 -2
- data/docs/UploadsApi.md +12 -10
- data/docs/UsersApi.md +1 -2
- data/docs/VersionsHistoryApi.md +2 -4
- data/docs/WebhooksApi.md +11 -16
- data/git_push.sh +2 -2
- data/lib/phrase.rb +9 -1
- data/lib/phrase/api/authorizations_api.rb +10 -8
- data/lib/phrase/api/bitbucket_sync_api.rb +3 -3
- data/lib/phrase/api/blacklisted_keys_api.rb +10 -8
- data/lib/phrase/api/branches_api.rb +16 -14
- data/lib/phrase/api/comments_api.rb +19 -17
- data/lib/phrase/api/distributions_api.rb +10 -8
- data/lib/phrase/api/git_lab_sync_api.rb +3 -3
- data/lib/phrase/api/{glossary_api.rb → glossaries_api.rb} +31 -29
- data/lib/phrase/api/glossary_term_translations_api.rb +10 -8
- data/lib/phrase/api/glossary_terms_api.rb +10 -8
- data/lib/phrase/api/invitations_api.rb +10 -8
- data/lib/phrase/api/job_locales_api.rb +10 -8
- data/lib/phrase/api/jobs_api.rb +13 -11
- data/lib/phrase/api/keys_api.rb +14 -12
- data/lib/phrase/api/locales_api.rb +15 -13
- data/lib/phrase/api/members_api.rb +3 -3
- data/lib/phrase/api/orders_api.rb +10 -8
- data/lib/phrase/api/projects_api.rb +10 -8
- data/lib/phrase/api/releases_api.rb +10 -8
- data/lib/phrase/api/screenshot_markers_api.rb +10 -8
- data/lib/phrase/api/screenshots_api.rb +10 -8
- data/lib/phrase/api/spaces_api.rb +16 -14
- data/lib/phrase/api/style_guides_api.rb +10 -8
- data/lib/phrase/api/tags_api.rb +10 -8
- data/lib/phrase/api/teams_api.rb +840 -0
- data/lib/phrase/api/translations_api.rb +13 -11
- data/lib/phrase/api/uploads_api.rb +13 -5
- data/lib/phrase/api/webhooks_api.rb +13 -11
- data/lib/phrase/models/keys_search_parameters.rb +1 -1
- data/lib/phrase/models/keys_tag_parameters.rb +1 -1
- data/lib/phrase/models/keys_untag_parameters.rb +1 -1
- data/lib/phrase/models/project_create_parameters.rb +14 -4
- data/lib/phrase/models/team.rb +254 -0
- data/lib/phrase/models/team_create_parameters.rb +195 -0
- data/lib/phrase/models/team_detail.rb +254 -0
- data/lib/phrase/models/team_update_parameters.rb +195 -0
- data/lib/phrase/models/teams_projects_create_parameters.rb +195 -0
- data/lib/phrase/models/teams_spaces_create_parameters.rb +195 -0
- data/lib/phrase/models/teams_users_create_parameters.rb +195 -0
- data/lib/phrase/models/translations_exclude_parameters.rb +1 -1
- data/lib/phrase/models/translations_include_parameters.rb +1 -1
- data/lib/phrase/models/translations_review_parameters.rb +1 -1
- data/lib/phrase/models/translations_search_parameters.rb +1 -1
- data/lib/phrase/models/translations_unverify_parameters.rb +1 -1
- data/lib/phrase/models/translations_verify_parameters.rb +1 -1
- data/lib/phrase/models/upload_create_parameters.rb +4 -8
- data/lib/phrase/version.rb +1 -1
- data/spec/api/authorizations_api_spec.rb +1 -1
- data/spec/api/blacklisted_keys_api_spec.rb +1 -1
- data/spec/api/branches_api_spec.rb +1 -1
- data/spec/api/comments_api_spec.rb +1 -1
- data/spec/api/distributions_api_spec.rb +1 -1
- data/spec/api/{glossary_api_spec.rb → glossaries_api_spec.rb} +7 -7
- data/spec/api/glossary_term_translations_api_spec.rb +1 -1
- data/spec/api/glossary_terms_api_spec.rb +1 -1
- data/spec/api/invitations_api_spec.rb +1 -1
- data/spec/api/job_locales_api_spec.rb +1 -1
- data/spec/api/jobs_api_spec.rb +1 -1
- data/spec/api/keys_api_spec.rb +3 -3
- data/spec/api/locales_api_spec.rb +2 -2
- data/spec/api/orders_api_spec.rb +1 -1
- data/spec/api/projects_api_spec.rb +1 -1
- data/spec/api/releases_api_spec.rb +1 -1
- data/spec/api/screenshot_markers_api_spec.rb +1 -1
- data/spec/api/screenshots_api_spec.rb +1 -1
- data/spec/api/spaces_api_spec.rb +1 -1
- data/spec/api/style_guides_api_spec.rb +1 -1
- data/spec/api/tags_api_spec.rb +1 -1
- data/spec/api/teams_api_spec.rb +185 -0
- data/spec/api/translations_api_spec.rb +4 -4
- data/spec/api/uploads_api_spec.rb +3 -1
- data/spec/api/webhooks_api_spec.rb +1 -1
- data/spec/models/project_create_parameters_spec.rb +6 -0
- data/spec/models/team_create_parameters_spec.rb +29 -0
- data/spec/models/team_detail_spec.rb +65 -0
- data/spec/models/team_spec.rb +65 -0
- data/spec/models/team_update_parameters_spec.rb +29 -0
- data/spec/models/teams_projects_create_parameters_spec.rb +29 -0
- data/spec/models/teams_spaces_create_parameters_spec.rb +29 -0
- data/spec/models/teams_users_create_parameters_spec.rb +29 -0
- metadata +183 -151
|
@@ -13,10 +13,10 @@ module Phrase
|
|
|
13
13
|
# @param translation_create_parameters [TranslationCreateParameters]
|
|
14
14
|
# @param [Hash] opts the optional parameters
|
|
15
15
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [TranslationDetails]
|
|
17
17
|
def translation_create(project_id, translation_create_parameters, opts = {})
|
|
18
|
-
translation_create_with_http_info(project_id, translation_create_parameters, opts)
|
|
19
|
-
|
|
18
|
+
data, _status_code, _headers = translation_create_with_http_info(project_id, translation_create_parameters, opts)
|
|
19
|
+
data
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Create a translation
|
|
@@ -25,7 +25,7 @@ module Phrase
|
|
|
25
25
|
# @param translation_create_parameters [TranslationCreateParameters]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
27
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
|
-
# @return [Array<(Response<(
|
|
28
|
+
# @return [Array<(Response<(TranslationDetails)>, Integer, Hash)>] Response<(TranslationDetails)> data, response status code and response headers
|
|
29
29
|
def translation_create_with_http_info(project_id, translation_create_parameters, opts = {})
|
|
30
30
|
if @api_client.config.debugging
|
|
31
31
|
@api_client.config.logger.debug 'Calling API: TranslationsApi.translation_create ...'
|
|
@@ -46,6 +46,8 @@ module Phrase
|
|
|
46
46
|
|
|
47
47
|
# header parameters
|
|
48
48
|
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
49
51
|
# HTTP header 'Content-Type'
|
|
50
52
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
51
53
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
@@ -57,7 +59,7 @@ module Phrase
|
|
|
57
59
|
post_body = opts[:body] || @api_client.object_to_http_body(translation_create_parameters)
|
|
58
60
|
|
|
59
61
|
# return_type
|
|
60
|
-
return_type = opts[:return_type]
|
|
62
|
+
return_type = opts[:return_type] || 'TranslationDetails'
|
|
61
63
|
|
|
62
64
|
# auth_names
|
|
63
65
|
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
@@ -645,7 +647,7 @@ module Phrase
|
|
|
645
647
|
# @option opts [String] :branch specify the branch to use
|
|
646
648
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
647
649
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
648
|
-
# @option opts [String] :q
|
|
650
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
649
651
|
# @return [Array<Translation>]
|
|
650
652
|
def translations_by_key(project_id, key_id, opts = {})
|
|
651
653
|
data, _status_code, _headers = translations_by_key_with_http_info(project_id, key_id, opts)
|
|
@@ -663,7 +665,7 @@ module Phrase
|
|
|
663
665
|
# @option opts [String] :branch specify the branch to use
|
|
664
666
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
665
667
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
666
|
-
# @option opts [String] :q
|
|
668
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
667
669
|
# @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
|
|
668
670
|
def translations_by_key_with_http_info(project_id, key_id, opts = {})
|
|
669
671
|
if @api_client.config.debugging
|
|
@@ -735,7 +737,7 @@ module Phrase
|
|
|
735
737
|
# @option opts [String] :branch specify the branch to use
|
|
736
738
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
737
739
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
738
|
-
# @option opts [String] :q
|
|
740
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
739
741
|
# @return [Array<Translation>]
|
|
740
742
|
def translations_by_locale(project_id, locale_id, opts = {})
|
|
741
743
|
data, _status_code, _headers = translations_by_locale_with_http_info(project_id, locale_id, opts)
|
|
@@ -753,7 +755,7 @@ module Phrase
|
|
|
753
755
|
# @option opts [String] :branch specify the branch to use
|
|
754
756
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
755
757
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
756
|
-
# @option opts [String] :q
|
|
758
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
757
759
|
# @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
|
|
758
760
|
def translations_by_locale_with_http_info(project_id, locale_id, opts = {})
|
|
759
761
|
if @api_client.config.debugging
|
|
@@ -972,7 +974,7 @@ module Phrase
|
|
|
972
974
|
# @option opts [String] :branch specify the branch to use
|
|
973
975
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
974
976
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
975
|
-
# @option opts [String] :q
|
|
977
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
976
978
|
# @return [Array<Translation>]
|
|
977
979
|
def translations_list(project_id, opts = {})
|
|
978
980
|
data, _status_code, _headers = translations_list_with_http_info(project_id, opts)
|
|
@@ -989,7 +991,7 @@ module Phrase
|
|
|
989
991
|
# @option opts [String] :branch specify the branch to use
|
|
990
992
|
# @option opts [String] :sort Sort criteria. Can be one of: key_name, created_at, updated_at.
|
|
991
993
|
# @option opts [String] :order Order direction. Can be one of: asc, desc.
|
|
992
|
-
# @option opts [String] :q
|
|
994
|
+
# @option opts [String] :q Specify a query to find translations by content (including wildcards).<br><br> The following qualifiers are supported in the query:<br> <ul> <li><code>id:translation_id,...</code> for queries on a comma-separated list of ids</li> <li><code>tags:XYZ</code> for tags on the translation</li> <li><code>unverified:{true|false}</code> for verification status</li> <li><code>excluded:{true|false}</code> for exclusion status</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
993
995
|
# @return [Array<(Response<(Array<Translation>)>, Integer, Hash)>] Response<(Array<Translation>)> data, response status code and response headers
|
|
994
996
|
def translations_list_with_http_info(project_id, opts = {})
|
|
995
997
|
if @api_client.config.debugging
|
|
@@ -23,12 +23,14 @@ module Phrase
|
|
|
23
23
|
# @option opts [Boolean] :skip_upload_tags Indicates whether the upload should not create upload tags.
|
|
24
24
|
# @option opts [Boolean] :skip_unverification Indicates whether the upload should unverify updated translations.
|
|
25
25
|
# @option opts [String] :file_encoding Enforces a specific encoding on the file contents. Valid options are \\\"UTF-8\\\", \\\"UTF-16\\\" and \\\"ISO-8859-1\\\".
|
|
26
|
+
# @option opts [Object] :locale_mapping Optional, format specific mapping between locale names and the columns the translations to those locales are contained in.
|
|
27
|
+
# @option opts [Object] :format_options Additional options available for specific formats. See our format guide for complete list.
|
|
26
28
|
# @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically.
|
|
27
29
|
# @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow (currently beta) is enabled for the project.
|
|
28
|
-
# @return [
|
|
30
|
+
# @return [Upload]
|
|
29
31
|
def upload_create(project_id, opts = {})
|
|
30
|
-
upload_create_with_http_info(project_id, opts)
|
|
31
|
-
|
|
32
|
+
data, _status_code, _headers = upload_create_with_http_info(project_id, opts)
|
|
33
|
+
data
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
# Upload a new file
|
|
@@ -47,9 +49,11 @@ module Phrase
|
|
|
47
49
|
# @option opts [Boolean] :skip_upload_tags Indicates whether the upload should not create upload tags.
|
|
48
50
|
# @option opts [Boolean] :skip_unverification Indicates whether the upload should unverify updated translations.
|
|
49
51
|
# @option opts [String] :file_encoding Enforces a specific encoding on the file contents. Valid options are \\\"UTF-8\\\", \\\"UTF-16\\\" and \\\"ISO-8859-1\\\".
|
|
52
|
+
# @option opts [Object] :locale_mapping Optional, format specific mapping between locale names and the columns the translations to those locales are contained in.
|
|
53
|
+
# @option opts [Object] :format_options Additional options available for specific formats. See our format guide for complete list.
|
|
50
54
|
# @option opts [Boolean] :autotranslate If set, translations for the uploaded language will be fetched automatically.
|
|
51
55
|
# @option opts [Boolean] :mark_reviewed Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow (currently beta) is enabled for the project.
|
|
52
|
-
# @return [Array<(Response<(
|
|
56
|
+
# @return [Array<(Response<(Upload)>, Integer, Hash)>] Response<(Upload)> data, response status code and response headers
|
|
53
57
|
def upload_create_with_http_info(project_id, opts = {})
|
|
54
58
|
if @api_client.config.debugging
|
|
55
59
|
@api_client.config.logger.debug 'Calling API: UploadsApi.upload_create ...'
|
|
@@ -66,6 +70,8 @@ module Phrase
|
|
|
66
70
|
|
|
67
71
|
# header parameters
|
|
68
72
|
header_params = opts[:header_params] || {}
|
|
73
|
+
# HTTP header 'Accept' (if needed)
|
|
74
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
69
75
|
# HTTP header 'Content-Type'
|
|
70
76
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
71
77
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
@@ -83,6 +89,8 @@ module Phrase
|
|
|
83
89
|
form_params['skip_upload_tags'] = opts[:'skip_upload_tags'] if !opts[:'skip_upload_tags'].nil?
|
|
84
90
|
form_params['skip_unverification'] = opts[:'skip_unverification'] if !opts[:'skip_unverification'].nil?
|
|
85
91
|
form_params['file_encoding'] = opts[:'file_encoding'] if !opts[:'file_encoding'].nil?
|
|
92
|
+
form_params['locale_mapping'] = opts[:'locale_mapping'] if !opts[:'locale_mapping'].nil?
|
|
93
|
+
form_params['format_options'] = opts[:'format_options'] if !opts[:'format_options'].nil?
|
|
86
94
|
form_params['autotranslate'] = opts[:'autotranslate'] if !opts[:'autotranslate'].nil?
|
|
87
95
|
form_params['mark_reviewed'] = opts[:'mark_reviewed'] if !opts[:'mark_reviewed'].nil?
|
|
88
96
|
|
|
@@ -90,7 +98,7 @@ module Phrase
|
|
|
90
98
|
post_body = opts[:body]
|
|
91
99
|
|
|
92
100
|
# return_type
|
|
93
|
-
return_type = opts[:return_type]
|
|
101
|
+
return_type = opts[:return_type] || 'Upload'
|
|
94
102
|
|
|
95
103
|
# auth_names
|
|
96
104
|
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
@@ -13,10 +13,10 @@ module Phrase
|
|
|
13
13
|
# @param webhook_create_parameters [WebhookCreateParameters]
|
|
14
14
|
# @param [Hash] opts the optional parameters
|
|
15
15
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
16
|
-
# @return [
|
|
16
|
+
# @return [Webhook]
|
|
17
17
|
def webhook_create(project_id, webhook_create_parameters, opts = {})
|
|
18
|
-
webhook_create_with_http_info(project_id, webhook_create_parameters, opts)
|
|
19
|
-
|
|
18
|
+
data, _status_code, _headers = webhook_create_with_http_info(project_id, webhook_create_parameters, opts)
|
|
19
|
+
data
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
# Create a webhook
|
|
@@ -25,7 +25,7 @@ module Phrase
|
|
|
25
25
|
# @param webhook_create_parameters [WebhookCreateParameters]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
27
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
28
|
-
# @return [Array<(Response<(
|
|
28
|
+
# @return [Array<(Response<(Webhook)>, Integer, Hash)>] Response<(Webhook)> data, response status code and response headers
|
|
29
29
|
def webhook_create_with_http_info(project_id, webhook_create_parameters, opts = {})
|
|
30
30
|
if @api_client.config.debugging
|
|
31
31
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_create ...'
|
|
@@ -46,6 +46,8 @@ module Phrase
|
|
|
46
46
|
|
|
47
47
|
# header parameters
|
|
48
48
|
header_params = opts[:header_params] || {}
|
|
49
|
+
# HTTP header 'Accept' (if needed)
|
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
49
51
|
# HTTP header 'Content-Type'
|
|
50
52
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
51
53
|
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?
|
|
@@ -57,7 +59,7 @@ module Phrase
|
|
|
57
59
|
post_body = opts[:body] || @api_client.object_to_http_body(webhook_create_parameters)
|
|
58
60
|
|
|
59
61
|
# return_type
|
|
60
|
-
return_type = opts[:return_type]
|
|
62
|
+
return_type = opts[:return_type] || 'Webhook'
|
|
61
63
|
|
|
62
64
|
# auth_names
|
|
63
65
|
auth_names = opts[:auth_names] || ['Basic', 'Token']
|
|
@@ -87,8 +89,8 @@ module Phrase
|
|
|
87
89
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
88
90
|
# @return [nil]
|
|
89
91
|
def webhook_delete(project_id, id, opts = {})
|
|
90
|
-
webhook_delete_with_http_info(project_id, id, opts)
|
|
91
|
-
|
|
92
|
+
data, _status_code, _headers = webhook_delete_with_http_info(project_id, id, opts)
|
|
93
|
+
data
|
|
92
94
|
end
|
|
93
95
|
|
|
94
96
|
# Delete a webhook
|
|
@@ -97,7 +99,7 @@ module Phrase
|
|
|
97
99
|
# @param id [String] ID
|
|
98
100
|
# @param [Hash] opts the optional parameters
|
|
99
101
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
100
|
-
# @return [Array<(Response
|
|
102
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
101
103
|
def webhook_delete_with_http_info(project_id, id, opts = {})
|
|
102
104
|
if @api_client.config.debugging
|
|
103
105
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_delete ...'
|
|
@@ -229,8 +231,8 @@ module Phrase
|
|
|
229
231
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
230
232
|
# @return [nil]
|
|
231
233
|
def webhook_test(project_id, id, opts = {})
|
|
232
|
-
webhook_test_with_http_info(project_id, id, opts)
|
|
233
|
-
|
|
234
|
+
data, _status_code, _headers = webhook_test_with_http_info(project_id, id, opts)
|
|
235
|
+
data
|
|
234
236
|
end
|
|
235
237
|
|
|
236
238
|
# Test a webhook
|
|
@@ -239,7 +241,7 @@ module Phrase
|
|
|
239
241
|
# @param id [String] ID
|
|
240
242
|
# @param [Hash] opts the optional parameters
|
|
241
243
|
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
|
|
242
|
-
# @return [Array<(Response
|
|
244
|
+
# @return [Array<(Response, Integer, Hash)>] Response<(nil, response status code and response headers
|
|
243
245
|
def webhook_test_with_http_info(project_id, id, opts = {})
|
|
244
246
|
if @api_client.config.debugging
|
|
245
247
|
@api_client.config.logger.debug 'Calling API: WebhooksApi.webhook_test ...'
|
|
@@ -11,7 +11,7 @@ module Phrase
|
|
|
11
11
|
# Order direction. Can be one of: asc, desc.
|
|
12
12
|
attr_accessor :order
|
|
13
13
|
|
|
14
|
-
#
|
|
14
|
+
# Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - whitespaces need to be prefixed with a backspace (\\\"\\\\\\\")</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
15
15
|
attr_accessor :q
|
|
16
16
|
|
|
17
17
|
# Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
|
|
@@ -5,7 +5,7 @@ module Phrase
|
|
|
5
5
|
# specify the branch to use
|
|
6
6
|
attr_accessor :branch
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - whitespaces need to be prefixed with a backspace (\\\"\\\\\\\")</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
9
9
|
attr_accessor :q
|
|
10
10
|
|
|
11
11
|
# Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
|
|
@@ -5,7 +5,7 @@ module Phrase
|
|
|
5
5
|
# specify the branch to use
|
|
6
6
|
attr_accessor :branch
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# Specify a query to do broad search for keys by name (including wildcards).<br><br> The following qualifiers are also supported in the search term:<br> <ul> <li><code>ids:key_id,...</code> for queries on a comma-separated list of ids</li> <li><code>name:key_name</code> for text queries on exact key names - whitespaces need to be prefixed with a backspace (\\\"\\\\\\\")</li> <li><code>tags:tag_name</code> to filter for keys with certain tags</li> <li><code>translated:{true|false}</code> for translation status (also requires <code>locale_id</code> to be specified)</li> <li><code>updated_at:{>=|<=}2013-02-21T00:00:00Z</code> for date range queries</li> <li><code>unmentioned_in_upload:upload_id</code> to filter keys unmentioned within upload</li> </ul> Find more examples <a href=\"#overview--usage-examples\">here</a>.
|
|
9
9
|
attr_accessor :q
|
|
10
10
|
|
|
11
11
|
# Locale used to determine the translation state of a key when filtering for untranslated or translated keys.
|
|
@@ -20,6 +20,9 @@ module Phrase
|
|
|
20
20
|
# Account ID to specify the actual account the project should be created in. Required if the requesting user is a member of multiple accounts.
|
|
21
21
|
attr_accessor :account_id
|
|
22
22
|
|
|
23
|
+
# When a source project ID is given, a clone of that project will be created, including all locales, keys and translations as well as the main project settings if they are not defined otherwise through the params.
|
|
24
|
+
attr_accessor :source_project_id
|
|
25
|
+
|
|
23
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
27
|
def self.attribute_map
|
|
25
28
|
{
|
|
@@ -28,7 +31,8 @@ module Phrase
|
|
|
28
31
|
:'shares_translation_memory' => :'shares_translation_memory',
|
|
29
32
|
:'project_image' => :'project_image',
|
|
30
33
|
:'remove_project_image' => :'remove_project_image',
|
|
31
|
-
:'account_id' => :'account_id'
|
|
34
|
+
:'account_id' => :'account_id',
|
|
35
|
+
:'source_project_id' => :'source_project_id'
|
|
32
36
|
}
|
|
33
37
|
end
|
|
34
38
|
|
|
@@ -40,7 +44,8 @@ module Phrase
|
|
|
40
44
|
:'shares_translation_memory' => :'Boolean',
|
|
41
45
|
:'project_image' => :'File',
|
|
42
46
|
:'remove_project_image' => :'Boolean',
|
|
43
|
-
:'account_id' => :'String'
|
|
47
|
+
:'account_id' => :'String',
|
|
48
|
+
:'source_project_id' => :'String'
|
|
44
49
|
}
|
|
45
50
|
end
|
|
46
51
|
|
|
@@ -88,6 +93,10 @@ module Phrase
|
|
|
88
93
|
if attributes.key?(:'account_id')
|
|
89
94
|
self.account_id = attributes[:'account_id']
|
|
90
95
|
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'source_project_id')
|
|
98
|
+
self.source_project_id = attributes[:'source_project_id']
|
|
99
|
+
end
|
|
91
100
|
end
|
|
92
101
|
|
|
93
102
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -113,7 +122,8 @@ module Phrase
|
|
|
113
122
|
shares_translation_memory == o.shares_translation_memory &&
|
|
114
123
|
project_image == o.project_image &&
|
|
115
124
|
remove_project_image == o.remove_project_image &&
|
|
116
|
-
account_id == o.account_id
|
|
125
|
+
account_id == o.account_id &&
|
|
126
|
+
source_project_id == o.source_project_id
|
|
117
127
|
end
|
|
118
128
|
|
|
119
129
|
# @see the `==` method
|
|
@@ -125,7 +135,7 @@ module Phrase
|
|
|
125
135
|
# Calculates hash code according to all attributes.
|
|
126
136
|
# @return [Integer] Hash code
|
|
127
137
|
def hash
|
|
128
|
-
[name, main_format, shares_translation_memory, project_image, remove_project_image, account_id].hash
|
|
138
|
+
[name, main_format, shares_translation_memory, project_image, remove_project_image, account_id, source_project_id].hash
|
|
129
139
|
end
|
|
130
140
|
|
|
131
141
|
# Builds the object from hash
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
require 'date'
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
class Team
|
|
5
|
+
attr_accessor :id
|
|
6
|
+
|
|
7
|
+
attr_accessor :name
|
|
8
|
+
|
|
9
|
+
attr_accessor :created_at
|
|
10
|
+
|
|
11
|
+
attr_accessor :updated_at
|
|
12
|
+
|
|
13
|
+
attr_accessor :projects
|
|
14
|
+
|
|
15
|
+
attr_accessor :spaces
|
|
16
|
+
|
|
17
|
+
attr_accessor :users
|
|
18
|
+
|
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
20
|
+
def self.attribute_map
|
|
21
|
+
{
|
|
22
|
+
:'id' => :'id',
|
|
23
|
+
:'name' => :'name',
|
|
24
|
+
:'created_at' => :'created_at',
|
|
25
|
+
:'updated_at' => :'updated_at',
|
|
26
|
+
:'projects' => :'projects',
|
|
27
|
+
:'spaces' => :'spaces',
|
|
28
|
+
:'users' => :'users'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'id' => :'String',
|
|
36
|
+
:'name' => :'String',
|
|
37
|
+
:'created_at' => :'DateTime',
|
|
38
|
+
:'updated_at' => :'DateTime',
|
|
39
|
+
:'projects' => :'Array<Project>',
|
|
40
|
+
:'spaces' => :'Array<Space>',
|
|
41
|
+
:'users' => :'Array<UserPreview>'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::Team` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::Team`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'id')
|
|
67
|
+
self.id = attributes[:'id']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'name')
|
|
71
|
+
self.name = attributes[:'name']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'created_at')
|
|
75
|
+
self.created_at = attributes[:'created_at']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'updated_at')
|
|
79
|
+
self.updated_at = attributes[:'updated_at']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'projects')
|
|
83
|
+
if (value = attributes[:'projects']).is_a?(Array)
|
|
84
|
+
self.projects = value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'spaces')
|
|
89
|
+
if (value = attributes[:'spaces']).is_a?(Array)
|
|
90
|
+
self.spaces = value
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'users')
|
|
95
|
+
if (value = attributes[:'users']).is_a?(Array)
|
|
96
|
+
self.users = value
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
102
|
+
# @return Array for valid properties with the reasons
|
|
103
|
+
def list_invalid_properties
|
|
104
|
+
invalid_properties = Array.new
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
true
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Checks equality by comparing each attribute.
|
|
115
|
+
# @param [Object] Object to be compared
|
|
116
|
+
def ==(o)
|
|
117
|
+
return true if self.equal?(o)
|
|
118
|
+
self.class == o.class &&
|
|
119
|
+
id == o.id &&
|
|
120
|
+
name == o.name &&
|
|
121
|
+
created_at == o.created_at &&
|
|
122
|
+
updated_at == o.updated_at &&
|
|
123
|
+
projects == o.projects &&
|
|
124
|
+
spaces == o.spaces &&
|
|
125
|
+
users == o.users
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# @see the `==` method
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def eql?(o)
|
|
131
|
+
self == o
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Calculates hash code according to all attributes.
|
|
135
|
+
# @return [Integer] Hash code
|
|
136
|
+
def hash
|
|
137
|
+
[id, name, created_at, updated_at, projects, spaces, users].hash
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Builds the object from hash
|
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
142
|
+
# @return [Object] Returns the model itself
|
|
143
|
+
def self.build_from_hash(attributes)
|
|
144
|
+
new.build_from_hash(attributes)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Builds the object from hash
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
# @return [Object] Returns the model itself
|
|
150
|
+
def build_from_hash(attributes)
|
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
|
152
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
153
|
+
if type =~ /\AArray<(.*)>/i
|
|
154
|
+
# check to ensure the input is an array given that the attribute
|
|
155
|
+
# is documented as an array but the input is not
|
|
156
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
157
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
158
|
+
end
|
|
159
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
160
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
161
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
self
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Deserializes the data based on type
|
|
168
|
+
# @param string type Data type
|
|
169
|
+
# @param string value Value to be deserialized
|
|
170
|
+
# @return [Object] Deserialized data
|
|
171
|
+
def _deserialize(type, value)
|
|
172
|
+
case type.to_sym
|
|
173
|
+
when :DateTime
|
|
174
|
+
DateTime.parse(value)
|
|
175
|
+
when :Date
|
|
176
|
+
Date.parse(value)
|
|
177
|
+
when :String
|
|
178
|
+
value.to_s
|
|
179
|
+
when :Integer
|
|
180
|
+
value.to_i
|
|
181
|
+
when :Float
|
|
182
|
+
value.to_f
|
|
183
|
+
when :Boolean
|
|
184
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
185
|
+
true
|
|
186
|
+
else
|
|
187
|
+
false
|
|
188
|
+
end
|
|
189
|
+
when :Object
|
|
190
|
+
# generic object (usually a Hash), return directly
|
|
191
|
+
value
|
|
192
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
193
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
194
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
195
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
196
|
+
k_type = Regexp.last_match[:k_type]
|
|
197
|
+
v_type = Regexp.last_match[:v_type]
|
|
198
|
+
{}.tap do |hash|
|
|
199
|
+
value.each do |k, v|
|
|
200
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
else # model
|
|
204
|
+
Phrase.const_get(type).build_from_hash(value)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Returns the string representation of the object
|
|
209
|
+
# @return [String] String presentation of the object
|
|
210
|
+
def to_s
|
|
211
|
+
to_hash.to_s
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_body
|
|
217
|
+
to_hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Returns the object in the form of hash
|
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
|
222
|
+
def to_hash
|
|
223
|
+
hash = {}
|
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
225
|
+
value = self.send(attr)
|
|
226
|
+
if value.nil?
|
|
227
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
228
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
hash[param] = _to_hash(value)
|
|
232
|
+
end
|
|
233
|
+
hash
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Outputs non-array value in the form of hash
|
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
238
|
+
# @param [Object] value Any valid value
|
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
|
240
|
+
def _to_hash(value)
|
|
241
|
+
if value.is_a?(Array)
|
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
|
243
|
+
elsif value.is_a?(Hash)
|
|
244
|
+
{}.tap do |hash|
|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
246
|
+
end
|
|
247
|
+
elsif value.respond_to? :to_hash
|
|
248
|
+
value.to_hash
|
|
249
|
+
else
|
|
250
|
+
value
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
end
|