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.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -2
  3. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/base_request.rb +4 -4
  4. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/client.rb +24 -24
  5. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/base.rb +10 -10
  6. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/branch.rb +1 -1
  7. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/contributor.rb +1 -1
  8. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/custom_translation_status.rb +1 -1
  9. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/file.rb +1 -1
  10. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key.rb +2 -2
  11. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key_comment.rb +1 -1
  12. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/order.rb +1 -1
  13. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/payment_card.rb +1 -1
  14. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project.rb +1 -1
  15. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_comment.rb +1 -1
  16. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_language.rb +1 -1
  17. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/queued_process.rb +1 -1
  18. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/screenshot.rb +1 -1
  19. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/segment.rb +1 -1
  20. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/snapshot.rb +1 -1
  21. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/system_language.rb +1 -1
  22. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/task.rb +1 -1
  23. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team.rb +1 -1
  24. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user.rb +1 -1
  25. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user_group.rb +1 -1
  26. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation.rb +1 -1
  27. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation_provider.rb +1 -1
  28. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/webhook.rb +1 -1
  29. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/connection.rb +2 -2
  30. data/lib/ruby_lokalise_api/data/attributes.yml +235 -0
  31. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/error.rb +14 -14
  32. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/json_handler.rb +1 -1
  33. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/auth.rb +2 -2
  34. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/connection.rb +2 -2
  35. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/request.rb +3 -3
  36. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2_client.rb +1 -1
  37. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/request.rb +3 -3
  38. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/base.rb +8 -8
  39. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/branch.rb +1 -1
  40. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/contributor.rb +1 -1
  41. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/custom_translation_status.rb +1 -1
  42. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/file.rb +2 -2
  43. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key.rb +1 -1
  44. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key_comment.rb +1 -1
  45. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/order.rb +1 -1
  46. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/payment_card.rb +1 -1
  47. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project.rb +1 -1
  48. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_comment.rb +1 -1
  49. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_language.rb +1 -1
  50. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/queued_process.rb +1 -1
  51. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/screenshot.rb +1 -1
  52. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/segment.rb +1 -1
  53. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/snapshot.rb +2 -2
  54. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/system_language.rb +1 -1
  55. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/task.rb +1 -1
  56. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team.rb +1 -1
  57. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user.rb +1 -1
  58. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_billing_details.rb +1 -1
  59. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_group.rb +1 -1
  60. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation.rb +1 -1
  61. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation_provider.rb +1 -1
  62. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/webhook.rb +1 -1
  63. data/lib/ruby_lokalise_api/rest/branches.rb +69 -0
  64. data/lib/ruby_lokalise_api/rest/comments.rb +61 -0
  65. data/lib/ruby_lokalise_api/rest/contributors.rb +58 -0
  66. data/lib/ruby_lokalise_api/rest/custom_translation_statuses.rb +67 -0
  67. data/lib/ruby_lokalise_api/rest/files.rb +38 -0
  68. data/lib/ruby_lokalise_api/rest/keys.rb +79 -0
  69. data/lib/ruby_lokalise_api/rest/languages.rb +67 -0
  70. data/lib/ruby_lokalise_api/rest/orders.rb +37 -0
  71. data/lib/ruby_lokalise_api/rest/payment_cards.rb +43 -0
  72. data/lib/ruby_lokalise_api/rest/projects.rb +62 -0
  73. data/lib/ruby_lokalise_api/rest/queued_processes.rb +28 -0
  74. data/lib/ruby_lokalise_api/rest/screenshots.rb +58 -0
  75. data/lib/ruby_lokalise_api/rest/segments.rb +45 -0
  76. data/lib/ruby_lokalise_api/rest/snapshots.rb +47 -0
  77. data/lib/ruby_lokalise_api/rest/tasks.rb +58 -0
  78. data/lib/ruby_lokalise_api/rest/team_user_billing_details.rb +36 -0
  79. data/lib/ruby_lokalise_api/rest/team_user_groups.rb +109 -0
  80. data/lib/ruby_lokalise_api/rest/team_users.rb +48 -0
  81. data/lib/ruby_lokalise_api/rest/teams.rb +16 -0
  82. data/lib/ruby_lokalise_api/rest/translation_providers.rb +27 -0
  83. data/lib/ruby_lokalise_api/rest/translations.rb +39 -0
  84. data/lib/ruby_lokalise_api/rest/webhooks.rb +69 -0
  85. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/attribute_helpers.rb +7 -7
  86. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/endpoint_helpers.rb +1 -1
  87. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/string_utils.rb +1 -1
  88. data/lib/ruby_lokalise_api/version.rb +5 -0
  89. data/lib/ruby_lokalise_api.rb +50 -0
  90. data/ruby-lokalise-api.gemspec +6 -5
  91. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/branches_spec.rb +5 -5
  92. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/comments_spec.rb +7 -7
  93. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/contributors_spec.rb +9 -9
  94. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/custom_translation_statuses_spec.rb +7 -7
  95. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/files_spec.rb +2 -2
  96. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/keys_spec.rb +14 -14
  97. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/languages_spec.rb +4 -4
  98. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/orders_spec.rb +1 -1
  99. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/payment_cards_spec.rb +7 -7
  100. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/projects_spec.rb +10 -10
  101. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/queued_processes_spec.rb +1 -1
  102. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/screenshots_spec.rb +3 -3
  103. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/segments_spec.rb +4 -4
  104. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/snapshots_spec.rb +8 -8
  105. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/tasks_spec.rb +12 -12
  106. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_user_billing_details_spec.rb +1 -1
  107. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_user_groups_spec.rb +7 -7
  108. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/team_users_spec.rb +3 -3
  109. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/teams_spec.rb +1 -1
  110. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/translation_providers_spec.rb +2 -2
  111. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/translations_spec.rb +10 -10
  112. data/spec/lib/{ruby-lokalise-api/rest → ruby_lokalise_api/client}/webhooks_spec.rb +2 -2
  113. data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/connection_spec.rb +8 -8
  114. data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/custom_json_parser_spec.rb +3 -3
  115. data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/error_spec.rb +10 -10
  116. data/spec/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/auth_spec.rb +3 -3
  117. data/spec/lib/{ruby-lokalise-api_spec.rb → ruby_lokalise_api_spec.rb} +5 -5
  118. data/spec/spec_helper.rb +1 -1
  119. data/spec/support/test_client.rb +3 -3
  120. metadata +163 -149
  121. data/lib/ruby-lokalise-api/data/attributes.json +0 -259
  122. data/lib/ruby-lokalise-api/rest/branches.rb +0 -67
  123. data/lib/ruby-lokalise-api/rest/comments.rb +0 -59
  124. data/lib/ruby-lokalise-api/rest/contributors.rb +0 -56
  125. data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +0 -65
  126. data/lib/ruby-lokalise-api/rest/files.rb +0 -36
  127. data/lib/ruby-lokalise-api/rest/keys.rb +0 -77
  128. data/lib/ruby-lokalise-api/rest/languages.rb +0 -65
  129. data/lib/ruby-lokalise-api/rest/orders.rb +0 -35
  130. data/lib/ruby-lokalise-api/rest/payment_cards.rb +0 -41
  131. data/lib/ruby-lokalise-api/rest/projects.rb +0 -60
  132. data/lib/ruby-lokalise-api/rest/queued_processes.rb +0 -26
  133. data/lib/ruby-lokalise-api/rest/screenshots.rb +0 -56
  134. data/lib/ruby-lokalise-api/rest/segments.rb +0 -43
  135. data/lib/ruby-lokalise-api/rest/snapshots.rb +0 -45
  136. data/lib/ruby-lokalise-api/rest/tasks.rb +0 -56
  137. data/lib/ruby-lokalise-api/rest/team_user_billing_details.rb +0 -34
  138. data/lib/ruby-lokalise-api/rest/team_user_group.rb +0 -107
  139. data/lib/ruby-lokalise-api/rest/team_users.rb +0 -46
  140. data/lib/ruby-lokalise-api/rest/teams.rb +0 -14
  141. data/lib/ruby-lokalise-api/rest/translation_providers.rb +0 -25
  142. data/lib/ruby-lokalise-api/rest/translations.rb +0 -37
  143. data/lib/ruby-lokalise-api/rest/webhooks.rb +0 -67
  144. data/lib/ruby-lokalise-api/version.rb +0 -5
  145. data/lib/ruby-lokalise-api.rb +0 -111
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b99a57388157ac9dea3e17b78cf19b27ada718b172b9b5e91230e4b0772073f2
4
- data.tar.gz: fff194faef3d317f122987fc866c9358f3169dbf8d5a1d52fdf5d810bff0cb84
3
+ metadata.gz: 5d5ba084b81ce5556b416a397dcd0cb7e848614e84560bd1ac970275351abc52
4
+ data.tar.gz: 7d4a692fa26ce75ec6a77ea83d8ddd450ff7f4da268000213493c5ec8d061d49
5
5
  SHA512:
