-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththirdpartyrisks.go
More file actions
44 lines (35 loc) · 1.47 KB
/
Copy paththirdpartyrisks.go
File metadata and controls
44 lines (35 loc) · 1.47 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
package eramba
import (
"context"
"fmt"
"net/http"
"github.com/gdatasoftwareag/eramba-go-client/model"
)
func (a *Client) GetThirdPartyRisk(ctx context.Context, id int32) (model.ThirdPartyRisk, error) {
return getDataById[model.ThirdPartyRisk](ctx, "third-party-risks", id, a.getByPath)
}
func (a *Client) GetThirdPartyRisks(ctx context.Context) ([]model.ThirdPartyRisk, error) {
return getAllData[model.ThirdPartyRisk](ctx, "third-party-risks/index", a.getByPath)
}
func (a *Client) PostThirdPartyRisk(ctx context.Context, data *model.ThirdPartyRisk) (*model.ThirdPartyRisk, error) {
return postOrPatchJsonByPath(ctx, http.MethodPost, "third-party-risks/add", data, a.postOrPatchJsonByPath)
}
func (a *Client) PatchThirdPartyRisk(
ctx context.Context,
id int32,
data *model.ThirdPartyRisk,
) (*model.ThirdPartyRisk, error) {
return postOrPatchJsonByPath(ctx, http.MethodPatch, fmt.Sprintf("third-party-risks/%d", id), data, a.postOrPatchJsonByPath)
}
func (a *Client) GetThirdPartyRiskReviews(ctx context.Context) ([]model.Review, error) {
return getAllData[model.Review](ctx, "third-party-risk-reviews/index", a.getByPath)
}
func (a *Client) PostThirdPartyRiskReview(ctx context.Context, data *model.Review) (*model.Review, error) {
return postOrPatchJsonByPath(ctx, http.MethodPost, "third-party-risk-reviews/add", data, a.postOrPatchJsonByPath)
}
func (a *Client) ThirdPartyRiskComments() *CommentsClient {
return &CommentsClient{
client: a,
path: "third-party-risks",
}
}