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
@@ -0,0 +1,79 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Keys
6
+ # Returns all translation keys for the given project
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-keys-get
9
+ # @return [RubyLokaliseApi::Collection::Key<RubyLokaliseApi::Resources::Key>]
10
+ # @param project_id [String]
11
+ # @param params [Hash]
12
+ def keys(project_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::Key, :all, project_id, params
14
+ end
15
+
16
+ # Returns a single translation key for the given project
17
+ #
18
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-key-get
19
+ # @return [RubyLokaliseApi::Resources::Key]
20
+ # @param project_id [String]
21
+ # @param key_id [String, Integer]
22
+ # @param params [Hash]
23
+ def key(project_id, key_id, params = {})
24
+ c_r RubyLokaliseApi::Resources::Key, :find, [project_id, key_id], params
25
+ end
26
+
27
+ # Creates one or more translation keys for the given project
28
+ #
29
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-keys-post
30
+ # @return [RubyLokaliseApi::Collection::Key<RubyLokaliseApi::Resources::Key>]
31
+ # @param project_id [String]
32
+ # @param params [Hash, Array<Hash>]
33
+ def create_keys(project_id, params = {})
34
+ c_r RubyLokaliseApi::Resources::Key, :create, project_id, params, :keys
35
+ end
36
+
37
+ # Updates translation key for the given project
38
+ #
39
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put
40
+ # @return [RubyLokaliseApi::Resources::Key]
41
+ # @param project_id [String]
42
+ # @param key_id [String, Integer]
43
+ # @param params [Hash]
44
+ def update_key(project_id, key_id, params = {})
45
+ c_r RubyLokaliseApi::Resources::Key, :update, [project_id, key_id], params
46
+ end
47
+
48
+ # Updates one or multiple translation keys for the given project
49
+ #
50
+ # @see https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put
51
+ # @return [RubyLokaliseApi::Collection::Key<RubyLokaliseApi::Resources::Key>]
52
+ # @param project_id [String]
53
+ # @param params [Hash, Array<Hash>]
54
+ def update_keys(project_id, params)
55
+ c_r RubyLokaliseApi::Resources::Key, :update, project_id, params, :keys
56
+ end
57
+
58
+ # Deletes translation key for the given project
59
+ #
60
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-key-delete
61
+ # @return [Hash]
62
+ # @param project_id [String]
63
+ # @param key_id [String, Integer]
64
+ def destroy_key(project_id, key_id)
65
+ c_r RubyLokaliseApi::Resources::Key, :destroy, [project_id, key_id]
66
+ end
67
+
68
+ # Deletes one or multiple translation keys for the given project
69
+ #
70
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete
71
+ # @return [Hash]
72
+ # @param project_id [String]
73
+ # @param key_ids [String, Integer, Array<String>, Array<Integer>]
74
+ def destroy_keys(project_id, key_ids)
75
+ c_r RubyLokaliseApi::Resources::Key, :destroy, project_id, key_ids, :keys
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Languages
6
+ # Returns all languages supported by Lokalise
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-system-languages-get
9
+ # @return [RubyLokaliseApi::Collection::SystemLanguage<RubyLokaliseApi::Resources::SystemLanguage>]
10
+ # @param params [Hash]
11
+ def system_languages(params = {})
12
+ c_r RubyLokaliseApi::Collections::SystemLanguage, :all, nil, params
13
+ end
14
+
15
+ # Returns all languages for the given project
16
+ #
17
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-project-languages-get
18
+ # @return [RubyLokaliseApi::Collection::ProjectLanguage<RubyLokaliseApi::Resources::ProjectLanguage>]
19
+ # @param project_id [String, Integer]
20
+ # @param params [Hash]
21
+ def project_languages(project_id, params = {})
22
+ c_r RubyLokaliseApi::Collections::ProjectLanguage, :all, project_id, params
23
+ end
24
+
25
+ # Returns a single language for the given project
26
+ #
27
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-language-get
28
+ # @return [RubyLokaliseApi::Resources::ProjectLanguage]
29
+ # @param project_id [String]
30
+ # @param language_id [String, Integer]
31
+ def language(project_id, language_id)
32
+ c_r RubyLokaliseApi::Resources::ProjectLanguage, :find, [project_id, language_id]
33
+ end
34
+
35
+ # Creates one or more language for the given project
36
+ #
37
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-language-get
38
+ # @return [RubyLokaliseApi::Collection::ProjectLanguage<RubyLokaliseApi::Resources::ProjectLanguage>]
39
+ # @param project_id [String]
40
+ # @param params [Hash]
41
+ def create_languages(project_id, params)
42
+ c_r RubyLokaliseApi::Resources::ProjectLanguage, :create, project_id, params, :languages
43
+ end
44
+
45
+ # Updates language for the given project
46
+ #
47
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-language-put
48
+ # @return [RubyLokaliseApi::Resources::ProjectLanguage]
49
+ # @param project_id [String]
50
+ # @param language_id [String, Integer]
51
+ # @param params [Hash]
52
+ def update_language(project_id, language_id, params)
53
+ c_r RubyLokaliseApi::Resources::ProjectLanguage, :update, [project_id, language_id], params
54
+ end
55
+
56
+ # Deletes language for the given project
57
+ #
58
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-language-delete
59
+ # @return [Hash]
60
+ # @param project_id [String]
61
+ # @param language_id [String, Integer]
62
+ def destroy_language(project_id, language_id)
63
+ c_r RubyLokaliseApi::Resources::ProjectLanguage, :destroy, [project_id, language_id]
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Orders
6
+ # Returns all orders for the given team
7
+ #
8
+ # @see https://lokalise.co/api2docs/curl/#transition-list-all-orders-get
9
+ # @return [RubyLokaliseApi::Collection::Order<RubyLokaliseApi::Resources::Order>]
10
+ # @param team_id [String]
11
+ # @param params [Hash]
12
+ def orders(team_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::Order, :all, team_id, params
14
+ end
15
+
16
+ # Returns a single order for the given team
17
+ #
18
+ # @see https://lokalise.co/api2docs/curl/#transition-retrieve-an-order-get
19
+ # @return [RubyLokaliseApi::Resources::Order]
20
+ # @param team_id [String]
21
+ # @param order_id [String, Integer]
22
+ def order(team_id, order_id)
23
+ c_r RubyLokaliseApi::Resources::Order, :find, [team_id, order_id]
24
+ end
25
+
26
+ # Creates an order for the given team
27
+ #
28
+ # @see https://lokalise.co/api2docs/curl/#transition-create-an-order-post
29
+ # @return [RubyLokaliseApi::Resources::Order]
30
+ # @param team_id [String]
31
+ # @param params [Hash]
32
+ def create_order(team_id, params)
33
+ c_r RubyLokaliseApi::Resources::Order, :create, team_id, params
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module PaymentCards
6
+ # Returns all payment cards available to the user authorized with the API token
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-cards-get
9
+ # @return [RubyLokaliseApi::Collection::PaymentCard<RubyLokaliseApi::Resources::PaymentCard>]
10
+ # @param params [Hash]
11
+ def payment_cards(params = {})
12
+ c_r RubyLokaliseApi::Collections::PaymentCard, :all, nil, params
13
+ end
14
+
15
+ # Returns a single payment card
16
+ #
17
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-card-get
18
+ # @return [RubyLokaliseApi::Resources::PaymentCard]
19
+ # @param card_id [String, Integer]
20
+ def payment_card(card_id)
21
+ c_r RubyLokaliseApi::Resources::PaymentCard, :find, card_id
22
+ end
23
+
24
+ # Creates a payment card
25
+ #
26
+ # @see https://lokalise.co/api2docs/curl/#transition-create-a-card-post
27
+ # @return [RubyLokaliseApi::Resources::PaymentCard]
28
+ # @param params [Hash]
29
+ def create_payment_card(params)
30
+ c_r RubyLokaliseApi::Resources::PaymentCard, :create, nil, params
31
+ end
32
+
33
+ # Deletes the payment card
34
+ #
35
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-card-delete
36
+ # @return [Hash]
37
+ # @param card_id [String, Integer]
38
+ def destroy_payment_card(card_id)
39
+ c_r RubyLokaliseApi::Resources::PaymentCard, :destroy, card_id
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Projects
6
+ # Returns all projects available to the user authorized with the API token
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-projects-get
9
+ # @return [RubyLokaliseApi::Collection::Project<RubyLokaliseApi::Resources::Project>]
10
+ # @param params [Hash]
11
+ def projects(params = {})
12
+ c_r RubyLokaliseApi::Collections::Project, :all, nil, params
13
+ end
14
+
15
+ # Returns a single project
16
+ #
17
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-project-get
18
+ # @return [RubyLokaliseApi::Resources::Project]
19
+ # @param project_id [String, Integer]
20
+ def project(project_id)
21
+ c_r RubyLokaliseApi::Resources::Project, :find, project_id
22
+ end
23
+
24
+ # Creates project
25
+ #
26
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-project-post
27
+ # @return [RubyLokaliseApi::Resources::Project]
28
+ # @param params [Hash]
29
+ def create_project(params)
30
+ c_r RubyLokaliseApi::Resources::Project, :create, nil, params
31
+ end
32
+
33
+ # Updates project
34
+ #
35
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-project-put
36
+ # @return [RubyLokaliseApi::Resources::Project]
37
+ # @param project_id [String, Integer]
38
+ # @param params [Hash]
39
+ def update_project(project_id, params)
40
+ c_r RubyLokaliseApi::Resources::Project, :update, project_id, params
41
+ end
42
+
43
+ # Deletes all keys and translations from the project
44
+ #
45
+ # @see https://app.lokalise.com/api2docs/curl/#transition-empty-a-project-put
46
+ # @return [Hash]
47
+ # @param project_id [String, Integer]
48
+ def empty_project(project_id)
49
+ c_r RubyLokaliseApi::Resources::Project, :empty, [project_id, 'empty']
50
+ end
51
+
52
+ # Deletes the project
53
+ #
54
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-project-delete
55
+ # @return [Hash]
56
+ # @param project_id [String, Integer]
57
+ def destroy_project(project_id)
58
+ c_r RubyLokaliseApi::Resources::Project, :destroy, project_id
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module QueuedProcesses
6
+ # Returns all queued processes for the given project
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-processes-get
9
+ # @return [RubyLokaliseApi::Collection::QueuedProcess<RubyLokaliseApi::Resources::QueuedProcess>]
10
+ # @param project_id [String]
11
+ # @param params [Hash]
12
+ def queued_processes(project_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::QueuedProcess, :all, project_id, params
14
+ end
15
+
16
+ # Returns a queued process for the given project
17
+ #
18
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-process-get
19
+ # @return [RubyLokaliseApi::Resources::QueuedProcess]
20
+ # @param project_id [String]
21
+ # @param process_id [String]
22
+ def queued_process(project_id, process_id)
23
+ c_r RubyLokaliseApi::Resources::QueuedProcess, :find,
24
+ [project_id, process_id]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Screenshots
6
+ # Returns all screenshots for the given project
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-screenshots-get
9
+ # @return [RubyLokaliseApi::Collection::Screenshot<RubyLokaliseApi::Resources::Screenshot>]
10
+ # @param project_id [String]
11
+ # @param params [Hash]
12
+ def screenshots(project_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::Screenshot, :all, project_id, params
14
+ end
15
+
16
+ # Returns a single screenshot for the given project
17
+ #
18
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-screenshot-get
19
+ # @return [RubyLokaliseApi::Resources::Screenshot]
20
+ # @param project_id [String]
21
+ # @param screenshot_id [String, Integer]
22
+ def screenshot(project_id, screenshot_id)
23
+ c_r RubyLokaliseApi::Resources::Screenshot, :find, [project_id, screenshot_id]
24
+ end
25
+
26
+ # Creates one or more screenshots for the given project
27
+ #
28
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-screenshots-post
29
+ # @return [RubyLokaliseApi::Collection::Screenshot<RubyLokaliseApi::Resources::Screenshot>]
30
+ # @param project_id [String]
31
+ # @param params [Hash]
32
+ def create_screenshots(project_id, params = {})
33
+ c_r RubyLokaliseApi::Resources::Screenshot, :create, project_id, params, :screenshots
34
+ end
35
+
36
+ # Updates screenshot
37
+ #
38
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-screenshot-put
39
+ # @return [RubyLokaliseApi::Resources::Screenshot]
40
+ # @param project_id [String]
41
+ # @param screenshot_id [String, Integer]
42
+ # @param params [Hash]
43
+ def update_screenshot(project_id, screenshot_id, params = {})
44
+ c_r RubyLokaliseApi::Resources::Screenshot, :update, [project_id, screenshot_id], params
45
+ end
46
+
47
+ # Deletes screenshot
48
+ #
49
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-screenshot-delete
50
+ # @return [Hash]
51
+ # @param project_id [String]
52
+ # @param screenshot_id [String, Integer]
53
+ def destroy_screenshot(project_id, screenshot_id)
54
+ c_r RubyLokaliseApi::Resources::Screenshot, :destroy, [project_id, screenshot_id]
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Segments
6
+ # Returns all segments for the given key and language ISO code
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-segments-for-key-language-get
9
+ # @return [RubyLokaliseApi::Collection::Segments<RubyLokaliseApi::Resources::Segment>]
10
+ # @param project_id [String]
11
+ # @param key_id [String, Integer]
12
+ # @param lang_iso [String]
13
+ # @param params [Hash]
14
+ def segments(project_id, key_id, lang_iso, params = {})
15
+ c_r RubyLokaliseApi::Collections::Segment, :all, [project_id, key_id, lang_iso], params
16
+ end
17
+
18
+ # Returns a segment under a given number for the given key and language ISO code
19
+ #
20
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-segment-for-key-language-get
21
+ # @return [RubyLokaliseApi::Resources::Segment]
22
+ # @param project_id [String]
23
+ # @param key_id [String, Integer]
24
+ # @param lang_iso [String]
25
+ # @params segment_number [Integer, String]
26
+ # @param params [Hash]
27
+ def segment(project_id, key_id, lang_iso, segment_number, params = {})
28
+ c_r RubyLokaliseApi::Resources::Segment, :find, [project_id, key_id, lang_iso, segment_number], params
29
+ end
30
+
31
+ # Updates a segment under a given number for the given key and language ISO code
32
+ #
33
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-segment-post
34
+ # @return [RubyLokaliseApi::Resources::Segment]
35
+ # @param project_id [String]
36
+ # @param key_id [String, Integer]
37
+ # @param lang_iso [String]
38
+ # @params segment_number [Integer, String]
39
+ # @param params [Hash]
40
+ def update_segment(project_id, key_id, lang_iso, segment_number, params = {})
41
+ c_r RubyLokaliseApi::Resources::Segment, :update, [project_id, key_id, lang_iso, segment_number], params
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Snapshots
6
+ # Returns all snapshots for the given project
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-snapshots-get
9
+ # @return [RubyLokaliseApi::Collection::Snapshot<RubyLokaliseApi::Resources::Snapshot>]
10
+ # @param project_id [String]
11
+ # @param params [Hash]
12
+ def snapshots(project_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::Snapshot, :all, project_id, params
14
+ end
15
+
16
+ # Creates snapshot for the given project
17
+ #
18
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-snapshot-post
19
+ # @return [RubyLokaliseApi::Resources::Snapshot]
20
+ # @param project_id [String]
21
+ # @param params [Hash]
22
+ def create_snapshot(project_id, params = {})
23
+ c_r RubyLokaliseApi::Resources::Snapshot, :create, project_id, params
24
+ end
25
+
26
+ # Restore project from the given snapshot by producing project's copy
27
+ #
28
+ # @see https://app.lokalise.com/api2docs/curl/#transition-restore-a-snapshot-post
29
+ # @return [RubyLokaliseApi::Resources::Project]
30
+ # @param project_id [String]
31
+ # @param snapshot_id [String, Integer]
32
+ def restore_snapshot(project_id, snapshot_id)
33
+ c_r RubyLokaliseApi::Resources::Snapshot, :restore, [project_id, snapshot_id]
34
+ end
35
+
36
+ # Deletes snapshot
37
+ #
38
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-snapshot-delete
39
+ # @return [Hash]
40
+ # @param project_id [String]
41
+ # @param snapshot_id [String, Integer]
42
+ def destroy_snapshot(project_id, snapshot_id)
43
+ c_r RubyLokaliseApi::Resources::Snapshot, :destroy, [project_id, snapshot_id]
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module Tasks
6
+ # Returns all tasks for the given project
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-list-all-tasks-get
9
+ # @return [RubyLokaliseApi::Collection::Task<RubyLokaliseApi::Resources::Task>]
10
+ # @param project_id [String]
11
+ # @param params [Hash]
12
+ def tasks(project_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::Task, :all, project_id, params
14
+ end
15
+
16
+ # Returns a single task for the given project
17
+ #
18
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-task-get
19
+ # @return [RubyLokaliseApi::Resources::Task]
20
+ # @param project_id [String]
21
+ # @param task_id [String, Integer]
22
+ def task(project_id, task_id)
23
+ c_r RubyLokaliseApi::Resources::Task, :find, [project_id, task_id]
24
+ end
25
+
26
+ # Creates task for the given project
27
+ #
28
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-a-task-post
29
+ # @return [RubyLokaliseApi::Resources::Task]
30
+ # @param project_id [String]
31
+ # @param params [Hash]
32
+ def create_task(project_id, params)
33
+ c_r RubyLokaliseApi::Resources::Task, :create, project_id, params
34
+ end
35
+
36
+ # Updates task for the given project
37
+ #
38
+ # @see https://app.lokalise.com/api2docs/curl/#transition-update-a-task-put
39
+ # @return [RubyLokaliseApi::Resources::Task]
40
+ # @param project_id [String]
41
+ # @param task_id [String, Integer]
42
+ # @param params [Hash]
43
+ def update_task(project_id, task_id, params = {})
44
+ c_r RubyLokaliseApi::Resources::Task, :update, [project_id, task_id], params
45
+ end
46
+
47
+ # Deletes task for the given project
48
+ #
49
+ # @see https://app.lokalise.com/api2docs/curl/#transition-delete-a-task-delete
50
+ # @return [Hash]
51
+ # @param project_id [String]
52
+ # @param task_id [String, Integer]
53
+ def destroy_task(project_id, task_id)
54
+ c_r RubyLokaliseApi::Resources::Task, :destroy, [project_id, task_id]
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module TeamUserBillingDetails
6
+ # Returns team user billing details
7
+ #
8
+ # @see https://app.lokalise.com/api2docs/curl/#transition-retrieve-team-user-billing-details-get
9
+ # @return [RubyLokaliseApi::Resources::TeamUserBillingDetails]
10
+ # @param team_id [String]
11
+ def team_user_billing_details(team_id)
12
+ c_r RubyLokaliseApi::Resources::TeamUserBillingDetails, :find, team_id
13
+ end
14
+
15
+ # Creates team user billing details
16
+ #
17
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-team-user-billing-details-post
18
+ # @return [RubyLokaliseApi::Resources::TeamUserBillingDetails]
19
+ # @param team_id [String]
20
+ # @param params [Hash]
21
+ def create_team_user_billing_details(team_id, params)
22
+ c_r RubyLokaliseApi::Resources::TeamUserBillingDetails, :create, team_id, params
23
+ end
24
+
25
+ # Updates team user billing details
26
+ #
27
+ # @see https://app.lokalise.com/api2docs/curl/#transition-create-team-user-billing-details-post
28
+ # @return [RubyLokaliseApi::Resources::TeamUserBillingDetails]
29
+ # @param team_id [String]
30
+ # @param params [Hash]
31
+ def update_team_user_billing_details(team_id, params)
32
+ c_r RubyLokaliseApi::Resources::TeamUserBillingDetails, :update, team_id, params
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RubyLokaliseApi
4
+ module Rest
5
+ module TeamUserGroups
6
+ # Returns all team user groups for the given team
7
+ #
8
+ # @see https://lokalise.co/api2docs/curl/#transition-list-all-groups-get
9
+ # @return [RubyLokaliseApi::Collection::TeamUserGroup<RubyLokaliseApi::Resources::TeamUserGroup>]
10
+ # @param team_id [String]
11
+ # @param params [Hash]
12
+ def team_user_groups(team_id, params = {})
13
+ c_r RubyLokaliseApi::Collections::TeamUserGroup, :all, team_id, params
14
+ end
15
+
16
+ # Returns team user from the given team
17
+ #
18
+ # @see https://lokalise.co/api2docs/curl/#transition-retrieve-a-group-get
19
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
20
+ # @param team_id [String]
21
+ # @param group_id [String, Integer]
22
+ def team_user_group(team_id, group_id)
23
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :find, [team_id, group_id]
24
+ end
25
+
26
+ # Creates team user group
27
+ #
28
+ # @see https://lokalise.co/api2docs/curl/#resource-team-user-groups
29
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
30
+ # @param params [Hash]
31
+ def create_team_user_group(team_id, params)
32
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :create, team_id, params
33
+ end
34
+
35
+ # Updates team user group for the given team
36
+ #
37
+ # @see https://lokalise.co/api2docs/curl/#transition-update-a-group-put
38
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
39
+ # @param team_id [String]
40
+ # @param group_id [String, Integer]
41
+ # @param params [Hash]
42
+ def update_team_user_group(team_id, group_id, params)
43
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :update, [team_id, group_id], params
44
+ end
45
+
46
+ # Deletes team user group from the given team
47
+ #
48
+ # @see https://lokalise.co/api2docs/curl/#transition-delete-a-group-delete
49
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
50
+ # @param team_id [String]
51
+ # @param group_id [String, Integer]
52
+ def destroy_team_user_group(team_id, group_id)
53
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :destroy, [team_id, group_id]
54
+ end
55
+
56
+ # Adds projects to the given group
57
+ #
58
+ # @see https://lokalise.co/api2docs/curl/#transition-add-projects-to-group-put
59
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
60
+ # @param team_id [String]
61
+ # @param group_id [String, Integer]
62
+ # @param project_ids [String, Integer, Array<String>, Array<Integer>]
63
+ def add_projects_to_group(team_id, group_id, project_ids)
64
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :update,
65
+ [team_id, group_id, 'projects', 'add'],
66
+ project_ids, :projects, [team_id, group_id]
67
+ end
68
+
69
+ # Removes projects from the given group
70
+ #
71
+ # @see https://lokalise.co/api2docs/curl/#transition-remove-projects-from-group-put
72
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
73
+ # @param team_id [String]
74
+ # @param group_id [String, Integer]
75
+ # @param project_ids [String, Integer, Array<String>, Array<Integer>]
76
+ def remove_projects_from_group(team_id, group_id, project_ids)
77
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :update,
78
+ [team_id, group_id, 'projects', 'remove'],
79
+ project_ids, :projects, [team_id, group_id]
80
+ end
81
+
82
+ # Adds users to the given group
83
+ #
84
+ # @see https://lokalise.co/api2docs/curl/#transition-add-members-to-group-put
85
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
86
+ # @param team_id [String]
87
+ # @param group_id [String, Integer]
88
+ # @param users_ids [String, Integer, Array<String>, Array<Integer>]
89
+ def add_users_to_group(team_id, group_id, users_ids)
90
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :update,
91
+ [team_id, group_id, 'members', 'add'],
92
+ users_ids, :users, [team_id, group_id]
93
+ end
94
+
95
+ # Removes users from the given group
96
+ #
97
+ # @see https://lokalise.co/api2docs/curl/#transition-remove-members-from-group-put
98
+ # @return [RubyLokaliseApi::Resources::TeamUserGroup]
99
+ # @param team_id [String]
100
+ # @param group_id [String, Integer]
101
+ # @param users_ids [String, Integer, Array<String>, Array<Integer>]
102
+ def remove_users_from_group(team_id, group_id, users_ids)
103
+ c_r RubyLokaliseApi::Resources::TeamUserGroup, :update,
104
+ [team_id, group_id, 'members', 'remove'],
105
+ users_ids, :users, [team_id, group_id]
106
+ end
107
+ end
108
+ end
109
+ end