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

     1  package logstreams
     2  
     3  import "github.com/chnsz/golangsdk"
     4  
     5  // Log stream Create response
     6  type CreateResponse struct {
     7  	ID string `json:"log_stream_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  // DeleteResult is a struct which contains the result of deletion
    23  type DeleteResult struct {
    24  	golangsdk.ErrResult
    25  }
    26  
    27  // Log stream response
    28  type LogStream struct {
    29  	ID           string            `json:"log_stream_id"`
    30  	Name         string            `json:"log_stream_name"`
    31  	Tags         map[string]string `json:"tag"`
    32  	CreationTime int64             `json:"creation_time"`
    33  	FilterCount  int               `json:"filter_count"`
    34  	Favorite     bool              `json:"is_favorite"`
    35  }
    36  
    37  // Log stream list response
    38  type LogStreams struct {
    39  	LogStreams []LogStream `json:"log_streams"`
    40  }
    41  
    42  // ListResults contains the body of getting list
    43  type ListResults struct {
    44  	golangsdk.Result
    45  }
    46  
    47  // Extract list from GetResult
    48  func (r ListResults) Extract() (*LogStreams, error) {
    49  	s := new(LogStreams)
    50  	err := r.Result.ExtractInto(s)
    51  	return s, err
    52  }