ruby-lokalise-api 5.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/base_request.rb +4 -4
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/client.rb +24 -24
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/base.rb +10 -10
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/branch.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/contributor.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/custom_translation_status.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/file.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key.rb +2 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key_comment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/order.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/payment_card.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_comment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_language.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/queued_process.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/screenshot.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/segment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/snapshot.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/system_language.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/task.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user_group.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation_provider.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/webhook.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/connection.rb +2 -2
- data/lib/ruby_lokalise_api/data/attributes.yml +235 -0
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/error.rb +14 -14
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/json_handler.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/auth.rb +2 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/connection.rb +2 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/request.rb +3 -3
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2_client.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/request.rb +3 -3
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/base.rb +8 -8
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/branch.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/contributor.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/custom_translation_status.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/file.rb +2 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key_comment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/order.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/payment_card.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_comment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_language.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/queued_process.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/screenshot.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/segment.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/snapshot.rb +2 -2
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/system_language.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/task.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_billing_details.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_group.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation_provider.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/webhook.rb +1 -1
- data/lib/ruby_lokalise_api/rest/branches.rb +69 -0
- data/lib/ruby_lokalise_api/rest/comments.rb +61 -0
- data/lib/ruby_lokalise_api/rest/contributors.rb +58 -0
- data/lib/ruby_lokalise_api/rest/custom_translation_statuses.rb +67 -0
- data/lib/ruby_lokalise_api/rest/files.rb +38 -0
- data/lib/ruby_lokalise_api/rest/keys.rb +79 -0
- data/lib/ruby_lokalise_api/rest/languages.rb +67 -0
- data/lib/ruby_lokalise_api/rest/orders.rb +37 -0
- data/lib/ruby_lokalise_api/rest/payment_cards.rb +43 -0
- data/lib/ruby_lokalise_api/rest/projects.rb +62 -0
- data/lib/ruby_lokalise_api/rest/queued_processes.rb +28 -0
- data/lib/ruby_lokalise_api/rest/screenshots.rb +58 -0
- data/lib/ruby_lokalise_api/rest/segments.rb +45 -0
- data/lib/ruby_lokalise_api/rest/snapshots.rb +47 -0
- data/lib/ruby_lokalise_api/rest/tasks.rb +58 -0
- data/lib/ruby_lokalise_api/rest/team_user_billing_details.rb +36 -0
- data/lib/ruby_lokalise_api/rest/team_user_groups.rb +109 -0
- data/lib/ruby_lokalise_api/rest/team_users.rb +48 -0
- data/lib/ruby_lokalise_api/rest/teams.rb +16 -0
- data/lib/ruby_lokalise_api/rest/translation_providers.rb +27 -0
- data/lib/ruby_lokalise_api/rest/translations.rb +39 -0
- data/lib/ruby_lokalise_api/rest/webhooks.rb +69 -0
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/attribute_helpers.rb +7 -7
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/endpoint_helpers.rb +1 -1
- data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/string_utils.rb +1 -1
- data/lib/ruby_lokalise_api/version.rb +5 -0
- data/lib/ruby_lokalise_api.rb +50 -0
- data/ruby-lokalise-api.gemspec +6 -5
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/branches_spec.rb +5 -5
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/comments_spec.rb +7 -7
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/contributors_spec.rb +9 -9
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/custom_translation_statuses_spec.rb +7 -7
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/files_spec.rb +2 -2
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/keys_spec.rb +14 -14
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/languages_spec.rb +4 -4
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/orders_spec.rb +1 -1
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/payment_cards_spec.rb +7 -7
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/projects_spec.rb +10 -10
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/queued_processes_spec.rb +1 -1
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/screenshots_spec.rb +3 -3
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/segments_spec.rb +4 -4
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/snapshots_spec.rb +8 -8
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/tasks_spec.rb +12 -12
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_user_billing_details_spec.rb +1 -1
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_user_groups_spec.rb +7 -7
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_users_spec.rb +3 -3
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/teams_spec.rb +1 -1
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/translation_providers_spec.rb +2 -2
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/translations_spec.rb +10 -10
- data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/webhooks_spec.rb +2 -2
- data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/connection_spec.rb +8 -8
- data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/custom_json_parser_spec.rb +3 -3
- data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/error_spec.rb +10 -10
- data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/auth_spec.rb +3 -3
- data/spec/lib/{ruby-lokalise-api_spec.rb → ruby_lokalise_api_spec.rb} +5 -5
- data/spec/spec_helper.rb +1 -1
- data/spec/support/test_client.rb +3 -3
- metadata +163 -149
- data/lib/ruby-lokalise-api/data/attributes.json +0 -259
- data/lib/ruby-lokalise-api/rest/branches.rb +0 -67
- data/lib/ruby-lokalise-api/rest/comments.rb +0 -59
- data/lib/ruby-lokalise-api/rest/contributors.rb +0 -56
- data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +0 -65
- data/lib/ruby-lokalise-api/rest/files.rb +0 -36
- data/lib/ruby-lokalise-api/rest/keys.rb +0 -77
- data/lib/ruby-lokalise-api/rest/languages.rb +0 -65
- data/lib/ruby-lokalise-api/rest/orders.rb +0 -35
- data/lib/ruby-lokalise-api/rest/payment_cards.rb +0 -41
- data/lib/ruby-lokalise-api/rest/projects.rb +0 -60
- data/lib/ruby-lokalise-api/rest/queued_processes.rb +0 -26
- data/lib/ruby-lokalise-api/rest/screenshots.rb +0 -56
- data/lib/ruby-lokalise-api/rest/segments.rb +0 -43
- data/lib/ruby-lokalise-api/rest/snapshots.rb +0 -45
- data/lib/ruby-lokalise-api/rest/tasks.rb +0 -56
- data/lib/ruby-lokalise-api/rest/team_user_billing_details.rb +0 -34
- data/lib/ruby-lokalise-api/rest/team_user_group.rb +0 -107
- data/lib/ruby-lokalise-api/rest/team_users.rb +0 -46
- data/lib/ruby-lokalise-api/rest/teams.rb +0 -14
- data/lib/ruby-lokalise-api/rest/translation_providers.rb +0 -25
- data/lib/ruby-lokalise-api/rest/translations.rb +0 -37
- data/lib/ruby-lokalise-api/rest/webhooks.rb +0 -67
- data/lib/ruby-lokalise-api/version.rb +0 -5
- data/lib/ruby-lokalise-api.rb +0 -111
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d5ba084b81ce5556b416a397dcd0cb7e848614e84560bd1ac970275351abc52
|
4
|
+
data.tar.gz: 7d4a692fa26ce75ec6a77ea83d8ddd450ff7f4da268000213493c5ec8d061d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337aed88381630bf1f547dedd002e3081b3ee6100747ea74892cec4a368c559f70c3c008ab9925450ef9859db8f6ec25a00fc87813d74df19bc691eecbc2a34c
|
7
|
+
data.tar.gz: 55768797e44e4c7c416271eab0504cfb5ccb1655c7ae7f9f6f61ae49eb381c3bb49979f6e5fb9493c1fbcbe7d122fc1c8a934658f262ed31e37e2b662a36cbb0
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Obtain an API token in your [personal profile](https://lokalise.com/profile#apit
|
|
22
22
|
```ruby
|
23
23
|
require 'ruby-lokalise-api'
|
24
24
|
|
25
|
-
@client =
|
25
|
+
@client = RubyLokaliseApi.client 'YOUR_TOKEN_HERE'
|
26
26
|
```
|
27
27
|
|
28
28
|
Now the `@client` can be used to perform API requests:
|
@@ -42,9 +42,11 @@ process.status
|
|
42
42
|
Alternatively instantiate your client with an [OAuth2 token](http://docs.lokalise.com/en/articles/5574713-oauth-2):
|
43
43
|
|
44
44
|
```ruby
|
45
|
-
@client =
|
45
|
+
@client = RubyLokaliseApi.oauth2_client 'YOUR_OAUTH2_TOKEN_HERE'
|
46
46
|
```
|
47
47
|
|
48
|
+
Learn how to generate an OAuth2 token [in the docs](https://lokalise.github.io/ruby-lokalise-api/additional_info/oauth2).
|
49
|
+
|
48
50
|
## Usage
|
49
51
|
|
50
52
|
Detailed documentation can be found at [lokalise.github.io/ruby-lokalise-api](https://lokalise.github.io/ruby-lokalise-api/).
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module RubyLokaliseApi
|
4
4
|
module BaseRequest
|
5
|
-
include
|
5
|
+
include RubyLokaliseApi::JsonHandler
|
6
6
|
|
7
7
|
private
|
8
8
|
|
@@ -16,9 +16,9 @@ module Lokalise
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def respond_with_error(code, body)
|
19
|
-
raise(
|
19
|
+
raise(RubyLokaliseApi::Error, body['error'] || body) unless RubyLokaliseApi::Error::ERRORS.key? code
|
20
20
|
|
21
|
-
raise
|
21
|
+
raise RubyLokaliseApi::Error::ERRORS[code].from_response(body)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require 'ruby-lokalise-api/rest/languages'
|
5
|
-
require 'ruby-lokalise-api/rest/teams'
|
6
|
-
require 'ruby-lokalise-api/rest/projects'
|
7
|
-
require 'ruby-lokalise-api/rest/queued_processes'
|
8
|
-
require 'ruby-lokalise-api/rest/comments'
|
9
|
-
require 'ruby-lokalise-api/rest/keys'
|
10
|
-
require 'ruby-lokalise-api/rest/contributors'
|
11
|
-
require 'ruby-lokalise-api/rest/files'
|
12
|
-
require 'ruby-lokalise-api/rest/translations'
|
13
|
-
require 'ruby-lokalise-api/rest/team_users'
|
14
|
-
require 'ruby-lokalise-api/rest/tasks'
|
15
|
-
require 'ruby-lokalise-api/rest/snapshots'
|
16
|
-
require 'ruby-lokalise-api/rest/screenshots'
|
17
|
-
require 'ruby-lokalise-api/rest/orders'
|
18
|
-
require 'ruby-lokalise-api/rest/payment_cards'
|
19
|
-
require 'ruby-lokalise-api/rest/translation_providers'
|
20
|
-
require 'ruby-lokalise-api/rest/team_user_group'
|
21
|
-
require 'ruby-lokalise-api/rest/custom_translation_statuses'
|
22
|
-
require 'ruby-lokalise-api/rest/webhooks'
|
23
|
-
require 'ruby-lokalise-api/rest/segments'
|
24
|
-
require 'ruby-lokalise-api/rest/team_user_billing_details'
|
25
|
-
|
26
|
-
module Lokalise
|
3
|
+
module RubyLokaliseApi
|
27
4
|
class Client
|
5
|
+
include RubyLokaliseApi::Rest::Branches
|
6
|
+
include RubyLokaliseApi::Rest::Comments
|
7
|
+
include RubyLokaliseApi::Rest::Contributors
|
8
|
+
include RubyLokaliseApi::Rest::CustomTranslationStatuses
|
9
|
+
include RubyLokaliseApi::Rest::Files
|
10
|
+
include RubyLokaliseApi::Rest::Keys
|
11
|
+
include RubyLokaliseApi::Rest::Languages
|
12
|
+
include RubyLokaliseApi::Rest::Orders
|
13
|
+
include RubyLokaliseApi::Rest::PaymentCards
|
14
|
+
include RubyLokaliseApi::Rest::Projects
|
15
|
+
include RubyLokaliseApi::Rest::QueuedProcesses
|
16
|
+
include RubyLokaliseApi::Rest::Screenshots
|
17
|
+
include RubyLokaliseApi::Rest::Segments
|
18
|
+
include RubyLokaliseApi::Rest::Snapshots
|
19
|
+
include RubyLokaliseApi::Rest::Tasks
|
20
|
+
include RubyLokaliseApi::Rest::TeamUserBillingDetails
|
21
|
+
include RubyLokaliseApi::Rest::TeamUserGroups
|
22
|
+
include RubyLokaliseApi::Rest::TeamUsers
|
23
|
+
include RubyLokaliseApi::Rest::Teams
|
24
|
+
include RubyLokaliseApi::Rest::TranslationProviders
|
25
|
+
include RubyLokaliseApi::Rest::Translations
|
26
|
+
include RubyLokaliseApi::Rest::Webhooks
|
27
|
+
|
28
28
|
attr_reader :token, :token_header
|
29
29
|
attr_accessor :timeout, :open_timeout
|
30
30
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module RubyLokaliseApi
|
4
4
|
module Collections
|
5
5
|
class Base
|
6
|
-
using
|
6
|
+
using RubyLokaliseApi::Utils::StringUtils
|
7
7
|
|
8
|
-
extend
|
9
|
-
extend
|
10
|
-
include
|
11
|
-
extend
|
8
|
+
extend RubyLokaliseApi::Request
|
9
|
+
extend RubyLokaliseApi::Utils::AttributeHelpers
|
10
|
+
include RubyLokaliseApi::Utils::AttributeHelpers
|
11
|
+
extend RubyLokaliseApi::Utils::EndpointHelpers
|
12
12
|
|
13
13
|
attr_reader :total_pages, :total_results, :results_per_page, :current_page, :collection,
|
14
14
|
:project_id, :team_id, :request_params, :client, :path, :branch, :user_id
|
@@ -17,7 +17,7 @@ module Lokalise
|
|
17
17
|
#
|
18
18
|
# @param response [Hash]
|
19
19
|
# @param params [Hash]
|
20
|
-
# @return [
|
20
|
+
# @return [RubyLokaliseApi::Collections::Base]
|
21
21
|
def initialize(response, params = {})
|
22
22
|
produce_collection_for response
|
23
23
|
populate_pagination_data_for response
|
@@ -94,9 +94,9 @@ module Lokalise
|
|
94
94
|
# Fetch collection data and instantiate an individual resource for each object
|
95
95
|
# We also preserve the `client` to be able to chain API methods later
|
96
96
|
@collection = response['content'][data_key_plural].map do |raw_model|
|
97
|
-
Module.const_get("
|
98
|
-
|
99
|
-
|
97
|
+
Module.const_get("RubyLokaliseApi::Resources::#{model_class}").new 'content' => raw_model,
|
98
|
+
'client' => response['client'],
|
99
|
+
'base_path' => response['path']
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module RubyLokaliseApi
|
4
4
|
module Collections
|
5
5
|
class Key < Base
|
6
6
|
# Destroys all keys in the collection
|
7
7
|
# @return [Hash]
|
8
8
|
def destroy_all
|
9
9
|
keys = collection.map(&:key_id)
|
10
|
-
|
10
|
+
RubyLokaliseApi::Resources::Key.destroy @client, @path, keys: keys
|
11
11
|
end
|
12
12
|
|
13
13
|
class << self
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module RubyLokaliseApi
|
4
4
|
module Connection
|
5
5
|
BASE_URL = 'https://api.lokalise.com/api2/'
|
6
6
|
|
@@ -17,7 +17,7 @@ module Lokalise
|
|
17
17
|
{
|
18
18
|
headers: {
|
19
19
|
accept: 'application/json',
|
20
|
-
user_agent: "ruby-lokalise-api gem/#{
|
20
|
+
user_agent: "ruby-lokalise-api gem/#{RubyLokaliseApi::VERSION}",
|
21
21
|
accept_encoding: 'gzip,deflate,br',
|
22
22
|
client.token_header => client.token
|
23
23
|
},
|
@@ -0,0 +1,235 @@
|
|
1
|
+
branch:
|
2
|
+
- branch_id
|
3
|
+
- name
|
4
|
+
- created_at
|
5
|
+
- created_at_timestamp
|
6
|
+
- created_by
|
7
|
+
- created_by_email
|
8
|
+
comment:
|
9
|
+
- comment_id
|
10
|
+
- key_id
|
11
|
+
- comment
|
12
|
+
- added_by
|
13
|
+
- added_by_email
|
14
|
+
- added_at
|
15
|
+
- added_at_timestamp
|
16
|
+
contributor:
|
17
|
+
- user_id
|
18
|
+
- email
|
19
|
+
- fullname
|
20
|
+
- created_at
|
21
|
+
- created_at_timestamp
|
22
|
+
- is_admin
|
23
|
+
- is_reviewer
|
24
|
+
- languages
|
25
|
+
- admin_rights
|
26
|
+
custom_translation_status:
|
27
|
+
- status_id
|
28
|
+
- title
|
29
|
+
- color
|
30
|
+
file:
|
31
|
+
- filename
|
32
|
+
- key_count
|
33
|
+
key:
|
34
|
+
- key_id
|
35
|
+
- created_at
|
36
|
+
- created_at_timestamp
|
37
|
+
- key_name
|
38
|
+
- filenames
|
39
|
+
- description
|
40
|
+
- platforms
|
41
|
+
- tags
|
42
|
+
- comments
|
43
|
+
- screenshots
|
44
|
+
- translations
|
45
|
+
- is_plural
|
46
|
+
- plural_name
|
47
|
+
- is_hidden
|
48
|
+
- is_archived
|
49
|
+
- context
|
50
|
+
- base_words
|
51
|
+
- char_limit
|
52
|
+
- custom_attributes
|
53
|
+
- modified_at
|
54
|
+
- modified_at_timestamp
|
55
|
+
- translations_modified_at
|
56
|
+
- translations_modified_at_timestamp
|
57
|
+
language:
|
58
|
+
- lang_id
|
59
|
+
- lang_iso
|
60
|
+
- lang_name
|
61
|
+
- is_rtl
|
62
|
+
- plural_forms
|
63
|
+
order:
|
64
|
+
- order_id
|
65
|
+
- project_id
|
66
|
+
- card_id
|
67
|
+
- status
|
68
|
+
- created_at
|
69
|
+
- created_at_timestamp
|
70
|
+
- created_by
|
71
|
+
- created_by_email
|
72
|
+
- source_language_iso
|
73
|
+
- target_language_isos
|
74
|
+
- keys
|
75
|
+
- source_words
|
76
|
+
- provider_slug
|
77
|
+
- translation_style
|
78
|
+
- translation_tier
|
79
|
+
- translation_tier_name
|
80
|
+
- briefing
|
81
|
+
- total
|
82
|
+
- payment_method
|
83
|
+
- dry_run
|
84
|
+
payment_card:
|
85
|
+
- card_id
|
86
|
+
- last4
|
87
|
+
- brand
|
88
|
+
- created_at
|
89
|
+
- created_at_timestamp
|
90
|
+
project:
|
91
|
+
- project_id
|
92
|
+
- name
|
93
|
+
- description
|
94
|
+
- created_at
|
95
|
+
- created_at_timestamp
|
96
|
+
- created_by
|
97
|
+
- created_by_email
|
98
|
+
- team_id
|
99
|
+
- base_language_id
|
100
|
+
- base_language_iso
|
101
|
+
- settings
|
102
|
+
- statistics
|
103
|
+
queued_process:
|
104
|
+
- process_id
|
105
|
+
- type
|
106
|
+
- status
|
107
|
+
- message
|
108
|
+
- created_by
|
109
|
+
- created_by_email
|
110
|
+
- created_at
|
111
|
+
- created_at_timestamp
|
112
|
+
- details
|
113
|
+
screenshot:
|
114
|
+
- screenshot_id
|
115
|
+
- key_ids
|
116
|
+
- url
|
117
|
+
- title
|
118
|
+
- description
|
119
|
+
- screenshot_tags
|
120
|
+
- width
|
121
|
+
- height
|
122
|
+
- created_at
|
123
|
+
- created_at_timestamp
|
124
|
+
segment:
|
125
|
+
- segment_number
|
126
|
+
- language_iso
|
127
|
+
- modified_at
|
128
|
+
- modified_at_timestamp
|
129
|
+
- modified_by
|
130
|
+
- modified_by_email
|
131
|
+
- value
|
132
|
+
- is_fuzzy
|
133
|
+
- is_reviewed
|
134
|
+
- reviewed_by
|
135
|
+
- words
|
136
|
+
- custom_translation_statuses
|
137
|
+
snapshot:
|
138
|
+
- snapshot_id
|
139
|
+
- title
|
140
|
+
- created_at
|
141
|
+
- created_at_timestamp
|
142
|
+
- created_by
|
143
|
+
- created_by_email
|
144
|
+
task:
|
145
|
+
- task_id
|
146
|
+
- title
|
147
|
+
- description
|
148
|
+
- status
|
149
|
+
- progress
|
150
|
+
- due_date
|
151
|
+
- due_date_timestamp
|
152
|
+
- keys_count
|
153
|
+
- words_count
|
154
|
+
- created_at
|
155
|
+
- created_at_timestamp
|
156
|
+
- created_by
|
157
|
+
- created_by_email
|
158
|
+
- can_be_parent
|
159
|
+
- task_type
|
160
|
+
- parent_task_id
|
161
|
+
- closing_tags
|
162
|
+
- do_lock_translations
|
163
|
+
- languages
|
164
|
+
- auto_close_languages
|
165
|
+
- auto_close_task
|
166
|
+
- auto_close_items
|
167
|
+
- completed_at
|
168
|
+
- completed_at_timestamp
|
169
|
+
- completed_by
|
170
|
+
- completed_by_email
|
171
|
+
- custom_translation_status_ids
|
172
|
+
team:
|
173
|
+
- team_id
|
174
|
+
- name
|
175
|
+
- created_at
|
176
|
+
- created_at_timestamp
|
177
|
+
- plan
|
178
|
+
- quota_usage
|
179
|
+
- quota_allowed
|
180
|
+
team_user:
|
181
|
+
- user_id
|
182
|
+
- email
|
183
|
+
- fullname
|
184
|
+
- created_at
|
185
|
+
- created_at_timestamp
|
186
|
+
- role
|
187
|
+
team_user_billing_details:
|
188
|
+
- billing_email
|
189
|
+
- country_code
|
190
|
+
- zip
|
191
|
+
- state_code
|
192
|
+
- address1
|
193
|
+
- address2
|
194
|
+
- city
|
195
|
+
- phone
|
196
|
+
- company
|
197
|
+
- vatnumber
|
198
|
+
team_user_group:
|
199
|
+
- group_id
|
200
|
+
- name
|
201
|
+
- permissions
|
202
|
+
- created_at
|
203
|
+
- created_at_timestamp
|
204
|
+
- team_id
|
205
|
+
- projects
|
206
|
+
- members
|
207
|
+
translation:
|
208
|
+
- translation_id
|
209
|
+
- key_id
|
210
|
+
- language_iso
|
211
|
+
- modified_at
|
212
|
+
- modified_at_timestamp
|
213
|
+
- modified_by
|
214
|
+
- modified_by_email
|
215
|
+
- translation
|
216
|
+
- is_fuzzy
|
217
|
+
- is_reviewed
|
218
|
+
- words
|
219
|
+
- custom_translation_statuses
|
220
|
+
- task_id
|
221
|
+
translation_provider:
|
222
|
+
- provider_id
|
223
|
+
- name
|
224
|
+
- slug
|
225
|
+
- price_pair_min
|
226
|
+
- website_url
|
227
|
+
- description
|
228
|
+
- tiers
|
229
|
+
- pairs
|
230
|
+
webhook:
|
231
|
+
- webhook_id
|
232
|
+
- url
|
233
|
+
- secret
|
234
|
+
- events
|
235
|
+
- event_lang_map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module RubyLokaliseApi
|
4
4
|
class Error < StandardError
|
5
5
|
ClientError = Class.new(self)
|
6
6
|
ServerError = Class.new(self)
|
@@ -21,19 +21,19 @@ module Lokalise
|
|
21
21
|
GatewayTimeout = Class.new(ServerError)
|
22
22
|
|
23
23
|
ERRORS = {
|
24
|
-
400 =>
|
25
|
-
401 =>
|
26
|
-
403 =>
|
27
|
-
404 =>
|
28
|
-
405 =>
|
29
|
-
406 =>
|
30
|
-
409 =>
|
31
|
-
423 =>
|
32
|
-
429 =>
|
33
|
-
500 =>
|
34
|
-
502 =>
|
35
|
-
503 =>
|
36
|
-
504 =>
|
24
|
+
400 => RubyLokaliseApi::Error::BadRequest,
|
25
|
+
401 => RubyLokaliseApi::Error::Unauthorized,
|
26
|
+
403 => RubyLokaliseApi::Error::Forbidden,
|
27
|
+
404 => RubyLokaliseApi::Error::NotFound,
|
28
|
+
405 => RubyLokaliseApi::Error::MethodNotAllowed,
|
29
|
+
406 => RubyLokaliseApi::Error::NotAcceptable,
|
30
|
+
409 => RubyLokaliseApi::Error::Conflict,
|
31
|
+
423 => RubyLokaliseApi::Error::Locked,
|
32
|
+
429 => RubyLokaliseApi::Error::TooManyRequests,
|
33
|
+
500 => RubyLokaliseApi::Error::ServerError,
|
34
|
+
502 => RubyLokaliseApi::Error::BadGateway,
|
35
|
+
503 => RubyLokaliseApi::Error::ServiceUnavailable,
|
36
|
+
504 => RubyLokaliseApi::Error::GatewayTimeout
|
37
37
|
}.freeze
|
38
38
|
|
39
39
|
class << self
|