-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathRoutineEndpoint.cs
More file actions
46 lines (44 loc) · 2.14 KB
/
Copy pathRoutineEndpoint.cs
File metadata and controls
46 lines (44 loc) · 2.14 KB
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
using Microsoft.Extensions.Primitives;
namespace NpgsqlRest;
public struct RoutineEndpoint(
string url,
Method method,
RequestParamType requestParamType,
bool requiresAuthorization,
string[] columnNames,
string[] paramNames,
int? commandTimeout,
string? responseContentType,
Dictionary<string, StringValues> responseHeaders,
RequestHeadersMode requestHeadersMode,
string requestHeadersParameterName,
string? bodyParameterName,
TextResponseNullHandling textResponseNullHandling,
QueryStringNullHandling queryStringNullHandling,
HashSet<string>? authorizeRoles = null,
bool login = false,
bool logout = false,
ulong? bufferRows = null)
{
internal HashSet<string> ParamsNameHash { get; } = new(paramNames);
internal Action<ILogger, string, string, Exception?>? LogCallback { get; set; }
public string Url { get; set; } = url;
public Method Method { get; set; } = method;
public RequestParamType RequestParamType { get; set; } = requestParamType;
public bool RequiresAuthorization { get; set; } = requiresAuthorization;
public string[] ColumnNames { get; set; } = columnNames;
public string[] ParamNames { get; set; } = paramNames;
public int? CommandTimeout { get; set; } = commandTimeout;
public string? ResponseContentType { get; set; } = responseContentType;
public Dictionary<string, StringValues> ResponseHeaders { get; set; } = responseHeaders;
public RequestHeadersMode RequestHeadersMode { get; set; } = requestHeadersMode;
public string RequestHeadersParameterName { get; set; } = requestHeadersParameterName;
public string? BodyParameterName { get; set; } = bodyParameterName;
public TextResponseNullHandling TextResponseNullHandling { get; set; } = textResponseNullHandling;
public QueryStringNullHandling QueryStringNullHandling { get; set; } = queryStringNullHandling;
public HashSet<string>? AuthorizeRoles { get; set; } = authorizeRoles;
public bool Login { get; set; } = login;
public bool Logout { get; set; } = logout;
public bool IsAuth => Login || Logout;
public ulong? BufferRows { get; set; } = bufferRows;
}