-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from crowdin/client-updates
Release '1.4.0'
- Loading branch information
Showing
19 changed files
with
943 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# frozen_string_literal: true | ||
|
||
module Crowdin | ||
module ApiResources | ||
module Bundles | ||
def list_bundles(query = {}, project_id = config.project_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:get, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles", | ||
{ params: query } | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
|
||
def add_bundle(query = {}, project_id = config.project_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:post, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles", | ||
{ params: query } | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
|
||
def get_bundle(bundle_id, project_id = config.project_id) | ||
bundle_id || raise_parameter_is_required_error(:bundle_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:get, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles/#{bundle_id}" | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
|
||
def delete_bundle(bundle_id, project_id = config.project_id) | ||
bundle_id || raise_parameter_is_required_error(:bundle_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:delete, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles/#{bundle_id}" | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
|
||
def edit_bundle(bundle_id, query = {}, project_id = config.project_id) | ||
bundle_id || raise_parameter_is_required_error(:bundle_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:patch, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles/#{bundle_id}", | ||
{ params: query } | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
|
||
def bundle_list_files(bundle_id, query = {}, project_id = config.project_id) | ||
bundle_id || raise_parameter_is_required_error(:bundle_id) | ||
project_id || raise_project_id_is_required_error | ||
|
||
request = Web::Request.new( | ||
connection, | ||
:get, | ||
"#{config.target_api_url}/projects/#{project_id}/bundles/#{bundle_id}/files", | ||
{ params: query } | ||
) | ||
Web::SendRequest.new(request).perform | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.