-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathRequestOptions.mustache
87 lines (75 loc) · 2.83 KB
/
RequestOptions.mustache
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{{>partial_header}}
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
namespace {{packageName}}.Client
{
/// <summary>
/// A container for generalized request inputs. This type allows consumers to extend the request functionality
/// by abstracting away from the default (built-in) request framework (e.g. RestSharp).
/// </summary>
public class RequestOptions
{
/// <summary>
/// Parameters to be bound to path parts of the Request's URL
/// </summary>
public Dictionary<string, string> PathParameters { get; set; }
/// <summary>
/// Query parameters to be applied to the request.
/// Keys may have 1 or more values associated.
/// </summary>
public Multimap<string, string> QueryParameters { get; set; }
/// <summary>
/// Header parameters to be applied to the request.
/// Keys may have 1 or more values associated.
/// </summary>
public Multimap<string, string> HeaderParameters { get; set; }
/// <summary>
/// Form parameters to be sent along with the request.
/// </summary>
public Dictionary<string, string> FormParameters { get; set; }
{{#supportsFileParameters}}
/// <summary>
/// File parameters to be sent along with the request.
/// </summary>
public Multimap<string, Stream> FileParameters { get; set; }
{{/supportsFileParameters}}
/// <summary>
/// Cookies to be sent along with the request.
/// </summary>
public List<Cookie> Cookies { get; set; }
/// <summary>
/// Operation associated with the request path.
/// </summary>
public string Operation { get; set; }
/// <summary>
/// Index associated with the operation.
/// </summary>
public int OperationIndex { get; set; }
/// <summary>
/// Any data associated with a request body.
/// </summary>
public Object Data { get; set; }
{{#hasOAuthMethods}}
/// <summary>
/// If request should be authenticated with OAuth.
/// </summary>
public bool OAuth { get; set; }
{{/hasOAuthMethods}}
/// <summary>
/// Constructs a new instance of <see cref="RequestOptions"/>
/// </summary>
public RequestOptions()
{
PathParameters = new Dictionary<string, string>();
QueryParameters = new Multimap<string, string>();
HeaderParameters = new Multimap<string, string>();
FormParameters = new Dictionary<string, string>();
{{#supportsFileParameters}}
FileParameters = new Multimap<string, Stream>();
{{/supportsFileParameters}}
Cookies = new List<Cookie>();
}
}
}