-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
111 lines (92 loc) · 3.68 KB
/
types.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package cyberrisk
import (
"time"
)
type ProjectType string
type ScoreType string
type RequestSupplier struct {
VAT string `json:"vat"` // mandatory
CompanyName string `json:"companyName"` // mandatory
Language string `json:"language"` // mandatory
Email string `json:"email"` // mandatory
Websites []string `json:"websites,omitempty"` // optional
Forename string `json:"forename,omitempty"` // optional
Surname string `json:"surname,omitempty"` // optional
Tel string `json:"tel,omitempty"` // optional
Street string `json:"street,omitempty"` // optional
ZipCode string `json:"zipCode,omitempty"` // optional
City string `json:"city,omitempty"` // optional
Country string `json:"country,omitempty"` // optional
Sector string `json:"sector,omitempty"` // optional
ExternalIDs []string `json:"externalIDs,omitempty"` // optional
OrderCRR string `json:"orderCRR,omitempty"` // optional
OrderDPR bool `json:"orderDPR,omitempty"` // optional
}
type SupplierFilter struct {
IncludeRatings bool `url:"include-ratings"`
}
type UnassignSupplier struct {
SupplierIDs []string `url:"supplier-id"`
ExternalIDs []string `url:"external-id"`
}
type Rating struct {
CompanyName string `json:"companyName,omitempty"`
SupplierID string `json:"supplierID"`
ExternalIDs []string `json:"externalIDs,omitempty"`
RatingCRR *RatingCRR `json:"ratingCRR,omitempty"`
RatingDPR *RatingDPR `json:"ratingDPR,omitempty"`
WebRisk *WebRisk `json:"webrisk,omitempty"`
}
type RatingCRR struct {
AScore int `json:"aScore,omitempty"`
BScore int `json:"bScore,omitempty"`
Status string `json:"status,omitempty"`
ValidFrom *time.Time `json:"validFrom,omitempty"`
ValidUntil *time.Time `json:"validUntil,omitempty"`
AssessmentValidUntil *time.Time `json:"assessmentValidUntil,omitempty"`
CyberTrustLabel string `json:"cyberTrustLabel,omitempty"`
}
type RatingDPR struct {
MinimumRequirementsMet bool `json:"minimumRequirementsMet,omitempty"`
Score int `json:"score,omitempty"`
Status string `json:"status,omitempty"`
ValidFrom *time.Time `json:"validFrom,omitempty"`
ValidUntil *time.Time `json:"validUntil,omitempty"`
AssessmentValidUntil *time.Time `json:"assessmentValidUntil,omitempty"`
}
type WebRisk struct {
Score int `json:"score,omitempty"`
Status string `json:"status,omitempty"`
Websites []string `json:"websites,omitempty"`
}
type RatingFilter struct {
Status []string `url:"status"`
ScoreType []ScoreType `url:"st"`
SupplierIDs []string `url:"supplier-id"`
ExternalIDs []string `url:"external-id"`
}
type RequestRatingCRR struct {
Category string `json:"category"`
SupplierID string `json:"supplierID,omitempty"`
ExternalID string `json:"externalID,omitempty"`
}
type RequestRatingDPR struct {
SupplierID string `json:"supplierID,omitempty"`
ExternalID string `json:"externalID,omitempty"`
}
type ContingentUsage struct {
Project ProjectType `json:"project"`
ContingentBefore int `json:"contingentBefore"`
ContingentAfter int `json:"contingentAfter"`
OrderedSuppliers []string `json:"orderedSuppliers"`
}
type PostSuppliersResponse struct {
Created int `json:"created"`
Existed int `json:"existed"`
OrdersCRR *ContingentUsage `json:"ordersCRR,omitempty"`
OrdersDPR *ContingentUsage `json:"ordersDPR,omitempty"`
}
type Account struct {
ContingentCRR int `json:"contingentCRR,omitempty"`
ContingentDPR int `json:"contingentDPR,omitempty"`
}