Add new structs for different origin cert resources
list and revoke send back different types in Result
@@ -19,6 +19,11 @@ type OriginCA struct {
Csr string `json:"csr"`
}
+// OriginCertificateID is the resource sent back for a revoke action
+type OriginCertificateID struct {
+ ID string `json:"id"`
+}
+
// OriginCAResponse is the APIv4 response envelop containing the OriginCA result
type OriginCAResponse struct {
Success bool `json:"success"`
@@ -27,6 +32,23 @@ type OriginCAResponse struct {
Result OriginCA `json:"result"`
}
+// OriginCAResponseList is the APIv4 response envelop containing a listof OriginCA result
+type OriginCAResponseList struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result []OriginCA `json:"result"`
+ ResultInfo ResultInfo `json:"result_info"`
+}
+
+// OriginCAResponseRevoke is the APIv4 response envelop containing a revoked cert id
+type OriginCAResponseRevoke struct {
+ Success bool `json:"success"`
+ Errors []string `json:"errors"`
+ Messages []string `json:"messages"`
+ Result OriginCertificateID `json:"result"`
+}
+
// CreateOriginCertificate will create an origin certificate for a User
// API reference: https://api.cloudflare.com/#origin-ca-create-certificate
func (api *API) CreateOriginCertificate(certificate OriginCA) (*OriginCA, error) {
