diff --git a/Templates/Android/generated/BaseEntityWithReferenceRequest.java.tt b/Templates/Android/generated/BaseEntityWithReferenceRequest.java.tt index a24ef0db7..ad86f1bb1 100644 --- a/Templates/Android/generated/BaseEntityWithReferenceRequest.java.tt +++ b/Templates/Android/generated/BaseEntityWithReferenceRequest.java.tt @@ -39,6 +39,22 @@ return send(HttpMethod.GET, null); } + public void delete(final ICallback<<#=TypeName(c)#>> callback) { + send(HttpMethod.DELETE, callback, null); + } + + public void delete() throws ClientException { + send(HttpMethod.DELETE, null); + } + + public void patch(final <#=TypeName(c)#> source<#=TypeName(c)#>, final ICallback<<#=TypeName(c)#>> callback) { + send(HttpMethod.PATCH, callback, source<#=TypeName(c)#>); + } + + public <#=TypeName(c)#> patch(final <#=TypeName(c)#> source<#=TypeName(c)#>) throws ClientException { + return send(HttpMethod.PATCH, source<#=TypeName(c)#>); + } + <# if (c.GetFeatures().CanSelect) { #> /** * Sets the select clause for the request diff --git a/Templates/Android/generated/IBaseEntityWithReferenceRequest.java.tt b/Templates/Android/generated/IBaseEntityWithReferenceRequest.java.tt index 7da20327d..019dba395 100644 --- a/Templates/Android/generated/IBaseEntityWithReferenceRequest.java.tt +++ b/Templates/Android/generated/IBaseEntityWithReferenceRequest.java.tt @@ -16,6 +16,14 @@ <#=TypeName(c)#> get() throws ClientException; + void delete(final ICallback<<#=TypeName(c)#>> callback); + + void delete() throws ClientException; + + void patch(final <#=TypeName(c)#> source<#=TypeName(c)#>, final ICallback<<#=TypeName(c)#>> callback); + + <#=TypeName(c)#> patch(final <#=TypeName(c)#> source<#=TypeName(c)#>) throws ClientException; + <# if (c.GetFeatures().CanSelect) { #> <#=IBaseTypeWithReferencesRequest(c)#> select(final String value); diff --git a/Templates/CSharp/Base/EntityRequest.Base.template.tt b/Templates/CSharp/Base/EntityRequest.Base.template.tt index 03e8591e5..e42fe0416 100644 --- a/Templates/CSharp/Base/EntityRequest.Base.template.tt +++ b/Templates/CSharp/Base/EntityRequest.Base.template.tt @@ -196,7 +196,7 @@ public void AppendCreateAsyncHeader(string entityName, string lowerCaseEntityNam stringBuilder.AppendFormat(" /// The created {0}.", entityName); } -public string GetEntityCreateAsyncMethod(OdcmClass odcmClass) +public string GetEntityCreateAsyncMethod(OdcmClass odcmClass, bool initializeCollectionProperties = true) { var stringBuilder = new StringBuilder(); @@ -238,10 +238,14 @@ public string GetEntityCreateAsyncMethod(OdcmClass odcmClass) stringBuilder.Append(Environment.NewLine); stringBuilder.AppendFormat(" var newEntity = await this.SendAsync<{0}>({1}ToCreate, cancellationToken).ConfigureAwait(false);", entityName, lowerCaseEntityName); stringBuilder.Append(Environment.NewLine); - stringBuilder.Append( -@" this.InitializeCollectionProperties(newEntity); - return newEntity; + if (initializeCollectionProperties) { + stringBuilder.Append( + @" this.InitializeCollectionProperties(newEntity);"); + stringBuilder.Append(Environment.NewLine); + } + stringBuilder.Append(@" return newEntity; }"); + return stringBuilder.ToString(); } @@ -352,7 +356,7 @@ public void AppendUpdateAsyncHeader(string entityName, string lowerCaseEntityNam stringBuilder.AppendFormat(" /// The updated {0}.", entityName); } -public string GetEntityUpdateAsyncMethod(OdcmClass odcmClass) +public string GetEntityUpdateAsyncMethod(OdcmClass odcmClass, bool initializeCollectionProperties = true) { var stringBuilder = new StringBuilder(); @@ -393,9 +397,12 @@ public string GetEntityUpdateAsyncMethod(OdcmClass odcmClass) stringBuilder.Append(Environment.NewLine); stringBuilder.AppendFormat(" var updatedEntity = await this.SendAsync<{0}>({1}ToUpdate, cancellationToken).ConfigureAwait(false);", entityName, lowerCaseEntityName); stringBuilder.Append(Environment.NewLine); - stringBuilder.Append( -@" this.InitializeCollectionProperties(updatedEntity); - return updatedEntity; + if (initializeCollectionProperties) { + stringBuilder.Append( + @" this.InitializeCollectionProperties(updatedEntity);"); + stringBuilder.Append(Environment.NewLine); + } + stringBuilder.Append(@" return updatedEntity; }"); return stringBuilder.ToString(); diff --git a/Templates/CSharp/Requests/EntityWithReferenceRequest.cs.tt b/Templates/CSharp/Requests/EntityWithReferenceRequest.cs.tt index 59e89bf17..a7f4a1d5b 100644 --- a/Templates/CSharp/Requests/EntityWithReferenceRequest.cs.tt +++ b/Templates/CSharp/Requests/EntityWithReferenceRequest.cs.tt @@ -25,6 +25,12 @@ namespace <#=this.GetNamespaceName(entity)#> <#=this.GetEntityGetAsyncMethod(entity, false)#> + <#=this.GetEntityCreateAsyncMethod(entity, false)#> + + <#=this.GetEntityUpdateAsyncMethod(entity, false)#> + + <#=this.GetEntityDeleteAsyncMethod(entity)#> + <# if (features.CanExpand) { diff --git a/Templates/CSharp/Requests/IEntityWithReferenceRequest.cs.tt b/Templates/CSharp/Requests/IEntityWithReferenceRequest.cs.tt index da9aad3fc..651e54d0b 100644 --- a/Templates/CSharp/Requests/IEntityWithReferenceRequest.cs.tt +++ b/Templates/CSharp/Requests/IEntityWithReferenceRequest.cs.tt @@ -19,7 +19,13 @@ namespace <#=this.GetNamespaceName(entity)#> <#=this.GetEntityWithReferenceRequestInterfaceDefinition(entity)#> { - <#=this.GetEntityGetAsyncMethod(entity)#> + <#=this.GetEntityGetAsyncMethod(entity, false)#> + + <#=this.GetEntityCreateAsyncMethod(entity, false)#> + + <#=this.GetEntityUpdateAsyncMethod(entity, false)#> + + <#=this.GetEntityDeleteAsyncMethod(entity)#> <# if (features.CanExpand) diff --git a/Templates/Java/requests_generated/BaseEntityWithReferenceRequest.java.tt b/Templates/Java/requests_generated/BaseEntityWithReferenceRequest.java.tt index e47153355..29f77aa9e 100644 --- a/Templates/Java/requests_generated/BaseEntityWithReferenceRequest.java.tt +++ b/Templates/Java/requests_generated/BaseEntityWithReferenceRequest.java.tt @@ -39,6 +39,23 @@ return send(HttpMethod.GET, null); } + public void delete(final ICallback<<#=TypeName(c)#>> callback) { + send(HttpMethod.DELETE, callback, null); + } + + public void delete() throws ClientException { + send(HttpMethod.DELETE, null); + } + + public void patch(final <#=TypeName(c)#> source<#=TypeName(c)#>, final ICallback<<#=TypeName(c)#>> callback) { + send(HttpMethod.PATCH, callback, source<#=TypeName(c)#>); + } + + public <#=TypeName(c)#> patch(final <#=TypeName(c)#> source<#=TypeName(c)#>) throws ClientException { + return send(HttpMethod.PATCH, source<#=TypeName(c)#>); + } + + <# if (c.GetFeatures().CanSelect) { #> /** * Sets the select clause for the request diff --git a/Templates/Java/requests_generated/IBaseEntityWithReferenceRequest.java.tt b/Templates/Java/requests_generated/IBaseEntityWithReferenceRequest.java.tt index e64033994..1686fed82 100644 --- a/Templates/Java/requests_generated/IBaseEntityWithReferenceRequest.java.tt +++ b/Templates/Java/requests_generated/IBaseEntityWithReferenceRequest.java.tt @@ -16,6 +16,14 @@ <#=TypeName(c)#> get() throws ClientException; + void delete(final ICallback<<#=TypeName(c)#>> callback); + + void delete() throws ClientException; + + void patch(final <#=TypeName(c)#> source<#=TypeName(c)#>, final ICallback<<#=TypeName(c)#>> callback); + + <#=TypeName(c)#> patch(final <#=TypeName(c)#> source<#=TypeName(c)#>) throws ClientException; + <# if (c.GetFeatures().CanSelect) { #> <#=IBaseTypeWithReferencesRequest(c)#> select(final String value);