6
- metadata.gz: 478a91cc6130208809c783ac145270d89d3a059d76d9b011133a2e62b8b82bee8d9011004945cfb02b9cd950699f45d6354522281904aaf61b885935aee28dca
7
- data.tar.gz: 15b10938bcfd13534fbcbea1f7f705b74b39e9f9c02895d413f9c859246a389b020ca4abd1d35c59078388564c7c22995bd558b47aad52b5e233229f34e4bec3
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 = Lokalise.client 'YOUR_TOKEN_HERE'
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 = Lokalise.oauth2_client 'YOUR_OAUTH2_TOKEN_HERE'
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 Lokalise
3
+ module RubyLokaliseApi
4
4
  module BaseRequest
5
- include Lokalise::JsonHandler
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(Lokalise::Error, body['error'] || body) unless Lokalise::Error::ERRORS.key? code
19
+ raise(RubyLokaliseApi::Error, body['error'] || body) unless RubyLokaliseApi::Error::ERRORS.key? code
20
20
 
21
- raise Lokalise::Error::ERRORS[code].from_response(body)
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
- require 'ruby-lokalise-api/rest/branches'
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 Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Base
6
- using Lokalise::Utils::StringUtils
6
+ using RubyLokaliseApi::Utils::StringUtils
7
7
 
