Skip to content

Commit fdce57a

Browse files
committed
- adds missing put methods for java sdk
1 parent 970c882 commit fdce57a

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Templates/Java/requests_extensions/BaseEntityRequest.java.tt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,23 @@ import <#=importNamespace#>.http.HttpMethod;
5050
<#=deleteMethods(c)#>
5151
<#=patchMethods(c)#>
5252
<#=postMethods(c)#>
53+
<#=putMethods(c)#>
5354
<# }
5455
else if (!c.AsOdcmClass().Derived.Any() && c.AsOdcmClass().Base != null)
5556
{ #>
5657
<#=getMethods(c)#>
5758
<#=deleteMethods(c)#>
5859
<#=patchMethods(c)#>
5960
<#=postMethods(c)#>
61+
<#=putMethods(c)#>
6062
<# }
6163
else if (c.AsOdcmClass().Base == null)
6264
{ #>
6365
<#=getMethods(c)#>
6466
<#=deleteMethods(c)#>
6567
<#=patchMethods(c)#>
6668
<#=postMethods(c)#>
69+
<#=putMethods(c)#>
6770
<# }
6871
else
6972
{
@@ -215,6 +218,34 @@ import <#=importNamespace#>.http.HttpMethod;
215218
public {0} post(final {0} new{0}) throws ClientException {{
216219
return send(HttpMethod.POST, new{0});
217220
}}
221+
";
222+
return string.Format(formatString, odcmObject.TypeName());
223+
}
224+
225+
public string putMethods(OdcmObject c)
226+
{
227+
var odcmObject = c.AsOdcmClass();
228+
var formatString =
229+
@" /**
230+
* Creates a {0} with a new object
231+
*
232+
* @param new{0} the object to create/update
233+
* @param callback the callback to be called after success or failure
234+
*/
235+
public void put(final {0} new{0}, final ICallback<{0}> callback) {{
236+
send(HttpMethod.PUT, callback, new{0});
237+
}}
238+
239+
/**
240+
* Creates a {0} with a new object
241+
*
242+
* @param new{0} the object to create/update
243+
* @return the created {0}
244+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
245+
*/
246+
public {0} put(final {0} new{0}) throws ClientException {{
247+
return send(HttpMethod.PUT, new{0});
248+
}}
218249
";
219250
return string.Format(formatString, odcmObject.TypeName());
220251
}

Templates/Java/requests_extensions/IBaseEntityRequest.java.tt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,23 @@ import <#=importNamespace#>.http.IHttpRequest;
2222
<#=deleteMethods(c)#>
2323
<#=patchMethods(c)#>
2424
<#=postMethods(c)#>
25+
<#=putMethods(c)#>
2526
<# }
2627
else if (!c.AsOdcmClass().Derived.Any() && c.AsOdcmClass().Base != null)
2728
{ #>
2829
<#=getMethods(c)#>
2930
<#=deleteMethods(c)#>
3031
<#=patchMethods(c)#>
3132
<#=postMethods(c)#>
33+
<#=putMethods(c)#>
3234
<# }
3335
else if (c.AsOdcmClass().Base == null)
3436
{ #>
3537
<#=getMethods(c)#>
3638
<#=deleteMethods(c)#>
3739
<#=patchMethods(c)#>
3840
<#=postMethods(c)#>
41+
<#=putMethods(c)#>
3942
<# }
4043
else
4144
{
@@ -162,6 +165,30 @@ import <#=importNamespace#>.http.IHttpRequest;
162165
* @throws ClientException this exception occurs if the request was unable to complete for any reason
163166
*/
164167
{0} post(final {0} new{0}) throws ClientException;
168+
";
169+
return string.Format(formatString, odcmObject.TypeName());
170+
}
171+
172+
public string putMethods(OdcmObject c)
173+
{
174+
var odcmObject = c.AsOdcmClass();
175+
var formatString =
176+
@" /**
177+
* Posts a {0} with a new object
178+
*
179+
* @param new{0} the object to create/update
180+
* @param callback the callback to be called after success or failure
181+
*/
182+
void put(final {0} new{0}, final ICallback<{0}> callback);
183+
184+
/**
185+
* Posts a {0} with a new object
186+
*
187+
* @param new{0} the object to create/update
188+
* @return the created {0}
189+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
190+
*/
191+
{0} put(final {0} new{0}) throws ClientException;
165192
";
166193
return string.Format(formatString, odcmObject.TypeName());
167194
}

0 commit comments

Comments
 (0)