Skip to content

Commit 17f6932

Browse files
committed
Resolve conflict
2 parents 1b33dc4 + 2e1b2ae commit 17f6932

File tree

105 files changed

+4474
-243
lines changed

Some content is hidden

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

105 files changed

+4474
-243
lines changed

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ branches:
44
- dev
55
- master
66
image: Visual Studio 2017
7+
78
before_build:
89
- cmd: >-
910
nuget restore
10-
11-
dotnet restore
1211
build:
1312
verbosity: minimal
1413

src/Microsoft.Graph.Core/Extensions/HttpRequestMessageExtensions.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace Microsoft.Graph
88
using System.Collections.Generic;
99
using System.Linq;
1010
using System.Net.Http;
11+
using System.Threading.Tasks;
1112

1213
/// <summary>
1314
/// Contains extension methods for <see cref="HttpRequestMessage"/>
@@ -48,6 +49,37 @@ internal static FeatureFlag GetFeatureFlags(this HttpRequestMessage httpRequestM
4849
return featureFlag;
4950
}
5051

52+
/// <summary>
53+
/// Create a new HTTP request by copying previous HTTP request's headers and properties from response's request message.
54+
/// </summary>
55+
/// <param name="originalRequest">The previous <see cref="HttpRequestMessage"/> needs to be copy.</param>
56+
/// <returns>The <see cref="HttpRequestMessage"/>.</returns>
57+
/// <remarks>
58+
/// Re-issue a new HTTP request with the previous request's headers and properities
59+
/// </remarks>
60+
internal static async Task<HttpRequestMessage> CloneAsync(this HttpRequestMessage originalRequest)
61+
{
62+
var newRequest = new HttpRequestMessage(originalRequest.Method, originalRequest.RequestUri);
63+
64+
foreach (var header in originalRequest.Headers)
65+
{
66+
newRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
67+
}
68+
69+
foreach (var property in originalRequest.Properties)
70+
{
71+
newRequest.Properties.Add(property);
72+
}
73+
74+
// Set Content if previous request contains
75+
if (originalRequest.Content != null && originalRequest.Content.Headers.ContentLength != 0)
76+
{
77+
newRequest.Content = new StreamContent(await originalRequest.Content.ReadAsStreamAsync());
78+
}
79+
80+
return newRequest;
81+
}
82+
5183
/// <summary>
5284
/// Gets a <see cref="GraphRequestContext"/> from <see cref="HttpRequestMessage"/>
5385
/// </summary>
@@ -79,5 +111,6 @@ public static T GetMiddlewareOption<T>(this HttpRequestMessage httpRequestMessag
79111
}
80112
return (T)option;
81113
}
114+
82115
}
83116
}

