Skip to content

Commit

Permalink
Enhancement
Browse files Browse the repository at this point in the history
Add the destination parameter to the download_bundle method.
  • Loading branch information
araujotadeu committed Apr 15, 2024
1 parent 98430f7 commit 113eb58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/crowdin-api/api_resources/bundles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def check_bundle_export_status(bundle_id, export_id, project_id = config.project

# @param bundle_id [Integer] Bundle ID
# @param export_id [String] Export ID
# @param destination [String] Destination of File
# * {https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.download.get API Documentation}
# * {https://developer.crowdin.com/enterprise/api/v2/#operation/api.projects.bundles.exports.download.get Enterprise API Documentation}
def download_bundle(bundle_id, export_id, project_id = config.project_id)
def download_bundle(bundle_id, export_id, destination = nil, project_id = config.project_id)
bundle_id || raise_parameter_is_required_error(:bundle_id)
export_id || raise_parameter_is_required_error(:export_id)
project_id || raise_project_id_is_required_error
Expand All @@ -82,7 +83,7 @@ def download_bundle(bundle_id, export_id, project_id = config.project_id)
:get,
"#{config.target_api_url}/projects/#{project_id}/bundles/#{bundle_id}/exports/#{export_id}/download"
)
Web::SendRequest.new(request).perform
Web::SendRequest.new(request, destination).perform
end

# @param bundle_id [Integer] Bundle ID
Expand Down

0 comments on commit 113eb58

Please sign in to comment.