Sha256: 7b38fe4df2d0975efdec01ed38155b2ed4580ae1d04e7abf1ef3ae1388360cd6

Contents?: true

Size: 1.85 KB

Versions: 2

Compression:

Stored size: 1.85 KB

Contents

# frozen_string_literal: true

module RubyLokaliseApi
  module Rest
    module Files
      # Returns all translation files for the given project
      #
      # @see https://developers.lokalise.com/reference/list-all-files
      # @return [RubyLokaliseApi::Collection::File<RubyLokaliseApi::Resources::File>]
      # @param project_id [String]
      # @param params [Hash]
      def files(project_id, params = {})
        c_r RubyLokaliseApi::Collections::File, :all, project_id, params
      end

      # 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
      #
      # @see https://developers.lokalise.com/reference/download-files
      # @return [Hash]
      # @param project_id [String]
      # @param params [Hash]
      def download_files(project_id, params)
        c_r RubyLokaliseApi::Resources::File, :download, [project_id, 'download'], params
      end

      # Imports translation file to the given project. File data must base64-encoded.
      # To encode your data in Base64, use `Base64.strict_encode64()` method.
      #
      # @see https://developers.lokalise.com/reference/upload-a-file
      # @return [Hash]
      # @param project_id [String]
      # @param params [Hash]
      def upload_file(project_id, params)
        c_r RubyLokaliseApi::Resources::File, :upload, [project_id, 'upload'], params
      end

      # Deletes a file and it's associated keys from the project.
      # File __unassigned__ cannot be deleted.
      #
      # @see https://developers.lokalise.com/reference/delete-a-file
      # @return [Hash]
      # @param project_id [String]
      # @param params [Hash]
      def destroy_file(project_id, file_id)
        c_r RubyLokaliseApi::Resources::File, :destroy, [project_id, file_id]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-lokalise-api-6.2.0 lib/ruby_lokalise_api/rest/files.rb
ruby-lokalise-api-6.1.0 lib/ruby_lokalise_api/rest/files.rb