(r *http.Request, params ListRequestParams)
| 90 | } |
| 91 | |
| 92 | func (h testResourceHandler) GetAll(r *http.Request, params ListRequestParams) (Page, error) { |
| 93 | if params.Count == 0 { |
| 94 | return Page{ |
| 95 | TotalResults: len(h.data), |
| 96 | }, nil |
| 97 | } |
| 98 | |
| 99 | resources := make([]Resource, 0) |
| 100 | i := 1 |
| 101 | |
| 102 | for k, v := range h.data { |
| 103 | if i > (params.StartIndex + params.Count - 1) { |
| 104 | break |
| 105 | } |
| 106 | |
| 107 | if i >= params.StartIndex { |
| 108 | resources = append(resources, Resource{ |
| 109 | ID: k, |
| 110 | ExternalID: h.externalID(v.resourceAttributes), |
| 111 | Attributes: v.resourceAttributes, |
| 112 | }) |
| 113 | } |
| 114 | i++ |
| 115 | } |
| 116 | |
| 117 | return Page{ |
| 118 | TotalResults: len(h.data), |
| 119 | Resources: resources, |
| 120 | }, nil |
| 121 | } |
| 122 | |
| 123 | func (h testResourceHandler) Patch(r *http.Request, id string, operations []PatchOperation) (Resource, error) { |
| 124 | if h.shouldReturnNoContent(id, operations) { |
nothing calls this directly
no test coverage detected