-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentitymetadata.go
55 lines (48 loc) · 1.63 KB
/
entitymetadata.go
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
package icp
import (
"context"
"fmt"
"net/http"
"net/url"
)
// EntityMetaDataRequest type
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/POST-api-entitymetadata
type EntityMetaDataRequest []EntityMetaDataItem
// EntityMetaDataItem type
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/POST-api-entitymetadata
type EntityMetaDataItem struct {
SourceServer string
InternalID string
Groupings []Grouping
Action string
}
// EntityMetaData request
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/POST-api-entitymetadata
func (i *ICP) EntityMetaData(ctx context.Context, request EntityMetaDataRequest) (resp *http.Response, err error) {
resp, err = i.Post(ctx, EntityMetaDataEndpoint, request, nil)
resp.Body.Close()
return
}
// EntityMeteDataExportRequest type
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/GET-api-metadataexport-projectId_onlyInclude
type EntityMeteDataExportRequest struct {
ProjectID int `url:"projectId,omitempty"`
OnlyInclude string `url:"onlyInclude,omitempty"`
}
// EntityMetaDataExportResponse type
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/GET-api-metadataexport-projectId_onlyInclude
type EntityMetaDataExportResponse []string
// EntityMetaDataExport type
//
// https://icp-api.itrsgroup.com/v2.0/Help/Api/GET-api-metadataexport-projectId_onlyInclude
func (i *ICP) EntityMetaDataExport(ctx context.Context, request *EntityMeteDataExportRequest) (response EntityMetaDataExportResponse, resp *http.Response, err error) {
endpoint, _ := url.JoinPath(EntityMetaDataExportEndpoint, fmt.Sprint(request.ProjectID))
request.ProjectID = 0
resp, err = i.Get(ctx, endpoint, request, &response)
return
}