Skip to content

Commit 8b7023b

Browse files
author
Brian Melton
committed
PATCH + POST now taking params
1 parent 2db804b commit 8b7023b

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

Templates/Android/generated/BaseMethodRequest.java.tt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,40 +128,43 @@ if (c.AsOdcmMethod().IsAction()) {
128128
#>
129129
/**
130130
* Patches the <#=TypeName(c)#>
131-
*
131+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> with which to PATCH
132132
* @param callback The callback to be called after success or failure
133133
*/
134-
public void patch(final ICallback<<#=ReturnType(c)#>> callback) {
135-
send(HttpMethod.PATCH, callback, null);
134+
public void patch(<#=ReturnType(c)#> src<#=ReturnType(c)#>, final ICallback<<#=ReturnType(c)#>> callback) {
135+
send(HttpMethod.PATCH, callback, src<#=ReturnType(c)#>);
136136
}
137137

138138
/**
139139
* Patches the <#=TypeName(c)#>
140140
*
141+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> with which to PATCH
141142
* @return The <#=ReturnType(c)#>
142143
* @throws ClientException An exception occurs if there was an error while the request was sent
143144
*/
144-
public <#=ReturnType(c)#> patch() throws ClientException {
145-
return this.send(HttpMethod.PATCH, null);
145+
public <#=ReturnType(c)#> patch(<#=ReturnType(c)#> src<#=ReturnType(c)#>) throws ClientException {
146+
return this.send(HttpMethod.PATCH, src<#=ReturnType(c)#>);
146147
}
147148

148149
/**
149150
* Puts the <#=TypeName(c)#>
150151
*
152+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> to PUT
151153
* @param callback The callback to be called after success or failure
152154
*/
153-
public void put(final ICallback<<#=ReturnType(c)#>> callback) {
154-
send(HttpMethod.PUT, callback, null);
155+
public void put(<#=ReturnType(c)#> src<#=ReturnType(c)#>, final ICallback<<#=ReturnType(c)#>> callback) {
156+
send(HttpMethod.PUT, callback, src<#=ReturnType(c)#>);
155157
}
156158

157159
/**
158160
* Puts the <#=TypeName(c)#>
159161
*
162+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> to PUT
160163
* @return The <#=ReturnType(c)#>
161164
* @throws ClientException An exception occurs if there was an error while the request was sent
162165
*/
163-
public <#=ReturnType(c)#> put() throws ClientException {
164-
return this.send(HttpMethod.PUT, null);
166+
public <#=ReturnType(c)#> put(<#=ReturnType(c)#> src<#=ReturnType(c)#>) throws ClientException {
167+
return this.send(HttpMethod.PUT, src<#=ReturnType(c)#>);
165168
}
166169
<#
167170
}

Templates/Android/generated/IBaseMethodRequest.java.tt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,32 +95,36 @@ if (c.AsOdcmMethod().IsAction()) {
9595
/**
9696
* Patches the <#=TypeName(c)#>
9797
*
98+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> with which to PATCH
9899
* @param callback The callback to be called after success or failure
99100
*/
100-
void patch(final ICallback<<#=ReturnType(c)#>> callback);
101+
void patch(<#=ReturnType(c)#> src<#=ReturnType(c)#>, final ICallback<<#=ReturnType(c)#>> callback);
101102

102103
/**
103104
* Patches the <#=TypeName(c)#>
104105
*
106+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> with which to PATCH
105107
* @return The <#=ReturnType(c)#>
106108
* @throws ClientException An exception occurs if there was an error while the request was sent
107109
*/
108-
<#=ReturnType(c)#> patch() throws ClientException;
110+
<#=ReturnType(c)#> patch(<#=ReturnType(c)#> src<#=ReturnType(c)#>) throws ClientException;
109111

110112
/**
111113
* Puts the <#=TypeName(c)#>
112114
*
115+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> to PUT
113116
* @param callback The callback to be called after success or failure
114117
*/
115-
void put(final ICallback<<#=ReturnType(c)#>> callback);
118+
void put(<#=ReturnType(c)#> src<#=ReturnType(c)#>, final ICallback<<#=ReturnType(c)#>> callback);
116119

117120
/**
118121
* Puts the <#=TypeName(c)#>
119122
*
123+
* @param src<#=ReturnType(c)#> The <#=ReturnType(c)#> to PUT
120124
* @return The <#=ReturnType(c)#>
121125
* @throws ClientException An exception occurs if there was an error while the request was sent
122126
*/
123-
<#=ReturnType(c)#> put() throws ClientException;
127+
<#=ReturnType(c)#> put(<#=ReturnType(c)#> src<#=ReturnType(c)#>) throws ClientException;
124128
<#
125129
}
126130
#>

0 commit comments

Comments
 (0)