NewMethod creates a new method
(reqRes RequestResponse)
| 9 | |
| 10 | // NewMethod creates a new method |
| 11 | func NewMethod(reqRes RequestResponse) *Method { |
| 12 | method := &Method{ |
| 13 | Responses: map[int]*Response{}, |
| 14 | Parameters: NewParameters(reqRes.Request), |
| 15 | } |
| 16 | if reqRes.Response != nil { |
| 17 | method.Responses = map[int]*Response{ |
| 18 | reqRes.Response.StatusCode: NewResponse(reqRes.Response), |
| 19 | } |
| 20 | } |
| 21 | return method |
| 22 | } |
| 23 | |
| 24 | // UpdateMethod updates a method |
| 25 | func (m *Method) UpdateMethod(reqRes RequestResponse) { |
no test coverage detected