github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/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/huaweicloud/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  }