Skip to content

Commit 8c10af5

Browse files
committed
add a singular reference in the subnamespace
1 parent a68d603 commit 8c10af5

12 files changed

+677
-0
lines changed

test/Typewriter.Test/Metadata/MetadataMultipleNamespaces.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@
194194
<Property Name="media" Type="Collection(microsoft.graph2.callRecords.media)" />
195195
<NavigationProperty Name="refTypes" Type="Collection(graph.entityType3)" />
196196
<NavigationProperty Name="refType" Type="graph.call" /> <!-- No ContainsTarget -->
197+
<NavigationProperty Name="sessionRef" Type="microsoft.graph2.callRecords.session" /> <!-- No ContainsTarget -->
197198
</EntityType>
198199
<ComplexType Name="endpoint">
199200
<Property Name="userAgent" Type="microsoft.graph2.callRecords.userAgent" />

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Model/Segment.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public Segment()
7878
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "refType", Required = Newtonsoft.Json.Required.Default)]
7979
public Microsoft.Graph.Call RefType { get; set; }
8080

81+
/// <summary>
82+
/// Gets or sets session ref.
83+
/// </summary>
84+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "sessionRef", Required = Newtonsoft.Json.Required.Default)]
85+
public Session SessionRef { get; set; }
86+
8187
}
8288
}
8389

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/ISegmentRequestBuilder.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ public partial interface ISegmentRequestBuilder : Microsoft.Graph.IEntityRequest
4242
/// </summary>
4343
/// <returns>The <see cref="Microsoft.Graph.ICallWithReferenceRequestBuilder"/>.</returns>
4444
Microsoft.Graph.ICallWithReferenceRequestBuilder RefType { get; }
45+
46+
/// <summary>
47+
/// Gets the request builder for SessionRef.
48+
/// </summary>
49+
/// <returns>The <see cref="ISessionWithReferenceRequestBuilder"/>.</returns>
50+
ISessionWithReferenceRequestBuilder SessionRef { get; }
4551

