ruby-lokalise-api 5.0.0 → 6.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +7 -5
  4. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/base_request.rb +4 -4
  5. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/client.rb +24 -24
  6. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/base.rb +10 -10
  7. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/branch.rb +1 -1
  8. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/contributor.rb +1 -1
  9. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/custom_translation_status.rb +1 -1
  10. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/file.rb +1 -1
  11. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key.rb +2 -2
  12. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/key_comment.rb +1 -1
  13. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/order.rb +1 -1
  14. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/payment_card.rb +1 -1
  15. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project.rb +1 -1
  16. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_comment.rb +1 -1
  17. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/project_language.rb +1 -1
  18. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/queued_process.rb +1 -1
  19. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/screenshot.rb +1 -1
  20. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/segment.rb +1 -1
  21. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/snapshot.rb +1 -1
  22. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/system_language.rb +1 -1
  23. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/task.rb +1 -1
  24. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team.rb +1 -1
  25. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user.rb +1 -1
  26. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/team_user_group.rb +1 -1
  27. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation.rb +1 -1
  28. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/translation_provider.rb +1 -1
  29. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/collections/webhook.rb +1 -1
  30. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/connection.rb +2 -2
  31. data/lib/ruby_lokalise_api/data/attributes.yml +235 -0
  32. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/error.rb +14 -14
  33. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/json_handler.rb +1 -1
  34. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/auth.rb +2 -2
  35. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/connection.rb +2 -2
  36. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2/request.rb +3 -3
  37. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/oauth2_client.rb +1 -1
  38. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/request.rb +3 -3
  39. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/base.rb +16 -8
  40. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/branch.rb +1 -1
  41. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/contributor.rb +1 -1
  42. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/custom_translation_status.rb +1 -1
  43. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/file.rb +2 -2
  44. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key.rb +1 -1
  45. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/key_comment.rb +1 -1
  46. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/order.rb +1 -1
  47. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/payment_card.rb +1 -1
  48. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project.rb +1 -1
  49. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_comment.rb +1 -1
  50. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/project_language.rb +1 -1
  51. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/queued_process.rb +1 -1
  52. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/screenshot.rb +1 -1
  53. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/segment.rb +1 -1
  54. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/snapshot.rb +2 -2
  55. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/system_language.rb +1 -1
  56. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/task.rb +1 -1
  57. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team.rb +1 -1
  58. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user.rb +1 -1
  59. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_billing_details.rb +1 -1
  60. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/team_user_group.rb +1 -1
  61. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation.rb +1 -1
  62. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/translation_provider.rb +1 -1
  63. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/resources/webhook.rb +1 -1
  64. data/lib/ruby_lokalise_api/rest/branches.rb +69 -0
  65. data/lib/ruby_lokalise_api/rest/comments.rb +61 -0
  66. data/lib/ruby_lokalise_api/rest/contributors.rb +58 -0
  67. data/lib/ruby_lokalise_api/rest/custom_translation_statuses.rb +67 -0
  68. data/lib/ruby_lokalise_api/rest/files.rb +49 -0
  69. data/lib/ruby_lokalise_api/rest/keys.rb +79 -0
  70. data/lib/ruby_lokalise_api/rest/languages.rb +67 -0
  71. data/lib/ruby_lokalise_api/rest/orders.rb +37 -0
  72. data/lib/ruby_lokalise_api/rest/payment_cards.rb +43 -0
  73. data/lib/ruby_lokalise_api/rest/projects.rb +62 -0
  74. data/lib/ruby_lokalise_api/rest/queued_processes.rb +28 -0
  75. data/lib/ruby_lokalise_api/rest/screenshots.rb +58 -0
  76. data/lib/ruby_lokalise_api/rest/segments.rb +45 -0
  77. data/lib/ruby_lokalise_api/rest/snapshots.rb +47 -0
  78. data/lib/ruby_lokalise_api/rest/tasks.rb +58 -0
  79. data/lib/ruby_lokalise_api/rest/team_user_billing_details.rb +36 -0
  80. data/lib/ruby_lokalise_api/rest/team_user_groups.rb +109 -0
  81. data/lib/ruby_lokalise_api/rest/team_users.rb +48 -0
  82. data/lib/ruby_lokalise_api/rest/teams.rb +16 -0
  83. data/lib/ruby_lokalise_api/rest/translation_providers.rb +27 -0
  84. data/lib/ruby_lokalise_api/rest/translations.rb +39 -0
  85. data/lib/ruby_lokalise_api/rest/webhooks.rb +69 -0
  86. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/attribute_helpers.rb +7 -7
  87. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/endpoint_helpers.rb +1 -1
  88. data/lib/{ruby-lokalise-api → ruby_lokalise_api}/utils/string_utils.rb +1 -1
  89. data/lib/ruby_lokalise_api/version.rb +5 -0
  90. data/lib/ruby_lokalise_api.rb +50 -0
  91. data/ruby-lokalise-api.gemspec +8 -7
  92. metadata +125 -157
  93. data/lib/ruby-lokalise-api/data/attributes.json +0 -259
  94. data/lib/ruby-lokalise-api/rest/branches.rb +0 -67
  95. data/lib/ruby-lokalise-api/rest/comments.rb +0 -59
  96. data/lib/ruby-lokalise-api/rest/contributors.rb +0 -56
  97. data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +0 -65
  98. data/lib/ruby-lokalise-api/rest/files.rb +0 -36
  99. data/lib/ruby-lokalise-api/rest/keys.rb +0 -77
  100. data/lib/ruby-lokalise-api/rest/languages.rb +0 -65
  101. data/lib/ruby-lokalise-api/rest/orders.rb +0 -35
  102. data/lib/ruby-lokalise-api/rest/payment_cards.rb +0 -41
  103. data/lib/ruby-lokalise-api/rest/projects.rb +0 -60
  104. data/lib/ruby-lokalise-api/rest/queued_processes.rb +0 -26
  105. data/lib/ruby-lokalise-api/rest/screenshots.rb +0 -56
  106. data/lib/ruby-lokalise-api/rest/segments.rb +0 -43
  107. data/lib/ruby-lokalise-api/rest/snapshots.rb +0 -45
  108. data/lib/ruby-lokalise-api/rest/tasks.rb +0 -56
  109. data/lib/ruby-lokalise-api/rest/team_user_billing_details.rb +0 -34
  110. data/lib/ruby-lokalise-api/rest/team_user_group.rb +0 -107
  111. data/lib/ruby-lokalise-api/rest/team_users.rb +0 -46
  112. data/lib/ruby-lokalise-api/rest/teams.rb +0 -14
  113. data/lib/ruby-lokalise-api/rest/translation_providers.rb +0 -25
  114. data/lib/ruby-lokalise-api/rest/translations.rb +0 -37
  115. data/lib/ruby-lokalise-api/rest/webhooks.rb +0 -67
  116. data/lib/ruby-lokalise-api/version.rb +0 -5
  117. data/lib/ruby-lokalise-api.rb +0 -111
  118. data/spec/lib/ruby-lokalise-api/connection_spec.rb +0 -68
  119. data/spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb +0 -81
  120. data/spec/lib/ruby-lokalise-api/error_spec.rb +0 -41
  121. data/spec/lib/ruby-lokalise-api/oauth2/auth_spec.rb +0 -73
  122. data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +0 -140
  123. data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +0 -118
  124. data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +0 -132
  125. data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +0 -131
  126. data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +0 -66
  127. data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +0 -199
  128. data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +0 -134
  129. data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +0 -113
  130. data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +0 -92
  131. data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +0 -150
  132. data/spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb +0 -57
  133. data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +0 -127
  134. data/spec/lib/ruby-lokalise-api/rest/segments_spec.rb +0 -106
  135. data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +0 -117
  136. data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +0 -145
  137. data/spec/lib/ruby-lokalise-api/rest/team_user_billing_details_spec.rb +0 -48
  138. data/spec/lib/ruby-lokalise-api/rest/team_user_groups_spec.rb +0 -278
  139. data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +0 -95
  140. data/spec/lib/ruby-lokalise-api/rest/teams_spec.rb +0 -25
  141. data/spec/lib/ruby-lokalise-api/rest/translation_providers_spec.rb +0 -48
  142. data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +0 -118
  143. data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +0 -126
  144. data/spec/lib/ruby-lokalise-api_spec.rb +0 -47
  145. data/spec/spec_helper.rb +0 -22
  146. data/spec/support/test_client.rb +0 -15
  147. data/spec/support/vcr.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b99a57388157ac9dea3e17b78cf19b27ada718b172b9b5e91230e4b0772073f2
