github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/lts/huawei/loggroups/results.go (about)

     1  package loggroups
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  // Log group Create response
     6  type CreateResponse struct {
     7  	ID string `json:"log_group_id"`
     8  }
     9  
    10  // CreateResult is a struct that contains all the return parameters of creation
    11  type CreateResult struct {
    12  	golangsdk.Result
    13  }
    14  
    15  // Extract from CreateResult
    16  func (r CreateResult) Extract() (*CreateResponse, error) {
    17  	s := new(CreateResponse)
    18  	err := r.Result.ExtractInto(s)
    19  	return s, err
    20  }
    21  
    22  // UpdateResult contains the response body and error from an Update request.
    23  type UpdateResult struct {
    24  	golangsdk.Result
    25  }
    26  
    27  // Extract from UpdateResult
    28  func (r UpdateResult) Extract() (*LogGroup, error) {
    29  	s := new(LogGroup)
    30  	err := r.Result.ExtractInto(s)
    31  	return s, err
    32  }
    33  
    34  // DeleteResult is a struct which contains the result of deletion
    35  type DeleteResult struct {
    36  	golangsdk.ErrResult
    37  }
    38  
    39  // Log group response
    40  type LogGroup struct {
    41  	ID           string `json:"log_group_id"`
    42  	Name         string `json:"log_group_name"`
    43  	CreationTime int64  `json:"creation_time"`
    44  	TTLinDays    int    `json:"ttl_in_days"`
    45  }
    46  
    47  // Log group list response
    48  type LogGroups struct {
    49  	LogGroups []LogGroup `json:"log_groups"`
    50  }
    51  
    52  // ListResults contains the body of getting list
    53  type ListResults struct {
    54  	golangsdk.Result
    55  }
    56  
    57  // Extract list from GetResult
    58  func (r ListResults) Extract() (*LogGroups, error) {
    59  	s := new(LogGroups)
    60  	err := r.Result.ExtractInto(s)
    61  	return s, err
    62  }