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
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns a single comment for the given key
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-comment-get
8
- # @return [Lokalise::Resources::Comment]
9
- # @param project_id [String]
10
- # @param key_id [String, Integer]
11
- # @param comment_id [String, Integer]
12
- def comment(project_id, key_id, comment_id)
13
- c_r Lokalise::Resources::KeyComment, :find, [project_id, key_id, comment_id]
14
- end
15
-
16
- # Returns all comments for all keys inside the given project
17
- #
18
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-project-comments-get
19
- # @return [Lokalise::Collection::Comment<Lokalise::Resources::Comment>]
20
- # @param project_id [String]
21
- # @param params [Hash]
22
- def project_comments(project_id, params = {})
23
- c_r Lokalise::Collections::ProjectComment, :all, project_id, params
24
- end
25
-
26
- # Returns all comments for the given key inside the given project
27
- #
28
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-key-comments-get
29
- # @return [Lokalise::Collection::Comment<Lokalise::Resources::Comment>]
30
- # @param project_id [String]
31
- # @param key_id [String, Integer]
32
- # @param params [Hash]
33
- def comments(project_id, key_id, params = {})
34
- c_r Lokalise::Collections::KeyComment, :all, [project_id, key_id], params
35
- end
36
-
37
- # Creates one or more comments for the given key inside the given project
38
- #
39
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-comments-post
40
- # @return [Lokalise::Collection::Comment<Lokalise::Resources::Comment>]
41
- # @param project_id [String]
42
- # @param key_id [String, Integer]
43
- # @param params [Hash, Array<Hash>]
44
- def create_comments(project_id, key_id, params)
45
- c_r Lokalise::Resources::KeyComment, :create, [project_id, key_id], params, :comments
46
- end
47
-
48
- # Deletes comment for the given key inside the given project
49
- #
50
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-comment-delete
51
- # @return [Hash]
52
- # @param project_id [String]
53
- # @param key_id [String, Integer]
54
- # @param comment_id [String, Integer]
55
- def destroy_comment(project_id, key_id, comment_id)
56
- c_r Lokalise::Resources::KeyComment, :destroy, [project_id, key_id, comment_id]
57
- end
58
- end
59
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all contributors for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-contributors-get
8
- # @return [Lokalise::Collection::Contributor<Lokalise::Resources::Contributor>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def contributors(project_id, params = {})
12
- c_r Lokalise::Collections::Contributor, :all, project_id, params
13
- end
14
-
15
- # Returns a single contributor for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get
18
- # @return [Lokalise::Resources::Contributor]
19
- # @param project_id [String]
20
- # @param contributor_id [String, Integer]
21
- def contributor(project_id, contributor_id)
22
- c_r Lokalise::Resources::Contributor, :find, [project_id, contributor_id]
23
- end
24
-
25
- # Creates one or more contributors inside the given project
26
- #
27
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-contributors-post
28
- # @return [Lokalise::Collection::Contributor<Lokalise::Resources::Contributor>]
29
- # @param project_id [String]
30
- # @param params [Hash, Array<Hash>]
31
- def create_contributors(project_id, params)
32
- c_r Lokalise::Resources::Contributor, :create, project_id, params, :contributors
33
- end
34
-
35
- # Updates the given contributor inside the given project
36
- #
37
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-contributor-put
38
- # @return [Lokalise::Resources::Contributor]
39
- # @param project_id [String]
40
- # @param contributor_id [String, Integer]
41
- # @param params [Hash]
42
- def update_contributor(project_id, contributor_id, params)
43
- c_r Lokalise::Resources::Contributor, :update, [project_id, contributor_id], params
44
- end
45
-
46
- # Deletes contributor inside the given project
47
- #
48
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete
49
- # @return [Hash]
50
- # @param project_id [String]
51
- # @param contributor_id [String, Integer]
52
- def destroy_contributor(project_id, contributor_id)
53
- c_r Lokalise::Resources::Contributor, :destroy, [project_id, contributor_id]
54
- end
55
- end
56
- end
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all translation statuses for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-custom-translation-statuses-get
8
- # @return [Lokalise::Collection::CustomTranslationStatus<Lokalise::Resources::CustomTranslationStatus>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def translation_statuses(project_id, params = {})
12
- c_r Lokalise::Collections::CustomTranslationStatus, :all, project_id, params
13
- end
14
-
15
- # Returns a single translation status for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-custom-translation-status-get
18
- # @return [Lokalise::Resources::CustomTranslationStatus]
19
- # @param project_id [String]
20
- # @param status_id [String, Integer]
21
- def translation_status(project_id, status_id)
22
- c_r Lokalise::Resources::CustomTranslationStatus, :find, [project_id, status_id]
23
- end
24
-
25
- # Creates translation status inside the given project
26
- #
27
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-custom-translation-status-post
28
- # @return Lokalise::Resources::CustomTranslationStatus
29
- # @param project_id [String]
30
- # @param params Hash
31
- def create_translation_status(project_id, params)
32
- c_r Lokalise::Resources::CustomTranslationStatus, :create, project_id, params
33
- end
34
-
35
- # Updates the given translation status inside the given project
36
- #
37
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-custom-translation-status-put
38
- # @return [Lokalise::Resources::CustomTranslationStatus]
39
- # @param project_id [String]
40
- # @param status_id [String, Integer]
41
- # @param params [Hash]
42
- def update_translation_status(project_id, status_id, params)
43
- c_r Lokalise::Resources::CustomTranslationStatus, :update, [project_id, status_id], params
44
- end
45
-
46
- # Deletes translation status inside the given project
47
- #
48
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-custom-translation-status-delete
49
- # @return [Hash]
50
- # @param project_id [String]
51
- # @param status_id [String, Integer]
52
- def destroy_translation_status(project_id, status_id)
53
- c_r Lokalise::Resources::CustomTranslationStatus, :destroy, [project_id, status_id]
54
- end
55
-
56
- # Returns an array of available colors that can be assigned to custom translation statuses
57
- #
58
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-available-colors-for-custom-translation-statuses-get
59
- # @return [Array]
60
- # @param project_id [String]
61
- def translation_status_colors(project_id)
62
- c_r Lokalise::Resources::CustomTranslationStatus, :colors, [project_id, 'colors']
63
- end
64
- end
65
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all translation files for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-files-get
8
- # @return [Lokalise::Collection::File<Lokalise::Resources::File>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def files(project_id, params = {})
12
- c_r Lokalise::Collections::File, :all, project_id, params
13
- end
14
-
15
- # Exports translation files as .zip bundle, uploads them to Amazon S3 and returns a URL to the generated bundle. The URL is valid for a year
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-download-files-post
18
- # @return [Hash]
19
- # @param project_id [String]
20
- # @param params [Hash]
21
- def download_files(project_id, params)
22
- c_r Lokalise::Resources::File, :download, [project_id, 'download'], params
23
- end
24
-
25
- # Imports translation file to the given project. File data must base64-encoded.
26
- # To encode your data in Base64, use `Base64.strict_encode64()` method.
27
- #
28
- # @see https://app.lokalise.com/api2docs/curl/#transition-upload-a-file-post
29
- # @return [Hash]
30
- # @param project_id [String]
31
- # @param params [Hash]
32
- def upload_file(project_id, params)
33
- c_r Lokalise::Resources::File, :upload, [project_id, 'upload'], params
34
- end
35
- end
36
- end
@@ -1,77 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all translation keys for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-keys-get
8
- # @return [Lokalise::Collection::Key<Lokalise::Resources::Key>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def keys(project_id, params = {})
12
- c_r Lokalise::Collections::Key, :all, project_id, params
13
- end
14
-
15
- # Returns a single translation key for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-key-get
18
- # @return [Lokalise::Resources::Key]
19
- # @param project_id [String]
20
- # @param key_id [String, Integer]
21
- # @param params [Hash]
22
- def key(project_id, key_id, params = {})
23
- c_r Lokalise::Resources::Key, :find, [project_id, key_id], params
24
- end
25
-
26
- # Creates one or more translation keys for the given project
27
- #
28
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-keys-post
29
- # @return [Lokalise::Collection::Key<Lokalise::Resources::Key>]
30
- # @param project_id [String]
31
- # @param params [Hash, Array<Hash>]
32
- def create_keys(project_id, params = {})
33
- c_r Lokalise::Resources::Key, :create, project_id, params, :keys
34
- end
35
-
36
- # Updates translation key for the given project
37
- #
38
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put
39
- # @return [Lokalise::Resources::Key]
40
- # @param project_id [String]
41
- # @param key_id [String, Integer]
42
- # @param params [Hash]
43
- def update_key(project_id, key_id, params = {})
44
- c_r Lokalise::Resources::Key, :update, [project_id, key_id], params
45
- end
46
-
47
- # Updates one or multiple translation keys for the given project
48
- #
49
- # @see https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put
50
- # @return [Lokalise::Collection::Key<Lokalise::Resources::Key>]
51
- # @param project_id [String]
52
- # @param params [Hash, Array<Hash>]
53
- def update_keys(project_id, params)
54
- c_r Lokalise::Resources::Key, :update, project_id, params, :keys
55
- end
56
-
57
- # Deletes translation key for the given project
58
- #
59
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-key-delete
60
- # @return [Hash]
61
- # @param project_id [String]
62
- # @param key_id [String, Integer]
63
- def destroy_key(project_id, key_id)
64
- c_r Lokalise::Resources::Key, :destroy, [project_id, key_id]
65
- end
66
-
67
- # Deletes one or multiple translation keys for the given project
68
- #
69
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete
70
- # @return [Hash]
71
- # @param project_id [String]
72
- # @param key_ids [String, Integer, Array<String>, Array<Integer>]
73
- def destroy_keys(project_id, key_ids)
74
- c_r Lokalise::Resources::Key, :destroy, project_id, key_ids, :keys
75
- end
76
- end
77
- end
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all languages supported by Lokalise
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-system-languages-get
8
- # @return [Lokalise::Collection::SystemLanguage<Lokalise::Resources::SystemLanguage>]
9
- # @param params [Hash]
10
- def system_languages(params = {})
11
- c_r Lokalise::Collections::SystemLanguage, :all, nil, params
12
- end
13
-
14
- # Returns all languages for the given project
15
- #
16
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-project-languages-get
17
- # @return [Lokalise::Collection::ProjectLanguage<Lokalise::Resources::ProjectLanguage>]
18
- # @param project_id [String, Integer]
19
- # @param params [Hash]
20
- def project_languages(project_id, params = {})
21
- c_r Lokalise::Collections::ProjectLanguage, :all, project_id, params
22
- end
23
-
24
- # Returns a single language for the given project
25
- #
26
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-language-get
27
- # @return [Lokalise::Resources::ProjectLanguage]
28
- # @param project_id [String]
29
- # @param language_id [String, Integer]
30
- def language(project_id, language_id)
31
- c_r Lokalise::Resources::ProjectLanguage, :find, [project_id, language_id]
32
- end
33
-
34
- # Creates one or more language for the given project
35
- #
36
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-language-get
37
- # @return [Lokalise::Collection::ProjectLanguage<Lokalise::Resources::ProjectLanguage>]
38
- # @param project_id [String]
39
- # @param params [Hash]
40
- def create_languages(project_id, params)
41
- c_r Lokalise::Resources::ProjectLanguage, :create, project_id, params, :languages
42
- end
43
-
44
- # Updates language for the given project
45
- #
46
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-language-put
47
- # @return [Lokalise::Resources::ProjectLanguage]
48
- # @param project_id [String]
49
- # @param language_id [String, Integer]
50
- # @param params [Hash]
51
- def update_language(project_id, language_id, params)
52
- c_r Lokalise::Resources::ProjectLanguage, :update, [project_id, language_id], params
53
- end
54
-
55
- # Deletes language for the given project
56
- #
57
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-language-delete
58
- # @return [Hash]
59
- # @param project_id [String]
60
- # @param language_id [String, Integer]
61
- def destroy_language(project_id, language_id)
62
- c_r Lokalise::Resources::ProjectLanguage, :destroy, [project_id, language_id]
63
- end
64
- end
65
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all orders for the given team
6
- #
7
- # @see https://lokalise.co/api2docs/curl/#transition-list-all-orders-get
8
- # @return [Lokalise::Collection::Order<Lokalise::Resources::Order>]
9
- # @param team_id [String]
10
- # @param params [Hash]
11
- def orders(team_id, params = {})
12
- c_r Lokalise::Collections::Order, :all, team_id, params
13
- end
14
-
15
- # Returns a single order for the given team
16
- #
17
- # @see https://lokalise.co/api2docs/curl/#transition-retrieve-an-order-get
18
- # @return [Lokalise::Resources::Order]
19
- # @param team_id [String]
20
- # @param order_id [String, Integer]
21
- def order(team_id, order_id)
22
- c_r Lokalise::Resources::Order, :find, [team_id, order_id]
23
- end
24
-
25
- # Creates an order for the given team
26
- #
27
- # @see https://lokalise.co/api2docs/curl/#transition-create-an-order-post
28
- # @return [Lokalise::Resources::Order]
29
- # @param team_id [String]
30
- # @param params [Hash]
31
- def create_order(team_id, params)
32
- c_r Lokalise::Resources::Order, :create, team_id, params
33
- end
34
- end
35
- end
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all payment cards available to the user authorized with the API token
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-cards-get
8
- # @return [Lokalise::Collection::PaymentCard<Lokalise::Resources::PaymentCard>]
9
- # @param params [Hash]
10
- def payment_cards(params = {})
11
- c_r Lokalise::Collections::PaymentCard, :all, nil, params
12
- end
13
-
14
- # Returns a single payment card
15
- #
16
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-card-get
17
- # @return [Lokalise::Resources::PaymentCard]
18
- # @param card_id [String, Integer]
19
- def payment_card(card_id)
20
- c_r Lokalise::Resources::PaymentCard, :find, card_id
21
- end
22
-
23
- # Creates a payment card
24
- #
25
- # @see https://lokalise.co/api2docs/curl/#transition-create-a-card-post
26
- # @return [Lokalise::Resources::PaymentCard]
27
- # @param params [Hash]
28
- def create_payment_card(params)
29
- c_r Lokalise::Resources::PaymentCard, :create, nil, params
30
- end
31
-
32
- # Deletes the payment card
33
- #
34
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-card-delete
35
- # @return [Hash]
36
- # @param card_id [String, Integer]
37
- def destroy_payment_card(card_id)
38
- c_r Lokalise::Resources::PaymentCard, :destroy, card_id
39
- end
40
- end
41
- end
@@ -1,60 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all projects available to the user authorized with the API token
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-projects-get
8
- # @return [Lokalise::Collection::Project<Lokalise::Resources::Project>]
9
- # @param params [Hash]
10
- def projects(params = {})
11
- c_r Lokalise::Collections::Project, :all, nil, params
12
- end
13
-
14
- # Returns a single project
15
- #
16
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-project-get
17
- # @return [Lokalise::Resources::Project]
18
- # @param project_id [String, Integer]
19
- def project(project_id)
20
- c_r Lokalise::Resources::Project, :find, project_id
21
- end
22
-
23
- # Creates project
24
- #
25
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-project-post
26
- # @return [Lokalise::Resources::Project]
27
- # @param params [Hash]
28
- def create_project(params)
29
- c_r Lokalise::Resources::Project, :create, nil, params
30
- end
31
-
32
- # Updates project
33
- #
34
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-project-put
35
- # @return [Lokalise::Resources::Project]
36
- # @param project_id [String, Integer]
37
- # @param params [Hash]
38
- def update_project(project_id, params)
39
- c_r Lokalise::Resources::Project, :update, project_id, params
40
- end
41
-
42
- # Deletes all keys and translations from the project
43
- #
44
- # @see https://app.lokalise.com/api2docs/curl/#transition-empty-a-project-put
45
- # @return [Hash]
46
- # @param project_id [String, Integer]
47
- def empty_project(project_id)
48
- c_r Lokalise::Resources::Project, :empty, [project_id, 'empty']
49
- end
50
-
51
- # Deletes the project
52
- #
53
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-project-delete
54
- # @return [Hash]
55
- # @param project_id [String, Integer]
56
- def destroy_project(project_id)
57
- c_r Lokalise::Resources::Project, :destroy, project_id
58
- end
59
- end
60
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all queued processes for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-processes-get
8
- # @return [Lokalise::Collection::QueuedProcess<Lokalise::Resources::QueuedProcess>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def queued_processes(project_id, params = {})
12
- c_r Lokalise::Collections::QueuedProcess, :all, project_id, params
13
- end
14
-
15
- # Returns a queued process for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-process-get
18
- # @return [Lokalise::Resources::QueuedProcess]
19
- # @param project_id [String]
20
- # @param process_id [String]
21
- def queued_process(project_id, process_id)
22
- c_r Lokalise::Resources::QueuedProcess, :find,
23
- [project_id, process_id]
24
- end
25
- end
26
- end
@@ -1,56 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all screenshots for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-screenshots-get
8
- # @return [Lokalise::Collection::Screenshot<Lokalise::Resources::Screenshot>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def screenshots(project_id, params = {})
12
- c_r Lokalise::Collections::Screenshot, :all, project_id, params
13
- end
14
-
15
- # Returns a single screenshot for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-screenshot-get
18
- # @return [Lokalise::Resources::Screenshot]
19
- # @param project_id [String]
20
- # @param screenshot_id [String, Integer]
21
- def screenshot(project_id, screenshot_id)
22
- c_r Lokalise::Resources::Screenshot, :find, [project_id, screenshot_id]
23
- end
24
-
25
- # Creates one or more screenshots for the given project
26
- #
27
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-screenshots-post
28
- # @return [Lokalise::Collection::Screenshot<Lokalise::Resources::Screenshot>]
29
- # @param project_id [String]
30
- # @param params [Hash]
31
- def create_screenshots(project_id, params = {})
32
- c_r Lokalise::Resources::Screenshot, :create, project_id, params, :screenshots
33
- end
34
-
35
- # Updates screenshot
36
- #
37
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-screenshot-put
38
- # @return [Lokalise::Resources::Screenshot]
39
- # @param project_id [String]
40
- # @param screenshot_id [String, Integer]
41
- # @param params [Hash]
42
- def update_screenshot(project_id, screenshot_id, params = {})
43
- c_r Lokalise::Resources::Screenshot, :update, [project_id, screenshot_id], params
44
- end
45
-
46
- # Deletes screenshot
47
- #
48
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-screenshot-delete
49
- # @return [Hash]
50
- # @param project_id [String]
51
- # @param screenshot_id [String, Integer]
52
- def destroy_screenshot(project_id, screenshot_id)
53
- c_r Lokalise::Resources::Screenshot, :destroy, [project_id, screenshot_id]
54
- end
55
- end
56
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all segments for the given key and language ISO code
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-segments-for-key-language-get
8
- # @return [Lokalise::Collection::Segments<Lokalise::Resources::Segment>]
9
- # @param project_id [String]
10
- # @param key_id [String, Integer]
11
- # @param lang_iso [String]
12
- # @param params [Hash]
13
- def segments(project_id, key_id, lang_iso, params = {})
14
- c_r Lokalise::Collections::Segment, :all, [project_id, key_id, lang_iso], params
15
- end
16
-
17
- # Returns a segment under a given number for the given key and language ISO code
18
- #
19
- # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-segment-for-key-language-get
20
- # @return [Lokalise::Resources::Segment]
21
- # @param project_id [String]
22
- # @param key_id [String, Integer]
23
- # @param lang_iso [String]
24
- # @params segment_number [Integer, String]
25
- # @param params [Hash]
26
- def segment(project_id, key_id, lang_iso, segment_number, params = {})
27
- c_r Lokalise::Resources::Segment, :find, [project_id, key_id, lang_iso, segment_number], params
28
- end
29
-
30
- # Updates a segment under a given number for the given key and language ISO code
31
- #
32
- # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-segment-post
33
- # @return [Lokalise::Resources::Segment]
34
- # @param project_id [String]
35
- # @param key_id [String, Integer]
36
- # @param lang_iso [String]
37
- # @params segment_number [Integer, String]
38
- # @param params [Hash]
39
- def update_segment(project_id, key_id, lang_iso, segment_number, params = {})
40
- c_r Lokalise::Resources::Segment, :update, [project_id, key_id, lang_iso, segment_number], params
41
- end
42
- end
43
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Lokalise
4
- class Client
5
- # Returns all snapshots for the given project
6
- #
7
- # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-snapshots-get
8
- # @return [Lokalise::Collection::Snapshot<Lokalise::Resources::Snapshot>]
9
- # @param project_id [String]
10
- # @param params [Hash]
11
- def snapshots(project_id, params = {})
12
- c_r Lokalise::Collections::Snapshot, :all, project_id, params
13
- end
14
-
15
- # Creates snapshot for the given project
16
- #
17
- # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-snapshot-post
18
- # @return [Lokalise::Resources::Snapshot]
19
- # @param project_id [String]
20
- # @param params [Hash]
21
- def create_snapshot(project_id, params = {})
22
- c_r Lokalise::Resources::Snapshot, :create, project_id, params
23
- end
24
-
25
- # Restore project from the given snapshot by producing project's copy
26
- #
27
- # @see https://app.lokalise.com/api2docs/curl/#transition-restore-a-snapshot-post
28
- # @return [Lokalise::Resources::Project]
29
- # @param project_id [String]
30
- # @param snapshot_id [String, Integer]
31
- def restore_snapshot(project_id, snapshot_id)
32
- c_r Lokalise::Resources::Snapshot, :restore, [project_id, snapshot_id]
33
- end
34
-
35
- # Deletes snapshot
36
- #
37
- # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-snapshot-delete
38
- # @return [Hash]
39
- # @param project_id [String]
40
- # @param snapshot_id [String, Integer]
41
- def destroy_snapshot(project_id, snapshot_id)
42
- c_r Lokalise::Resources::Snapshot, :destroy, [project_id, snapshot_id]
43
- end
44
- end
45
- end