-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathUsersRequestBuilder.cs
51 lines (51 loc) · 2.79 KB
/
UsersRequestBuilder.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Graphdotnetv4.Users.Item;
using Microsoft.Kiota.Abstractions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Graphdotnetv4.Users {
/// <summary>Builds and executes requests for operations under \users</summary>
public class UsersRequestBuilder {
/// <summary>Path parameters for the request</summary>
private Dictionary<string, object> PathParameters { get; set; }
/// <summary>The request adapter to use to execute the requests.</summary>
private IRequestAdapter RequestAdapter { get; set; }
/// <summary>Url template to use to build the URL for the current request builder</summary>
private string UrlTemplate { get; set; }
/// <summary>Gets an item from the Graphdotnetv4.users.item collection</summary>
public UserRequestBuilder this[string position] { get {
var urlTplParams = new Dictionary<string, object>(PathParameters);
urlTplParams.Add("user_id", position);
return new UserRequestBuilder(urlTplParams, RequestAdapter);
} }
/// <summary>
/// Instantiates a new UsersRequestBuilder and sets the default values.
/// <param name="pathParameters">Path parameters for the request</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
/// </summary>
public UsersRequestBuilder(Dictionary<string, object> pathParameters, IRequestAdapter requestAdapter) {
_ = pathParameters ?? throw new ArgumentNullException(nameof(pathParameters));
_ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
UrlTemplate = "https://graph.microsoft.com/v1.0/users";
var urlTplParams = new Dictionary<string, object>(pathParameters);
PathParameters = urlTplParams;
RequestAdapter = requestAdapter;
}
/// <summary>
/// Instantiates a new UsersRequestBuilder and sets the default values.
/// <param name="rawUrl">The raw URL to use for the request builder.</param>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
/// </summary>
public UsersRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) {
if(string.IsNullOrEmpty(rawUrl)) throw new ArgumentNullException(nameof(rawUrl));
_ = requestAdapter ?? throw new ArgumentNullException(nameof(requestAdapter));
UrlTemplate = "https://graph.microsoft.com/v1.0/users";
var urlTplParams = new Dictionary<string, object>();
urlTplParams.Add("request-raw-url", rawUrl);
PathParameters = urlTplParams;
RequestAdapter = requestAdapter;
}
}
}