Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type AccountService
- type Client
- type ClientConfig
- type ContingentUsage
- type Endpoint
- type Error
- type OrderRating
- type PostSuppliersReturn
- type Rating
- type RatingFilter
- type RatingService
- type RequestRating
- type RequestSupplier
- type Supplier
- type SupplierFilter
- type SupplierService
- type UnassignSupplier
Constants ¶
View Source
const ( StatusRatingInProgress = "in-progress" StatusRatingValidation = "validation" StatusRatingJustification = "justification" StatusRatingRevalidation = "revalidation" StatusRatingFinalization = "finalization" StatusRatingDone = "done" StatusRatingDeclined = "declined" StatusRatingBlocked = "blocked" StatusRatingExpired = "expired" )
View Source
const ( StatusCScoreInProgress = "in-progress" StatusCScoreDone = "done" StatusCScoreFailed = "failed" StatusCScoreMissing = "missing" )
Variables ¶
View Source
var DefaultEndpoint = Endpoint{
AuthURL: "https://auth.nimbusec.com/oauth2/token",
ServerURL: "https://cr.nimbusec.com",
}
Functions ¶
This section is empty.
Types ¶
type AccountService ¶
type AccountService service
func (AccountService) Get ¶
func (srv AccountService) Get() (Account, error)
type Client ¶
type Client struct { Suppliers *SupplierService Ratings *RatingService Account *AccountService // contains filtered or unexported fields }
func NewClient ¶
func NewClient(config ClientConfig) *Client
type ClientConfig ¶
type ContingentUsage ¶
type Error ¶
type OrderRating ¶
type OrderRating struct {
RequestedCategory string `json:"requestedCategory"` // mandatory
}
type PostSuppliersReturn ¶
type PostSuppliersReturn struct { Created int `json:"created"` Existed int `json:"existed"` Orders *ContingentUsage `json:"orders,omitempty"` }
type Rating ¶
type Rating struct { CompanyName string `json:"companyName,omitempty"` SupplierID string `json:"supplierID"` ExternalID string `json:"externalID,omitempty"` // Deprecated ExternalIDs []string `json:"externalIDs,omitempty"` 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:"-"` // internal only CyberTrustLabel string `json:"cyberTrustLabel,omitempty"` CScore int `json:"cScore,omitempty"` StatusCScore string `json:"statusCScore,omitempty"` Websites []string `json:"websites,omitempty"` }
type RatingFilter ¶
type RatingService ¶
type RatingService service
func (RatingService) Create ¶
func (srv RatingService) Create(create []RequestRating) ([]Rating, error)
func (RatingService) List ¶
func (srv RatingService) List(filter *RatingFilter) ([]Rating, error)
type RequestRating ¶
type RequestSupplier ¶
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"` // mandatory 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 ExternalID string `json:"externalID,omitempty"` // Deprecated ExternalIDs []string `json:"externalIDs,omitempty"` // optional OrderRating *OrderRating `json:"orderRating,omitempty"` // optional }
type Supplier ¶
type Supplier struct { VAT string `json:"vat"` CompanyName string `json:"companyName"` Language string `json:"language"` Email string `json:"email"` Websites []string `json:"websites"` Forename string `json:"forename,omitempty"` Surname string `json:"surname,omitempty"` Tel string `json:"tel,omitempty"` Street string `json:"street,omitempty"` ZipCode string `json:"zipCode,omitempty"` City string `json:"city,omitempty"` Country string `json:"country,omitempty"` Sector string `json:"sector,omitempty"` ExternalID string `json:"externalID,omitempty"` ID string `json:"id"` Rating *Rating `json:"rating,omitempty"` }
type SupplierFilter ¶
type SupplierFilter struct {
IncludeRatings bool `url:"include-ratings"`
}
type SupplierService ¶
type SupplierService service
func (SupplierService) Create ¶
func (srv SupplierService) Create(create []RequestSupplier) ([]Supplier, error)
func (SupplierService) List ¶
func (srv SupplierService) List(filter *SupplierFilter) ([]Supplier, error)
func (SupplierService) Unassign ¶
func (srv SupplierService) Unassign(unassign UnassignSupplier) error
type UnassignSupplier ¶
Click to show internal directories.
Click to hide internal directories.