github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/lts/huawei/loggroups/results.go (about)

     1  package loggroups
     2  
     3  import "github.com/chnsz/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  	Tags         map[string]string `json:"tag"`
    46  }
    47  
    48  // Log group list response
    49  type LogGroups struct {
    50  	LogGroups []LogGroup `json:"log_groups"`
    51  }
    52  
    53  // ListResults contains the body of getting list
    54  type ListResults struct {
    55  	golangsdk.Result
    56  }
    57  
    58  // Extract list from GetResult
    59  func (r ListResults) Extract() (*LogGroups, error) {
    60  	s := new(LogGroups)
    61  	err := r.Result.ExtractInto(s)
    62  	return s, err
    63  }