Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API version migration from v0.6 to v0.7 #80

Merged
merged 9 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

# History

## 3.4.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 3.4.0
## 4.0.0

I think this is kinda breaking enough change for a major version bump, don't you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but we should bump the version in gradle files as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I just didn't comment on every other line with a version. :-)

- Library:
- Migrated API from v0.6 to v0.7
onthecrow marked this conversation as resolved.
Show resolved Hide resolved
- Removed the `UploadcareClient.storeGroup()` and `UploadcareGroup.store()` methods, as its
endpoint has been removed.
onthecrow marked this conversation as resolved.
Show resolved Hide resolved
- Added event types of webhooks.
onthecrow marked this conversation as resolved.
Show resolved Hide resolved
- Removed the sorting methods by file size, as its parameter has been removed from the API query
parameters.
onthecrow marked this conversation as resolved.
Show resolved Hide resolved
- Example:
- Removed sorting options by file size from `UploadFragment`.

## 3.3.0
- Library:
- Added support for [signing your webhooks](https://uploadcare.com/docs/webhooks/#signed-webhooks) using the `signingSecret` parameter.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Check out [demo app](/example).

Supported features:

- File, group, and project API v0.6.
- File, group, and project API v0.7.
- Paginated resource fetching.
- CDN path builder.
- File uploading from a file, byte array, URL, and URI.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {

versions.androidx_core = "1.12.0"
versions.material = "1.9.0"
versions.navigation = "2.7.2"
versions.navigation = "2.7.3"
versions.lifecycle = "2.6.2"
versions.constraintlayout = "2.1.4"
versions.annotation = '1.7.0'
Expand Down
74 changes: 25 additions & 49 deletions documentation/LIBRARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Java
UploadcareClient uploadcare = new UploadcareClient("YOUR_PUBLIC_KEY", "YOUR_SECRET_KEY");
```

## List of files ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/filesList)) ##
## List of files ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesList)) ##

##### Asynchronous file fetch.

Expand Down Expand Up @@ -112,7 +112,7 @@ FilesQueryBuilder filesQueryBuilder = uploadcare.getFiles()
List<UploadcareFile> files = filesQueryBuilder.asList();
```

## File info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/fileInfo)) ##
## File info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/fileInfo)) ##

##### Asynchronous file info fetch.

Expand Down Expand Up @@ -160,7 +160,7 @@ Java
UploadcareFile file = uploadcare.getFile("YOUR_FILE_UUID");
```

## Store a file ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/storeFile)) ##
## Store a file ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/storeFile)) ##

##### Asynchronous file store.

Expand All @@ -184,7 +184,7 @@ Java
uploadcare.saveFile("YOUR_FILE_UUID");
```

## Batch file store ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/filesStoring)) ##
## Batch file store ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesStoring)) ##

##### Asynchronous multiple files store.

Expand Down Expand Up @@ -212,7 +212,7 @@ List<String> fileIds = ... // list of file UUID's
uploadcare.saveFiles(fileIds);
```

## Delete file ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/deleteFile)) ##
## Delete file ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/deleteFileStorage)) ##

##### Asynchronous file delete.

Expand All @@ -236,7 +236,7 @@ Java
uploadcare.deleteFile("YOUR_FILE_UUID");
```

## Batch file delete ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/filesDelete)) ##
## Batch file delete ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/filesDelete)) ##

##### Asynchronous multiple files delete.

Expand Down Expand Up @@ -264,7 +264,7 @@ List<String> fileIds = ... // list of file UUID's
uploadcare.deleteFiles(fileIds);
```

## Copy file to local storage ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/copyFileLocal)) ##
## Copy file to local storage ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/createLocalCopy)) ##

##### Asynchronous file copy to local storage.

Expand Down Expand Up @@ -321,7 +321,7 @@ UploadcareCopyFile copyResult = uploadcare.copyFileLocalStorage(source, true);
// process result that will have either UploadcareFile or URI depending on source.
```

## Copy file to remote storage ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/copyFile)) ##
## Copy file to remote storage ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/createRemoteCopy)) ##

##### Asynchronous copy file to remote storage.

Expand Down Expand Up @@ -385,7 +385,7 @@ UploadcareCopyFile copyResult = uploadcare.copyFileRemoteStorage(source, target,
// process result that will have either UploadcareFile or URI depending on source.
```

## List of groups ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/groupsList)) ##
## List of groups ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/groupsList)) ##

##### Asynchronous group list fetch.

Expand Down Expand Up @@ -451,7 +451,7 @@ GroupsQueryBuilder groupsQueryBuilder = uploadcare.getGroups()
List<UploadcareGroup> groups = groupsQueryBuilder.asList();
```

## Group info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/groupInfo)) ##
## Group info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/groupInfo)) ##

##### Asynchronous group info fetch.

Expand Down Expand Up @@ -499,31 +499,7 @@ Java
UploadcareGroup group = uploadcare.getGroup("YOUR_GROUP_UUID");
```

## Store group ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#tag/Group/paths/~1groups~1%3Cuuid%3E~1storage~1/put)) ##

##### Asynchronous group store.

Kotlin
```kotlin
uploadcare.storeGroupAsync(context, "YOUR_GROUP_UUID")
```
Java
```java
uploadcare.storeGroupAsync(context, "YOUR_GROUP_UUID", null); // callback is optional
```

##### Synchronous group store.

Kotlin
```kotlin
uploadcare.storeGroup("YOUR_GROUP_UUID")
```
Java
```java
uploadcare.storeGroup("YOUR_GROUP_UUID");
```

## Project info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/projectInfo)) ##
## Project info ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/projectInfo)) ##

##### Asynchronous project info fetch.

Expand Down Expand Up @@ -569,7 +545,7 @@ Java
Project project = uploadcare.getProject();
```

## List of webhooks ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/webhooksList)) ##
## List of webhooks ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhooksList)) ##

##### Asynchronous webhook list fetch.

Expand Down Expand Up @@ -615,7 +591,7 @@ Java
List<UploadcareWebhook> webhooks = uploadcare.getWebhooks();
```

## Create webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/webhookCreate)) ##
## Create webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhookCreate)) ##

##### Asynchronous webhook create.

Expand All @@ -624,7 +600,7 @@ Kotlin
uploadcare.createWebhookAsync(
context, // Context
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
signingSecret = "YOUR_WEBHOOK_SIGNING_SECRET",
callback = object : UploadcareWebhookCallback {
override fun onFailure(e: UploadcareApiException) {
Expand All @@ -641,7 +617,7 @@ Java
uploadcare.createWebhookAsync(
context, // Context
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET",
new UploadcareWebhookCallback() {
Expand All @@ -663,7 +639,7 @@ Kotlin
```kotlin
val webhook = uploadcare.createWebhook(
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET"
)
Expand All @@ -672,13 +648,13 @@ Java
```java
UploadcareWebhook webhook = uploadcare.createWebhook(
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET"
);
```

## Update webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/updateWebhook)) ##
## Update webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/updateWebhook)) ##

##### Asynchronous webhook update.

Expand All @@ -688,7 +664,7 @@ uploadcare.updateWebhookAsync(
context, // Context
"YOUR_WEBHOOK_UUID",
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
signingSecret = "YOUR_WEBHOOK_SIGNING_SECRET",
callback = object : UploadcareWebhookCallback {
override fun onFailure(e: UploadcareApiException) {
Expand All @@ -706,7 +682,7 @@ uploadcare.updateWebhookAsync(
context, // Context
"YOUR_WEBHOOK_UUID",
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET",
new UploadcareWebhookCallback() {
Expand All @@ -729,7 +705,7 @@ Kotlin
val webhook = uploadcare.updateWebhook(
"YOUR_WEBHOOK_UUID",
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET"
)
Expand All @@ -739,13 +715,13 @@ Java
UploadcareWebhook webhook = uploadcare.updateWebhook(
"YOUR_WEBHOOK_UUID",
URI.create("YOUR_WEBHOOK_URL"),
"YOUR_WEBHOOK_EVENT",
EventType.UPLOADED, // Webhook event
true, // is webhook active or not.
"YOUR_WEBHOOK_SIGNING_SECRET"
);
```

## Delete webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/webhookUnsubscribe)) ##
## Delete webhook ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/webhookUnsubscribe)) ##

##### Asynchronous webhook delete.

Expand All @@ -769,7 +745,7 @@ Java
uploadcare.deleteWebhook(URI.create("YOUR_WEBHOOK_URL"));
```

## Convert documents ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/documentConvert)) ##
## Convert documents ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/documentConvert)) ##

##### Asynchronous documents convert.

Expand Down Expand Up @@ -858,7 +834,7 @@ DocumentConverter converter = new DocumentConverter(uploadcare, conversionJobs);
List<UploadcareFile> result = converter.convert();
```

## Convert videos ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/videoConvert)) ##
## Convert videos ([API Reference](https://uploadcare.com/api-refs/rest-api/v0.7.0/#operation/videoConvert)) ##

##### Asynchronous videos convert.

Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
applicationId "com.uploadcare.android.example"
minSdkVersion versions.min_sdk
targetSdkVersion versions.target_sdk
versionCode 9
versionCode 10
versionName "${version}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class OrderDialogFragment : DialogFragment() {
private fun orderSelected(position: Int) {
val order: Order = when (position) {
1 -> Order.UPLOAD_TIME_DESC
2 -> Order.SIZE_ASC
3 -> Order.SIZE_DESC
0 -> Order.UPLOAD_TIME_ASC
else -> Order.UPLOAD_TIME_ASC
}
Expand All @@ -54,4 +52,4 @@ class OrderDialogFragment : DialogFragment() {

interface OrderDialogListener {
fun onOrderSelected(order: Order)
}
}
2 changes: 0 additions & 2 deletions example/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,5 @@
<array name="orders">
<item>Upload time, Ascending (Default)</item>
<item>Upload time, Descending</item>
<item>File size, Ascending</item>
<item>File size, Descending</item>
</array>
</resources>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project-wide Gradle settings.
version=3.3.0
version=3.4.0-SNAPSHOT

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
Expand Down
2 changes: 1 addition & 1 deletion library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is an Android library for Uploadcare.

Supported features:

- File, group, and project API v0.6.
- File, group, and project API v0.7.
- Paginated resources fetching.
- CDN path builder.
- File uploading from a file, byte array, URL, and URI.
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
defaultConfig {
minSdkVersion versions.min_sdk
targetSdkVersion versions.target_sdk
versionCode 13
versionCode 14
versionName "${version}"
buildConfigField 'String', 'VERSION_NAME', "\"${version}\""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ class FilesQueryBuilder(private val client: UploadcareClient)
return this
}

/**
* Adds a filter for datetime from objects will be returned.
* Order {@link Order#SIZE_ASC} will be used.
*
* @param fromSize File size in bytes.
*/
fun from(fromSize: Long): FilesQueryBuilder {
parameters["ordering"] = FilesOrderParameter(Order.SIZE_ASC)
parameters["from"] = FilesFromParameter(fromSize)
return this
}

/**
* Adds a filter for datetime to which objects will be returned.
* Order {@link Order#UPLOAD_TIME_DESC} will be used.
Expand All @@ -95,25 +83,13 @@ class FilesQueryBuilder(private val client: UploadcareClient)
return this
}

/**
* Adds a filter for datetime to which objects will be returned.
* Order {@link Order#SIZE_DESC} will be used.
*
* @param toSize File size in bytes.
*/
fun to(toSize: Long): FilesQueryBuilder {
parameters["ordering"] = FilesOrderParameter(Order.SIZE_DESC)
parameters["from"] = FilesFromParameter(toSize)
return this
}

/**
* Add special fields to the file object in the result.
*
* @param fields Example: "rekognition_info"
*/
fun addFields(fields: String): FilesQueryBuilder {
parameters["add_fields"] = AddFieldsParameter(fields)
fun include(fields: String): FilesQueryBuilder {
parameters["include"] = IncludeParameter(fields)
return this
}

Expand Down
Loading