4
- data.tar.gz: fff194faef3d317f122987fc866c9358f3169dbf8d5a1d52fdf5d810bff0cb84
3
+ metadata.gz: 90b862c7994f5c977a2a3a71dac7877163d83c7051ea16b808a770f2b1c24f9e
4
+ data.tar.gz: ca1cb74e869faae115c85d59011bd254bf0f06e6738d81297de4239d73c4c8d9
5
5
  SHA512:
6
- metadata.gz: 478a91cc6130208809c783ac145270d89d3a059d76d9b011133a2e62b8b82bee8d9011004945cfb02b9cd950699f45d6354522281904aaf61b885935aee28dca
7
- data.tar.gz: 15b10938bcfd13534fbcbea1f7f705b74b39e9f9c02895d413f9c859246a389b020ca4abd1d35c59078388564c7c22995bd558b47aad52b5e233229f34e4bec3
6
+ metadata.gz: 98cba873be8c354d5de708493cbdf078bca3c1269b8587417044b3a7e5b2c8d235b83e09de84cb2d03279d3459074b1b150dc7b8a5e830be12332254d2f57cbf
7
+ data.tar.gz: 5ef019ca07ac5e515f31805ebc63dd962832e42df1c10de46bc6a053de8639d92831763687d8cd80289ec8fb755da9c6b15f8272c0ec50c00c0ce722be4ed30c
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  BSD 3 Clause
2
2
 