4652
/// <summary>
4753
/// Gets the request builder for SegmentForward.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
6+
// <auto-generated/>
7+
8+
// Template Source: Templates\CSharp\Requests\IEntityReferenceRequest.cs.tt
9+
10+
namespace Microsoft.Graph2.CallRecords
11+
{
12+
using System;
13+
using System.Net.Http;
14+
using System.Threading;
15+
16+
/// <summary>
17+
/// The interface ISessionReferenceRequest.
18+
/// </summary>
19+
public partial interface ISessionReferenceRequest : Microsoft.Graph.IBaseRequest
20+
{
21+
/// <summary>
22+
/// Deletes the specified Session reference.
23+
/// </summary>
24+
/// <returns>The task to await.</returns>
25+
System.Threading.Tasks.Task DeleteAsync();
26+
27+
/// <summary>
28+
/// Deletes the specified Session reference.
29+
/// </summary>
30+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
31+
/// <returns>The task to await.</returns>
32+
System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken);
33+
34+
/// <summary>
35+
/// Puts the specified Session reference.
36+
/// </summary>
37+
/// <param name="id">The Session reference reference to update.</param>
38+
/// <returns>The task to await.</returns>
39+
System.Threading.Tasks.Task PutAsync(string id);
40+
41+
/// <summary>
42+
/// Puts the specified Session reference.
43+
/// </summary>
44+
/// <param name="id">The Session reference reference to update.</param>
45+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
46+
/// <returns>The task to await.</returns>
47+
System.Threading.Tasks.Task PutAsync(string id, CancellationToken cancellationToken);
48+
}
49+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
6+
// <auto-generated/>
7+
8+
// Template Source: Templates\CSharp\Requests\IEntityReferenceRequestBuilder.cs.tt
9+
10+
namespace Microsoft.Graph2.CallRecords
11+
{
12+
using System;
13+
using System.Collections.Generic;
14+
15+
/// <summary>
16+
/// The interface ISessionReferenceRequestBuilder.
17+
/// </summary>
18+
public partial interface ISessionReferenceRequestBuilder : Microsoft.Graph.IBaseRequestBuilder
19+
{
20+
/// <summary>
21+
/// Builds the request.
22+
/// </summary>
23+
/// <returns>The built request.</returns>
24+
ISessionReferenceRequest Request();
25+
26+
/// <summary>
27+
/// Builds the request.
28+
/// </summary>
29+
/// <param name="options">The query and header options for the request.</param>
30+
/// <returns>The built request.</returns>
31+
ISessionReferenceRequest Request(IEnumerable<Microsoft.Graph.Option> options);
32+
}
33+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
6+
// <auto-generated/>
7+
8+
// Template Source: Templates\CSharp\Requests\IEntityWithReferenceRequest.cs.tt
9+
10+
namespace Microsoft.Graph2.CallRecords
11+
{
12+
using System;
13+
using System.IO;
14+
using System.Net.Http;
15+
using System.Threading;
16+
using System.Linq.Expressions;
17+
18+
/// <summary>
19+
/// The interface ISessionWithReferenceRequest.
20+
/// </summary>
21+
public partial interface ISessionWithReferenceRequest : Microsoft.Graph.IBaseRequest
22+
{
23+
/// <summary>
24+
/// Gets the specified Session.
25+
/// </summary>
26+
/// <returns>The Session.</returns>
27+
System.Threading.Tasks.Task<Session> GetAsync();
28+
29+
/// <summary>
30+
/// Gets the specified Session.
31+
/// </summary>
32+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
33+
/// <returns>The Session.</returns>
34+
System.Threading.Tasks.Task<Session> GetAsync(CancellationToken cancellationToken);
35+
36+
/// <summary>
37+
/// Creates the specified Session using POST.
38+
/// </summary>
39+
/// <param name="sessionToCreate">The Session to create.</param>
40+
/// <returns>The created Session.</returns>
41+
System.Threading.Tasks.Task<Session> CreateAsync(Session sessionToCreate); /// <summary>
42+
/// Creates the specified Session using POST.
43+
/// </summary>
44+
/// <param name="sessionToCreate">The Session to create.</param>
45+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
46+
/// <returns>The created Session.</returns>
47+
System.Threading.Tasks.Task<Session> CreateAsync(Session sessionToCreate, CancellationToken cancellationToken);
48+
49+
/// <summary>
50+
/// Updates the specified Session using PATCH.
51+
/// </summary>
52+
/// <param name="sessionToUpdate">The Session to update.</param>
53+
/// <returns>The updated Session.</returns>
54+
System.Threading.Tasks.Task<Session> UpdateAsync(Session sessionToUpdate);
55+
56+
/// <summary>
57+
/// Updates the specified Session using PATCH.
58+
/// </summary>
59+
/// <param name="sessionToUpdate">The Session to update.</param>
60+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
61+
/// <exception cref="Microsoft.Graph.ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception>
62+
/// <returns>The updated Session.</returns>
63+
System.Threading.Tasks.Task<Session> UpdateAsync(Session sessionToUpdate, CancellationToken cancellationToken);
64+
65+
/// <summary>
66+
/// Deletes the specified Session.
67+
/// </summary>
68+
/// <returns>The task to await.</returns>
69+
System.Threading.Tasks.Task DeleteAsync();
70+
71+
/// <summary>
72+
/// Deletes the specified Session.
73+
/// </summary>
74+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
75+
/// <returns>The task to await.</returns>
76+
System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken);
77+
78+
/// <summary>
79+
/// Adds the specified expand value to the request.
80+
/// </summary>
81+
/// <param name="value">The expand value.</param>
82+
/// <returns>The request object to send.</returns>
83+
ISessionWithReferenceRequest Expand(string value);
84+
85+
/// <summary>
86+
/// Adds the specified expand value to the request.
87+
/// </summary>
88+
/// <param name="expandExpression">The expression from which to calculate the expand value.</param>
89+
/// <returns>The request object to send.</returns>
90+
ISessionWithReferenceRequest Expand(Expression<Func<Session, object>> expandExpression);
91+
92+
/// <summary>
93+
/// Adds the specified select value to the request.
94+
/// </summary>
95+
/// <param name="value">The select value.</param>
96+
/// <returns>The request object to send.</returns>
97+
ISessionWithReferenceRequest Select(string value);
98+
99+
/// <summary>
100+
/// Adds the specified select value to the request.
101+
/// </summary>
102+
/// <param name="selectExpression">The expression from which to calculate the select value.</param>
103+
/// <returns>The request object to send.</returns>
104+
ISessionWithReferenceRequest Select(Expression<Func<Session, object>> selectExpression);
105+
106+
}
107+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
6+
// <auto-generated/>
7+
8+
// Template Source: Templates\CSharp\Requests\IEntityWithReferenceRequestBuilder.cs.tt
9+
10+
namespace Microsoft.Graph2.CallRecords
11+
{
12+
using System;
13+
using System.Collections.Generic;
14+
15+
/// <summary>
16+
/// The interface ISessionWithReferenceRequestBuilder.
17+
/// </summary>
18+
public partial interface ISessionWithReferenceRequestBuilder : Microsoft.Graph.IBaseRequestBuilder
19+
{
20+
/// <summary>
21+
/// Builds the request.
22+
/// </summary>
23+
/// <returns>The built request.</returns>
24+
ISessionWithReferenceRequest Request();
25+
26+
/// <summary>
27+
/// Builds the request.
28+
/// </summary>
29+
/// <param name="options">The query and header options for the request.</param>
30+
/// <returns>The built request.</returns>
31+
ISessionWithReferenceRequest Request(IEnumerable<Microsoft.Graph.Option> options);
32+
33+
/// <summary>
34+
/// Gets the request builder for the reference of the session.
35+
/// </summary>
36+
/// <returns>The <see cref="ISessionReferenceRequestBuilder"/>.</returns>
37+
ISessionReferenceRequestBuilder Reference { get; }
38+
39+
}
40+
}

test/Typewriter.Test/TestDataCSharp/com/Microsoft/Graph2/CallRecords/Requests/SegmentRequestBuilder.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ public Microsoft.Graph.ICallWithReferenceRequestBuilder RefType
7373
return new Microsoft.Graph.CallWithReferenceRequestBuilder(this.AppendSegmentToRequestUrl("refType"), this.Client);
7474
}
7575
}
76+
77+
/// <summary>
78+
/// Gets the request builder for SessionRef.
79+
/// </summary>
80+
/// <returns>The <see cref="ISessionWithReferenceRequestBuilder"/>.</returns>
81+
public ISessionWithReferenceRequestBuilder SessionRef
82+
{
83+
get
84+
{
85+
return new SessionWithReferenceRequestBuilder(this.AppendSegmentToRequestUrl("sessionRef"), this.Client);
86+
}
87+
}
7688

