Skip to content

Commit 4ae0d37

Browse files
authored
Merge pull request #282 from microsoftgraph/bugfix/missing-put-methods-java
- adds missing put methods for java sdk
2 parents 970c882 + 61e17b2 commit 4ae0d37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+818
-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
}

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/CallRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,27 @@ public Call post(final Call newCall) throws ClientException {
111111
return send(HttpMethod.POST, newCall);
112112
}
113113

114+
/**
115+
* Creates a Call with a new object
116+
*
117+
* @param newCall the object to create/update
118+
* @param callback the callback to be called after success or failure
119+
*/
120+
public void put(final Call newCall, final ICallback<Call> callback) {
121+
send(HttpMethod.PUT, callback, newCall);
122+
}
123+
124+
/**
125+
* Creates a Call with a new object
126+
*
127+
* @param newCall the object to create/update
128+
* @return the created Call
129+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
130+
*/
131+
public Call put(final Call newCall) throws ClientException {
132+
return send(HttpMethod.PUT, newCall);
133+
}
134+
114135
/**
115136
* Sets the select clause for the request
116137
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/CloudCommunicationsRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ public CloudCommunications post(final CloudCommunications newCloudCommunications
119119
return send(HttpMethod.POST, newCloudCommunications);
120120
}
121121

122+
/**
123+
* Creates a CloudCommunications with a new object
124+
*
125+
* @param newCloudCommunications the object to create/update
126+
* @param callback the callback to be called after success or failure
127+
*/
128+
public void put(final CloudCommunications newCloudCommunications, final ICallback<CloudCommunications> callback) {
129+
send(HttpMethod.PUT, callback, newCloudCommunications);
130+
}
131+
132+
/**
133+
* Creates a CloudCommunications with a new object
134+
*
135+
* @param newCloudCommunications the object to create/update
136+
* @return the created CloudCommunications
137+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
138+
*/
139+
public CloudCommunications put(final CloudCommunications newCloudCommunications) throws ClientException {
140+
return send(HttpMethod.PUT, newCloudCommunications);
141+
}
142+
122143
/**
123144
* Sets the select clause for the request
124145
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/EndpointRequest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,27 @@ public Endpoint post(final Endpoint newEndpoint) throws ClientException {
111111
return send(HttpMethod.POST, newEndpoint);
112112
}
113113

114+
/**
115+
* Creates a Endpoint with a new object
116+
*
117+
* @param newEndpoint the object to create/update
118+
* @param callback the callback to be called after success or failure
119+
*/
120+
public void put(final Endpoint newEndpoint, final ICallback<Endpoint> callback) {
121+
send(HttpMethod.PUT, callback, newEndpoint);
122+
}
123+
124+
/**
125+
* Creates a Endpoint with a new object
126+
*
127+
* @param newEndpoint the object to create/update
128+
* @return the created Endpoint
129+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
130+
*/
131+
public Endpoint put(final Endpoint newEndpoint) throws ClientException {
132+
return send(HttpMethod.PUT, newEndpoint);
133+
}
134+
114135
/**
115136
* Sets the select clause for the request
116137
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/EntityType2Request.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,27 @@ public EntityType2 post(final EntityType2 newEntityType2) throws ClientException
111111
return send(HttpMethod.POST, newEntityType2);
112112
}
113113

114+
/**
115+
* Creates a EntityType2 with a new object
116+
*
117+
* @param newEntityType2 the object to create/update
118+
* @param callback the callback to be called after success or failure
119+
*/
120+
public void put(final EntityType2 newEntityType2, final ICallback<EntityType2> callback) {
121+
send(HttpMethod.PUT, callback, newEntityType2);
122+
}
123+
124+
/**
125+
* Creates a EntityType2 with a new object
126+
*
127+
* @param newEntityType2 the object to create/update
128+
* @return the created EntityType2
129+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
130+
*/
131+
public EntityType2 put(final EntityType2 newEntityType2) throws ClientException {
132+
return send(HttpMethod.PUT, newEntityType2);
133+
}
134+
114135
/**
115136
* Sets the select clause for the request
116137
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/EntityType3Request.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,27 @@ public EntityType3 post(final EntityType3 newEntityType3) throws ClientException
113113
return send(HttpMethod.POST, newEntityType3);
114114
}
115115

116+
/**
117+
* Creates a EntityType3 with a new object
118+
*
119+
* @param newEntityType3 the object to create/update
120+
* @param callback the callback to be called after success or failure
121+
*/
122+
public void put(final EntityType3 newEntityType3, final ICallback<EntityType3> callback) {
123+
send(HttpMethod.PUT, callback, newEntityType3);
124+
}
125+
126+
/**
127+
* Creates a EntityType3 with a new object
128+
*
129+
* @param newEntityType3 the object to create/update
130+
* @return the created EntityType3
131+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
132+
*/
133+
public EntityType3 put(final EntityType3 newEntityType3) throws ClientException {
134+
return send(HttpMethod.PUT, newEntityType3);
135+
}
136+
116137
/**
117138
* Sets the select clause for the request
118139
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/ICallRequest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ public interface ICallRequest extends IHttpRequest {
7979
*/
8080
Call post(final Call newCall) throws ClientException;
8181

82+
/**
83+
* Posts a Call with a new object
84+
*
85+
* @param newCall the object to create/update
86+
* @param callback the callback to be called after success or failure
87+
*/
88+
void put(final Call newCall, final ICallback<Call> callback);
89+
90+
/**
91+
* Posts a Call with a new object
92+
*
93+
* @param newCall the object to create/update
94+
* @return the created Call
95+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
96+
*/
97+
Call put(final Call newCall) throws ClientException;
98+
8299
/**
83100
* Sets the select clause for the request
84101
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/ICloudCommunicationsRequest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ public interface ICloudCommunicationsRequest extends IHttpRequest {
7979
*/
8080
CloudCommunications post(final CloudCommunications newCloudCommunications) throws ClientException;
8181

82+
/**
83+
* Posts a CloudCommunications with a new object
84+
*
85+
* @param newCloudCommunications the object to create/update
86+
* @param callback the callback to be called after success or failure
87+
*/
88+
void put(final CloudCommunications newCloudCommunications, final ICallback<CloudCommunications> callback);
89+
90+
/**
91+
* Posts a CloudCommunications with a new object
92+
*
93+
* @param newCloudCommunications the object to create/update
94+
* @return the created CloudCommunications
95+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
96+
*/
97+
CloudCommunications put(final CloudCommunications newCloudCommunications) throws ClientException;
98+
8299
/**
83100
* Sets the select clause for the request
84101
*

test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEndpointRequest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ public interface IEndpointRequest extends IHttpRequest {
7979
*/
8080
Endpoint post(final Endpoint newEndpoint) throws ClientException;
8181

82+
/**
83+
* Posts a Endpoint with a new object
84+
*
85+
* @param newEndpoint the object to create/update
86+
* @param callback the callback to be called after success or failure
87+
*/
88+
void put(final Endpoint newEndpoint, final ICallback<Endpoint> callback);
89+
90+
/**
91+
* Posts a Endpoint with a new object
92+
*
93+
* @param newEndpoint the object to create/update
94+
* @return the created Endpoint
95+
* @throws ClientException this exception occurs if the request was unable to complete for any reason
96+
*/
97+
Endpoint put(final Endpoint newEndpoint) throws ClientException;
98+
8299
/**
83100
* Sets the select clause for the request
84101
*

0 commit comments

Comments
 (0)