github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/elb/v2/certificates/results.go (about) 1 /* 2 Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 3 */ 4 5 package certificates 6 7 import "github.com/chnsz/golangsdk" 8 9 type ListResult struct { 10 golangsdk.Result 11 } 12 13 // CertificateList the struct returned by the query list. 14 type CertificateList struct { 15 // Lists the certificates. For details, see Table 4. 16 Certificates []Certificate `json:"certificates"` 17 // Specifies the number of certificates. 18 InstanceNum int `json:"instance_num"` 19 } 20 21 // Certificate the certificate detail returned by the query list. 22 type Certificate struct { 23 Id string `json:"id"` 24 TenantId string `json:"tenant_id"` 25 AdminStateUp bool `json:"admin_state_up"` 26 Name string `json:"name"` 27 Description string `json:"description"` 28 Type string `json:"type"` 29 Domain string `json:"domain"` 30 PrivateKey string `json:"private_key"` 31 Certificate string `json:"certificate"` 32 ExpireTime string `json:"expire_time"` 33 CreateTime string `json:"create_time"` 34 UpdateTime string `json:"update_time"` 35 } 36 37 // Extract extract the `Result.Body` to CertificateList 38 func (r ListResult) Extract() (*CertificateList, error) { 39 var s CertificateList 40 err := r.ExtractInto(&s) 41 return &s, err 42 } 43 44 func (r commonResult) Extract() (*Certificate, error) { 45 s := &Certificate{} 46 return s, r.ExtractInto(s) 47 } 48 49 type commonResult struct { 50 golangsdk.Result 51 } 52 53 type CreateResult struct { 54 commonResult 55 } 56 57 // GetResult represents the result of a get operation. 58 type GetResult struct { 59 commonResult 60 } 61 62 type UpdateResult struct { 63 commonResult 64 } 65 66 // DeleteResult represents the result of a delete operation. 67 type DeleteResult struct { 68 golangsdk.ErrResult 69 }