Skip to content

Commit

Permalink
SRUBY-15 delete file endpoint (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
bodrovis authored Jul 27, 2022
1 parent 6ec4655 commit 04b12d1
Show file tree
Hide file tree
Showing 50 changed files with 350 additions and 214 deletions.
2 changes: 1 addition & 1 deletion docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ gem 'minima', '~> 2.0'

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem 'github-pages', '~> 225', group: :jekyll_plugins
gem 'github-pages', '~> 227', group: :jekyll_plugins

# If you have any plugins, put them here!
group :jekyll_plugins do
Expand Down
2 changes: 2 additions & 0 deletions docs/_data/api_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
path: download-translation-files
- title: Upload translation file
path: upload-translation-file
- title: Delete a file
path: delete-a-file
- title: Translation keys
path: keys
sub_paths:
Expand Down
5 changes: 5 additions & 0 deletions docs/additional_info/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 6.1.0 (27-Jul-2022)

* Added support for the [Delete a file endpoint](https://lokalise.github.io/ruby-lokalise-api/api/files#delete-a-file)
* Updated links to the API docs

## 6.0.0 (11-Mar-2022)

* **Breaking change**: this gem now requires Ruby 2.7 or above.
Expand Down
12 changes: 6 additions & 6 deletions docs/api/branches.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Fetch branches

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-branches-get)
[Doc](https://developers.lokalise.com/reference/list-all-branches)

```ruby
@client.branches(project_id, params = {}) # Input:
Expand All @@ -23,7 +23,7 @@ For example:

## Fetch branch

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-branch)

```ruby
@client.branch(project_id, branch_id) # Input:
Expand All @@ -35,7 +35,7 @@ For example:

## Create branch

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-branch)

```ruby
@client.create_branch(project_id, params) # Input:
Expand All @@ -54,7 +54,7 @@ For example:

## Update branch

[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-branch-put)
[Doc](https://developers.lokalise.com/reference/update-a-branch)

```ruby
@client.update_branch(project_id, branch_id, params) # Input:
Expand All @@ -81,7 +81,7 @@ For example:

## Delete branch

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-branch-delete)
[Doc](https://developers.lokalise.com/reference/delete-a-branch)

```ruby
@client.destroy_branch(project_id, branch_id) # Input:
Expand All @@ -100,7 +100,7 @@ branch.destroy

## Merge branch

[Doc](https://app.lokalise.com/api2docs/curl/#transition-merge-a-branch-post)
[Doc](https://developers.lokalise.com/reference/merge-a-branch)

```ruby
@client.merge_branch(project_id, branch_id, params) # Input:
Expand Down
10 changes: 5 additions & 5 deletions docs/api/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Fetch project comments

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-project-comments-get)
[Doc](https://developers.lokalise.com/reference/list-project-comments)

```ruby
@client.project_comments(project_id, params = {}) # Input:
Expand All @@ -17,7 +17,7 @@

## Fetch key comments

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-key-comments-get)
[Doc](https://developers.lokalise.com/reference/list-key-comments)

```ruby
@client.comments(project_id, key_id, params = {}) # Input:
Expand All @@ -37,7 +37,7 @@ For example:

## Create key comments

[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-comments-post)
[Doc](https://developers.lokalise.com/reference/create-comments)

```ruby
@client.create_comments(project_id, key_id, params) # Input:
Expand All @@ -60,7 +60,7 @@ For example:

## Fetch key comment

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-comment-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-comment)

```ruby
@client.comment(project_id, key_id, comment_id) # Input:
Expand All @@ -73,7 +73,7 @@ For example:

## Delete key comment

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-comment-delete)
[Doc](https://developers.lokalise.com/reference/delete-a-comment)

```ruby
@client.destroy_comment(project_id, key_id, comment_id) # Input:
Expand Down
10 changes: 5 additions & 5 deletions docs/api/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Fetch contributors

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-contributors-get)
[Doc](https://developers.lokalise.com/reference/list-all-contributors)

```ruby
@client.contributors(project_id, params = {}) # Input:
Expand All @@ -21,7 +21,7 @@ For example:

## Fetch a single contributor

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-contributor)

```ruby
@client.contributor(project_id, contributor_id) # Input:
Expand All @@ -33,7 +33,7 @@ For example:

## Create contributors

[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-contributors-post)
[Doc](https://developers.lokalise.com/reference/create-contributors)

```ruby
@client.create_contributors(project_id, params) # Input:
Expand Down Expand Up @@ -67,7 +67,7 @@ For example:

## Update contributor

[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-contributor-put)
[Doc](https://developers.lokalise.com/reference/update-a-contributor)

```ruby
@client.update_contributor(project_id, contributor_id, params) # Input:
Expand Down Expand Up @@ -99,7 +99,7 @@ For example:

## Delete contributor

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete)
[Doc](https://developers.lokalise.com/reference/delete-a-contributor)

```ruby
@client.destroy_contributor(project_id, contributor_id) # Input:
Expand Down
12 changes: 6 additions & 6 deletions docs/api/custom-translation-statuses.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Fetch translation statuses

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-custom-translation-statuses-get)
[Doc](https://developers.lokalise.com/reference/list-all-custom-translation-statuses)

```ruby
@client.translation_statuses(project_id, params = {}) # Input:
Expand All @@ -25,7 +25,7 @@ For example:

## Fetch a single translation status

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-custom-translation-status-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-custom-translation-status)

```ruby
@client.translation_status(project_id, status_id) # Input:
Expand All @@ -37,7 +37,7 @@ For example:

## Create translation status

[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-custom-translation-status-post)
[Doc](https://developers.lokalise.com/reference/create-a-custom-translation-status)

```ruby
@client.create_translation_status(project_id, params) # Input:
Expand All @@ -59,7 +59,7 @@ For example:

## Update translation status

[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-custom-translation-status-put)
[Doc](https://developers.lokalise.com/reference/update-a-custom-translation-status)

```ruby
@client.update_translation_status(project_id, status_id, params) # Input:
Expand Down Expand Up @@ -89,7 +89,7 @@ For example:

## Delete translation status

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-custom-translation-status-delete)
[Doc](https://developers.lokalise.com/reference/delete-a-custom-translation-status)

```ruby
@client.destroy_translation_status(project_id, status_id) # Input:
Expand All @@ -108,7 +108,7 @@ status.destroy

## Supported color codes for translation statuses

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-available-colors-for-custom-translation-statuses-get)
[Doc](https://developers.lokalise.com/reference/retrieve-available-colors-for-custom-translation-statuses)

As long as Lokalise supports only very limited array of color hexadecimal codes for custom translation statuses, this method can be used to fetch all permitted values.

Expand Down
28 changes: 23 additions & 5 deletions docs/api/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Fetch translation files

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-files-get)
[Doc](https://developers.lokalise.com/reference/list-all-files)

```ruby
@client.files(project_id, params = {}) # Input:
Expand All @@ -23,7 +23,7 @@ For example:

## Download translation files

[Doc](https://app.lokalise.com/api2docs/curl/#transition-download-files-post)
[Doc](https://developers.lokalise.com/reference/download-files)

Exports project files as a `.zip` bundle and makes them available to download (the link is valid for 12 months).

Expand All @@ -32,7 +32,7 @@ Exports project files as a `.zip` bundle and makes them available to download (t
## project_id (string, required)
## params (hash, required)
### :format (string, required) - one of the file formats supported by Lokalise (json, xml, po etc).
### Find the list of other supported params at https://app.lokalise.com/api2docs/curl/#transition-download-files-post
### Find the list of other supported params at https://developers.lokalise.com/reference/download-files
# Output:
## Hash with the project id and a "bundle_url" link
```
Expand All @@ -48,7 +48,7 @@ For example:

## Upload translation file

[Doc](https://app.lokalise.com/api2docs/curl/#transition-upload-a-file-post)
[Doc](https://developers.lokalise.com/reference/upload-a-file)

Starting from July 2020, **background uploading is the only method of importing translation files**.

Expand All @@ -59,7 +59,7 @@ Starting from July 2020, **background uploading is the only method of importing
### :data (string, required) - base64-encoded data (the format must be supported by Lokalise)
### :filename (string, required)
### :lang_iso (string, required)
### Find the list of other supported params at https://app.lokalise.com/api2docs/curl/#transition-upload-a-file-post
### Find the list of other supported params at https://developers.lokalise.com/reference/upload-a-file
# Output:
## QueuedProcess resource
```
Expand Down Expand Up @@ -110,3 +110,21 @@ process = @client.upload_file project_id,
lang_iso: 'en'
uploaded? process
```

## Delete a file

[Doc](https://developers.lokalise.com/reference/delete-a-file)

```ruby
@client.destroy_file(project_id, file_id) # Input:
## project_id (string, required)
## file_id (string or integer, required)
# Output:
## Hash with project_id and "file_deleted" set to "true"
```

For example:

```ruby
@client.destroy_file project_id, file_id
```
20 changes: 10 additions & 10 deletions docs/api/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Fetch project keys

[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-keys-get)
[Doc](https://developers.lokalise.com/reference/list-all-keys)

```ruby
@client.keys(project_id, params = {}) # Input:
Expand All @@ -23,7 +23,7 @@ For example:

## Fetch a single project key

[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-key-get)
[Doc](https://developers.lokalise.com/reference/retrieve-a-key)

```ruby
@client.key(project_id, key_id, params = {}) # Input:
Expand All @@ -43,15 +43,15 @@ For example:

## Create project keys

[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-keys-post)
[Doc](https://developers.lokalise.com/reference/create-keys)

```ruby
@client.create_keys(project_id, params) # Input:
## project_id (string, required)
## params (array of hashes or hash, required)
### :key_name (string or hash, required) - for projects with enabled per-platform key names, pass hash with "ios", "android", "web" and "other" params.
### :platforms (array) - supported values are "ios", "android", "web" and "other"
### Find all other supported attributes at https://app.lokalise.com/api2docs/curl/#transition-create-keys-post
### Find all other supported attributes at https://developers.lokalise.com/reference/create-keys
# Output:
## Collection of newly created keys
```
Expand All @@ -73,14 +73,14 @@ For example:

## Update project key

[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put)
[Doc](https://developers.lokalise.com/reference/update-a-key)

```ruby
@client.update_key(project_id, key_id, params = {}) # Input:
## project_id (string, required)
## key_id (string, required)
## params (hash)
### Find a list of supported attributes at https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put
### Find a list of supported attributes at https://developers.lokalise.com/reference/update-a-key
# Output:
## Updated key
```
Expand All @@ -100,14 +100,14 @@ For example:

## Bulk update project keys

[Doc](https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put)
[Doc](https://developers.lokalise.com/reference/bulk-update)

```ruby
@client.update_keys(project_id, params) # Input:
## project_id (string, required)
## params (hash or array of hashes, required)
### :key_id (string, required)
### Find all other supported attributes at https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put
### Find all other supported attributes at https://developers.lokalise.com/reference/bulk-update
# Output:
## Collection of updated keys
```
Expand All @@ -129,7 +129,7 @@ client.update_keys '123.abc', [

## Delete project key

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-key-delete)
[Doc](https://developers.lokalise.com/reference/delete-a-key)

```ruby
@client.destroy_key(project_id, key_id) # Input:
Expand All @@ -148,7 +148,7 @@ key.destroy

## Bulk delete project keys

[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete)
[Doc](https://developers.lokalise.com/reference/delete-multiple-keys)

```ruby
@client.destroy_keys(project_id, key_ids) # Input:
Expand Down
Loading

0 comments on commit 04b12d1

Please sign in to comment.