Skip to content

Commit 49dae4c

Browse files
authored
Merge pull request #1687 from microsoftgraph/kiota/v1.0/pipelinebuild/108103
Generated models and request builders
2 parents fd6f353 + 8d0abf5 commit 49dae4c

100 files changed

Lines changed: 2791 additions & 139 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.

CHANGELOG.md

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

88
## [Unreleased]
99

10+
11+
## [5.1.0] - 2023-03-07
12+
13+
### Added
14+
15+
- Adds support for enhanced batch requests
16+
- Latest metadata updates from 7th March 2023
17+
1018
## [5.0.0] - 2023-02-28
1119

1220
- GA release for Kiota SDK version

src/Microsoft.Graph/Generated/Chats/Item/Messages/MessagesRequestBuilder.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<MessagesRequest
8484
return await RequestAdapter.SendAsync<ChatMessageCollectionResponse>(requestInfo, ChatMessageCollectionResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
8585
}
8686
/// <summary>
87-
/// Send a new chatMessage in the specified chat. This API can&apos;t create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
88-
/// Find more info here <see href="https://docs.microsoft.com/graph/api/chat-post-messages?view=graph-rest-1.0" />
87+
/// Send a new chatMessage in the specified channel or a chat.
88+
/// Find more info here <see href="https://docs.microsoft.com/graph/api/chatmessage-post?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<MessagesRequestBuilderG
132132
return requestInfo;
133133
}
134134
/// <summary>
135-
/// Send a new chatMessage in the specified chat. This API can&apos;t create a new chat; you must use the list chats method to retrieve the ID of an existing chat before you can create a chat message.
135+
/// Send a new chatMessage in the specified channel or a chat.
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/Contracts/ContractsRequestBuilder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.Graph.Contracts.Count;
2+
using Microsoft.Graph.Contracts.Delta;
23
using Microsoft.Graph.Contracts.GetAvailableExtensionProperties;
34
using Microsoft.Graph.Contracts.GetByIds;
45
using Microsoft.Graph.Contracts.Item;
@@ -22,6 +23,10 @@ public class ContractsRequestBuilder {
2223
public CountRequestBuilder Count { get =>
2324
new CountRequestBuilder(PathParameters, RequestAdapter);
2425
}
26+
/// <summary>Provides operations to call the delta method.</summary>
27+
public DeltaRequestBuilder Delta { get =>
28+
new DeltaRequestBuilder(PathParameters, RequestAdapter);
29+
}
2530
/// <summary>Provides operations to call the getAvailableExtensionProperties method.</summary>
2631
public GetAvailableExtensionPropertiesRequestBuilder GetAvailableExtensionProperties { get =>
2732
new GetAvailableExtensionPropertiesRequestBuilder(PathParameters, RequestAdapter);
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
using Microsoft.Graph.Models.ODataErrors;
2+
using Microsoft.Kiota.Abstractions;
3+
using Microsoft.Kiota.Abstractions.Serialization;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.IO;
7+
using System.Linq;
8+
using System.Threading;
9+
using System.Threading.Tasks;
10+
namespace Microsoft.Graph.Contracts.Delta {
11+
/// <summary>
12+
/// Provides operations to call the delta method.
13+
/// </summary>
14+
public class DeltaRequestBuilder {
15+
/// <summary>Path parameters for the request</summary>
16+
private Dictionary<string, object> PathParameters { get; set; }
17+
/// <summary>The request adapter to use to execute the requests.</summary>
18+
private IRequestAdapter RequestAdapter { get; set; }
19+
/// <summary>Url template to use to build the URL for the current request builder</summary>
20+
private string UrlTemplate { get; set; }
21+
/// <summary>
22+
/// Instantiates a new DeltaRequestBuilder and sets the default values.
23+
/// </summary>
24+
/// <param name="pathParameters">Path parameters for the request</param>
25+
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
26+
public DeltaRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) {
27+
_ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
28+
_ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
29+
UrlTemplate = "{+baseurl}/contracts/delta(){?%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}";
30+
var urlTplParams = new Dictionary<string, object>(pathParameters);
31+
PathParameters = urlTplParams;
32+
RequestAdapter = requestAdapter;
33+
}
34+
/// <summary>
35+
/// Instantiates a new DeltaRequestBuilder and sets the default values.
36+
/// </summary>
37+
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
38+
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
39+
public DeltaRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
40+
if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
41+
_ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
42+
UrlTemplate = "{+baseurl}/contracts/delta(){?%24top,%24skip,%24search,%24filter,%24count,%24select,%24orderby}";
43+
var urlTplParams = new Dictionary<string, object>();
44+
if (!string.IsNullOrWhiteSpace(rawUrl)) urlTplParams.Add("request-raw-url", rawUrl);
45+
PathParameters = urlTplParams;
46+
RequestAdapter = requestAdapter;
47+
}
48+
/// <summary>
49+
/// Invoke function delta
50+
/// </summary>
51+
/// <param name="cancellationToken">Cancellation token to use when cancelling requests</param>
52+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
53+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
54+
#nullable enable
55+
public async Task<DeltaResponse?> GetAsync(Action<DeltaRequestBuilderGetRequestConfiguration>? requestConfiguration = default, CancellationToken cancellationToken = default) {
56+
#nullable restore
57+
#else
58+
public async Task<DeltaResponse> GetAsync(Action<DeltaRequestBuilderGetRequestConfiguration> requestConfiguration = default, CancellationToken cancellationToken = default) {
59+
#endif
60+
var requestInfo = ToGetRequestInformation(requestConfiguration);
61+
var errorMapping = new Dictionary<string, ParsableFactory<IParsable>> {
62+
{"4XX", ODataError.CreateFromDiscriminatorValue},
63+
{"5XX", ODataError.CreateFromDiscriminatorValue},
64+
};
65+
return await RequestAdapter.SendAsync<DeltaResponse>(requestInfo, DeltaResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken);
66+
}
67+
/// <summary>
68+
/// Invoke function delta
69+
/// </summary>
70+
/// <param name="requestConfiguration">Configuration for the request such as headers, query parameters, and middleware options.</param>
71+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
72+
#nullable enable
73+
public RequestInformation ToGetRequestInformation(Action<DeltaRequestBuilderGetRequestConfiguration>? requestConfiguration = default) {
74+
#nullable restore
75+
#else
76+
public RequestInformation ToGetRequestInformation(Action<DeltaRequestBuilderGetRequestConfiguration> requestConfiguration = default) {
77+
#endif
78+
var requestInfo = new RequestInformation {
79+
HttpMethod = Method.GET,
80+
UrlTemplate = UrlTemplate,
81+
PathParameters = PathParameters,
82+
};
83+
requestInfo.Headers.Add("Accept", "application/json");
84+
if (requestConfiguration != null) {
85+
var requestConfig = new DeltaRequestBuilderGetRequestConfiguration();
86+
requestConfiguration.Invoke(requestConfig);
87+
requestInfo.AddQueryParameters(requestConfig.QueryParameters);
88+
requestInfo.AddRequestOptions(requestConfig.Options);
89+
requestInfo.AddHeaders(requestConfig.Headers);
90+
}
91+
return requestInfo;
92+
}
93+
/// <summary>
94+
/// Invoke function delta
95+
/// </summary>
96+
public class DeltaRequestBuilderGetQueryParameters {
97+
/// <summary>Include count of items</summary>
98+
[QueryParameter("%24count")]
99+
public bool? Count { get; set; }
100+
/// <summary>Filter items by property values</summary>
101+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
102+
#nullable enable
103+
[QueryParameter("%24filter")]
104+
public string? Filter { get; set; }
105+
#nullable restore
106+
#else
107+
[QueryParameter("%24filter")]
108+
public string Filter { get; set; }
109+
#endif
110+
/// <summary>Order items by property values</summary>
111+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
112+
#nullable enable
113+
[QueryParameter("%24orderby")]
114+
public string[]? Orderby { get; set; }
115+
#nullable restore
116+
#else
117+
[QueryParameter("%24orderby")]
118+
public string[] Orderby { get; set; }
119+
#endif
120+
/// <summary>Search items by search phrases</summary>
121+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
122+
#nullable enable
123+
[QueryParameter("%24search")]
124+
public string? Search { get; set; }
125+
#nullable restore
126+
#else
127+
[QueryParameter("%24search")]
128+
public string Search { get; set; }
129+
#endif
130+
/// <summary>Select properties to be returned</summary>
131+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
132+
#nullable enable
133+
[QueryParameter("%24select")]
134+
public string[]? Select { get; set; }
135+
#nullable restore
136+
#else
137+
[QueryParameter("%24select")]
138+
public string[] Select { get; set; }
139+
#endif
140+
/// <summary>Skip the first n items</summary>
141+
[QueryParameter("%24skip")]
142+
public int? Skip { get; set; }
143+
/// <summary>Show only the first n items</summary>
144+
[QueryParameter("%24top")]
145+
public int? Top { get; set; }
146+
}
147+
/// <summary>
148+
/// Configuration for the request such as headers, query parameters, and middleware options.
149+
/// </summary>
150+
public class DeltaRequestBuilderGetRequestConfiguration {
151+
/// <summary>Request headers</summary>
152+
public RequestHeaders Headers { get; set; }
153+
/// <summary>Request options</summary>
154+
public IList<IRequestOption> Options { get; set; }
155+
/// <summary>Request query parameters</summary>
156+
public DeltaRequestBuilderGetQueryParameters QueryParameters { get; set; } = new DeltaRequestBuilderGetQueryParameters();
157+
/// <summary>
158+
/// Instantiates a new deltaRequestBuilderGetRequestConfiguration and sets the default values.
159+
/// </summary>
160+
public DeltaRequestBuilderGetRequestConfiguration() {
161+
Options = new List<IRequestOption>();
162+
Headers = new RequestHeaders();
163+
}
164+
}
165+
}
166+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using Microsoft.Graph.Models;
2+
using Microsoft.Kiota.Abstractions.Serialization;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.IO;
6+
using System.Linq;
7+
namespace Microsoft.Graph.Contracts.Delta {
8+
public class DeltaResponse : BaseDeltaFunctionResponse, IParsable {
9+
/// <summary>The value property</summary>
10+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
11+
#nullable enable
12+
public List<DirectoryObject>? Value {
13+
get { return BackingStore?.Get<List<DirectoryObject>?>("value"); }
14+
set { BackingStore?.Set("value", value); }
15+
}
16+
#nullable restore
17+
#else
18+
public List<DirectoryObject> Value {
19+
get { return BackingStore?.Get<List<DirectoryObject>>("value"); }
20+
set { BackingStore?.Set("value", value); }
21+
}
22+
#endif
23+
/// <summary>
24+
/// Creates a new instance of the appropriate class based on discriminator value
25+
/// </summary>
26+
/// <param name="parseNode">The parse node to use to read the discriminator value and create the object</param>
27+
public static new DeltaResponse CreateFromDiscriminatorValue(IParseNode parseNode) {
28+
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
29+
return new DeltaResponse();
30+
}
31+
/// <summary>
32+
/// The deserialization information for the current model
33+
/// </summary>
34+
public new IDictionary<string, Action<IParseNode>> GetFieldDeserializers() {
35+
return new Dictionary<string, Action<IParseNode>>(base.GetFieldDeserializers()) {
36+
{"value", n => { Value = n.GetCollectionOfObjectValues<DirectoryObject>(DirectoryObject.CreateFromDiscriminatorValue)?.ToList(); } },
37+
};
38+
}
39+
/// <summary>
40+
/// Serializes information the current object
41+
/// </summary>
42+
/// <param name="writer">Serialization writer to use to serialize this model</param>
43+
public new void Serialize(ISerializationWriter writer) {
44+
_ = writer ?? throw new ArgumentNullException(nameof(writer));
45+
base.Serialize(writer);
46+
writer.WriteCollectionOfObjectValues<DirectoryObject>("value", Value);
47+
}
48+
}
49+
}

src/Microsoft.Graph/Generated/DirectoryNamespace/DeletedItems/DeletedItemsRequestBuilder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.Graph.DirectoryNamespace.DeletedItems.Count;
2+
using Microsoft.Graph.DirectoryNamespace.DeletedItems.Delta;
23
using Microsoft.Graph.DirectoryNamespace.DeletedItems.GetAvailableExtensionProperties;
34
using Microsoft.Graph.DirectoryNamespace.DeletedItems.GetByIds;
45
using Microsoft.Graph.DirectoryNamespace.DeletedItems.GraphApplication;
@@ -25,6 +26,10 @@ public class DeletedItemsRequestBuilder {
2526
public CountRequestBuilder Count { get =>
2627
new CountRequestBuilder(PathParameters, RequestAdapter);
2728
}
29+
/// <summary>Provides operations to call the delta method.</summary>
30+
public DeltaRequestBuilder Delta { get =>
31+
new DeltaRequestBuilder(PathParameters, RequestAdapter);
32+
}
2833
/// <summary>Provides operations to call the getAvailableExtensionProperties method.</summary>
2934
public GetAvailableExtensionPropertiesRequestBuilder GetAvailableExtensionProperties { get =>
3035
new GetAvailableExtensionPropertiesRequestBuilder(PathParameters, RequestAdapter);

0 commit comments

Comments
 (0)