7789
/// <summary>
7890
/// Gets the request builder for SegmentForward.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// ------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
3+
// ------------------------------------------------------------------------------
4+
5+
// **NOTE** This file was generated by a tool and any changes will be overwritten.
6+
// <auto-generated/>
7+
8+
// Template Source: Templates\CSharp\Requests\EntityReferenceRequest.cs.tt
9+
10+
namespace Microsoft.Graph2.CallRecords
11+
{
12+
using System.Collections.Generic;
13+
using System.Net.Http;
14+
using System.Threading;
15+
16+
/// <summary>
17+
/// The type SessionReferenceRequest.
18+
/// </summary>
19+
public partial class SessionReferenceRequest : Microsoft.Graph.BaseRequest, ISessionReferenceRequest
20+
{
21+
/// <summary>
22+
/// Constructs a new SessionReferenceRequest.
23+
/// </summary>
24+
/// <param name="requestUrl">The URL for the built request.</param>
25+
/// <param name="client">The <see cref="Microsoft.Graph.IBaseClient"/> for handling requests.</param>
26+
/// <param name="options">Query and header option name value pairs for the request.</param>
27+
public SessionReferenceRequest(
28+
string requestUrl,
29+
Microsoft.Graph.IBaseClient client,
30+
IEnumerable<Microsoft.Graph.Option> options)
31+
: base(requestUrl, client, options)
32+
{
33+
}
34+
35+
/// <summary>
36+
/// Deletes the specified Session reference.
37+
/// </summary>
38+
/// <returns>The task to await.</returns>
39+
public System.Threading.Tasks.Task DeleteAsync()
40+
{
41+
return this.DeleteAsync(CancellationToken.None);
42+
}
43+
44+
/// <summary>
45+
/// Deletes the specified Session reference.
46+
/// </summary>
47+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
48+
/// <returns>The task to await.</returns>
49+
public async System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken)
50+
{
51+
this.Method = "DELETE";
52+
await this.SendAsync<Session>(null, cancellationToken).ConfigureAwait(false);
53+
}
54+
55+
/// <summary>
56+
/// Puts the specified Session reference.
57+
/// </summary>
58+
/// <param name="id">The Session reference to update.</param>
59+
/// <returns>The task to await.</returns>
60+
public System.Threading.Tasks.Task PutAsync(string id)
61+
{
62+
return this.PutAsync(id, CancellationToken.None);
63+
}
64+
65+
/// <summary>
66+
/// Puts the specified Session reference.
67+
/// </summary>
68+
/// <param name="id">The Session reference to update.</param>
69+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
70+
/// <returns>The task to await.</returns>
71+
public async System.Threading.Tasks.Task PutAsync(string id, CancellationToken cancellationToken)
72+
{
73+
var baseUrl = this.Client.BaseUrl;
74+
var objectUri = string.Format(@"{0}/users/{1}", baseUrl, id);
75+
var payload = new Newtonsoft.Json.Linq.JObject(
76+
new Newtonsoft.Json.Linq.JProperty("@odata.id", objectUri));
77+
this.Method = "PUT";
78+
this.ContentType = "application/json";
79+
await this.SendAsync(payload.ToString(), cancellationToken).ConfigureAwait(false);
80+
}
81+
}
82+
}

0 commit comments

Comments
 (0)