From 09e4ecc6a5d37c7fa5c423719a9fa4dda84f95c8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 14 Sep 2020 10:56:54 -0400 Subject: [PATCH 1/7] - adds missing navigation properties on composable functions in java --- .../BaseMethodRequestBuilder.java.tt | 33 +++++++++++++++++++ .../IBaseMethodRequestBuilder.java.tt | 29 ++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/Templates/Java/requests_extensions/BaseMethodRequestBuilder.java.tt b/Templates/Java/requests_extensions/BaseMethodRequestBuilder.java.tt index bf2efc4da..31b1e705f 100644 --- a/Templates/Java/requests_extensions/BaseMethodRequestBuilder.java.tt +++ b/Templates/Java/requests_extensions/BaseMethodRequestBuilder.java.tt @@ -71,4 +71,37 @@ import com.google.gson.JsonElement; <# } #> return request; } +<# +var m = c as OdcmMethod; +if(m != null && m.IsComposable && m.ReturnType != null && m.ReturnType is OdcmClass) { + foreach(var prop in m.ReturnType.AsOdcmClass().NavigationProperties(true)) + { + var propName = prop.Name.ToUpperFirstChar(); + var sanitizedProperty = propName.SanitizePropertyName().ToLowerFirstChar(); + var propRequestBuilder = prop.TypeRequestBuilder(); + if (prop.IsCollection()) { +#> + public <#=prop.ITypeCollectionRequestBuilder()#> <#=sanitizedProperty#>() { + return new <#=prop.TypeCollectionRequestBuilder()#>(getRequestUrlWithAdditionalSegment("<#=prop.Name#>"), getClient(), null); + } + + public <#=prop.ITypeRequestBuilder()#> <#=sanitizedProperty#>(final String id) { + return new <#=prop.TypeRequestBuilder()#>(getRequestUrlWithAdditionalSegment("<#=prop.Name#>") + "/" + id, getClient(), null); + } +<# + } else { +#> + + /** + * Gets the request builder for <#=prop.TypeName()#> + * + * @return the <#=prop.ITypeRequestBuilder()#> instance + */ + public <#=prop.ITypeRequestBuilder()#> <#=sanitizedProperty#>() { + return new <#=prop.TypeRequestBuilder()#>(getRequestUrlWithAdditionalSegment("<#=prop.Name#>"), getClient(), null); + } +<# + } + } +} #> } diff --git a/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt b/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt index 0f5033e20..153239746 100644 --- a/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt +++ b/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt @@ -24,4 +24,33 @@ import <#=importNamespace#>.http.IRequestBuilder; * @return the <#=c.ITypeRequest()#> instance */ <#=c.ITypeRequest()#> buildRequest(final java.util.List.options.Option> requestOptions); + +<# +var m = c as OdcmMethod; +if(m != null && m.IsComposable && m.ReturnType != null && m.ReturnType is OdcmClass) { + foreach(var prop in m.ReturnType.AsOdcmClass().NavigationProperties(true)) + { + var propName = prop.Name.ToUpperFirstChar(); + var sanitizedName = prop.Name.SanitizePropertyName(); + var propRequestBuilder = prop.TypeRequestBuilder(); + if (prop.IsCollection()) { +#> + + <#=prop.ITypeCollectionRequestBuilder()#> <#=sanitizedName.ToLowerFirstChar()#>(); + + <#=prop.ITypeRequestBuilder()#> <#=prop.Name#>(final String id); +<# + } else { +#> + + /** + * Gets the request builder for <#=prop.TypeName()#> + * + * @return the <#=prop.ITypeRequestBuilder()#> instance + */ + <#=prop.ITypeRequestBuilder()#> <#=sanitizedName.ToLowerFirstChar()#>(); +<# + } + } +} #> } From eae476f216af3a8f63862e99f8e4b8533a30b23b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 14 Sep 2020 11:13:28 -0400 Subject: [PATCH 2/7] - updates test files --- .../requests/extensions/IEntityType3ForwardRequestBuilder.java | 1 + .../requests/extensions/IOnenotePageForwardRequestBuilder.java | 1 + .../requests/extensions/ISegmentForwardRequestBuilder.java | 1 + 3 files changed, 3 insertions(+) diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java index 7f342fdfd..c4ad193ee 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java @@ -28,4 +28,5 @@ public interface IEntityType3ForwardRequestBuilder extends IRequestBuilder { * @return the IEntityType3ForwardRequest instance */ IEntityType3ForwardRequest buildRequest(final java.util.List requestOptions); + } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java index e3dfd20c2..ca9233523 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java @@ -28,4 +28,5 @@ public interface IOnenotePageForwardRequestBuilder extends IRequestBuilder { * @return the IOnenotePageForwardRequest instance */ IOnenotePageForwardRequest buildRequest(final java.util.List requestOptions); + } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java index ba13fa5ce..3e6fc607d 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java @@ -28,4 +28,5 @@ public interface ISegmentForwardRequestBuilder extends IRequestBuilder { * @return the ISegmentForwardRequest instance */ ISegmentForwardRequest buildRequest(final java.util.List requestOptions); + } From 6ee78f9567762aeea1ae9146a306e661895f239b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Sep 2020 08:32:37 -0400 Subject: [PATCH 3/7] - fixes whitespace insertion --- .../Java/requests_extensions/IBaseMethodRequestBuilder.java.tt | 1 - .../requests/extensions/IEntityType3ForwardRequestBuilder.java | 1 - .../requests/extensions/IOnenotePageForwardRequestBuilder.java | 1 - .../requests/extensions/ISegmentForwardRequestBuilder.java | 1 - 4 files changed, 4 deletions(-) diff --git a/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt b/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt index 153239746..b0098d312 100644 --- a/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt +++ b/Templates/Java/requests_extensions/IBaseMethodRequestBuilder.java.tt @@ -24,7 +24,6 @@ import <#=importNamespace#>.http.IRequestBuilder; * @return the <#=c.ITypeRequest()#> instance */ <#=c.ITypeRequest()#> buildRequest(final java.util.List.options.Option> requestOptions); - <# var m = c as OdcmMethod; if(m != null && m.IsComposable && m.ReturnType != null && m.ReturnType is OdcmClass) { diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java index c4ad193ee..7f342fdfd 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IEntityType3ForwardRequestBuilder.java @@ -28,5 +28,4 @@ public interface IEntityType3ForwardRequestBuilder extends IRequestBuilder { * @return the IEntityType3ForwardRequest instance */ IEntityType3ForwardRequest buildRequest(final java.util.List requestOptions); - } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java index ca9233523..e3dfd20c2 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph/requests/extensions/IOnenotePageForwardRequestBuilder.java @@ -28,5 +28,4 @@ public interface IOnenotePageForwardRequestBuilder extends IRequestBuilder { * @return the IOnenotePageForwardRequest instance */ IOnenotePageForwardRequest buildRequest(final java.util.List requestOptions); - } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java index 3e6fc607d..ba13fa5ce 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ISegmentForwardRequestBuilder.java @@ -28,5 +28,4 @@ public interface ISegmentForwardRequestBuilder extends IRequestBuilder { * @return the ISegmentForwardRequest instance */ ISegmentForwardRequest buildRequest(final java.util.List requestOptions); - } From 97d616aebe25e3aff158edea614e4110763a0d85 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Sep 2020 08:43:00 -0400 Subject: [PATCH 4/7] - adds composable collection test items --- .../Metadata/MetadataMultipleNamespaces.xml | 5 + .../CallRecordCollectionRequestBuilder.java | 5 + .../extensions/CallRecordItemRequest.java | 127 ++++++++++++++++++ .../CallRecordItemRequestBuilder.java | 76 +++++++++++ .../ICallRecordCollectionRequestBuilder.java | 2 + .../extensions/ICallRecordItemRequest.java | 88 ++++++++++++ .../ICallRecordItemRequestBuilder.java | 39 ++++++ 7 files changed, 342 insertions(+) create mode 100644 test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequest.java create mode 100644 test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequestBuilder.java create mode 100644 test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequest.java create mode 100644 test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequestBuilder.java diff --git a/test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml b/test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml index 550b32535..d5ea53a79 100644 --- a/test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml +++ b/test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml @@ -278,6 +278,11 @@ + + + + + \ No newline at end of file diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordCollectionRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordCollectionRequestBuilder.java index 77f778b81..746ca7ff8 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordCollectionRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordCollectionRequestBuilder.java @@ -15,6 +15,7 @@ import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordCollectionRequestBuilder; import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordRequestBuilder; import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordCollectionRequest; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequestBuilder; import com.microsoft.graph.http.BaseRequestBuilder; import com.microsoft.graph.core.IBaseClient; @@ -49,4 +50,8 @@ public ICallRecordRequestBuilder byId(final String id) { } + + public ICallRecordItemRequestBuilder item(final String name) { + return new CallRecordItemRequestBuilder(getRequestUrlWithAdditionalSegment("microsoft.graph2.callRecords.item"), getClient(), null, name); + } } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequest.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequest.java new file mode 100644 index 000000000..a6fb69aff --- /dev/null +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequest.java @@ -0,0 +1,127 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph2.callrecords.requests.extensions; +import com.microsoft.graph2.callrecords.models.extensions.CallRecord; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequest; +import com.microsoft.graph2.callrecords.requests.extensions.CallRecordItemRequest; + +import com.microsoft.graph.concurrency.ICallback; +import com.microsoft.graph.concurrency.IExecutors; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Call Record Item Request. + */ +public class CallRecordItemRequest extends BaseRequest implements ICallRecordItemRequest { + + /** + * The request for this CallRecordItem + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + */ + public CallRecordItemRequest(final String requestUrl, final IBaseClient client, final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, CallRecord.class); + } + + /** + * Patches the CallRecordItem + * @param srcCallRecord the CallRecord with which to PATCH + * @param callback the callback to be called after success or failure + */ + public void patch(CallRecord srcCallRecord, final ICallback callback) { + send(HttpMethod.PATCH, callback, srcCallRecord); + } + + /** + * Patches the CallRecordItem + * + * @param srcCallRecord the CallRecord with which to PATCH + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + public CallRecord patch(CallRecord srcCallRecord) throws ClientException { + return this.send(HttpMethod.PATCH, srcCallRecord); + } + + /** + * Puts the CallRecordItem + * + * @param srcCallRecord the CallRecord to PUT + * @param callback the callback to be called after success or failure + */ + public void put(CallRecord srcCallRecord, final ICallback callback) { + send(HttpMethod.PUT, callback, srcCallRecord); + } + + /** + * Puts the CallRecordItem + * + * @param srcCallRecord the CallRecord to PUT + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + public CallRecord put(CallRecord srcCallRecord) throws ClientException { + return this.send(HttpMethod.PUT, srcCallRecord); + } + /** + * Gets the CallRecord + * + * @param callback the callback to be called after success or failure + */ + public void get(final ICallback callback) { + send(HttpMethod.GET, callback, null); + } + + /** + * Gets the CallRecord + * + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + public CallRecord get() throws ClientException { + return send(HttpMethod.GET, null); + } + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + public ICallRecordItemRequest select(final String value) { + getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$select", value)); + return (CallRecordItemRequest)this; + } + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + public ICallRecordItemRequest expand(final String value) { + getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$expand", value)); + return (CallRecordItemRequest)this; + } + + /** + * Sets the filter clause for the request + * + * @param value the filter clause + * @return the updated request + */ + public ICallRecordItemRequest filter(final String value) { + getQueryOptions().add(new com.microsoft.graph.options.QueryOption("$filter", value)); + return (CallRecordItemRequest)this; + } + +} diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequestBuilder.java new file mode 100644 index 000000000..ee4f46f03 --- /dev/null +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/CallRecordItemRequestBuilder.java @@ -0,0 +1,76 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph2.callrecords.requests.extensions; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequest; +import com.microsoft.graph2.callrecords.requests.extensions.CallRecordItemRequest; +import com.microsoft.graph2.callrecords.models.extensions.CallRecord; +import com.microsoft.graph.core.BaseActionRequestBuilder; +import com.microsoft.graph.core.BaseFunctionRequestBuilder; +import com.microsoft.graph.core.IBaseClient; +import com.google.gson.JsonElement; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The class for the Call Record Item Request Builder. + */ +public class CallRecordItemRequestBuilder extends BaseFunctionRequestBuilder implements ICallRecordItemRequestBuilder { + + /** + * The request builder for this CallRecordItem + * + * @param requestUrl the request URL + * @param client the service client + * @param requestOptions the options for this request + * @param name the name + */ + public CallRecordItemRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List requestOptions, final String name) { + super(requestUrl, client, requestOptions); + functionOptions.add(new com.microsoft.graph.options.FunctionOption("name", name)); + } + + /** + * Creates the ICallRecordItemRequest + * + * @return the ICallRecordItemRequest instance + */ + public ICallRecordItemRequest buildRequest() { + return buildRequest(getOptions()); + } + + /** + * Creates the ICallRecordItemRequest with specific requestOptions instead of the existing requestOptions + * + * @param requestOptions the options for the request + * @return the ICallRecordItemRequest instance + */ + public ICallRecordItemRequest buildRequest(final java.util.List requestOptions) { + CallRecordItemRequest request = new CallRecordItemRequest( + getRequestUrl(), + getClient(), + requestOptions + ); + + for (com.microsoft.graph.options.FunctionOption option : functionOptions) { + request.addFunctionOption(option); + } + + return request; + } + public ISessionCollectionRequestBuilder sessions() { + return new SessionCollectionRequestBuilder(getRequestUrlWithAdditionalSegment("sessions"), getClient(), null); + } + + public ISessionRequestBuilder sessions(final String id) { + return new SessionRequestBuilder(getRequestUrlWithAdditionalSegment("sessions") + "/" + id, getClient(), null); + } + public IEntityType2CollectionRequestBuilder recipients() { + return new EntityType2CollectionRequestBuilder(getRequestUrlWithAdditionalSegment("recipients"), getClient(), null); + } + + public IEntityType2RequestBuilder recipients(final String id) { + return new EntityType2RequestBuilder(getRequestUrlWithAdditionalSegment("recipients") + "/" + id, getClient(), null); + } +} diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordCollectionRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordCollectionRequestBuilder.java index 32337040c..b84c02678 100644 --- a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordCollectionRequestBuilder.java +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordCollectionRequestBuilder.java @@ -14,6 +14,7 @@ import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordRequestBuilder; import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordCollectionRequest; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequestBuilder; import com.microsoft.graph.http.IBaseCollectionPage; // **NOTE** This file was generated by a tool and any changes will be overwritten. @@ -29,4 +30,5 @@ public interface ICallRecordCollectionRequestBuilder extends IRequestBuilder { ICallRecordRequestBuilder byId(final String id); + ICallRecordItemRequestBuilder item(final String name); } diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequest.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequest.java new file mode 100644 index 000000000..3d16daaec --- /dev/null +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequest.java @@ -0,0 +1,88 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph2.callrecords.requests.extensions; +import com.microsoft.graph2.callrecords.models.extensions.CallRecord; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequest; + +import com.microsoft.graph.concurrency.ICallback; +import com.microsoft.graph.concurrency.IExecutors; +import com.microsoft.graph.core.ClientException; +import com.microsoft.graph.core.IBaseClient; +import com.microsoft.graph.http.BaseRequest; +import com.microsoft.graph.http.HttpMethod; +import com.microsoft.graph.http.IHttpRequest; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The interface for the Call Record Item Request. + */ +public interface ICallRecordItemRequest extends IHttpRequest { + + /** + * Patches the CallRecordItem + * + * @param srcCallRecord the CallRecord with which to PATCH + * @param callback the callback to be called after success or failure + */ + void patch(CallRecord srcCallRecord, final ICallback callback); + + /** + * Patches the CallRecordItem + * + * @param srcCallRecord the CallRecord with which to PATCH + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + CallRecord patch(CallRecord srcCallRecord) throws ClientException; + + /** + * Puts the CallRecordItem + * + * @param srcCallRecord the CallRecord to PUT + * @param callback the callback to be called after success or failure + */ + void put(CallRecord srcCallRecord, final ICallback callback); + + /** + * Puts the CallRecordItem + * + * @param srcCallRecord the CallRecord to PUT + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + CallRecord put(CallRecord srcCallRecord) throws ClientException; + /** + * Gets the CallRecord + * + * @param callback the callback to be called after success or failure + */ + void get(final ICallback callback); + + /** + * Gets the CallRecord + * + * @return the CallRecord + * @throws ClientException an exception occurs if there was an error while the request was sent + */ + CallRecord get() throws ClientException; + + /** + * Sets the select clause for the request + * + * @param value the select clause + * @return the updated request + */ + ICallRecordItemRequest select(final String value); + + /** + * Sets the expand clause for the request + * + * @param value the expand clause + * @return the updated request + */ + ICallRecordItemRequest expand(final String value); + +} diff --git a/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequestBuilder.java b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequestBuilder.java new file mode 100644 index 000000000..a53ce54a0 --- /dev/null +++ b/test/Typewriter.Test/TestDataJava/com/microsoft/graph2/callrecords/requests/extensions/ICallRecordItemRequestBuilder.java @@ -0,0 +1,39 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +package com.microsoft.graph2.callrecords.requests.extensions; +import com.microsoft.graph2.callrecords.requests.extensions.ICallRecordItemRequest; + +import com.microsoft.graph.http.IRequestBuilder; + +// **NOTE** This file was generated by a tool and any changes will be overwritten. + +/** + * The interface for the Call Record Item Request Builder. + */ +public interface ICallRecordItemRequestBuilder extends IRequestBuilder { + + /** + * Creates the ICallRecordItemRequest + * + * @return the ICallRecordItemRequest instance + */ + ICallRecordItemRequest buildRequest(); + + /** + * Creates the ICallRecordItemRequest with specific options instead of the existing options + * + * @param requestOptions the options for the request + * @return the ICallRecordItemRequest instance + */ + ICallRecordItemRequest buildRequest(final java.util.List requestOptions); + + ISessionCollectionRequestBuilder sessions(); + + ISessionRequestBuilder sessions(final String id); + + IEntityType2CollectionRequestBuilder recipients(); + + IEntityType2RequestBuilder recipients(final String id); +} From dce6d9d02b3897d920ab67af2465c48ab3872bc4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Sep 2020 08:45:49 -0400 Subject: [PATCH 5/7] - updates CHarp test files --- ...ionsCallRecordsCollectionRequestBuilder.cs | 14 +- ...ionsCallRecordsCollectionRequestBuilder.cs | 8 +- .../Requests/CallRecordItemRequest.cs | 123 ++++++++++++++++++ .../Requests/CallRecordItemRequestBuilder.cs | 49 +++++++ .../Requests/CallRecordRequestBuilder.cs | 2 + .../Requests/ICallRecordItemRequest.cs | 90 +++++++++++++ .../Requests/ICallRecordItemRequestBuilder.cs | 28 ++++ .../Requests/ICallRecordRequestBuilder.cs | 2 + 8 files changed, 314 insertions(+), 2 deletions(-) create mode 100644 test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequest.cs create mode 100644 test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequestBuilder.cs create mode 100644 test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequest.cs create mode 100644 test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequestBuilder.cs diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/CloudCommunicationsCallRecordsCollectionRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/CloudCommunicationsCallRecordsCollectionRequestBuilder.cs index e25b2059d..0efd98aa3 100644 --- a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/CloudCommunicationsCallRecordsCollectionRequestBuilder.cs +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/CloudCommunicationsCallRecordsCollectionRequestBuilder.cs @@ -52,6 +52,7 @@ public ICloudCommunicationsCallRecordsCollectionRequest Request(IEnumerable /// The ID for the CloudCommunicationsMicrosoft.Graph2.CallRecords.CallRecord. /// The . + [System.Runtime.CompilerServices.IndexerName("ThisItem")] public Microsoft.Graph2.CallRecords.ICallRecordRequestBuilder this[string id] { get @@ -60,6 +61,17 @@ public Microsoft.Graph2.CallRecords.ICallRecordRequestBuilder this[string id] } } - + /// + /// Gets the request builder for CallRecordItem. + /// + /// The . + public ICallRecordItemRequestBuilder Item( + string name = null) + { + return new CallRecordItemRequestBuilder( + this.AppendSegmentToRequestUrl("microsoft.graph2.callRecords.item"), + this.Client, + name); + } } } diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/ICloudCommunicationsCallRecordsCollectionRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/ICloudCommunicationsCallRecordsCollectionRequestBuilder.cs index 6f8779071..391f7a949 100644 --- a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/ICloudCommunicationsCallRecordsCollectionRequestBuilder.cs +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph/Requests/ICloudCommunicationsCallRecordsCollectionRequestBuilder.cs @@ -34,8 +34,14 @@ public partial interface ICloudCommunicationsCallRecordsCollectionRequestBuilder /// /// The ID for the Microsoft.Graph2.CallRecords.CallRecord. /// The . + [System.Runtime.CompilerServices.IndexerName("ThisItem")] Microsoft.Graph2.CallRecords.ICallRecordRequestBuilder this[string id] { get; } - + /// + /// Gets the request builder for CallRecordItem. + /// + /// The . + ICallRecordItemRequestBuilder Item( + string name = null); } } diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequest.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequest.cs new file mode 100644 index 000000000..45696fec4 --- /dev/null +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequest.cs @@ -0,0 +1,123 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +// **NOTE** This file was generated by a tool and any changes will be overwritten. +// + +// Template Source: Templates\CSharp\Requests\MethodRequest.cs.tt + +namespace Microsoft.Graph2.CallRecords +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Net.Http; + using System.Threading; + + /// + /// The type CallRecordItemRequest. + /// + public partial class CallRecordItemRequest : Microsoft.Graph.BaseRequest, ICallRecordItemRequest + { + /// + /// Constructs a new CallRecordItemRequest. + /// + public CallRecordItemRequest( + string requestUrl, + Microsoft.Graph.IBaseClient client, + IEnumerable options) + : base(requestUrl, client, options) + { + } + + /// + /// Issues the GET request. + /// + public System.Threading.Tasks.Task GetAsync() + { + return this.GetAsync(CancellationToken.None); + } + + /// + /// Issues the GET request. + /// + /// The for the request. + /// The task to await for async call. + public System.Threading.Tasks.Task GetAsync( + CancellationToken cancellationToken) + { + this.Method = "GET"; + return this.SendAsync(null, cancellationToken); + } + + + /// + /// Issues the PATCH request. + /// + /// The CallRecord object set with the properties to update. + /// The task to await for async call. + public System.Threading.Tasks.Task PatchAsync(CallRecord callrecord) + { + return this.PatchAsync(callrecord, CancellationToken.None); + } + + /// + /// Issues the PATCH request. + /// + /// The CallRecord object set with the properties to update. + /// The for the request. + /// The task to await for async call. + public System.Threading.Tasks.Task PatchAsync(CallRecord callrecord, + CancellationToken cancellationToken) + { + this.Method = "PATCH"; + return this.SendAsync(callrecord, cancellationToken); + } + + /// + /// Issues the PUT request. + /// + /// The CallRecord object to update. + /// The task to await for async call. + public System.Threading.Tasks.Task PutAsync(CallRecord callrecord) + { + return this.PutAsync(callrecord, CancellationToken.None); + } + + /// + /// Issues the PUT request. + /// + /// The CallRecord object to update. + /// The for the request. + /// The task to await for async call. + public System.Threading.Tasks.Task PutAsync(CallRecord callrecord, + CancellationToken cancellationToken) + { + this.Method = "PUT"; + return this.SendAsync(callrecord, cancellationToken); + } + + /// + /// Adds the specified expand value to the request. + /// + /// The expand value. + /// The request object to send. + public ICallRecordItemRequest Expand(string value) + { + this.QueryOptions.Add(new Microsoft.Graph.QueryOption("$expand", value)); + return this; + } + + /// + /// Adds the specified select value to the request. + /// + /// The select value. + /// The request object to send. + public ICallRecordItemRequest Select(string value) + { + this.QueryOptions.Add(new Microsoft.Graph.QueryOption("$select", value)); + return this; + } + } +} diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequestBuilder.cs new file mode 100644 index 000000000..58f009f33 --- /dev/null +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordItemRequestBuilder.cs @@ -0,0 +1,49 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +// **NOTE** This file was generated by a tool and any changes will be overwritten. +// + +// Template Source: Templates\CSharp\Requests\MethodRequestBuilder.cs.tt + +namespace Microsoft.Graph2.CallRecords +{ + using System; + using System.Collections.Generic; + using System.IO; + + /// + /// The type CallRecordItemRequestBuilder. + /// + public partial class CallRecordItemRequestBuilder : Microsoft.Graph.BaseFunctionMethodRequestBuilder, ICallRecordItemRequestBuilder + { + /// + /// Constructs a new . + /// + /// The URL for the request. + /// The for handling requests. + /// A name parameter for the OData method call. + public CallRecordItemRequestBuilder( + string requestUrl, + Microsoft.Graph.IBaseClient client, + string name) + : base(requestUrl, client) + { + this.SetParameter("name", name, true); + } + + /// + /// A method used by the base class to construct a request class instance. + /// + /// The request URL to + /// The query and header options for the request. + /// An instance of a specific request class. + protected override ICallRecordItemRequest CreateRequest(string functionUrl, IEnumerable options) + { + var request = new CallRecordItemRequest(functionUrl, this.Client, options); + + return request; + } + } +} diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordRequestBuilder.cs index 2772a47e9..07746e579 100644 --- a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordRequestBuilder.cs +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/CallRecordRequestBuilder.cs @@ -74,5 +74,7 @@ public ICallRecordRecipientsCollectionRequestBuilder Recipients } } + + } } diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequest.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequest.cs new file mode 100644 index 000000000..942aa58a7 --- /dev/null +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequest.cs @@ -0,0 +1,90 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +// **NOTE** This file was generated by a tool and any changes will be overwritten. +// + +// Template Source: Templates\CSharp\Requests\IMethodRequest.cs.tt + +namespace Microsoft.Graph2.CallRecords +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Net.Http; + using System.Threading; + + /// + /// The interface ICallRecordItemRequest. + /// + public partial interface ICallRecordItemRequest : Microsoft.Graph.IBaseRequest + { + + + /// + /// Issues the GET request. + /// + System.Threading.Tasks.Task GetAsync(); + + /// + /// Issues the GET request. + /// + /// The for the request. + /// The task to await for async call. + System.Threading.Tasks.Task GetAsync( + CancellationToken cancellationToken); + + + + /// + /// Issues the PATCH request. + /// + /// The CallRecord object set with the properties to update. + /// The task to await for async call. + System.Threading.Tasks.Task PatchAsync(CallRecord callrecord); + + /// + /// Issues the PATCH request. + /// + /// The CallRecord object set with the properties to update. + /// The for the request. + /// The task to await for async call. + System.Threading.Tasks.Task PatchAsync(CallRecord callrecord, + CancellationToken cancellationToken); + + + /// + /// Issues the PUT request. + /// + /// The CallRecord object to update. + /// The task to await for async call. + System.Threading.Tasks.Task PutAsync(CallRecord callrecord); + + /// + /// Issues the PUT request. + /// + /// The CallRecord object to update. + /// The for the request. + /// The task to await for async call. + System.Threading.Tasks.Task PutAsync(CallRecord callrecord, + CancellationToken cancellationToken); + + + + + /// + /// Adds the specified expand value to the request. + /// + /// The expand value. + /// The request object to send. + ICallRecordItemRequest Expand(string value); + + /// + /// Adds the specified select value to the request. + /// + /// The select value. + /// The request object to send. + ICallRecordItemRequest Select(string value); + } +} diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequestBuilder.cs new file mode 100644 index 000000000..01351569b --- /dev/null +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordItemRequestBuilder.cs @@ -0,0 +1,28 @@ +// ------------------------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. +// ------------------------------------------------------------------------------ + +// **NOTE** This file was generated by a tool and any changes will be overwritten. +// + +// Template Source: Templates\CSharp\Requests\IMethodRequestBuilder.cs.tt + +namespace Microsoft.Graph2.CallRecords +{ + using System; + using System.Collections.Generic; + using System.IO; + + /// + /// The interface ICallRecordItemRequestBuilder. + /// + public partial interface ICallRecordItemRequestBuilder + { + /// + /// Builds the request. + /// + /// The query and header options for the request. + /// The built request. + ICallRecordItemRequest Request(IEnumerable options = null); + } +} diff --git a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordRequestBuilder.cs b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordRequestBuilder.cs index 97ffb4bfe..f634dcb23 100644 --- a/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordRequestBuilder.cs +++ b/test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ICallRecordRequestBuilder.cs @@ -43,5 +43,7 @@ public partial interface ICallRecordRequestBuilder : Microsoft.Graph.IEntityRequ /// The . ICallRecordRecipientsCollectionRequestBuilder Recipients { get; } + + } } From efdca45b98b2998aa03dbe899f80024be48a70df Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Sep 2020 08:51:32 -0400 Subject: [PATCH 6/7] - adds composable test function to non-namespace schema --- test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml b/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml index 669f4e9d1..5cf593993 100644 --- a/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml +++ b/test/Typewriter.Test/Metadata/MetadataWithSubNamespaces.xml @@ -278,6 +278,11 @@ + + + + + \ No newline at end of file From cbf28dc488e72e07e3e836f43d917de444fdd306 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Sep 2020 09:05:57 -0400 Subject: [PATCH 7/7] - updates objc test files for composable function --- .../TestDataObjC/Requests/MSGraphODataEntities.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Typewriter.Test/TestDataObjC/Requests/MSGraphODataEntities.h b/test/Typewriter.Test/TestDataObjC/Requests/MSGraphODataEntities.h index ba5ea5b10..8d1d4b955 100644 --- a/test/Typewriter.Test/TestDataObjC/Requests/MSGraphODataEntities.h +++ b/test/Typewriter.Test/TestDataObjC/Requests/MSGraphODataEntities.h @@ -70,6 +70,8 @@ #import "MSGraphCallRecordSessionsCollectionRequest.h" #import "MSGraphCallRecordRecipientsCollectionRequestBuilder.h" #import "MSGraphCallRecordRecipientsCollectionRequest.h" +#import "MSGraphCallRecordItemRequestBuilder.h" +#import "MSGraphCallRecordItemRequest.h" #import "MSGraphSessionRequestBuilder.h" #import "MSGraphSessionRequest.h" #import "MSGraphSessionSegmentsCollectionRequestBuilder.h"