github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/scm/v3/certificates/results.go (about)

     1  package certificates
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  /*
     8  Part 1:
     9  The response of the import operation.
    10  */
    11  // The struct defines the information about the imported certificate.
    12  type CertificateImportInfo struct {
    13  	CertificateId string `json:"certificate_id"`
    14  }
    15  
    16  type ImportResult struct {
    17  	golangsdk.Result
    18  }
    19  
    20  func (r ImportResult) Extract() (*CertificateImportInfo, error) {
    21  	var s CertificateImportInfo
    22  	err := r.ExtractInto(&s)
    23  	return &s, err
    24  }
    25  
    26  /*
    27  Part 2:
    28  The response from query escrowed certificate.
    29  */
    30  // This struct defines the authentication information of the domain.
    31  // API that will be used to Obtain Certificate Information
    32  type Authentification struct {
    33  	RecordName  string `json:"record_name"`
    34  	RecordType  string `json:"record_type"`
    35  	RecordValue string `json:"record_value"`
    36  	Domain      string `json:"domain"`
    37  }
    38  
    39  // The struct defines the detail information about the escrow certificate information.
    40  type CertificateEscrowInfo struct {
    41  	Id                string             `json:"id"`
    42  	Status            string             `json:"status"`
    43  	OrderId           string             `json:"order_id"`
    44  	Name              string             `json:"name"`
    45  	CertificateType   string             `json:"type"`
    46  	Brand             string             `json:"brand"`
    47  	PushSupport       string             `json:"push_support"`
    48  	RevokeReason      string             `json:"revoke_reason"`
    49  	SignatureAlgrithm string             `json:"signature_algrithm"`
    50  	IssueTime         string             `json:"issue_time"`
    51  	NotBefore         string             `json:"not_before"`
    52  	NotAfter          string             `json:"not_after"`
    53  	ValidityPeriod    int                `json:"validity_period,omitempty"`
    54  	ValidationMethod  string             `json:"validation_method"`
    55  	DomainType        string             `json:"domain_type"`
    56  	Domain            string             `json:"domain"`
    57  	Sans              string             `json:"sans"`
    58  	DomainCount       int                `json:"domain_count,omitempty"`
    59  	WildcardCount     int                `json:"wildcard_count,omitempty"`
    60  	Authentifications []Authentification `json:"authentification,omitempty"`
    61  }
    62  
    63  type GetResult struct {
    64  	golangsdk.Result
    65  }
    66  
    67  func (r GetResult) Extract() (*CertificateEscrowInfo, error) {
    68  	var s CertificateEscrowInfo
    69  	err := r.ExtractInto(&s)
    70  	return &s, err
    71  }
    72  
    73  /*
    74  -- Part 3:
    75  -- The response from exported certificate.
    76  */
    77  // The struct defines the detail information about the imported certificate.
    78  type CertificateDetail struct {
    79  	Certificate      string `json:"certificate" required:"true"`
    80  	CertificateChain string `json:"certificate_chain" required:"true"`
    81  	PrivateKey       string `json:"private_key" required:"true"`
    82  }
    83  
    84  func (r ExportResult) Extract() (*CertificateDetail, error) {
    85  	var s CertificateDetail
    86  	err := r.ExtractInto(&s)
    87  	return &s, err
    88  }
    89  
    90  type ExportResult struct {
    91  	golangsdk.Result
    92  }
    93  
    94  /*
    95  Part 4:
    96  The response from pushing certificate.
    97  */
    98  type PushResult struct {
    99  	golangsdk.ErrResult
   100  }
   101  
   102  /*
   103  Part 5:
   104  The response from deleting certificate.
   105  */
   106  type DeleteResult struct {
   107  	golangsdk.ErrResult
   108  }