Debian Codegraph @

v2/sarif/web_request.go

raw
1 package sarif
2
3 // WebRequest ...
4 type WebRequest struct {
5 Body *ArtifactContent `json:"body,omitempty"`
6 Headers map[string]string `json:"headers,omitempty"`
7 Index *int `json:"index,omitempty"`
8 Method *string `json:"method,omitempty"`
9 Parameters map[string]string `json:"parameters,omitempty"`
10 Protocol *string `json:"protocol,omitempty"`
11 Target *string `json:"target,omitempty"`
12 Version *string `json:"version,omitempty"`
13 PropertyBag
14
15 }
16
17 // NewWebRequest creates a new WebRequest and returns a pointer to it
18 func NewWebRequest() *WebRequest {
19 return &WebRequest{}
20 }
21
22 // WithBody sets the Body
23 func (webRequest *WebRequest) WithBody(body *ArtifactContent) *WebRequest {
24 webRequest.Body = body
25 return webRequest
26 }
27
28 // WithHeaders sets the Headers
29 func (webRequest *WebRequest) WithHeaders(headers map[string]string) *WebRequest {
30 webRequest.Headers = headers
31 return webRequest
32 }
33
34 // SetHeader ...
35 func (webRequest *WebRequest) SetHeader(name, value string) {
36 webRequest.Headers[name] = value
37 }
38
39 // WithIndex sets the Index
40 func (webRequest *WebRequest) WithIndex(index int) *WebRequest {
41 webRequest.Index = &index
42 return webRequest
43 }
44
45 // WithMethod sets the Method
46 func (webRequest *WebRequest) WithMethod(method string) *WebRequest {
47 webRequest.Method = &method
48 return webRequest
49 }
50
51 // WithParameters sets the Parameters
52 func (webRequest *WebRequest) WithParameters(parameters map[string]string) *WebRequest {
53 webRequest.Parameters = parameters
54 return webRequest
55 }
56
57 // SetParameter ...
58 func (webRequest *WebRequest) SetParameter(name, value string) {
59 webRequest.Parameters[name] = value
60 }
61
62 // WithProtocol sets the Protocol
63 func (webRequest *WebRequest) WithProtocol(protocol string) *WebRequest {
64 webRequest.Protocol = &protocol
65 return webRequest
66 }
67
68 // WithTarget sets the Target
69 func (webRequest *WebRequest) WithTarget(target string) *WebRequest {
70 webRequest.Target = &target
71 return webRequest
72 }
73
74 // WithVersion sets the Version
75 func (webRequest *WebRequest) WithVersion(version string) *WebRequest {
76 webRequest.Version = &version
77 return webRequest
78 }