@@ -14,13 +14,14 @@ type Domain interface {
1414 Get (ctx context.Context , m * DomainGet ) (* DomainItem , error )
1515 List (ctx context.Context , m * DomainList ) (* DomainListResult , error )
1616 Delete (ctx context.Context , m * DomainDelete ) (* Empty , error )
17+ PurgeCache (ctx context.Context , m * DomainGet ) (* Empty , error )
1718}
1819
1920type DomainCreate struct {
2021 Project string `json:"project" yaml:"project"`
2122 Location string `json:"location" yaml:"location"`
2223 Domain string `json:"domain" yaml:"domain"`
23- Plan DomainPlan `json:"plan " yaml:"plan "`
24+ Type DomainType `json:"type " yaml:"type "`
2425}
2526
2627func (m * DomainCreate ) Valid () error {
@@ -35,16 +36,14 @@ func (m *DomainCreate) Valid() error {
3536}
3637
3738type DomainGet struct {
38- Project string `json:"project" yaml:"project"`
39- Location string `json:"location" yaml:"location"`
40- Domain string `json:"domain" yaml:"domain"`
39+ Project string `json:"project" yaml:"project"`
40+ Domain string `json:"domain" yaml:"domain"`
4141}
4242
4343func (m * DomainGet ) Valid () error {
4444 v := validator .New ()
4545
4646 v .Must (m .Project != "" , "project required" )
47- v .Must (m .Location != "" , "location required" )
4847 v .Must (govalidator .IsDNSName (m .Domain ), "domain invalid" )
4948
5049 return WrapValidate (v )
@@ -84,25 +83,51 @@ type DomainItem struct {
8483 Project string `json:"project" yaml:"project"`
8584 Location string `json:"location" yaml:"location"`
8685 Domain string `json:"domain" yaml:"domain"`
87- Plan DomainPlan `json:"plan " yaml:"plan "`
86+ Type DomainType `json:"type " yaml:"type "`
8887 Verification DomainVerification `json:"verification" yaml:"verification"`
88+ DNSConfig DomainDNSConfig `json:"dnsConfig" yaml:"dnsConfig"`
89+ Status DomainStatus `json:"status" yaml:"status"`
8990 CreatedAt time.Time `json:"createdAt" yaml:"createdAt"`
91+ CreatedBy string `json:"createdBy" yaml:"createdBy"`
9092}
9193
9294type DomainVerification struct {
95+ Ownership DomainVerificationOwnership `json:"ownership"`
96+ SSL DomainVerificationSSL `json:"ssl"`
97+ }
98+
99+ type DomainVerificationOwnership struct {
100+ Type string `json:"type"`
101+ Name string `json:"name"`
102+ Value string `json:"value"`
103+ Errors []string `json:"errors"`
104+ }
105+
106+ type DomainVerificationSSL struct {
107+ Records []DomainVerificationSSLRecord `json:"records"`
108+ Errors []string `json:"errors"`
109+ }
110+
111+ type DomainVerificationSSLRecord struct {
112+ TxtName string `json:"txtName"`
113+ TxtValue string `json:"txtValue"`
114+ }
115+
116+ type DomainDNSConfig struct {
117+ IPv4 []string `json:"ipv4" yaml:"ipv4"`
118+ IPv6 []string `json:"ipv6" yaml:"ipv6"`
119+ CName []string `json:"cname" yaml:"cname"`
93120}
94121
95122type DomainDelete struct {
96- Project string `json:"project" yaml:"project"`
97- Location string `json:"location" yaml:"location"`
98- Domain string `json:"domain" yaml:"domain"`
123+ Project string `json:"project" yaml:"project"`
124+ Domain string `json:"domain" yaml:"domain"`
99125}
100126
101127func (m * DomainDelete ) Valid () error {
102128 v := validator .New ()
103129
104130 v .Must (m .Project != "" , "project required" )
105- v .Must (m .Location != "" , "location required" )
106131 v .Must (govalidator .IsDNSName (m .Domain ), "domain invalid" )
107132
108133 return WrapValidate (v )
0 commit comments