-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement trash operation to retrieve recently deleted assets from By…
…nder (#116) * implement trash operations to be able to retrieve deleted assets from bynder api * adjust formatting by replacing tabs with spaces
- Loading branch information
Showing
11 changed files
with
421 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright (c) 2017 Bynder B.V. All rights reserved. | ||
* | ||
* Licensed under the MIT License. See LICENSE file in the project root for full license | ||
* information. | ||
*/ | ||
package com.bynder.sdk.model; | ||
|
||
import java.util.Map; | ||
|
||
import com.bynder.sdk.api.BynderApi; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Media model returned by {@link BynderApi#getRecentlyRemovedMediaList(Map)}. | ||
*/ | ||
public class DeletedMedia { | ||
|
||
/** | ||
* Media id. | ||
*/ | ||
private String id; | ||
/** | ||
* Media name. | ||
*/ | ||
private String name; | ||
/** | ||
* Date removed. | ||
*/ | ||
private String dateRemoved; | ||
/** | ||
* Date created. | ||
*/ | ||
private String dateCreated; | ||
/** | ||
* Username of the user triggering the deletion. | ||
*/ | ||
private String username; | ||
/** | ||
* UserID of the user triggering the deletion. | ||
*/ | ||
private String userId; | ||
/** | ||
* Public URL of the media item when available. | ||
*/ | ||
@SerializedName(value = "S3_filepointer") | ||
private String publicUrl; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDateRemoved() { | ||
return dateRemoved; | ||
} | ||
|
||
public void setDateRemoved(String dateRemoved) { | ||
this.dateRemoved = dateRemoved; | ||
} | ||
|
||
public String getDateCreated() { | ||
return dateCreated; | ||
} | ||
|
||
public void setDateCreated(String dateCreated) { | ||
this.dateCreated = dateCreated; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(String userId) { | ||
this.userId = userId; | ||
} | ||
|
||
public String getPublicUrl() { | ||
return publicUrl; | ||
} | ||
|
||
public void setPublicUrl(String publicUrl) { | ||
this.publicUrl = publicUrl; | ||
} | ||
|
||
} |
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,88 @@ | ||
/* | ||
* Copyright (c) 2017 Bynder B.V. All rights reserved. | ||
* | ||
* Licensed under the MIT License. See LICENSE file in the project root for full license | ||
* information. | ||
*/ | ||
package com.bynder.sdk.query; | ||
|
||
import com.bynder.sdk.query.decoder.ApiField; | ||
|
||
/** | ||
* Query to filter deleted media results. | ||
*/ | ||
public class DeletedMediaQuery { | ||
|
||
/** | ||
* Limit of results per request. Example: 20. Default: 10. | ||
*/ | ||
@ApiField | ||
private Integer limit; | ||
/** | ||
* Page to be retrieved. | ||
*/ | ||
@ApiField | ||
private Integer page; | ||
/** | ||
* Retrieve assets removed after this date. | ||
* You can only retrieve the removed assets from the last 30 days. | ||
*/ | ||
@ApiField | ||
private String dateRemoved; | ||
/** | ||
* Desired field to sort the returned list of results. | ||
*/ | ||
@ApiField | ||
private OrderField field; | ||
/** | ||
* Desired order for the returned list of results. | ||
*/ | ||
@ApiField | ||
private Order order; | ||
|
||
public Integer getLimit() { | ||
return limit; | ||
} | ||
|
||
public DeletedMediaQuery setLimit(Integer limit) { | ||
this.limit = limit; | ||
return this; | ||
} | ||
|
||
public Integer getPage() { | ||
return page; | ||
} | ||
|
||
public DeletedMediaQuery setPage(Integer page) { | ||
this.page = page; | ||
return this; | ||
} | ||
|
||
public String getDateRemoved() { | ||
return dateRemoved; | ||
} | ||
|
||
public DeletedMediaQuery setDateRemoved(String dateRemoved) { | ||
this.dateRemoved = dateRemoved; | ||
return this; | ||
} | ||
|
||
public OrderField getField() { | ||
return field; | ||
} | ||
|
||
public DeletedMediaQuery setField(OrderField field) { | ||
this.field = field; | ||
return this; | ||
} | ||
|
||
public Order getOrder() { | ||
return order; | ||
} | ||
|
||
public DeletedMediaQuery setOrder(Order order) { | ||
this.order = order; | ||
return this; | ||
} | ||
|
||
} |
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,26 @@ | ||
/* | ||
* Copyright (c) 2017 Bynder B.V. All rights reserved. | ||
* | ||
* Licensed under the MIT License. See LICENSE file in the project root for full license | ||
* information. | ||
*/ | ||
package com.bynder.sdk.query; | ||
|
||
/** | ||
* Enum used to define how API results should be ordered. | ||
*/ | ||
public enum Order { | ||
|
||
ASC("asc"), DESC("desc"); | ||
|
||
private final String name; | ||
|
||
Order(final String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
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,27 @@ | ||
/* | ||
* Copyright (c) 2017 Bynder B.V. All rights reserved. | ||
* | ||
* Licensed under the MIT License. See LICENSE file in the project root for full license | ||
* information. | ||
*/ | ||
package com.bynder.sdk.query; | ||
|
||
/** | ||
* Enum used to define by which field the API results should be ordered. | ||
*/ | ||
public enum OrderField { | ||
|
||
DATE_CREATED("media.dateCreated"), DATE_REMOVED("media.dateRemoved"), NAME("media.name"), | ||
USERNAME("media.username"); | ||
|
||
private final String name; | ||
|
||
OrderField(final String name) { | ||
this.name = name; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return name; | ||
} | ||
} |
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
Oops, something went wrong.