src/Microsoft.Graph.Core/Requests/Handlers/AuthenticationHandler.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,17 @@ private async Task<HttpResponseMessage> SendRetryAsync(HttpResponseMessage httpR
7474
int retryAttempt = 0;
7575
while (retryAttempt < MaxRetry)
7676
{
77-
var originalRequest = httpResponseMessage.RequestMessage;
77+
// general clone request with internal CloneAsync (see CloneAsync for details) extension method
78+
var newRequest = await httpResponseMessage.RequestMessage.CloneAsync();
7879

7980
// Authenticate request using AuthenticationProvider
80-
await authProvider.AuthenticateRequestAsync(originalRequest);
81-
httpResponseMessage = await base.SendAsync(originalRequest, cancellationToken);
81+
82+
await AuthenticationProvider.AuthenticateRequestAsync(newRequest);
83+
httpResponseMessage = await base.SendAsync(newRequest, cancellationToken);
8284

8385
retryAttempt++;
8486

85-
if (!IsUnauthorized(httpResponseMessage) || !originalRequest.IsBuffered())
87+
if (!IsUnauthorized(httpResponseMessage) || !newRequest.IsBuffered())
8688
{
8789
// Re-issue the request to get a new access token
8890
return httpResponseMessage;

src/Microsoft.Graph.Core/Requests/Handlers/RedirectHandler.cs

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
7070

7171
while (redirectCount < RedirectOption.MaxRedirects)
7272
{
73-
// general copy request with internal CopyRequest(see copyRequest for details) method
74-
var newRequest = await CopyRequest(response.RequestMessage);
73+
// general clone request with internal CloneAsync (see CloneAsync for details) extension method
74+
var newRequest = await response.RequestMessage.CloneAsync();
7575

7676
// status code == 303: change request method from post to get and content to be null
7777
if (response.StatusCode == HttpStatusCode.SeeOther)
@@ -109,38 +109,6 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
109109

110110
}
111111
return response;
112-
113-
}
114-
115-
/// <summary>
116-
/// Create a new HTTP request by copying previous HTTP request's headers and properties from response's request message.
117-
/// </summary>
118-
/// <param name="originalRequest">The previous <see cref="HttpRequestMessage"/> needs to be copy.</param>
119-
/// <returns>The <see cref="HttpRequestMessage"/>.</returns>
120-
/// <remarks>
121-
/// Re-issue a new HTTP request with the previous request's headers and properities
122-
/// </remarks>
123-
internal async Task<HttpRequestMessage> CopyRequest(HttpRequestMessage originalRequest)
124-
{
125-
var newRequest = new HttpRequestMessage(originalRequest.Method, originalRequest.RequestUri);
126-
127-
foreach (var header in originalRequest.Headers)
128-
{
129-
newRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
130-
}
131-
132-
foreach (var property in originalRequest.Properties)
133-
{
134-
newRequest.Properties.Add(property);
135-
}
136-
137-
// Set Content if previous request contains
138-
if (originalRequest.Content != null && originalRequest.Content.Headers.ContentLength != 0)
139-
{
140-
newRequest.Content = new StreamContent(await originalRequest.Content.ReadAsStreamAsync());
141-
}
142-
143-
return newRequest;
144112
}
145113

146114
/// <summary>

src/Microsoft.Graph.Core/Requests/Handlers/RetryHandler.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,14 @@ protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage
7676
/// <returns></returns>
7777
public async Task<HttpResponseMessage> SendRetryAsync(HttpResponseMessage response, CancellationToken cancellationToken)
7878
{
79-
80-
8179
int retryCount = 0;
82-
83-
8480
while (retryCount < RetryOption.MaxRetry)
8581
{
86-
8782
// Call Delay method to get delay time from response's Retry-After header or by exponential backoff
8883
Task delay = Delay(response, retryCount, cancellationToken);
8984

90-
// Get the original request
91-
var request = response.RequestMessage;
85+
// general clone request with internal CloneAsync (see CloneAsync for details) extension method
86+
var request = await response.RequestMessage.CloneAsync();
9287

9388
// Increase retryCount and then update Retry-Attempt in request header
9489
retryCount++;
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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+
7+
// Template Source: Templates\CSharp\Model\ComplexType.cs.tt
8+
9+
namespace Microsoft.Graph
10+
{
11+
using System;
12+
using System.Collections.Generic;
13+
using System.IO;
14+
using System.Runtime.Serialization;
15+
using Newtonsoft.Json;
16+
17+
/// <summary>
18+
/// The type CopyNotebookModel.
19+
/// </summary>
20+
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
21+
[JsonConverter(typeof(DerivedTypeConverter))]
22+
public partial class CopyNotebookModel
23+
{
24+
25+
/// <summary>
26+
/// Gets or sets isDefault.
27+
/// </summary>
28+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "isDefault", Required = Newtonsoft.Json.Required.Default)]
29+
public bool? IsDefault { get; set; }
30+
31+
/// <summary>
32+
/// Gets or sets userRole.
33+
/// </summary>
34+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "userRole", Required = Newtonsoft.Json.Required.Default)]
35+
public OnenoteUserRole? UserRole { get; set; }
36+
37+
/// <summary>
38+
/// Gets or sets isShared.
39+
/// </summary>
40+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "isShared", Required = Newtonsoft.Json.Required.Default)]
41+
public bool? IsShared { get; set; }
42+
43+
/// <summary>
44+
/// Gets or sets sectionsUrl.
45+
/// </summary>
46+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "sectionsUrl", Required = Newtonsoft.Json.Required.Default)]
47+
public string SectionsUrl { get; set; }
48+
49+
/// <summary>
50+
/// Gets or sets sectionGroupsUrl.
51+
/// </summary>
52+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "sectionGroupsUrl", Required = Newtonsoft.Json.Required.Default)]
53+
public string SectionGroupsUrl { get; set; }
54+
55+
/// <summary>
56+
/// Gets or sets links.
57+
/// </summary>
58+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "links", Required = Newtonsoft.Json.Required.Default)]
59+
public NotebookLinks Links { get; set; }
60+
61+
/// <summary>
62+
/// Gets or sets name.
63+
/// </summary>
64+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "name", Required = Newtonsoft.Json.Required.Default)]
65+
public string Name { get; set; }
66+
67+
/// <summary>
68+
/// Gets or sets createdBy.
69+
/// </summary>
70+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "createdBy", Required = Newtonsoft.Json.Required.Default)]
71+
public string CreatedBy { get; set; }
72+
73+
/// <summary>
74+
/// Gets or sets createdByIdentity.
75+
/// </summary>
76+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "createdByIdentity", Required = Newtonsoft.Json.Required.Default)]
77+
public IdentitySet CreatedByIdentity { get; set; }
78+
79+
/// <summary>
80+
/// Gets or sets lastModifiedBy.
81+
/// </summary>
82+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "lastModifiedBy", Required = Newtonsoft.Json.Required.Default)]
83+
public string LastModifiedBy { get; set; }
84+
85+
/// <summary>
86+
/// Gets or sets lastModifiedByIdentity.
87+
/// </summary>
88+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "lastModifiedByIdentity", Required = Newtonsoft.Json.Required.Default)]
89+
public IdentitySet LastModifiedByIdentity { get; set; }
90+
91+
/// <summary>
92+
/// Gets or sets lastModifiedTime.
93+
/// </summary>
94+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "lastModifiedTime", Required = Newtonsoft.Json.Required.Default)]
95+
public DateTimeOffset? LastModifiedTime { get; set; }
96+
97+
/// <summary>
98+
/// Gets or sets id.
99+
/// </summary>
100+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "id", Required = Newtonsoft.Json.Required.Default)]
101+
public string Id { get; set; }
102+
103+
/// <summary>
104+
/// Gets or sets self.
105+
/// </summary>
106+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "self", Required = Newtonsoft.Json.Required.Default)]
107+
public string Self { get; set; }
108+
109+
/// <summary>
110+
/// Gets or sets createdTime.
111+
/// </summary>
112+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "createdTime", Required = Newtonsoft.Json.Required.Default)]
113+
public DateTimeOffset? CreatedTime { get; set; }
114+
115+
/// <summary>
116+
/// Gets or sets additional data.
117+
/// </summary>
118+
[JsonExtensionData(ReadData = true)]
119+
public IDictionary<string, object> AdditionalData { get; set; }
120+
121+
/// <summary>
122+
/// Gets or sets @odata.type.
123+
/// </summary>
124+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "@odata.type", Required = Newtonsoft.Json.Required.Default)]
125+
public string ODataType { get; set; }
126+
127+
}
128+
}

