github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/iec/v1/keypairs/results.go (about)

     1  package keypairs
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  	"github.com/huaweicloud/golangsdk/openstack/iec/v1/common"
     6  )
     7  
     8  type commonResult struct {
     9  	golangsdk.Result
    10  }
    11  
    12  type CreateResult struct {
    13  	commonResult
    14  }
    15  
    16  func (r CreateResult) Extract() (*common.KeyPair, error) {
    17  	var entity common.KeyPair
    18  	err := r.ExtractIntoStructPtr(&entity, "")
    19  	return &entity, err
    20  }
    21  
    22  type DeleteResult struct {
    23  	golangsdk.ErrResult
    24  }
    25  
    26  type GetResult struct {
    27  	commonResult
    28  }
    29  
    30  func (r GetResult) Extract() (*common.KeyPair, error) {
    31  	var entity common.KeyPair
    32  	err := r.ExtractIntoStructPtr(&entity, "")
    33  	return &entity, err
    34  }
    35  
    36  type ListResult struct {
    37  	commonResult
    38  }
    39  
    40  func (r ListResult) Extract() (*[]common.KeyPair, error) {
    41  	var entity []common.KeyPair
    42  
    43  	err := r.ExtractInto(&entity)
    44  	return &entity, err
    45  }