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

     1  package logstreams
     2  
     3  import "github.com/huaweicloud/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  	CreationTime int64  `json:"creation_time"`
    32  	FilterCount  int64  `json:"filter_count"`
    33  }
    34  
    35  // Log stream list response
    36  type LogStreams struct {
    37  	LogStreams []LogStream `json:"log_streams"`
    38  }
    39  
    40  // ListResults contains the body of getting list
    41  type ListResults struct {
    42  	golangsdk.Result
    43  }
    44  
    45  // Extract list from GetResult
    46  func (r ListResults) Extract() (*LogStreams, error) {
    47  	s := new(LogStreams)
    48  	err := r.Result.ExtractInto(s)
    49  	return s, err
    50  }