src/Microsoft.Graph/Models/Generated/DataPolicyOperation.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,42 @@ public partial class DataPolicyOperation : Entity
2323

2424
/// <summary>
2525
/// Gets or sets completed date time.
26+
/// Represents when the request for this data policy operation was completed, in UTC time, using the ISO 8601 format. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'. Null until the operation completes.
2627
/// </summary>
2728
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "completedDateTime", Required = Newtonsoft.Json.Required.Default)]
2829
public DateTimeOffset? CompletedDateTime { get; set; }
2930

3031
/// <summary>
3132
/// Gets or sets status.
33+
/// Possible values are: notStarted, running, complete, failed, unknownFutureValue.
3234
/// </summary>
3335
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "status", Required = Newtonsoft.Json.Required.Default)]
3436
public DataPolicyOperationStatus? Status { get; set; }
3537

3638
/// <summary>
3739
/// Gets or sets storage location.
40+
/// The URL location to where data is being exported for export requests.
3841
/// </summary>
3942
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "storageLocation", Required = Newtonsoft.Json.Required.Default)]
4043
public string StorageLocation { get; set; }
4144

4245
/// <summary>
4346
/// Gets or sets user id.
47+
/// The id for the user on whom the operation is performed.
4448
/// </summary>
4549
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "userId", Required = Newtonsoft.Json.Required.Default)]
4650
public string UserId { get; set; }
4751

4852
/// <summary>
4953
/// Gets or sets submitted date time.
54+
/// Represents when the request for this data operation was submitted, in UTC time, using the ISO 8601 format. For example, midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'
5055
/// </summary>
5156
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "submittedDateTime", Required = Newtonsoft.Json.Required.Default)]
5257
public DateTimeOffset? SubmittedDateTime { get; set; }
5358

5459
/// <summary>
5560
/// Gets or sets progress.
61+
/// Specifies the progress of an operation.
5662
/// </summary>
5763
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "progress", Required = Newtonsoft.Json.Required.Default)]
5864
public double? Progress { get; set; }

src/Microsoft.Graph/Models/Generated/Device.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ public partial class Device : DirectoryObject
147147
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "registeredUsers", Required = Newtonsoft.Json.Required.Default)]
148148
public IDeviceRegisteredUsersCollectionWithReferencesPage RegisteredUsers { get; set; }
149149

150+
/// <summary>
151+
/// Gets or sets transitive member of.
152+
/// </summary>
153+
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "transitiveMemberOf", Required = Newtonsoft.Json.Required.Default)]
154+
public IDeviceTransitiveMemberOfCollectionWithReferencesPage TransitiveMemberOf { get; set; }
155+
150156
/// <summary>
151157
/// Gets or sets extensions.
152158
/// The collection of open extensions defined for the device. Read-only. Nullable.

src/Microsoft.Graph/Models/Generated/EducationUser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ public partial class EducationUser : Entity
7979

8080
/// <summary>
8181
/// Gets or sets related contacts.
82+
/// Set of contacts related to the user. This optional property must be specified in a $select clause and can only be retrieved for an individual user.
8283
/// </summary>
8384
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "relatedContacts", Required = Newtonsoft.Json.Required.Default)]
8485
public IEnumerable<EducationRelatedContact> RelatedContacts { get; set; }

src/Microsoft.Graph/Models/Generated/FileAttachment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public partial class FileAttachment : Attachment
3030

3131
/// <summary>
3232
/// Gets or sets content location.
33-
/// The Uniform Resource Identifier (URI) that corresponds to the location of the content of the attachment.
33+
/// Do not use this property as it is not supported.
3434
/// </summary>
3535
[JsonProperty(NullValueHandling = NullValueHandling.Ignore, PropertyName = "contentLocation", Required = Newtonsoft.Json.Required.Default)]
3636
public string ContentLocation { get; set; }

0 commit comments

Comments
 (0)