8
- extend Lokalise::Request
9
- extend Lokalise::Utils::AttributeHelpers
10
- include Lokalise::Utils::AttributeHelpers
11
- extend Lokalise::Utils::EndpointHelpers
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 [Lokalise::Collections::Base]
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("Lokalise::Resources::#{model_class}").new 'content' => raw_model,
98
- 'client' => response['client'],
99
- 'base_path' => response['path']
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,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Branch < Base
6
6
  DATA_KEY_PLURAL = 'Branches'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Contributor < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class CustomTranslationStatus < Base
6
6
  DATA_KEY_PLURAL = 'CustomTranslationStatuses'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class File < Base
6
6
  class << self
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
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
- Lokalise::Resources::Key.destroy @client, @path, keys: keys
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 Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class KeyComment < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Order < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class PaymentCard < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Project < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class ProjectComment < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class ProjectLanguage < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class QueuedProcess < Base
6
6
  DATA_KEY_PLURAL = 'Processes'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Screenshot < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Segment < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Snapshot < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class SystemLanguage < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Task < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Team < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class TeamUser < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class TeamUserGroup < Base
6
6
  DATA_KEY = 'UserGroup'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Translation < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class TranslationProvider < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
3
+ module RubyLokaliseApi
4
4
  module Collections
5
5
  class Webhook < Base
6
6
  class << self
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Lokalise
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/#{Lokalise::VERSION}",
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 Lokalise
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 => Lokalise::Error::BadRequest,
25
- 401 => Lokalise::Error::Unauthorized,
26
- 403 => Lokalise::Error::Forbidden,
27
- 404 => Lokalise::Error::NotFound,
28
- 405 => Lokalise::Error::MethodNotAllowed,
29
- 406 => Lokalise::Error::NotAcceptable,
30
- 409 => Lokalise::Error::Conflict,
31
- 423 => Lokalise::Error::Locked,
32
- 429 => Lokalise::Error::TooManyRequests,
33
- 500 => Lokalise::Error::ServerError,
34
- 502 => Lokalise::Error::BadGateway,
35
- 503 => Lokalise::Error::ServiceUnavailable,
36
- 504 => Lokalise::Error::GatewayTimeout
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'json'
4
4
 
5
- module Lokalise
5
+ module RubyLokaliseApi
6
6
  module JsonHandler
7
7
  # JSON custom parser. Uses built-in JSON by default but can be overridden to any other parser
8
8