Skip to content

Commit df8a643

Browse files
authored
Merge pull request #1721 from microsoftgraph/dev
Release 5.2.0
2 parents 3b2a274 + 82d4f5d commit df8a643

80 files changed

Lines changed: 2739 additions & 268 deletions

File tree

Some content is hidden

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

.github/workflows/projectbot.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# This workflow is used to add new issues to GitHub Projects (Beta)
2+
3+
name: Add PR to project
4+
on:
5+
issues:
6+
types:
7+
- opened
8+
jobs:
9+
track_issue:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Generate token
13+
id: generate_token
14+
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
15+
with:
16+
app_id: ${{ secrets.GRAPHBOT_APP_ID }}
17+
private_key: ${{ secrets.GRAPHBOT_APP_PEM }}
18+
19+
- name: Get project data
20+
env:
21+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
22+
ORGANIZATION: microsoftgraph
23+
PROJECT_NUMBER: 28
24+
run: |
25+
gh api graphql -f query='
26+
query($org: String!, $number: Int!) {
27+
organization(login: $org){
28+
projectV2(number: $number) {
29+
id
30+
fields(first:20) {
31+
nodes {
32+
... on ProjectV2SingleSelectField {
33+
id
34+
name
35+
options {
36+
id
37+
name
38+
}
39+
}
40+
}
41+
}
42+
}
43+
}
44+
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
45+
46+
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
47+
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
48+
echo 'TRIAGE_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Needs Triage 🔍") |.id' project_data.json) >> $GITHUB_ENV
49+
50+
- name: Add Issue to project
51+
env:
52+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
53+
ISSUE_ID: ${{ github.event.issue.node_id }}
54+
run: |
55+
item_id="$( gh api graphql -f query='
56+
mutation($project:ID!, $issue:ID!) {
57+
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
58+
item {
59+
id
60+
}
61+
}
62+
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
63+
64+
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
65+
66+
- name: Set Triage
67+
env:
68+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
69+
run: |
70+
gh api graphql -f query='
71+
mutation (
72+
$project: ID!
73+
$item: ID!
74+
$status_field: ID!
75+
$status_value: String!
76+
) {
77+
set_status: updateProjectV2ItemFieldValue(input: {
78+
projectId: $project
79+
itemId: $item
80+
fieldId: $status_field
81+
value: {singleSelectOptionId: $status_value}
82+
}) {
83+
projectV2Item {
84+
id
85+
}
86+
}
87+
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.TRIAGE_OPTION_ID }} --silent

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and this project does adheres to [Semantic Versioning](https://semver.org/spec/v
88
## [Unreleased]
99

1010

11+
## [5.2.0] - 2023-03-14
12+
13+
### Added
14+
15+
- Updated core version to fix delta link parsing in pageiterator
16+
- Updated core version to use range dependency for System.Text.Json and System.DiagnosticSource
17+
- Latest metadata updates from 14th March 2023
18+
1119
## [5.1.0] - 2023-03-07
1220

1321
### Added

docs/upgrade-to-v5.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ var user = await graphServiceClient
108108
.GetAsync(requestConfiguration => requestConfiguration.Headers.Add("ConsistencyLevel","eventual"));
109109
```
110110

111-
### Query Options
111+
### Query Parameter Options
112112
To pass query Options, the `QueryOption` class is no longer used. Query options are set using the `requestConfiguration` modifier as follows
113113

114114
```cs
@@ -130,6 +130,36 @@ var groups = await graphServiceClient
130130
});
131131
```
132132

133+
### Per-Request Options
134+
To pass per-request options to the default http middleware to configure actions like redirects and retries, this can be done using the `requestConfiguration` by adding an `IRequestOption` instance to the `Options` collection. For example, adding a `RetryHandlerOption` instance to configure the retry handler option as below.
135+
136+
```cs
137+
138+
var retryHandlerOption = new RetryHandlerOption
139+
{
140+
MaxRetry = 7,
141+
ShouldRetry = (delay,attempt,message) => true
142+
};
143+
var user = await graphClient.Me.GetAsync(requestConfiguration => requestConfiguration.Options.Add(retryHandlerOption));
144+
```
145+
146+
Other `IRequestOption` instances provided by default include the following and their source can be found [here](https://github.com/microsoft/kiota-http-dotnet/tree/main/src/Middleware/Options)
147+
148+
- `RetryHandlerOption` - for configuring the retry handler to customise request retries
149+
- `RedirectHandlerOption` - for configuring the redirect handler to customise request redirects
150+
- `ChaosHandlerOption` - for configuring the chaos handler to customise simulated chaos when testing with mock responses
151+
152+
### Native Response Object
153+
The per-request options object can be used to obtain the native `HttpReponseMessage` from the request to override the default response handling of the request builders using the `ResponseHandlerOption` as below. This can be used in scenarios where one wished to access the native response object or customize the response handling by creating and passing an instance of [IResponseHandler](https://github.com/microsoft/kiota-abstractions-dotnet/blob/main/src/IResponseHandler.cs).
154+
155+
```cs
156+
var nativeResponseHandler = new NativeResponseHandler();
157+
await graphClient.Me.GetAsync(requestConfiguration => requestConfiguration.Options.Add(new ResponseHandlerOption(){ ResponseHandler = nativeResponseHandler }));
158+
159+
var responseMessage = nativeResponseHandler.Value as HttpResponseMessage;
160+
161+
```
162+
133163
### Collections
134164

135165
Querying for collections are done as follows and resembles the response from API.

src/Microsoft.Graph/Enums/GraphErrorCode.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ public enum GraphErrorCode
4848
InvalidRequest,
4949
/// Invalid start index.
5050
InvalidStartIndex,
51+
/// The image could not be found.
52+
ImageNotFound,
5153
/// The resource could not be found.
5254
ItemNotFound,
5355
/// Lock token does not match existing lock.

src/Microsoft.Graph/Generated/BaseGraphServiceClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
using Microsoft.Graph.Domains;
2828
using Microsoft.Graph.Drives;
2929
using Microsoft.Graph.Education;
30+
using Microsoft.Graph.EmployeeExperience;
3031
using Microsoft.Graph.External;
3132
using Microsoft.Graph.GroupLifecyclePolicies;
3233
using Microsoft.Graph.Groups;
@@ -197,6 +198,10 @@ public class BaseGraphServiceClient {
197198
public EducationRequestBuilder Education { get =>
198199
new EducationRequestBuilder(PathParameters, RequestAdapter);
199200
}
201+
/// <summary>Provides operations to manage the employeeExperience singleton.</summary>
202+
public EmployeeExperienceRequestBuilder EmployeeExperience { get =>
203+
new EmployeeExperienceRequestBuilder(PathParameters, RequestAdapter);
204+
}
200205
/// <summary>Provides operations to manage the external singleton.</summary>
201206
public ExternalRequestBuilder External { get =>
202207
new ExternalRequestBuilder(PathParameters, RequestAdapter);

src/Microsoft.Graph/Generated/Chats/Item/Messages/Item/Replies/RepliesRequestBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ public async Task<ChatMessageCollectionResponse> GetAsync(Action<RepliesRequestB
8484
return await RequestAdapter.SendAsync<ChatMessageCollectionResponse>(requestInfo, ChatMessageCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
8585
}
8686
/// <summary>
87-
/// Send a new reply to a chatMessage in a specified channel.
88-
/// Find more info here <see href="https://docs.microsoft.com/graph/api/chatmessage-post-replies?view=graph-rest-1.0" />
87+
/// Create a new reply to a chatMessage in a specified channel.
88+
/// Find more info here <see href="https://docs.microsoft.com/graph/api/channel-post-messagereply?view=graph-rest-1.0" />
8989
/// </summary>
9090
/// <param name="body">The request body</param>
9191
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
@@ -132,7 +132,7 @@ public RequestInformation ToGetRequestInformation(Action<RepliesRequestBuilderGe
132132
return requestInfo;
133133
}
134134
/// <summary>
135-
/// Send a new reply to a chatMessage in a specified channel.
135+
/// Create a new reply to a chatMessage in a specified channel.
136136
/// </summary>
137137
/// <param name="body">The request body</param>
138138
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

src/Microsoft.Graph/Generated/Communications/Calls/Item/Participants/Invite/InviteRequestBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public InviteRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
4747
RequestAdapter = requestAdapter;
4848
}
4949
/// <summary>
50-
/// Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
51-
/// Find more info here <see href="https://docs.microsoft.com/graph/api/participant-delete?view=graph-rest-1.0" />
50+
/// Invite participants to the active call. For more information about how to handle operations, see commsOperation.
51+
/// Find more info here <see href="https://docs.microsoft.com/graph/api/participant-invite?view=graph-rest-1.0" />
5252
/// </summary>
5353
/// <param name="body">The request body</param>
5454
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
@@ -69,7 +69,7 @@ public async Task<InviteParticipantsOperation> PostAsync(InvitePostRequestBody b
6969
return await RequestAdapter.SendAsync<InviteParticipantsOperation>(requestInfo, InviteParticipantsOperation.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
7070
}
7171
/// <summary>
72-
/// Delete a specific participant in a call. In some situations, it is appropriate for an application to remove a participant from an active call. This action can be done before or after the participant answers the call. When an active caller is removed, they are immediately dropped from the call with no pre- or post-removal notification. When an invited participant is removed, any outstanding add participant request is canceled.
72+
/// Invite participants to the active call. For more information about how to handle operations, see commsOperation.
7373
/// </summary>
7474
/// <param name="body">The request body</param>
7575
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

src/Microsoft.Graph/Generated/Drives/Item/Bundles/BundlesRequestBuilder.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,27 @@ public async Task<DriveItemCollectionResponse> GetAsync(Action<BundlesRequestBui
7878
return await RequestAdapter.SendAsync<DriveItemCollectionResponse>(requestInfo, DriveItemCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
7979
}
8080
/// <summary>
81+
/// Create new navigation property to bundles for drives
82+
/// </summary>
83+
/// <param name="body">The request body</param>
84+
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
85+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
86+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
87+
#nullable enable
88+
public async Task<Microsoft.Graph.Models.DriveItem?> PostAsync(Microsoft.Graph.Models.DriveItem body, Action<BundlesRequestBuilderPostRequestConfiguration>? requestConfiguration = default, CancellationToken cancellationToken = default) {
89+
#nullable restore
90+
#else
91+
public async Task<Microsoft.Graph.Models.DriveItem> PostAsync(Microsoft.Graph.Models.DriveItem body, Action<BundlesRequestBuilderPostRequestConfiguration> requestConfiguration = default, CancellationToken cancellationToken = default) {
92+
#endif
93+
_ = body ?? throw new ArgumentNullException(nameof(body));
94+
var requestInfo = ToPostRequestInformation(body, requestConfiguration);
95+
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
96+
{"4XX", ODataError.CreateFromDiscriminatorValue},
97+
{"5XX", ODataError.CreateFromDiscriminatorValue},
98+
};
99+
return await RequestAdapter.SendAsync<Microsoft.Graph.Models.DriveItem>(requestInfo, Microsoft.Graph.Models.DriveItem.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
100+
}
101+
/// <summary>
81102
/// Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive.
82103
/// </summary>
83104
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
@@ -104,6 +125,34 @@ public RequestInformation ToGetRequestInformation(Action<BundlesRequestBuilderGe
104125
return requestInfo;
105126
}
106127
/// <summary>
128+
/// Create new navigation property to bundles for drives
129+
/// </summary>
130+
/// <param name="body">The request body</param>
131+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
132+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
133+
#nullable enable
134+
public RequestInformation ToPostRequestInformation(Microsoft.Graph.Models.DriveItem body, Action<BundlesRequestBuilderPostRequestConfiguration>? requestConfiguration = default) {
135+
#nullable restore
136+
#else
137+
public RequestInformation ToPostRequestInformation(Microsoft.Graph.Models.DriveItem body, Action<BundlesRequestBuilderPostRequestConfiguration> requestConfiguration = default) {
138+
#endif
139+
_ = body ?? throw new ArgumentNullException(nameof(body));
140+
var requestInfo = new RequestInformation {
141+
HttpMethod = Method.POST,
142+
UrlTemplate = UrlTemplate,
143+
PathParameters = PathParameters,
144+
};
145+
requestInfo.Headers.Add("Accept", "application/json");
146+
requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body);
147+
if (requestConfiguration != null) {
148+
var requestConfig = new BundlesRequestBuilderPostRequestConfiguration();
149+
requestConfiguration.Invoke(requestConfig);
150+
requestInfo.AddRequestOptions(requestConfig.Options);
151+
requestInfo.AddHeaders(requestConfig.Headers);
152+
}
153+
return requestInfo;
154+
}
155+
/// <summary>
107156
/// Collection of [bundles][bundle] (albums and multi-select-shared sets of items). Only in personal OneDrive.
108157
/// </summary>
109158
public class BundlesRequestBuilderGetQueryParameters {
@@ -185,5 +234,21 @@ public BundlesRequestBuilderGetRequestConfiguration() {
185234
Headers = new RequestHeaders();
186235
}
187236
}
237+
/// <summary>
238+
/// Configuration for the request such as headers, query parameters, and middleware options.
239+
/// </summary>
240+
public class BundlesRequestBuilderPostRequestConfiguration {
241+
/// <summary>Request headers</summary>
242+
public RequestHeaders Headers { get; set; }
243+
/// <summary>Request options</summary>
244+
public IList<IRequestOption> Options { get; set; }
245+
/// <summary>
246+
/// Instantiates a new bundlesRequestBuilderPostRequestConfiguration and sets the default values.
247+
/// </summary>
248+
public BundlesRequestBuilderPostRequestConfiguration() {
249+
Options = new List<IRequestOption>();
250+
Headers = new RequestHeaders();
251+
}
252+
}
188253
}
189254
}

src/Microsoft.Graph/Generated/Drives/Item/Items/Item/Workbook/Names/NamesRequestBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public NamesRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
7070
}
7171
/// <summary>
7272
/// Retrieve a list of nameditem objects.
73-
/// Find more info here <see href="https://docs.microsoft.com/graph/api/workbook-list-names?view=graph-rest-1.0" />
73+
/// Find more info here <see href="https://docs.microsoft.com/graph/api/nameditem-list?view=graph-rest-1.0" />
7474
/// </summary>
7575
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
7676
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

src/Microsoft.Graph/Generated/Drives/Item/Items/Item/Workbook/Tables/Item/Columns/ColumnsRequestBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public ColumnsRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
6666
}
6767
/// <summary>
6868
/// Retrieve a list of tablecolumn objects.
69-
/// Find more info here <see href="https://docs.microsoft.com/graph/api/table-list-columns?view=graph-rest-1.0" />
69+
/// Find more info here <see href="https://docs.microsoft.com/graph/api/tablecolumn-list?view=graph-rest-1.0" />
7070
/// </summary>
7171
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
7272
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>

0 commit comments

Comments
 (0)