3
- Copyright 2021 Lokalise Group, Ilya Bodrov
3
+ Copyright 2021 Lokalise Group, Ilya Krukowski
4
4
 
5
5
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
6
 
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Test Coverage](https://codecov.io/gh/lokalise/ruby-lokalise-api/graph/badge.svg)](https://codecov.io/gh/lokalise/ruby-lokalise-api)
6
6
  ![Downloads total](https://img.shields.io/gem/dt/ruby-lokalise-api)
7
7
 
8
- Official opinionated Ruby interface for the [Lokalise API](https://app.lokalise.com/api2docs/curl/) that represents returned data as Ruby objects.
8
+ Official opinionated Ruby interface for the [Lokalise API](https://developers.lokalise.com/reference/lokalise-rest-api) that represents returned data as Ruby objects.
9
9
 
10
10
  Looking for a Rails integration? Try the [lokalise_rails gem](https://github.com/bodrovis/lokalise_rails). Also you can use a [lokalise_manager gem](https://github.com/bodrovis/lokalise_manager) which allows to exchange translation files between Lokalise and *any* Ruby script.
11
11
 
@@ -20,9 +20,9 @@ $ gem install ruby-lokalise-api
20
20
  Obtain an API token in your [personal profile](https://lokalise.com/profile#apitokens) (*API tokens* section) and initialize the client:
21
21
 
22
22
  ```ruby
23
- require 'ruby-lokalise-api'
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/).
@@ -55,4 +57,4 @@ You can also check [this repo containing some usage examples](https://github.com
55
57
 
56
58
  This gem is licensed under the [BSD 3 Clause license](https://github.com/lokalise/ruby-lokalise-api/blob/master/LICENSE). Prior to version 4 the license type was MIT.
57
59
 
58
- Copyright (c) [Lokalise team](http://lokalise.co) and [Ilya Bodrov](http://bodrovis.tech)
60
+ Copyright (c) [Lokalise team](http://lokalise.co) and [Ilya Krukowski](http://bodrovis.tech)
@@ -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