Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit d96c875

Browse files
author
Peter Nied
committed
Merge pull request #52 from daboxu/update-templates
fix #30 inconstant verbs & remove view.recent
2 parents e0a9d3a + 009a429 commit d96c875

23 files changed

+452
-75
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ mavenGroupId = com.onedrive.sdk
2323
mavenArtifactId = onedrive-sdk-android
2424
mavenMajorVersion = 1
2525
mavenMinorVersion = 1
26-
mavenPatchVersion = 2
26+
mavenPatchVersion = 3
2727
nightliesUrl = http://dl.bintray.com/onedrive/Maven

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseCopyRequest.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,34 @@ public BaseCopyRequest(final String requestUrl, final IOneDriveClient client, fi
5555
addHeader("Prefer", "respond-async");
5656
}
5757

58-
public void create(final ICallback<AsyncMonitor<Item>> callback) {
58+
/**
59+
* @deprecated As of release 1.1.3, replaced by {@link #post(ICallback)}
60+
*/
61+
@Deprecated public void create(final ICallback<AsyncMonitor<Item>> callback) {
62+
this.post(callback);
63+
}
64+
65+
/**
66+
* @deprecated As of release 1.1.3, replaced by {@link #post()}
67+
*/
68+
@Deprecated public AsyncMonitor<Item> create() throws ClientException {
69+
return this.post();
70+
}
71+
72+
public void post(final ICallback<AsyncMonitor<Item>> callback) {
5973
getClient().getExecutors().performOnBackground(new Runnable() {
6074
@Override
6175
public void run() {
6276
try {
63-
getClient().getExecutors().performOnForeground(create(), callback);
77+
getClient().getExecutors().performOnForeground(post(), callback);
6478
} catch (final ClientException e) {
6579
getClient().getExecutors().performOnForeground(e, callback);
6680
}
6781
}
6882
});
6983
}
7084

71-
public AsyncMonitor<Item> create() throws ClientException {
85+
public AsyncMonitor<Item> post() throws ClientException {
7286
final AsyncMonitorLocation monitorLocation = send(HttpMethod.POST, mBody);
7387

7488
return new AsyncMonitor<>(getClient(), monitorLocation, new ResultGetter<Item>() {

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseCreateLinkRequest.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,25 @@ public BaseCreateLinkRequest(final String requestUrl, final IOneDriveClient clie
5353
mBody.type = type;
5454
}
5555

56-
public void create(final ICallback<Permission> callback) {
56+
/**
57+
* @deprecated As of release 1.1.3, replaced by {@link #post(ICallback)}
58+
*/
59+
@Deprecated public void create(final ICallback<Permission> callback) {
60+
this.post(callback);
61+
}
62+
63+
/**
64+
* @deprecated As of release 1.1.3, replaced by {@link #post()}
65+
*/
66+
@Deprecated public Permission create() throws ClientException {
67+
return this.post();
68+
}
69+
70+
public void post(final ICallback<Permission> callback) {
5771
send(HttpMethod.POST, callback, mBody);
5872
}
5973

60-
public Permission create() throws ClientException {
74+
public Permission post() throws ClientException {
6175
return send(HttpMethod.POST, mBody);
6276
}
6377

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseCreateSessionRequest.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,25 @@ public BaseCreateSessionRequest(final String requestUrl, final IOneDriveClient c
5353
mBody.item = item;
5454
}
5555

56-
public void create(final ICallback<UploadSession> callback) {
56+
/**
57+
* @deprecated As of release 1.1.3, replaced by {@link #post(ICallback)}
58+
*/
59+
@Deprecated public void create(final ICallback<UploadSession> callback) {
60+
this.post(callback);
61+
}
62+
63+
/**
64+
* @deprecated As of release 1.1.3, replaced by {@link #post()}
65+
*/
66+
@Deprecated public UploadSession create() throws ClientException {
67+
return this.post();
68+
}
69+
70+
public void post(final ICallback<UploadSession> callback) {
5771
send(HttpMethod.POST, callback, mBody);
5872
}
5973

60-
public UploadSession create() throws ClientException {
74+
public UploadSession post() throws ClientException {
6175
return send(HttpMethod.POST, mBody);
6276
}
6377

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseDriveRequest.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,25 @@ public Drive get() throws ClientException {
5858
return send(HttpMethod.GET, null);
5959
}
6060

61-
public void update(final Drive sourceDrive, final ICallback<Drive> callback) {
61+
/**
62+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Drive, ICallback)}
63+
*/
64+
@Deprecated public void update(final Drive sourceDrive, final ICallback<Drive> callback) {
65+
this.patch(sourceDrive, callback);
66+
}
67+
68+
/**
69+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Drive)}
70+
*/
71+
@Deprecated public Drive update(final Drive sourceDrive) throws ClientException {
72+
return this.patch(sourceDrive);
73+
}
74+
75+
public void patch(final Drive sourceDrive, final ICallback<Drive> callback) {
6276
send(HttpMethod.PATCH, callback, sourceDrive);
6377
}
6478

65-
public Drive update(final Drive sourceDrive) throws ClientException {
79+
public Drive patch(final Drive sourceDrive) throws ClientException {
6680
return send(HttpMethod.PATCH, sourceDrive);
6781
}
6882

@@ -74,11 +88,25 @@ public void delete() throws ClientException {
7488
send(HttpMethod.DELETE, null);
7589
}
7690

77-
public void create(final Drive newDrive, final ICallback<Drive> callback) {
91+
/**
92+
* @deprecated As of release 1.1.3, replaced by {@link #post(Drive, ICallback)}
93+
*/
94+
@Deprecated public void create(final Drive newDrive, final ICallback<Drive> callback) {
95+
this.post(newDrive, callback);
96+
}
97+
98+
/**
99+
* @deprecated As of release 1.1.3, replaced by {@link #post(Drive)}
100+
*/
101+
@Deprecated public Drive create(final Drive newDrive) throws ClientException {
102+
return this.post(newDrive);
103+
}
104+
105+
public void post(final Drive newDrive, final ICallback<Drive> callback) {
78106
send(HttpMethod.POST, callback, newDrive);
79107
}
80108

81-
public Drive create(final Drive newDrive) throws ClientException {
109+
public Drive post(final Drive newDrive) throws ClientException {
82110
return send(HttpMethod.POST, newDrive);
83111
}
84112

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseDriveRequestBuilder.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,4 @@ public IItemRequestBuilder getSpecial(final String id) {
7979
public IAllPhotosRequestBuilder getAllPhotos() {
8080
return new AllPhotosRequestBuilder(getRequestUrlWithAdditionalSegment("view.allPhotos"), getClient(), null);
8181
}
82-
83-
public IRecentRequestBuilder getRecent() {
84-
return new RecentRequestBuilder(getRequestUrlWithAdditionalSegment("view.recent"), getClient(), null);
85-
}
8682
}

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseItemCollectionRequest.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,33 @@ public IItemCollectionPage get() throws ClientException {
7070
return buildFromResponse(response);
7171
}
7272

73-
public void create(final Item newItem, final ICallback<Item> callback) {
73+
/**
74+
* @deprecated As of release 1.1.3, replaced by {@link #post(Item, ICallback)}
75+
*/
76+
@Deprecated public void create(final Item newItem, final ICallback<Item> callback) {
77+
this.post(newItem, callback);
78+
}
79+
80+
/**
81+
* @deprecated As of release 1.1.3, replaced by {@link #post(Item)}
82+
*/
83+
@Deprecated public Item create(final Item newItem) throws ClientException {
84+
return this.post(newItem);
85+
}
86+
87+
public void post(final Item newItem, final ICallback<Item> callback) {
7488
final String requestUrl = getBaseRequest().getRequestUrl().toString();
7589
new ItemRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null)
7690
.buildRequest()
77-
.create(newItem, callback);
91+
.post(newItem, callback);
7892
}
7993

80-
public Item create(final Item newItem) throws ClientException {
94+
public Item post(final Item newItem) throws ClientException {
8195
final String requestUrl = getBaseRequest().getRequestUrl().toString();
8296
return new ItemRequestBuilder(requestUrl, getBaseRequest().getClient(), /* Options */ null)
8397
.buildRequest()
84-
.create(newItem);
98+
.post(newItem);
8599
}
86-
87100
public IItemCollectionRequest expand(final String value) {
88101
addQueryOption(new QueryOption("expand", value));
89102
return (ItemCollectionRequest)this;

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseItemRequest.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,25 @@ public Item get() throws ClientException {
5858
return send(HttpMethod.GET, null);
5959
}
6060

61-
public void update(final Item sourceItem, final ICallback<Item> callback) {
61+
/**
62+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Item, ICallback)}
63+
*/
64+
@Deprecated public void update(final Item sourceItem, final ICallback<Item> callback) {
65+
this.patch(sourceItem, callback);
66+
}
67+
68+
/**
69+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Item)}
70+
*/
71+
@Deprecated public Item update(final Item sourceItem) throws ClientException {
72+
return this.patch(sourceItem);
73+
}
74+
75+
public void patch(final Item sourceItem, final ICallback<Item> callback) {
6276
send(HttpMethod.PATCH, callback, sourceItem);
6377
}
6478

65-
public Item update(final Item sourceItem) throws ClientException {
79+
public Item patch(final Item sourceItem) throws ClientException {
6680
return send(HttpMethod.PATCH, sourceItem);
6781
}
6882

@@ -74,11 +88,25 @@ public void delete() throws ClientException {
7488
send(HttpMethod.DELETE, null);
7589
}
7690

77-
public void create(final Item newItem, final ICallback<Item> callback) {
91+
/**
92+
* @deprecated As of release 1.1.3, replaced by {@link #post(Item, ICallback)}
93+
*/
94+
@Deprecated public void create(final Item newItem, final ICallback<Item> callback) {
95+
this.post(newItem, callback);
96+
}
97+
98+
/**
99+
* @deprecated As of release 1.1.3, replaced by {@link #post(Item)}
100+
*/
101+
@Deprecated public Item create(final Item newItem) throws ClientException {
102+
return this.post(newItem);
103+
}
104+
105+
public void post(final Item newItem, final ICallback<Item> callback) {
78106
send(HttpMethod.POST, callback, newItem);
79107
}
80108

81-
public Item create(final Item newItem) throws ClientException {
109+
public Item post(final Item newItem) throws ClientException {
82110
return send(HttpMethod.POST, newItem);
83111
}
84112

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BasePermissionRequest.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,25 @@ public Permission get() throws ClientException {
5858
return send(HttpMethod.GET, null);
5959
}
6060

61-
public void update(final Permission sourcePermission, final ICallback<Permission> callback) {
61+
/**
62+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Permission, ICallback)}
63+
*/
64+
@Deprecated public void update(final Permission sourcePermission, final ICallback<Permission> callback) {
65+
this.patch(sourcePermission, callback);
66+
}
67+
68+
/**
69+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Permission)}
70+
*/
71+
@Deprecated public Permission update(final Permission sourcePermission) throws ClientException {
72+
return this.patch(sourcePermission);
73+
}
74+
75+
public void patch(final Permission sourcePermission, final ICallback<Permission> callback) {
6276
send(HttpMethod.PATCH, callback, sourcePermission);
6377
}
6478

65-
public Permission update(final Permission sourcePermission) throws ClientException {
79+
public Permission patch(final Permission sourcePermission) throws ClientException {
6680
return send(HttpMethod.PATCH, sourcePermission);
6781
}
6882

@@ -74,11 +88,25 @@ public void delete() throws ClientException {
7488
send(HttpMethod.DELETE, null);
7589
}
7690

77-
public void create(final Permission newPermission, final ICallback<Permission> callback) {
91+
/**
92+
* @deprecated As of release 1.1.3, replaced by {@link #post(Permission, ICallback)}
93+
*/
94+
@Deprecated public void create(final Permission newPermission, final ICallback<Permission> callback) {
95+
this.post(newPermission, callback);
96+
}
97+
98+
/**
99+
* @deprecated As of release 1.1.3, replaced by {@link #post(Permission)}
100+
*/
101+
@Deprecated public Permission create(final Permission newPermission) throws ClientException {
102+
return this.post(newPermission);
103+
}
104+
105+
public void post(final Permission newPermission, final ICallback<Permission> callback) {
78106
send(HttpMethod.POST, callback, newPermission);
79107
}
80108

81-
public Permission create(final Permission newPermission) throws ClientException {
109+
public Permission post(final Permission newPermission) throws ClientException {
82110
return send(HttpMethod.POST, newPermission);
83111
}
84112

onedrivesdk/src/main/java/com/onedrive/sdk/generated/BaseShareRequest.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,25 @@ public Share get() throws ClientException {
5858
return send(HttpMethod.GET, null);
5959
}
6060

61-
public void update(final Share sourceShare, final ICallback<Share> callback) {
61+
/**
62+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Share, ICallback)}
63+
*/
64+
@Deprecated public void update(final Share sourceShare, final ICallback<Share> callback) {
65+
this.patch(sourceShare, callback);
66+
}
67+
68+
/**
69+
* @deprecated As of release 1.1.3, replaced by {@link #patch(Share)}
70+
*/
71+
@Deprecated public Share update(final Share sourceShare) throws ClientException {
72+
return this.patch(sourceShare);
73+
}
74+
75+
public void patch(final Share sourceShare, final ICallback<Share> callback) {
6276
send(HttpMethod.PATCH, callback, sourceShare);
6377
}
6478

65-
public Share update(final Share sourceShare) throws ClientException {
79+
public Share patch(final Share sourceShare) throws ClientException {
6680
return send(HttpMethod.PATCH, sourceShare);
6781
}
6882

@@ -74,11 +88,25 @@ public void delete() throws ClientException {
7488
send(HttpMethod.DELETE, null);
7589
}
7690

77-
public void create(final Share newShare, final ICallback<Share> callback) {
91+
/**
92+
* @deprecated As of release 1.1.3, replaced by {@link #post(Share, ICallback)}
93+
*/
94+
@Deprecated public void create(final Share newShare, final ICallback<Share> callback) {
95+
this.post(newShare, callback);
96+
}
97+
98+
/**
99+
* @deprecated As of release 1.1.3, replaced by {@link #post(Share)}
100+
*/
101+
@Deprecated public Share create(final Share newShare) throws ClientException {
102+
return this.post(newShare);
103+
}
104+
105+
public void post(final Share newShare, final ICallback<Share> callback) {
78106
send(HttpMethod.POST, callback, newShare);
79107
}
80108

81-
public Share create(final Share newShare) throws ClientException {
109+
public Share post(final Share newShare) throws ClientException {
82110
return send(HttpMethod.POST, newShare);
83111
}
84112

0 commit comments

Comments
 (0)