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
|
package schema
import "time"
// CertificateUsedByRef defines the schema of a resource using a certificate.
type CertificateUsedByRef struct {
ID int64 `json:"id"`
Type string `json:"type"`
}
type CertificateStatusRef struct {
Issuance string `json:"issuance"`
Renewal string `json:"renewal"`
Error *Error `json:"error,omitempty"`
}
// Certificate defines the schema of an certificate.
type Certificate struct {
ID int64 `json:"id"`
Name string `json:"name"`
Labels map[string]string `json:"labels"`
Type string `json:"type"`
Certificate string `json:"certificate"`
Created time.Time `json:"created"`
NotValidBefore time.Time `json:"not_valid_before"`
NotValidAfter time.Time `json:"not_valid_after"`
DomainNames []string `json:"domain_names"`
Fingerprint string `json:"fingerprint"`
Status *CertificateStatusRef `json:"status"`
UsedBy []CertificateUsedByRef `json:"used_by"`
}
// CertificateListResponse defines the schema of the response when
// listing Certificates.
type CertificateListResponse struct {
Certificates []Certificate `json:"certificates"`
}
// CertificateGetResponse defines the schema of the response when
// retrieving a single Certificate.
type CertificateGetResponse struct {
Certificate Certificate `json:"certificate"`
}
// CertificateCreateRequest defines the schema of the request to create a certificate.
type CertificateCreateRequest struct {
Name string `json:"name"`
Type string `json:"type"`
DomainNames []string `json:"domain_names,omitempty"`
Certificate string `json:"certificate,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
Labels *map[string]string `json:"labels,omitempty"`
}
// CertificateCreateResponse defines the schema of the response when creating a certificate.
type CertificateCreateResponse struct {
Certificate Certificate `json:"certificate"`
Action *Action `json:"action"`
}
// CertificateUpdateRequest defines the schema of the request to update a certificate.
type CertificateUpdateRequest struct {
Name *string `json:"name,omitempty"`
Labels *map[string]string `json:"labels,omitempty"`
}
// CertificateUpdateResponse defines the schema of the response when updating a certificate.
type CertificateUpdateResponse struct {
Certificate Certificate `json:"certificate"`
}
// CertificateIssuanceRetryResponse defines the schema for the response of the
// retry issuance endpoint.
type CertificateIssuanceRetryResponse struct {
Action Action `json:"action"`
}
|